]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20210828
[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 PKG_CONFIG_LIBDIR=no
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   PKG_CONFIG_LIBDIR=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3290 fi;
3291
3292 case x$PKG_CONFIG_LIBDIR in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         # Look for the library directory using the same prefix as the executable
3297         if test "x$PKG_CONFIG" = xnone
3298         then
3299                 cf_path=$prefix
3300         else
3301                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3302         fi
3303
3304         # If you don't like using the default architecture, you have to specify the
3305         # intended library directory and corresponding compiler/linker options.
3306         #
3307         # This case allows for Debian's 2014-flavor of multiarch, along with the
3308         # most common variations before that point.  Some other variants spell the
3309         # directory differently, e.g., "pkg-config", and put it in unusual places.
3310         # pkg-config has always been poorly standardized, which is ironic...
3311         case x`(arch) 2>/dev/null` in
3312         (*64)
3313                 cf_search_path="\
3314                         $cf_path/lib/*64-linux-gnu \
3315                         $cf_path/share \
3316                         $cf_path/lib64 \
3317                         $cf_path/lib32 \
3318                         $cf_path/lib"
3319                 ;;
3320         (*)
3321                 cf_search_path="\
3322                         $cf_path/lib/*-linux-gnu \
3323                         $cf_path/share \
3324                         $cf_path/lib32 \
3325                         $cf_path/lib \
3326                         $cf_path/libdata"
3327                 ;;
3328         esac
3329
3330         test -n "$verbose" && echo "    list..." 1>&6
3331
3332 echo "${as_me:-configure}:3332: testing list... ..." 1>&5
3333
3334         for cf_config in $cf_search_path
3335         do
3336                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3337
3338 echo "${as_me:-configure}:3338: testing checking $cf_config/pkgconfig ..." 1>&5
3339
3340                 if test -d "$cf_config/pkgconfig"
3341                 then
3342                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3343                         echo "$as_me:3343: checking done" >&5
3344 echo $ECHO_N "checking done... $ECHO_C" >&6
3345                         break
3346                 fi
3347         done
3348         ;;
3349 (*)
3350         ;;
3351 esac
3352
3353 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3354         echo "$as_me:3354: result: $PKG_CONFIG_LIBDIR" >&5
3355 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3356 fi
3357
3358 echo "$as_me:3358: checking if you want to build test-programs" >&5
3359 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3360
3361 # Check whether --with-tests or --without-tests was given.
3362 if test "${with_tests+set}" = set; then
3363   withval="$with_tests"
3364   cf_with_tests=$withval
3365 else
3366   cf_with_tests=yes
3367 fi;
3368 echo "$as_me:3368: result: $cf_with_tests" >&5
3369 echo "${ECHO_T}$cf_with_tests" >&6
3370
3371 echo "$as_me:3371: checking if we should assume mixed-case filenames" >&5
3372 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3373
3374 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3375 if test "${enable_mixed_case+set}" = set; then
3376   enableval="$enable_mixed_case"
3377   enable_mixedcase=$enableval
3378 else
3379   enable_mixedcase=auto
3380 fi;
3381 echo "$as_me:3381: result: $enable_mixedcase" >&5
3382 echo "${ECHO_T}$enable_mixedcase" >&6
3383 if test "$enable_mixedcase" = "auto" ; then
3384
3385 echo "$as_me:3385: checking if filesystem supports mixed-case filenames" >&5
3386 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3387 if test "${cf_cv_mixedcase+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390
3391 if test "$cross_compiling" = yes ; then
3392         case "$target_alias" in
3393         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3394                 cf_cv_mixedcase=no
3395                 ;;
3396         (*)
3397                 cf_cv_mixedcase=yes
3398                 ;;
3399         esac
3400 else
3401         rm -f conftest CONFTEST
3402         echo test >conftest
3403         if test -f CONFTEST ; then
3404                 cf_cv_mixedcase=no
3405         else
3406                 cf_cv_mixedcase=yes
3407         fi
3408         rm -f conftest CONFTEST
3409 fi
3410
3411 fi
3412 echo "$as_me:3412: result: $cf_cv_mixedcase" >&5
3413 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3414 test "$cf_cv_mixedcase" = yes &&
3415 cat >>confdefs.h <<\EOF
3416 #define MIXEDCASE_FILENAMES 1
3417 EOF
3418
3419 else
3420         cf_cv_mixedcase=$enable_mixedcase
3421         if test "$enable_mixedcase" = "yes" ; then
3422                 cat >>confdefs.h <<\EOF
3423 #define MIXEDCASE_FILENAMES 1
3424 EOF
3425
3426         fi
3427 fi
3428
3429 # do this after mixed-case option (tags/TAGS is not as important as tic).
3430 echo "$as_me:3430: checking whether ${MAKE-make} sets \${MAKE}" >&5
3431 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3432 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3433 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3434   echo $ECHO_N "(cached) $ECHO_C" >&6
3435 else
3436   cat >conftest.make <<\EOF
3437 all:
3438         @echo 'ac_maketemp="${MAKE}"'
3439 EOF
3440 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3441 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3442 if test -n "$ac_maketemp"; then
3443   eval ac_cv_prog_make_${ac_make}_set=yes
3444 else
3445   eval ac_cv_prog_make_${ac_make}_set=no
3446 fi
3447 rm -f conftest.make
3448 fi
3449 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3450   echo "$as_me:3450: result: yes" >&5
3451 echo "${ECHO_T}yes" >&6
3452   SET_MAKE=
3453 else
3454   echo "$as_me:3454: result: no" >&5
3455 echo "${ECHO_T}no" >&6
3456   SET_MAKE="MAKE=${MAKE-make}"
3457 fi
3458
3459 echo "$as_me:3459: checking for \".PHONY\" make-support" >&5
3460 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3461 if test "${cf_cv_make_PHONY+set}" = set; then
3462   echo $ECHO_N "(cached) $ECHO_C" >&6
3463 else
3464
3465         rm -rf conftest*
3466         (
3467                 mkdir conftest || exit 1
3468                 cd conftest
3469                 cat >makefile <<'CF_EOF'
3470 .PHONY: always
3471 DATA=0
3472 always: always.out
3473         @echo "** making $@ $(DATA)"
3474 once: once.out
3475         @echo "** making $@ $(DATA)"
3476 always.out:
3477         @echo "** making $@ $(DATA)"
3478         echo $(DATA) > $@
3479 once.out:
3480         @echo "** making $@ $(DATA)"
3481         echo $(DATA) > $@
3482 CF_EOF
3483                 for cf_data in 1 2 3
3484                 do
3485                         ${MAKE:-make} always DATA=$cf_data
3486                         ${MAKE:-make} once   DATA=$cf_data
3487                         ${MAKE:-make} -t always once
3488                         if test -f always ; then
3489                                 echo "no (case 1)" > ../conftest.tmp
3490                         elif test ! -f always.out ; then
3491                                 echo "no (case 2)" > ../conftest.tmp
3492                         elif test ! -f once.out ; then
3493                                 echo "no (case 3)" > ../conftest.tmp
3494                         elif ! cmp -s always.out once.out ; then
3495                                 echo "no (case 4)" > ../conftest.tmp
3496                                 diff always.out once.out
3497                         else
3498                                 cf_check="`cat always.out`"
3499                                 if test "x$cf_check" != "x$cf_data" ; then
3500                                         echo "no (case 5)" > ../conftest.tmp
3501                                 else
3502                                         echo yes > ../conftest.tmp
3503                                         rm -f ./*.out
3504                                         continue
3505                                 fi
3506                         fi
3507                         break
3508                 done
3509         ) >&5 2>&1
3510         cf_cv_make_PHONY="`cat conftest.tmp`"
3511         rm -rf conftest*
3512
3513 fi
3514 echo "$as_me:3514: result: $cf_cv_make_PHONY" >&5
3515 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3516 MAKE_NO_PHONY="#"
3517 MAKE_PHONY="#"
3518 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3519 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3520
3521 for ac_prog in exctags ctags
3522 do
3523   # Extract the first word of "$ac_prog", so it can be a program name with args.
3524 set dummy $ac_prog; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_CTAGS+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$CTAGS"; then
3531   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_CTAGS="$ac_prog"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544 fi
3545 fi
3546 CTAGS=$ac_cv_prog_CTAGS
3547 if test -n "$CTAGS"; then
3548   echo "$as_me:3548: result: $CTAGS" >&5
3549 echo "${ECHO_T}$CTAGS" >&6
3550 else
3551   echo "$as_me:3551: result: no" >&5
3552 echo "${ECHO_T}no" >&6
3553 fi
3554
3555   test -n "$CTAGS" && break
3556 done
3557
3558 for ac_prog in exetags etags
3559 do
3560   # Extract the first word of "$ac_prog", so it can be a program name with args.
3561 set dummy $ac_prog; ac_word=$2
3562 echo "$as_me:3562: checking for $ac_word" >&5
3563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3564 if test "${ac_cv_prog_ETAGS+set}" = set; then
3565   echo $ECHO_N "(cached) $ECHO_C" >&6
3566 else
3567   if test -n "$ETAGS"; then
3568   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3569 else
3570   ac_save_IFS=$IFS; IFS=$ac_path_separator
3571 ac_dummy="$PATH"
3572 for ac_dir in $ac_dummy; do
3573   IFS=$ac_save_IFS
3574   test -z "$ac_dir" && ac_dir=.
3575   $as_executable_p "$ac_dir/$ac_word" || continue
3576 ac_cv_prog_ETAGS="$ac_prog"
3577 echo "$as_me:3577: found $ac_dir/$ac_word" >&5
3578 break
3579 done
3580
3581 fi
3582 fi
3583 ETAGS=$ac_cv_prog_ETAGS
3584 if test -n "$ETAGS"; then
3585   echo "$as_me:3585: result: $ETAGS" >&5
3586 echo "${ECHO_T}$ETAGS" >&6
3587 else
3588   echo "$as_me:3588: result: no" >&5
3589 echo "${ECHO_T}no" >&6
3590 fi
3591
3592   test -n "$ETAGS" && break
3593 done
3594
3595 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3596 set dummy ${CTAGS:-ctags}; ac_word=$2
3597 echo "$as_me:3597: checking for $ac_word" >&5
3598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3599 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3600   echo $ECHO_N "(cached) $ECHO_C" >&6
3601 else
3602   if test -n "$MAKE_LOWER_TAGS"; then
3603   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3604 else
3605   ac_save_IFS=$IFS; IFS=$ac_path_separator
3606 ac_dummy="$PATH"
3607 for ac_dir in $ac_dummy; do
3608   IFS=$ac_save_IFS
3609   test -z "$ac_dir" && ac_dir=.
3610   $as_executable_p "$ac_dir/$ac_word" || continue
3611 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3612 echo "$as_me:3612: found $ac_dir/$ac_word" >&5
3613 break
3614 done
3615
3616   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3617 fi
3618 fi
3619 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3620 if test -n "$MAKE_LOWER_TAGS"; then
3621   echo "$as_me:3621: result: $MAKE_LOWER_TAGS" >&5
3622 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3623 else
3624   echo "$as_me:3624: result: no" >&5
3625 echo "${ECHO_T}no" >&6
3626 fi
3627
3628 if test "$cf_cv_mixedcase" = yes ; then
3629         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3630 set dummy ${ETAGS:-etags}; ac_word=$2
3631 echo "$as_me:3631: checking for $ac_word" >&5
3632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3633 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3634   echo $ECHO_N "(cached) $ECHO_C" >&6
3635 else
3636   if test -n "$MAKE_UPPER_TAGS"; then
3637   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3638 else
3639   ac_save_IFS=$IFS; IFS=$ac_path_separator
3640 ac_dummy="$PATH"
3641 for ac_dir in $ac_dummy; do
3642   IFS=$ac_save_IFS
3643   test -z "$ac_dir" && ac_dir=.
3644   $as_executable_p "$ac_dir/$ac_word" || continue
3645 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3646 echo "$as_me:3646: found $ac_dir/$ac_word" >&5
3647 break
3648 done
3649
3650   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3651 fi
3652 fi
3653 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3654 if test -n "$MAKE_UPPER_TAGS"; then
3655   echo "$as_me:3655: result: $MAKE_UPPER_TAGS" >&5
3656 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3657 else
3658   echo "$as_me:3658: result: no" >&5
3659 echo "${ECHO_T}no" >&6
3660 fi
3661
3662 else
3663         MAKE_UPPER_TAGS=no
3664 fi
3665
3666 if test "$MAKE_UPPER_TAGS" = yes ; then
3667         MAKE_UPPER_TAGS=
3668 else
3669         MAKE_UPPER_TAGS="#"
3670 fi
3671
3672 if test "$MAKE_LOWER_TAGS" = yes ; then
3673         MAKE_LOWER_TAGS=
3674 else
3675         MAKE_LOWER_TAGS="#"
3676 fi
3677
3678 echo "$as_me:3678: checking for makeflags variable" >&5
3679 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3680 if test "${cf_cv_makeflags+set}" = set; then
3681   echo $ECHO_N "(cached) $ECHO_C" >&6
3682 else
3683
3684         cf_cv_makeflags=''
3685         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3686         do
3687                 cat >cf_makeflags.tmp <<CF_EOF
3688 SHELL = $SHELL
3689 all :
3690         @ echo '.$cf_option'
3691 CF_EOF
3692                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3693                 case "$cf_result" in
3694                 (.*k|.*kw)
3695                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3696                         case "$cf_result" in
3697                         (.*CC=*)        cf_cv_makeflags=
3698                                 ;;
3699                         (*)     cf_cv_makeflags=$cf_option
3700                                 ;;
3701                         esac
3702                         break
3703                         ;;
3704                 (.-)
3705                         ;;
3706                 (*)
3707
3708 echo "${as_me:-configure}:3708: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3709
3710                         ;;
3711                 esac
3712         done
3713         rm -f cf_makeflags.tmp
3714
3715 fi
3716 echo "$as_me:3716: result: $cf_cv_makeflags" >&5
3717 echo "${ECHO_T}$cf_cv_makeflags" >&6
3718
3719 if test -n "$ac_tool_prefix"; then
3720   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3721 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3722 echo "$as_me:3722: checking for $ac_word" >&5
3723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3724 if test "${ac_cv_prog_RANLIB+set}" = set; then
3725   echo $ECHO_N "(cached) $ECHO_C" >&6
3726 else
3727   if test -n "$RANLIB"; then
3728   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3729 else
3730   ac_save_IFS=$IFS; IFS=$ac_path_separator
3731 ac_dummy="$PATH"
3732 for ac_dir in $ac_dummy; do
3733   IFS=$ac_save_IFS
3734   test -z "$ac_dir" && ac_dir=.
3735   $as_executable_p "$ac_dir/$ac_word" || continue
3736 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3737 echo "$as_me:3737: found $ac_dir/$ac_word" >&5
3738 break
3739 done
3740
3741 fi
3742 fi
3743 RANLIB=$ac_cv_prog_RANLIB
3744 if test -n "$RANLIB"; then
3745   echo "$as_me:3745: result: $RANLIB" >&5
3746 echo "${ECHO_T}$RANLIB" >&6
3747 else
3748   echo "$as_me:3748: result: no" >&5
3749 echo "${ECHO_T}no" >&6
3750 fi
3751
3752 fi
3753 if test -z "$ac_cv_prog_RANLIB"; then
3754   ac_ct_RANLIB=$RANLIB
3755   # Extract the first word of "ranlib", so it can be a program name with args.
3756 set dummy ranlib; ac_word=$2
3757 echo "$as_me:3757: checking for $ac_word" >&5
3758 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3759 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3760   echo $ECHO_N "(cached) $ECHO_C" >&6
3761 else
3762   if test -n "$ac_ct_RANLIB"; then
3763   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3764 else
3765   ac_save_IFS=$IFS; IFS=$ac_path_separator
3766 ac_dummy="$PATH"
3767 for ac_dir in $ac_dummy; do
3768   IFS=$ac_save_IFS
3769   test -z "$ac_dir" && ac_dir=.
3770   $as_executable_p "$ac_dir/$ac_word" || continue
3771 ac_cv_prog_ac_ct_RANLIB="ranlib"
3772 echo "$as_me:3772: found $ac_dir/$ac_word" >&5
3773 break
3774 done
3775
3776   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3777 fi
3778 fi
3779 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3780 if test -n "$ac_ct_RANLIB"; then
3781   echo "$as_me:3781: result: $ac_ct_RANLIB" >&5
3782 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3783 else
3784   echo "$as_me:3784: result: no" >&5
3785 echo "${ECHO_T}no" >&6
3786 fi
3787
3788   RANLIB=$ac_ct_RANLIB
3789 else
3790   RANLIB="$ac_cv_prog_RANLIB"
3791 fi
3792
3793 if test -n "$ac_tool_prefix"; then
3794   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3795 set dummy ${ac_tool_prefix}ld; ac_word=$2
3796 echo "$as_me:3796: checking for $ac_word" >&5
3797 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3798 if test "${ac_cv_prog_LD+set}" = set; then
3799   echo $ECHO_N "(cached) $ECHO_C" >&6
3800 else
3801   if test -n "$LD"; then
3802   ac_cv_prog_LD="$LD" # Let the user override the test.
3803 else
3804   ac_save_IFS=$IFS; IFS=$ac_path_separator
3805 ac_dummy="$PATH"
3806 for ac_dir in $ac_dummy; do
3807   IFS=$ac_save_IFS
3808   test -z "$ac_dir" && ac_dir=.
3809   $as_executable_p "$ac_dir/$ac_word" || continue
3810 ac_cv_prog_LD="${ac_tool_prefix}ld"
3811 echo "$as_me:3811: found $ac_dir/$ac_word" >&5
3812 break
3813 done
3814
3815 fi
3816 fi
3817 LD=$ac_cv_prog_LD
3818 if test -n "$LD"; then
3819   echo "$as_me:3819: result: $LD" >&5
3820 echo "${ECHO_T}$LD" >&6
3821 else
3822   echo "$as_me:3822: result: no" >&5
3823 echo "${ECHO_T}no" >&6
3824 fi
3825
3826 fi
3827 if test -z "$ac_cv_prog_LD"; then
3828   ac_ct_LD=$LD
3829   # Extract the first word of "ld", so it can be a program name with args.
3830 set dummy ld; ac_word=$2
3831 echo "$as_me:3831: checking for $ac_word" >&5
3832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3833 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3834   echo $ECHO_N "(cached) $ECHO_C" >&6
3835 else
3836   if test -n "$ac_ct_LD"; then
3837   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3838 else
3839   ac_save_IFS=$IFS; IFS=$ac_path_separator
3840 ac_dummy="$PATH"
3841 for ac_dir in $ac_dummy; do
3842   IFS=$ac_save_IFS
3843   test -z "$ac_dir" && ac_dir=.
3844   $as_executable_p "$ac_dir/$ac_word" || continue
3845 ac_cv_prog_ac_ct_LD="ld"
3846 echo "$as_me:3846: found $ac_dir/$ac_word" >&5
3847 break
3848 done
3849
3850   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3851 fi
3852 fi
3853 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3854 if test -n "$ac_ct_LD"; then
3855   echo "$as_me:3855: result: $ac_ct_LD" >&5
3856 echo "${ECHO_T}$ac_ct_LD" >&6
3857 else
3858   echo "$as_me:3858: result: no" >&5
3859 echo "${ECHO_T}no" >&6
3860 fi
3861
3862   LD=$ac_ct_LD
3863 else
3864   LD="$ac_cv_prog_LD"
3865 fi
3866
3867 if test -n "$ac_tool_prefix"; then
3868   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3869 set dummy ${ac_tool_prefix}ar; ac_word=$2
3870 echo "$as_me:3870: checking for $ac_word" >&5
3871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3872 if test "${ac_cv_prog_AR+set}" = set; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   if test -n "$AR"; then
3876   ac_cv_prog_AR="$AR" # Let the user override the test.
3877 else
3878   ac_save_IFS=$IFS; IFS=$ac_path_separator
3879 ac_dummy="$PATH"
3880 for ac_dir in $ac_dummy; do
3881   IFS=$ac_save_IFS
3882   test -z "$ac_dir" && ac_dir=.
3883   $as_executable_p "$ac_dir/$ac_word" || continue
3884 ac_cv_prog_AR="${ac_tool_prefix}ar"
3885 echo "$as_me:3885: found $ac_dir/$ac_word" >&5
3886 break
3887 done
3888
3889 fi
3890 fi
3891 AR=$ac_cv_prog_AR
3892 if test -n "$AR"; then
3893   echo "$as_me:3893: result: $AR" >&5
3894 echo "${ECHO_T}$AR" >&6
3895 else
3896   echo "$as_me:3896: result: no" >&5
3897 echo "${ECHO_T}no" >&6
3898 fi
3899
3900 fi
3901 if test -z "$ac_cv_prog_AR"; then
3902   ac_ct_AR=$AR
3903   # Extract the first word of "ar", so it can be a program name with args.
3904 set dummy ar; ac_word=$2
3905 echo "$as_me:3905: checking for $ac_word" >&5
3906 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3907 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3908   echo $ECHO_N "(cached) $ECHO_C" >&6
3909 else
3910   if test -n "$ac_ct_AR"; then
3911   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3912 else
3913   ac_save_IFS=$IFS; IFS=$ac_path_separator
3914 ac_dummy="$PATH"
3915 for ac_dir in $ac_dummy; do
3916   IFS=$ac_save_IFS
3917   test -z "$ac_dir" && ac_dir=.
3918   $as_executable_p "$ac_dir/$ac_word" || continue
3919 ac_cv_prog_ac_ct_AR="ar"
3920 echo "$as_me:3920: found $ac_dir/$ac_word" >&5
3921 break
3922 done
3923
3924   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3925 fi
3926 fi
3927 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3928 if test -n "$ac_ct_AR"; then
3929   echo "$as_me:3929: result: $ac_ct_AR" >&5
3930 echo "${ECHO_T}$ac_ct_AR" >&6
3931 else
3932   echo "$as_me:3932: result: no" >&5
3933 echo "${ECHO_T}no" >&6
3934 fi
3935
3936   AR=$ac_ct_AR
3937 else
3938   AR="$ac_cv_prog_AR"
3939 fi
3940
3941 if test -n "$ac_tool_prefix"; then
3942   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3943 set dummy ${ac_tool_prefix}ar; ac_word=$2
3944 echo "$as_me:3944: checking for $ac_word" >&5
3945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3946 if test "${ac_cv_prog_AR+set}" = set; then
3947   echo $ECHO_N "(cached) $ECHO_C" >&6
3948 else
3949   if test -n "$AR"; then
3950   ac_cv_prog_AR="$AR" # Let the user override the test.
3951 else
3952   ac_save_IFS=$IFS; IFS=$ac_path_separator
3953 ac_dummy="$PATH"
3954 for ac_dir in $ac_dummy; do
3955   IFS=$ac_save_IFS
3956   test -z "$ac_dir" && ac_dir=.
3957   $as_executable_p "$ac_dir/$ac_word" || continue
3958 ac_cv_prog_AR="${ac_tool_prefix}ar"
3959 echo "$as_me:3959: found $ac_dir/$ac_word" >&5
3960 break
3961 done
3962
3963 fi
3964 fi
3965 AR=$ac_cv_prog_AR
3966 if test -n "$AR"; then
3967   echo "$as_me:3967: result: $AR" >&5
3968 echo "${ECHO_T}$AR" >&6
3969 else
3970   echo "$as_me:3970: result: no" >&5
3971 echo "${ECHO_T}no" >&6
3972 fi
3973
3974 fi
3975 if test -z "$ac_cv_prog_AR"; then
3976   ac_ct_AR=$AR
3977   # Extract the first word of "ar", so it can be a program name with args.
3978 set dummy ar; ac_word=$2
3979 echo "$as_me:3979: checking for $ac_word" >&5
3980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3981 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984   if test -n "$ac_ct_AR"; then
3985   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3986 else
3987   ac_save_IFS=$IFS; IFS=$ac_path_separator
3988 ac_dummy="$PATH"
3989 for ac_dir in $ac_dummy; do
3990   IFS=$ac_save_IFS
3991   test -z "$ac_dir" && ac_dir=.
3992   $as_executable_p "$ac_dir/$ac_word" || continue
3993 ac_cv_prog_ac_ct_AR="ar"
3994 echo "$as_me:3994: found $ac_dir/$ac_word" >&5
3995 break
3996 done
3997
3998   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3999 fi
4000 fi
4001 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4002 if test -n "$ac_ct_AR"; then
4003   echo "$as_me:4003: result: $ac_ct_AR" >&5
4004 echo "${ECHO_T}$ac_ct_AR" >&6
4005 else
4006   echo "$as_me:4006: result: no" >&5
4007 echo "${ECHO_T}no" >&6
4008 fi
4009
4010   AR=$ac_ct_AR
4011 else
4012   AR="$ac_cv_prog_AR"
4013 fi
4014
4015 echo "$as_me:4015: checking for options to update archives" >&5
4016 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4017 if test "${cf_cv_ar_flags+set}" = set; then
4018   echo $ECHO_N "(cached) $ECHO_C" >&6
4019 else
4020
4021         case "$cf_cv_system_name" in
4022         (*-msvc*)
4023                 cf_cv_ar_flags=''
4024                 cat >mk_static_lib.sh <<-EOF
4025                 #!$SHELL
4026                 MSVC_BIN="$AR"
4027                 out="\$1"
4028                 shift
4029                 exec \$MSVC_BIN -out:"\$out" \$@
4030                 EOF
4031                 chmod +x mk_static_lib.sh
4032                 AR=`pwd`/mk_static_lib.sh
4033                 ;;
4034         (*)
4035                 cf_cv_ar_flags=unknown
4036                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4037                 do
4038
4039                         # check if $ARFLAGS already contains this choice
4040                         if test "x$ARFLAGS" != "x" ; then
4041                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4042                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4043                                         cf_cv_ar_flags=
4044                                         break
4045                                 fi
4046                         fi
4047
4048                         rm -f "conftest.$ac_cv_objext"
4049                         rm -f conftest.a
4050
4051                         cat >"conftest.$ac_ext" <<EOF
4052 #line 4052 "configure"
4053 int     testdata[3] = { 123, 456, 789 };
4054 EOF
4055                         if { (eval echo "$as_me:4055: \"$ac_compile\"") >&5
4056   (eval $ac_compile) 2>&5
4057   ac_status=$?
4058   echo "$as_me:4058: \$? = $ac_status" >&5
4059   (exit "$ac_status"); } ; then
4060                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4061                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4062                                 if test -f conftest.a ; then
4063                                         cf_cv_ar_flags="$cf_ar_flags"
4064                                         break
4065                                 fi
4066                         else
4067                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4068
4069 echo "${as_me:-configure}:4069: testing cannot compile test-program ..." 1>&5
4070
4071                                 break
4072                         fi
4073                 done
4074                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4075                 ;;
4076         esac
4077
4078 fi
4079 echo "$as_me:4079: result: $cf_cv_ar_flags" >&5
4080 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4081
4082 if test -n "$ARFLAGS" ; then
4083         if test -n "$cf_cv_ar_flags" ; then
4084                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4085         fi
4086 else
4087         ARFLAGS=$cf_cv_ar_flags
4088 fi
4089
4090         echo "$as_me:4090: checking for PATH separator" >&5
4091 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4092         case "$cf_cv_system_name" in
4093         (os2*)  PATH_SEPARATOR=';'  ;;
4094         (*)     ${PATH_SEPARATOR:=':'}  ;;
4095         esac
4096
4097         echo "$as_me:4097: result: $PATH_SEPARATOR" >&5
4098 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4099
4100 echo "$as_me:4100: checking if you have specified an install-prefix" >&5
4101 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4102
4103 # Check whether --with-install-prefix or --without-install-prefix was given.
4104 if test "${with_install_prefix+set}" = set; then
4105   withval="$with_install_prefix"
4106   case "$withval" in
4107         (yes|no)
4108                 ;;
4109         (*)     DESTDIR="$withval"
4110                 ;;
4111         esac
4112 fi;
4113 echo "$as_me:4113: result: $DESTDIR" >&5
4114 echo "${ECHO_T}$DESTDIR" >&6
4115
4116 ###############################################################################
4117
4118 # If we're cross-compiling, allow the user to override the tools and their
4119 # options.  The configure script is oriented toward identifying the host
4120 # compiler, etc., but we need a build compiler to generate parts of the source.
4121
4122 if test "$cross_compiling" = yes ; then
4123
4124         # defaults that we might want to override
4125         : ${BUILD_CFLAGS:=''}
4126         : ${BUILD_CPPFLAGS:=''}
4127         : ${BUILD_LDFLAGS:=''}
4128         : ${BUILD_LIBS:=''}
4129         : ${BUILD_EXEEXT:='$x'}
4130         : ${BUILD_OBJEXT:='o'}
4131
4132 # Check whether --with-build-cc or --without-build-cc was given.
4133 if test "${with_build_cc+set}" = set; then
4134   withval="$with_build_cc"
4135   BUILD_CC="$withval"
4136 else
4137   for ac_prog in gcc clang c99 c89 cc cl
4138 do
4139   # Extract the first word of "$ac_prog", so it can be a program name with args.
4140 set dummy $ac_prog; ac_word=$2
4141 echo "$as_me:4141: checking for $ac_word" >&5
4142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4143 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4144   echo $ECHO_N "(cached) $ECHO_C" >&6
4145 else
4146   if test -n "$BUILD_CC"; then
4147   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4148 else
4149   ac_save_IFS=$IFS; IFS=$ac_path_separator
4150 ac_dummy="$PATH"
4151 for ac_dir in $ac_dummy; do
4152   IFS=$ac_save_IFS
4153   test -z "$ac_dir" && ac_dir=.
4154   $as_executable_p "$ac_dir/$ac_word" || continue
4155 ac_cv_prog_BUILD_CC="$ac_prog"
4156 echo "$as_me:4156: found $ac_dir/$ac_word" >&5
4157 break
4158 done
4159
4160 fi
4161 fi
4162 BUILD_CC=$ac_cv_prog_BUILD_CC
4163 if test -n "$BUILD_CC"; then
4164   echo "$as_me:4164: result: $BUILD_CC" >&5
4165 echo "${ECHO_T}$BUILD_CC" >&6
4166 else
4167   echo "$as_me:4167: result: no" >&5
4168 echo "${ECHO_T}no" >&6
4169 fi
4170
4171   test -n "$BUILD_CC" && break
4172 done
4173 test -n "$BUILD_CC" || BUILD_CC="none"
4174
4175 fi;
4176         echo "$as_me:4176: checking for native build C compiler" >&5
4177 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4178         echo "$as_me:4178: result: $BUILD_CC" >&5
4179 echo "${ECHO_T}$BUILD_CC" >&6
4180
4181         echo "$as_me:4181: checking for native build C preprocessor" >&5
4182 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4183
4184 # Check whether --with-build-cpp or --without-build-cpp was given.
4185 if test "${with_build_cpp+set}" = set; then
4186   withval="$with_build_cpp"
4187   BUILD_CPP="$withval"
4188 else
4189   BUILD_CPP='${BUILD_CC} -E'
4190 fi;
4191         echo "$as_me:4191: result: $BUILD_CPP" >&5
4192 echo "${ECHO_T}$BUILD_CPP" >&6
4193
4194         echo "$as_me:4194: checking for native build C flags" >&5
4195 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4196
4197 # Check whether --with-build-cflags or --without-build-cflags was given.
4198 if test "${with_build_cflags+set}" = set; then
4199   withval="$with_build_cflags"
4200   BUILD_CFLAGS="$withval"
4201 fi;
4202         echo "$as_me:4202: result: $BUILD_CFLAGS" >&5
4203 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4204
4205         echo "$as_me:4205: checking for native build C preprocessor-flags" >&5
4206 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4207
4208 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4209 if test "${with_build_cppflags+set}" = set; then
4210   withval="$with_build_cppflags"
4211   BUILD_CPPFLAGS="$withval"
4212 fi;
4213         echo "$as_me:4213: result: $BUILD_CPPFLAGS" >&5
4214 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4215
4216         echo "$as_me:4216: checking for native build linker-flags" >&5
4217 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4218
4219 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4220 if test "${with_build_ldflags+set}" = set; then
4221   withval="$with_build_ldflags"
4222   BUILD_LDFLAGS="$withval"
4223 fi;
4224         echo "$as_me:4224: result: $BUILD_LDFLAGS" >&5
4225 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4226
4227         echo "$as_me:4227: checking for native build linker-libraries" >&5
4228 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4229
4230 # Check whether --with-build-libs or --without-build-libs was given.
4231 if test "${with_build_libs+set}" = set; then
4232   withval="$with_build_libs"
4233   BUILD_LIBS="$withval"
4234 fi;
4235         echo "$as_me:4235: result: $BUILD_LIBS" >&5
4236 echo "${ECHO_T}$BUILD_LIBS" >&6
4237
4238         # this assumes we're on Unix.
4239         BUILD_EXEEXT=
4240         BUILD_OBJEXT=o
4241
4242         : ${BUILD_CC:='${CC}'}
4243
4244         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4245                 { { echo "$as_me:4245: error: Cross-build requires two compilers.
4246 Use --with-build-cc to specify the native compiler." >&5
4247 echo "$as_me: error: Cross-build requires two compilers.
4248 Use --with-build-cc to specify the native compiler." >&2;}
4249    { (exit 1); exit 1; }; }
4250         fi
4251
4252 else
4253         : ${BUILD_CC:='${CC}'}
4254         : ${BUILD_CPP:='${CPP}'}
4255         : ${BUILD_CFLAGS:='${CFLAGS}'}
4256         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4257         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4258         : ${BUILD_LIBS:='${LIBS}'}
4259         : ${BUILD_EXEEXT:='$x'}
4260         : ${BUILD_OBJEXT:='o'}
4261 fi
4262
4263 ###############################################################################
4264
4265 ### Options to allow the user to specify the set of libraries which are used.
4266 ### Use "--without-normal --with-shared" to allow the default model to be
4267 ### shared, for example.
4268 cf_list_models=""
4269
4270 echo "$as_me:4270: checking if you want to build shared C-objects" >&5
4271 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4272
4273 # Check whether --with-shared or --without-shared was given.
4274 if test "${with_shared+set}" = set; then
4275   withval="$with_shared"
4276   with_shared=$withval
4277 else
4278   with_shared=no
4279 fi;
4280 echo "$as_me:4280: result: $with_shared" >&5
4281 echo "${ECHO_T}$with_shared" >&6
4282 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4283
4284 echo "$as_me:4284: checking for specified models" >&5
4285 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4286 test -z "$cf_list_models" && cf_list_models=normal
4287 echo "$as_me:4287: result: $cf_list_models" >&5
4288 echo "${ECHO_T}$cf_list_models" >&6
4289
4290 ### Use the first model as the default, and save its suffix for use in building
4291 ### up test-applications.
4292 echo "$as_me:4292: checking for default model" >&5
4293 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4294 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4295 echo "$as_me:4295: result: $DFT_LWR_MODEL" >&5
4296 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4297
4298 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4299
4300 echo "$as_me:4300: checking for specific curses-directory" >&5
4301 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4302
4303 # Check whether --with-curses-dir or --without-curses-dir was given.
4304 if test "${with_curses_dir+set}" = set; then
4305   withval="$with_curses_dir"
4306   cf_cv_curses_dir=$withval
4307 else
4308   cf_cv_curses_dir=no
4309 fi;
4310 echo "$as_me:4310: result: $cf_cv_curses_dir" >&5
4311 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4312
4313 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4314 then
4315
4316 if test "x$prefix" != xNONE; then
4317         cf_path_syntax="$prefix"
4318 else
4319         cf_path_syntax="$ac_default_prefix"
4320 fi
4321
4322 case ".$withval" in
4323 (.\$\(*\)*|.\'*\'*)
4324         ;;
4325 (..|./*|.\\*)
4326         ;;
4327 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4328         ;;
4329 (.\$\{*prefix\}*|.\$\{*dir\}*)
4330         eval withval="$withval"
4331         case ".$withval" in
4332         (.NONE/*)
4333                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4334                 ;;
4335         esac
4336         ;;
4337 (.no|.NONE/*)
4338         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4339         ;;
4340 (*)
4341         { { echo "$as_me:4341: error: expected a pathname, not \"$withval\"" >&5
4342 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4343    { (exit 1); exit 1; }; }
4344         ;;
4345 esac
4346
4347         if test -d "$cf_cv_curses_dir"
4348         then
4349
4350 if test -n "$cf_cv_curses_dir/include" ; then
4351   for cf_add_incdir in $cf_cv_curses_dir/include
4352   do
4353         while test "$cf_add_incdir" != /usr/include
4354         do
4355           if test -d "$cf_add_incdir"
4356           then
4357                 cf_have_incdir=no
4358                 if test -n "$CFLAGS$CPPFLAGS" ; then
4359                   # a loop is needed to ensure we can add subdirs of existing dirs
4360                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4361                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4362                           cf_have_incdir=yes; break
4363                         fi
4364                   done
4365                 fi
4366
4367                 if test "$cf_have_incdir" = no ; then
4368                   if test "$cf_add_incdir" = /usr/local/include ; then
4369                         if test "$GCC" = yes
4370                         then
4371                           cf_save_CPPFLAGS=$CPPFLAGS
4372
4373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4374         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4375
4376                           cat >"conftest.$ac_ext" <<_ACEOF
4377 #line 4377 "configure"
4378 #include "confdefs.h"
4379 #include <stdio.h>
4380 int
4381 main (void)
4382 {
4383 printf("Hello")
4384   ;
4385   return 0;
4386 }
4387 _ACEOF
4388 rm -f "conftest.$ac_objext"
4389 if { (eval echo "$as_me:4389: \"$ac_compile\"") >&5
4390   (eval $ac_compile) 2>&5
4391   ac_status=$?
4392   echo "$as_me:4392: \$? = $ac_status" >&5
4393   (exit "$ac_status"); } &&
4394          { ac_try='test -s "conftest.$ac_objext"'
4395   { (eval echo "$as_me:4395: \"$ac_try\"") >&5
4396   (eval $ac_try) 2>&5
4397   ac_status=$?
4398   echo "$as_me:4398: \$? = $ac_status" >&5
4399   (exit "$ac_status"); }; }; then
4400   :
4401 else
4402   echo "$as_me: failed program was:" >&5
4403 cat "conftest.$ac_ext" >&5
4404 cf_have_incdir=yes
4405 fi
4406 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4407                           CPPFLAGS=$cf_save_CPPFLAGS
4408                         fi
4409                   fi
4410                 fi
4411
4412                 if test "$cf_have_incdir" = no ; then
4413                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4414
4415 echo "${as_me:-configure}:4415: testing adding $cf_add_incdir to include-path ..." 1>&5
4416
4417                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4418
4419                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4420                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4421                   cf_add_incdir="$cf_top_incdir"
4422                 else
4423                   break
4424                 fi
4425           else
4426                 break
4427           fi
4428         done
4429   done
4430 fi
4431
4432 if test -n "$cf_cv_curses_dir/lib" ; then
4433         for cf_add_libdir in $cf_cv_curses_dir/lib
4434         do
4435                 if test "$cf_add_libdir" = /usr/lib ; then
4436                         :
4437                 elif test -d "$cf_add_libdir"
4438                 then
4439                         cf_have_libdir=no
4440                         if test -n "$LDFLAGS$LIBS" ; then
4441                                 # a loop is needed to ensure we can add subdirs of existing dirs
4442                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4443                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4444                                                 cf_have_libdir=yes; break
4445                                         fi
4446                                 done
4447                         fi
4448                         if test "$cf_have_libdir" = no ; then
4449                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4450
4451 echo "${as_me:-configure}:4451: testing adding $cf_add_libdir to library-path ..." 1>&5
4452
4453                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4454                         fi
4455                 fi
4456         done
4457 fi
4458
4459         fi
4460 fi
4461
4462 cf_ncuconfig_root=ncurses
4463 cf_have_ncuconfig=no
4464
4465 if test "x${PKG_CONFIG:=none}" != xnone; then
4466         echo "$as_me:4466: checking pkg-config for $cf_ncuconfig_root" >&5
4467 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4468         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4469                 echo "$as_me:4469: result: yes" >&5
4470 echo "${ECHO_T}yes" >&6
4471
4472                 echo "$as_me:4472: checking if the $cf_ncuconfig_root package files work" >&5
4473 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4474                 cf_have_ncuconfig=unknown
4475
4476                 cf_save_CFLAGS="$CFLAGS"
4477                 cf_save_CPPFLAGS="$CPPFLAGS"
4478                 cf_save_LIBS="$LIBS"
4479
4480                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4481                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4482
4483                 # while -W for passing linker flags is prevalent, it is not "standard".
4484                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4485                 # incompatible _and_ non-standard -W option which gives an error.  Work
4486                 # around that pitfall.
4487                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4488                 (x*c[89]9@@*-W*)
4489
4490 cf_fix_cppflags=no
4491 cf_new_cflags=
4492 cf_new_cppflags=
4493 cf_new_extra_cppflags=
4494
4495 for cf_add_cflags in $cf_pkg_cflags
4496 do
4497 case "$cf_fix_cppflags" in
4498 (no)
4499         case "$cf_add_cflags" in
4500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4501                 case "$cf_add_cflags" in
4502                 (-D*)
4503                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4504
4505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4506                                 && test -z "${cf_tst_cflags}" \
4507                                 && cf_fix_cppflags=yes
4508
4509                         if test "$cf_fix_cppflags" = yes ; then
4510
4511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4513
4514                                 continue
4515                         elif test "${cf_tst_cflags}" = "\"'" ; then
4516
4517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4519
4520                                 continue
4521                         fi
4522                         ;;
4523                 esac
4524                 case "$CPPFLAGS" in
4525                 (*$cf_add_cflags)
4526                         ;;
4527                 (*)
4528                         case "$cf_add_cflags" in
4529                         (-D*)
4530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4531
4532 CPPFLAGS=`echo "$CPPFLAGS" | \
4533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4535
4536                                 ;;
4537                         esac
4538
4539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4541
4542                         ;;
4543                 esac
4544                 ;;
4545         (*)
4546
4547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4549
4550                 ;;
4551         esac
4552         ;;
4553 (yes)
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4559
4560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4561                 && test -z "${cf_tst_cflags}" \
4562                 && cf_fix_cppflags=no
4563         ;;
4564 esac
4565 done
4566
4567 if test -n "$cf_new_cflags" ; then
4568
4569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4570         CFLAGS="${CFLAGS}$cf_new_cflags"
4571
4572 fi
4573
4574 if test -n "$cf_new_cppflags" ; then
4575
4576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4578
4579 fi
4580
4581 if test -n "$cf_new_extra_cppflags" ; then
4582
4583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4585
4586 fi
4587
4588 cf_add_libs="$LIBS"
4589 # reverse order
4590 cf_add_0lib=
4591 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4592 # filter duplicates
4593 for cf_add_1lib in $cf_add_0lib; do
4594         for cf_add_2lib in $cf_add_libs; do
4595                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4596                         cf_add_1lib=
4597                         break
4598                 fi
4599         done
4600         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4601 done
4602 LIBS="$cf_add_libs"
4603
4604                         cat >"conftest.$ac_ext" <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <${cf_cv_ncurses_header:-curses.h}>
4608 int
4609 main (void)
4610 {
4611 initscr(); mousemask(0,0); tigetstr((char *)0);
4612   ;
4613   return 0;
4614 }
4615 _ACEOF
4616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4617 if { (eval echo "$as_me:4617: \"$ac_link\"") >&5
4618   (eval $ac_link) 2>&5
4619   ac_status=$?
4620   echo "$as_me:4620: \$? = $ac_status" >&5
4621   (exit "$ac_status"); } &&
4622          { ac_try='test -s "conftest$ac_exeext"'
4623   { (eval echo "$as_me:4623: \"$ac_try\"") >&5
4624   (eval $ac_try) 2>&5
4625   ac_status=$?
4626   echo "$as_me:4626: \$? = $ac_status" >&5
4627   (exit "$ac_status"); }; }; then
4628   if test "$cross_compiling" = yes; then
4629   cf_test_ncuconfig=maybe
4630 else
4631   cat >"conftest.$ac_ext" <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634 #include <${cf_cv_ncurses_header:-curses.h}>
4635                                         int main(void)
4636                                         { const char *xx = curses_version(); return (xx == 0); }
4637 _ACEOF
4638 rm -f "conftest$ac_exeext"
4639 if { (eval echo "$as_me:4639: \"$ac_link\"") >&5
4640   (eval $ac_link) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit "$ac_status"); }; }; then
4649   cf_test_ncuconfig=yes
4650 else
4651   echo "$as_me: program exited with status $ac_status" >&5
4652 echo "$as_me: failed program was:" >&5
4653 cat "conftest.$ac_ext" >&5
4654 cf_test_ncuconfig=no
4655 fi
4656 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4657 fi
4658 else
4659   echo "$as_me: failed program was:" >&5
4660 cat "conftest.$ac_ext" >&5
4661 cf_test_ncuconfig=no
4662 fi
4663 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4664
4665                         CFLAGS="$cf_save_CFLAGS"
4666                         CPPFLAGS="$cf_save_CPPFLAGS"
4667                         LIBS="$cf_save_LIBS"
4668
4669                         if test "x$cf_test_ncuconfig" != xyes; then
4670                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4671                                 cf_pkg_cflags="$cf_temp"
4672                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4673                                 cf_pkg_libs="$cf_temp"
4674                         fi
4675                         ;;
4676                 esac
4677
4678 for cf_add_cflags in $cf_pkg_cflags
4679 do
4680
4681 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4682 cf_old_cflag="$CFLAGS"
4683
4684 case "$CFLAGS" in
4685 (*$cf_add_cflags=*)
4686         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
4687         ;;
4688 (*$cf_add_cflags\ *)
4689         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
4690         ;;
4691 (*$cf_add_cflags)
4692         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
4693         ;;
4694 esac
4695
4696 if test "$CFLAGS" != "$cf_old_cflag" ;
4697 then
4698
4699         CFLAGS="$cf_new_cflag"
4700 fi
4701
4702 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4703 cf_old_cflag="$CPPFLAGS"
4704
4705 case "$CPPFLAGS" in
4706 (*$cf_add_cflags=*)
4707         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
4708         ;;
4709 (*$cf_add_cflags\ *)
4710         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
4711         ;;
4712 (*$cf_add_cflags)
4713         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
4714         ;;
4715 esac
4716
4717 if test "$CPPFLAGS" != "$cf_old_cflag" ;
4718 then
4719
4720         CPPFLAGS="$cf_new_cflag"
4721 fi
4722
4723 done
4724
4725 cf_fix_cppflags=no
4726 cf_new_cflags=
4727 cf_new_cppflags=
4728 cf_new_extra_cppflags=
4729
4730 for cf_add_cflags in $cf_pkg_cflags
4731 do
4732 case "$cf_fix_cppflags" in
4733 (no)
4734         case "$cf_add_cflags" in
4735         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4736                 case "$cf_add_cflags" in
4737                 (-D*)
4738                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4739
4740                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4741                                 && test -z "${cf_tst_cflags}" \
4742                                 && cf_fix_cppflags=yes
4743
4744                         if test "$cf_fix_cppflags" = yes ; then
4745
4746         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4747         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4748
4749                                 continue
4750                         elif test "${cf_tst_cflags}" = "\"'" ; then
4751
4752         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4753         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4754
4755                                 continue
4756                         fi
4757                         ;;
4758                 esac
4759                 case "$CPPFLAGS" in
4760                 (*$cf_add_cflags)
4761                         ;;
4762                 (*)
4763                         case "$cf_add_cflags" in
4764                         (-D*)
4765                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4766
4767 CPPFLAGS=`echo "$CPPFLAGS" | \
4768         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4769                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4770
4771                                 ;;
4772                         esac
4773
4774         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4775         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4776
4777                         ;;
4778                 esac
4779                 ;;
4780         (*)
4781
4782         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4783         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4784
4785                 ;;
4786         esac
4787         ;;
4788 (yes)
4789
4790         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4791         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4792
4793         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4794
4795         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4796                 && test -z "${cf_tst_cflags}" \
4797                 && cf_fix_cppflags=no
4798         ;;
4799 esac
4800 done
4801
4802 if test -n "$cf_new_cflags" ; then
4803
4804         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4805         CFLAGS="${CFLAGS}$cf_new_cflags"
4806
4807 fi
4808
4809 if test -n "$cf_new_cppflags" ; then
4810
4811         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4812         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4813
4814 fi
4815
4816 if test -n "$cf_new_extra_cppflags" ; then
4817
4818         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4819         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4820
4821 fi
4822
4823 cf_add_libs="$LIBS"
4824 # reverse order
4825 cf_add_0lib=
4826 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4827 # filter duplicates
4828 for cf_add_1lib in $cf_add_0lib; do
4829         for cf_add_2lib in $cf_add_libs; do
4830                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4831                         cf_add_1lib=
4832                         break
4833                 fi
4834         done
4835         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4836 done
4837 LIBS="$cf_add_libs"
4838
4839                 cat >"conftest.$ac_ext" <<_ACEOF
4840 #line 4840 "configure"
4841 #include "confdefs.h"
4842 #include <${cf_cv_ncurses_header:-curses.h}>
4843 int
4844 main (void)
4845 {
4846 initscr(); mousemask(0,0); tigetstr((char *)0);
4847   ;
4848   return 0;
4849 }
4850 _ACEOF
4851 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4852 if { (eval echo "$as_me:4852: \"$ac_link\"") >&5
4853   (eval $ac_link) 2>&5
4854   ac_status=$?
4855   echo "$as_me:4855: \$? = $ac_status" >&5
4856   (exit "$ac_status"); } &&
4857          { ac_try='test -s "conftest$ac_exeext"'
4858   { (eval echo "$as_me:4858: \"$ac_try\"") >&5
4859   (eval $ac_try) 2>&5
4860   ac_status=$?
4861   echo "$as_me:4861: \$? = $ac_status" >&5
4862   (exit "$ac_status"); }; }; then
4863   if test "$cross_compiling" = yes; then
4864   cf_have_ncuconfig=maybe
4865 else
4866   cat >"conftest.$ac_ext" <<_ACEOF
4867 #line 4867 "configure"
4868 #include "confdefs.h"
4869 #include <${cf_cv_ncurses_header:-curses.h}>
4870                                 int main(void)
4871                                 { const char *xx = curses_version(); return (xx == 0); }
4872 _ACEOF
4873 rm -f "conftest$ac_exeext"
4874 if { (eval echo "$as_me:4874: \"$ac_link\"") >&5
4875   (eval $ac_link) 2>&5
4876   ac_status=$?
4877   echo "$as_me:4877: \$? = $ac_status" >&5
4878   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4879   { (eval echo "$as_me:4879: \"$ac_try\"") >&5
4880   (eval $ac_try) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit "$ac_status"); }; }; then
4884   cf_have_ncuconfig=yes
4885 else
4886   echo "$as_me: program exited with status $ac_status" >&5
4887 echo "$as_me: failed program was:" >&5
4888 cat "conftest.$ac_ext" >&5
4889 cf_have_ncuconfig=no
4890 fi
4891 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4892 fi
4893 else
4894   echo "$as_me: failed program was:" >&5
4895 cat "conftest.$ac_ext" >&5
4896 cf_have_ncuconfig=no
4897 fi
4898 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4899                 echo "$as_me:4899: result: $cf_have_ncuconfig" >&5
4900 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4901                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4902                 if test "$cf_have_ncuconfig" != "yes"
4903                 then
4904                         CPPFLAGS="$cf_save_CPPFLAGS"
4905                         LIBS="$cf_save_LIBS"
4906                         NCURSES_CONFIG_PKG=none
4907                 else
4908
4909 cat >>confdefs.h <<\EOF
4910 #define NCURSES 1
4911 EOF
4912
4913                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4914
4915 echo "$as_me:4915: checking for terminfo header" >&5
4916 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4917 if test "${cf_cv_term_header+set}" = set; then
4918   echo $ECHO_N "(cached) $ECHO_C" >&6
4919 else
4920
4921 case "${cf_cv_ncurses_header}" in
4922 (*/ncurses.h|*/ncursesw.h)
4923         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4924         ;;
4925 (*)
4926         cf_term_header=term.h
4927         ;;
4928 esac
4929
4930 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4931 do
4932 cat >"conftest.$ac_ext" <<_ACEOF
4933 #line 4933 "configure"
4934 #include "confdefs.h"
4935 #include <stdio.h>
4936 #include <${cf_cv_ncurses_header:-curses.h}>
4937 #include <$cf_test>
4938
4939 int
4940 main (void)
4941 {
4942 int x = auto_left_margin; (void)x
4943   ;
4944   return 0;
4945 }
4946 _ACEOF
4947 rm -f "conftest.$ac_objext"
4948 if { (eval echo "$as_me:4948: \"$ac_compile\"") >&5
4949   (eval $ac_compile) 2>&5
4950   ac_status=$?
4951   echo "$as_me:4951: \$? = $ac_status" >&5
4952   (exit "$ac_status"); } &&
4953          { ac_try='test -s "conftest.$ac_objext"'
4954   { (eval echo "$as_me:4954: \"$ac_try\"") >&5
4955   (eval $ac_try) 2>&5
4956   ac_status=$?
4957   echo "$as_me:4957: \$? = $ac_status" >&5
4958   (exit "$ac_status"); }; }; then
4959
4960         cf_cv_term_header="$cf_test"
4961 else
4962   echo "$as_me: failed program was:" >&5
4963 cat "conftest.$ac_ext" >&5
4964
4965         cf_cv_term_header=unknown
4966
4967 fi
4968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4969         test "$cf_cv_term_header" != unknown && break
4970 done
4971
4972 fi
4973 echo "$as_me:4973: result: $cf_cv_term_header" >&5
4974 echo "${ECHO_T}$cf_cv_term_header" >&6
4975
4976 # Set definitions to allow ifdef'ing to accommodate subdirectories
4977
4978 case "$cf_cv_term_header" in
4979 (*term.h)
4980
4981 cat >>confdefs.h <<\EOF
4982 #define HAVE_TERM_H 1
4983 EOF
4984
4985         ;;
4986 esac
4987
4988 case "$cf_cv_term_header" in
4989 (ncurses/term.h)
4990
4991 cat >>confdefs.h <<\EOF
4992 #define HAVE_NCURSES_TERM_H 1
4993 EOF
4994
4995         ;;
4996 (ncursesw/term.h)
4997
4998 cat >>confdefs.h <<\EOF
4999 #define HAVE_NCURSESW_TERM_H 1
5000 EOF
5001
5002         ;;
5003 esac
5004
5005                 fi
5006
5007         else
5008                 echo "$as_me:5008: result: no" >&5
5009 echo "${ECHO_T}no" >&6
5010                 NCURSES_CONFIG_PKG=none
5011         fi
5012 else
5013         NCURSES_CONFIG_PKG=none
5014 fi
5015
5016 if test "x$cf_have_ncuconfig" = "xno"; then
5017         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5018
5019 if test -n "$ac_tool_prefix"; then
5020   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5021   do
5022     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5023 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5024 echo "$as_me:5024: checking for $ac_word" >&5
5025 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5026 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5027   echo $ECHO_N "(cached) $ECHO_C" >&6
5028 else
5029   if test -n "$NCURSES_CONFIG"; then
5030   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5031 else
5032   ac_save_IFS=$IFS; IFS=$ac_path_separator
5033 ac_dummy="$PATH"
5034 for ac_dir in $ac_dummy; do
5035   IFS=$ac_save_IFS
5036   test -z "$ac_dir" && ac_dir=.
5037   $as_executable_p "$ac_dir/$ac_word" || continue
5038 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5039 echo "$as_me:5039: found $ac_dir/$ac_word" >&5
5040 break
5041 done
5042
5043 fi
5044 fi
5045 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5046 if test -n "$NCURSES_CONFIG"; then
5047   echo "$as_me:5047: result: $NCURSES_CONFIG" >&5
5048 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5049 else
5050   echo "$as_me:5050: result: no" >&5
5051 echo "${ECHO_T}no" >&6
5052 fi
5053
5054     test -n "$NCURSES_CONFIG" && break
5055   done
5056 fi
5057 if test -z "$NCURSES_CONFIG"; then
5058   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5059   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5060 do
5061   # Extract the first word of "$ac_prog", so it can be a program name with args.
5062 set dummy $ac_prog; ac_word=$2
5063 echo "$as_me:5063: checking for $ac_word" >&5
5064 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5065 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5066   echo $ECHO_N "(cached) $ECHO_C" >&6
5067 else
5068   if test -n "$ac_ct_NCURSES_CONFIG"; then
5069   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5070 else
5071   ac_save_IFS=$IFS; IFS=$ac_path_separator
5072 ac_dummy="$PATH"
5073 for ac_dir in $ac_dummy; do
5074   IFS=$ac_save_IFS
5075   test -z "$ac_dir" && ac_dir=.
5076   $as_executable_p "$ac_dir/$ac_word" || continue
5077 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5078 echo "$as_me:5078: found $ac_dir/$ac_word" >&5
5079 break
5080 done
5081
5082 fi
5083 fi
5084 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5085 if test -n "$ac_ct_NCURSES_CONFIG"; then
5086   echo "$as_me:5086: result: $ac_ct_NCURSES_CONFIG" >&5
5087 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5088 else
5089   echo "$as_me:5089: result: no" >&5
5090 echo "${ECHO_T}no" >&6
5091 fi
5092
5093   test -n "$ac_ct_NCURSES_CONFIG" && break
5094 done
5095 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5096
5097   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5098 fi
5099
5100         if test "$NCURSES_CONFIG" != none ; then
5101
5102 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5103 do
5104
5105 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5106 cf_old_cflag="$CFLAGS"
5107
5108 case "$CFLAGS" in
5109 (*$cf_add_cflags=*)
5110         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5111         ;;
5112 (*$cf_add_cflags\ *)
5113         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5114         ;;
5115 (*$cf_add_cflags)
5116         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5117         ;;
5118 esac
5119
5120 if test "$CFLAGS" != "$cf_old_cflag" ;
5121 then
5122
5123         CFLAGS="$cf_new_cflag"
5124 fi
5125
5126 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5127 cf_old_cflag="$CPPFLAGS"
5128
5129 case "$CPPFLAGS" in
5130 (*$cf_add_cflags=*)
5131         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5132         ;;
5133 (*$cf_add_cflags\ *)
5134         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5135         ;;
5136 (*$cf_add_cflags)
5137         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5138         ;;
5139 esac
5140
5141 if test "$CPPFLAGS" != "$cf_old_cflag" ;
5142 then
5143
5144         CPPFLAGS="$cf_new_cflag"
5145 fi
5146
5147 done
5148
5149 cf_fix_cppflags=no
5150 cf_new_cflags=
5151 cf_new_cppflags=
5152 cf_new_extra_cppflags=
5153
5154 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5155 do
5156 case "$cf_fix_cppflags" in
5157 (no)
5158         case "$cf_add_cflags" in
5159         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5160                 case "$cf_add_cflags" in
5161                 (-D*)
5162                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5163
5164                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5165                                 && test -z "${cf_tst_cflags}" \
5166                                 && cf_fix_cppflags=yes
5167
5168                         if test "$cf_fix_cppflags" = yes ; then
5169
5170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5172
5173                                 continue
5174                         elif test "${cf_tst_cflags}" = "\"'" ; then
5175
5176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5178
5179                                 continue
5180                         fi
5181                         ;;
5182                 esac
5183                 case "$CPPFLAGS" in
5184                 (*$cf_add_cflags)
5185                         ;;
5186                 (*)
5187                         case "$cf_add_cflags" in
5188                         (-D*)
5189                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5190
5191 CPPFLAGS=`echo "$CPPFLAGS" | \
5192         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5193                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5194
5195                                 ;;
5196                         esac
5197
5198         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5199         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5200
5201                         ;;
5202                 esac
5203                 ;;
5204         (*)
5205
5206         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5207         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5208
5209                 ;;
5210         esac
5211         ;;
5212 (yes)
5213
5214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5216
5217         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5218
5219         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5220                 && test -z "${cf_tst_cflags}" \
5221                 && cf_fix_cppflags=no
5222         ;;
5223 esac
5224 done
5225
5226 if test -n "$cf_new_cflags" ; then
5227
5228         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5229         CFLAGS="${CFLAGS}$cf_new_cflags"
5230
5231 fi
5232
5233 if test -n "$cf_new_cppflags" ; then
5234
5235         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5236         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5237
5238 fi
5239
5240 if test -n "$cf_new_extra_cppflags" ; then
5241
5242         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5243         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5244
5245 fi
5246
5247 cf_add_libs="$LIBS"
5248 # reverse order
5249 cf_add_0lib=
5250 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5251 # filter duplicates
5252 for cf_add_1lib in $cf_add_0lib; do
5253         for cf_add_2lib in $cf_add_libs; do
5254                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5255                         cf_add_1lib=
5256                         break
5257                 fi
5258         done
5259         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5260 done
5261 LIBS="$cf_add_libs"
5262
5263                 # even with config script, some packages use no-override for curses.h
5264
5265 echo "$as_me:5265: checking if we have identified curses headers" >&5
5266 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5267 if test "${cf_cv_ncurses_header+set}" = set; then
5268   echo $ECHO_N "(cached) $ECHO_C" >&6
5269 else
5270
5271 cf_cv_ncurses_header=none
5272 for cf_header in \
5273         ncurses.h ncurses/ncurses.h \
5274         curses.h ncurses/curses.h
5275 do
5276 cat >"conftest.$ac_ext" <<_ACEOF
5277 #line 5277 "configure"
5278 #include "confdefs.h"
5279 #include <${cf_header}>
5280 int
5281 main (void)
5282 {
5283 initscr(); tgoto("?", 0,0)
5284   ;
5285   return 0;
5286 }
5287 _ACEOF
5288 rm -f "conftest.$ac_objext"
5289 if { (eval echo "$as_me:5289: \"$ac_compile\"") >&5
5290   (eval $ac_compile) 2>&5
5291   ac_status=$?
5292   echo "$as_me:5292: \$? = $ac_status" >&5
5293   (exit "$ac_status"); } &&
5294          { ac_try='test -s "conftest.$ac_objext"'
5295   { (eval echo "$as_me:5295: \"$ac_try\"") >&5
5296   (eval $ac_try) 2>&5
5297   ac_status=$?
5298   echo "$as_me:5298: \$? = $ac_status" >&5
5299   (exit "$ac_status"); }; }; then
5300   cf_cv_ncurses_header=$cf_header; break
5301 else
5302   echo "$as_me: failed program was:" >&5
5303 cat "conftest.$ac_ext" >&5
5304 fi
5305 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5306 done
5307
5308 fi
5309 echo "$as_me:5309: result: $cf_cv_ncurses_header" >&5
5310 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5311
5312 if test "$cf_cv_ncurses_header" = none ; then
5313         { { echo "$as_me:5313: error: No curses header-files found" >&5
5314 echo "$as_me: error: No curses header-files found" >&2;}
5315    { (exit 1); exit 1; }; }
5316 fi
5317
5318 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5319
5320 for ac_header in $cf_cv_ncurses_header
5321 do
5322 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5323 echo "$as_me:5323: checking for $ac_header" >&5
5324 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5325 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5326   echo $ECHO_N "(cached) $ECHO_C" >&6
5327 else
5328   cat >"conftest.$ac_ext" <<_ACEOF
5329 #line 5329 "configure"
5330 #include "confdefs.h"
5331 #include <$ac_header>
5332 _ACEOF
5333 if { (eval echo "$as_me:5333: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5334   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5335   ac_status=$?
5336   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5337   rm -f conftest.er1
5338   cat conftest.err >&5
5339   echo "$as_me:5339: \$? = $ac_status" >&5
5340   (exit "$ac_status"); } >/dev/null; then
5341   if test -s conftest.err; then
5342     ac_cpp_err=$ac_c_preproc_warn_flag
5343   else
5344     ac_cpp_err=
5345   fi
5346 else
5347   ac_cpp_err=yes
5348 fi
5349 if test -z "$ac_cpp_err"; then
5350   eval "$as_ac_Header=yes"
5351 else
5352   echo "$as_me: failed program was:" >&5
5353   cat "conftest.$ac_ext" >&5
5354   eval "$as_ac_Header=no"
5355 fi
5356 rm -f conftest.err "conftest.$ac_ext"
5357 fi
5358 echo "$as_me:5358: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5359 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5360 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5361   cat >>confdefs.h <<EOF
5362 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5363 EOF
5364
5365 fi
5366 done
5367
5368 cat >>confdefs.h <<\EOF
5369 #define NCURSES 1
5370 EOF
5371
5372 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5373
5374                 cat >>confdefs.h <<EOF
5375 #define $cf_nculib_ROOT 1
5376 EOF
5377
5378                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5379
5380         else
5381
5382 cf_ncuhdr_root=ncurses
5383
5384 test -n "$cf_cv_curses_dir" && \
5385 test "$cf_cv_curses_dir" != "no" && { \
5386
5387 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5388   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5389   do
5390         while test "$cf_add_incdir" != /usr/include
5391         do
5392           if test -d "$cf_add_incdir"
5393           then
5394                 cf_have_incdir=no
5395                 if test -n "$CFLAGS$CPPFLAGS" ; then
5396                   # a loop is needed to ensure we can add subdirs of existing dirs
5397                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5398                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5399                           cf_have_incdir=yes; break
5400                         fi
5401                   done
5402                 fi
5403
5404                 if test "$cf_have_incdir" = no ; then
5405                   if test "$cf_add_incdir" = /usr/local/include ; then
5406                         if test "$GCC" = yes
5407                         then
5408                           cf_save_CPPFLAGS=$CPPFLAGS
5409
5410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5411         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5412
5413                           cat >"conftest.$ac_ext" <<_ACEOF
5414 #line 5414 "configure"
5415 #include "confdefs.h"
5416 #include <stdio.h>
5417 int
5418 main (void)
5419 {
5420 printf("Hello")
5421   ;
5422   return 0;
5423 }
5424 _ACEOF
5425 rm -f "conftest.$ac_objext"
5426 if { (eval echo "$as_me:5426: \"$ac_compile\"") >&5
5427   (eval $ac_compile) 2>&5
5428   ac_status=$?
5429   echo "$as_me:5429: \$? = $ac_status" >&5
5430   (exit "$ac_status"); } &&
5431          { ac_try='test -s "conftest.$ac_objext"'
5432   { (eval echo "$as_me:5432: \"$ac_try\"") >&5
5433   (eval $ac_try) 2>&5
5434   ac_status=$?
5435   echo "$as_me:5435: \$? = $ac_status" >&5
5436   (exit "$ac_status"); }; }; then
5437   :
5438 else
5439   echo "$as_me: failed program was:" >&5
5440 cat "conftest.$ac_ext" >&5
5441 cf_have_incdir=yes
5442 fi
5443 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5444                           CPPFLAGS=$cf_save_CPPFLAGS
5445                         fi
5446                   fi
5447                 fi
5448
5449                 if test "$cf_have_incdir" = no ; then
5450                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5451
5452 echo "${as_me:-configure}:5452: testing adding $cf_add_incdir to include-path ..." 1>&5
5453
5454                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5455
5456                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5457                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5458                   cf_add_incdir="$cf_top_incdir"
5459                 else
5460                   break
5461                 fi
5462           else
5463                 break
5464           fi
5465         done
5466   done
5467 fi
5468
5469 }
5470
5471 echo "$as_me:5471: checking for $cf_ncuhdr_root header in include-path" >&5
5472 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5473 if test "${cf_cv_ncurses_h+set}" = set; then
5474   echo $ECHO_N "(cached) $ECHO_C" >&6
5475 else
5476
5477         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5478         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5479         for cf_header in $cf_header_list
5480         do
5481
5482         cat >"conftest.$ac_ext" <<_ACEOF
5483 #line 5483 "configure"
5484 #include "confdefs.h"
5485
5486 #include <$cf_header>
5487 int
5488 main (void)
5489 {
5490
5491 #ifdef NCURSES_VERSION
5492
5493 printf("%s\\n", NCURSES_VERSION);
5494 #else
5495 #ifdef __NCURSES_H
5496 printf("old\\n");
5497 #else
5498         make an error
5499 #endif
5500 #endif
5501
5502   ;
5503   return 0;
5504 }
5505 _ACEOF
5506 rm -f "conftest.$ac_objext"
5507 if { (eval echo "$as_me:5507: \"$ac_compile\"") >&5
5508   (eval $ac_compile) 2>&5
5509   ac_status=$?
5510   echo "$as_me:5510: \$? = $ac_status" >&5
5511   (exit "$ac_status"); } &&
5512          { ac_try='test -s "conftest.$ac_objext"'
5513   { (eval echo "$as_me:5513: \"$ac_try\"") >&5
5514   (eval $ac_try) 2>&5
5515   ac_status=$?
5516   echo "$as_me:5516: \$? = $ac_status" >&5
5517   (exit "$ac_status"); }; }; then
5518   cf_cv_ncurses_h=$cf_header
5519
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat "conftest.$ac_ext" >&5
5523 cf_cv_ncurses_h=no
5524 fi
5525 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5526
5527                 test "$cf_cv_ncurses_h" != no && break
5528         done
5529
5530 fi
5531 echo "$as_me:5531: result: $cf_cv_ncurses_h" >&5
5532 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5533
5534 if test "$cf_cv_ncurses_h" != no ; then
5535         cf_cv_ncurses_header=$cf_cv_ncurses_h
5536 else
5537
5538 echo "$as_me:5538: checking for $cf_ncuhdr_root include-path" >&5
5539 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5540 if test "${cf_cv_ncurses_h2+set}" = set; then
5541   echo $ECHO_N "(cached) $ECHO_C" >&6
5542 else
5543
5544         test -n "$verbose" && echo
5545
5546 cf_search=
5547
5548 # collect the current set of include-directories from compiler flags
5549 cf_header_path_list=""
5550 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5551         for cf_header_path in $CPPFLAGS $CFLAGS
5552         do
5553                 case "$cf_header_path" in
5554                 (-I*)
5555                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5556
5557 test "x$cf_header_path" != "xNONE" && \
5558 test -d "$cf_header_path" && \
5559  {
5560         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5561         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5562         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5563         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5564         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5565         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"
5566 }
5567
5568                         cf_header_path_list="$cf_header_path_list $cf_search"
5569                         ;;
5570                 esac
5571         done
5572 fi
5573
5574 # add the variations for the package we are looking for
5575
5576 cf_search=
5577
5578 test "x$prefix" != "xNONE" && \
5579 test -d "$prefix" && \
5580  {
5581         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5582         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5583         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5584         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5585         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5586         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5587 }
5588
5589 for cf_subdir_prefix in \
5590         /usr \
5591         /usr/local \
5592         /usr/pkg \
5593         /opt \
5594         /opt/local \
5595         $HOME
5596 do
5597
5598 test "x$cf_subdir_prefix" != "x$prefix" && \
5599 test -d "$cf_subdir_prefix" && \
5600 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5601         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5602         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5603         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5604         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5605         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5606         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"
5607 }
5608
5609 done
5610
5611 test "$includedir" != NONE && \
5612 test "$includedir" != "/usr/include" && \
5613 test -d "$includedir" && {
5614         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5615         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5616 }
5617
5618 test "$oldincludedir" != NONE && \
5619 test "$oldincludedir" != "/usr/include" && \
5620 test -d "$oldincludedir" && {
5621         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5622         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5623 }
5624
5625 cf_search="$cf_search $cf_header_path_list"
5626
5627         test -n "$verbose" && echo "search path $cf_search"
5628         cf_save2_CPPFLAGS="$CPPFLAGS"
5629         for cf_incdir in $cf_search
5630         do
5631
5632 if test -n "$cf_incdir" ; then
5633   for cf_add_incdir in $cf_incdir
5634   do
5635         while test "$cf_add_incdir" != /usr/include
5636         do
5637           if test -d "$cf_add_incdir"
5638           then
5639                 cf_have_incdir=no
5640                 if test -n "$CFLAGS$CPPFLAGS" ; then
5641                   # a loop is needed to ensure we can add subdirs of existing dirs
5642                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5643                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5644                           cf_have_incdir=yes; break
5645                         fi
5646                   done
5647                 fi
5648
5649                 if test "$cf_have_incdir" = no ; then
5650                   if test "$cf_add_incdir" = /usr/local/include ; then
5651                         if test "$GCC" = yes
5652                         then
5653                           cf_save_CPPFLAGS=$CPPFLAGS
5654
5655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5656         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5657
5658                           cat >"conftest.$ac_ext" <<_ACEOF
5659 #line 5659 "configure"
5660 #include "confdefs.h"
5661 #include <stdio.h>
5662 int
5663 main (void)
5664 {
5665 printf("Hello")
5666   ;
5667   return 0;
5668 }
5669 _ACEOF
5670 rm -f "conftest.$ac_objext"
5671 if { (eval echo "$as_me:5671: \"$ac_compile\"") >&5
5672   (eval $ac_compile) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit "$ac_status"); } &&
5676          { ac_try='test -s "conftest.$ac_objext"'
5677   { (eval echo "$as_me:5677: \"$ac_try\"") >&5
5678   (eval $ac_try) 2>&5
5679   ac_status=$?
5680   echo "$as_me:5680: \$? = $ac_status" >&5
5681   (exit "$ac_status"); }; }; then
5682   :
5683 else
5684   echo "$as_me: failed program was:" >&5
5685 cat "conftest.$ac_ext" >&5
5686 cf_have_incdir=yes
5687 fi
5688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5689                           CPPFLAGS=$cf_save_CPPFLAGS
5690                         fi
5691                   fi
5692                 fi
5693
5694                 if test "$cf_have_incdir" = no ; then
5695                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5696
5697 echo "${as_me:-configure}:5697: testing adding $cf_add_incdir to include-path ..." 1>&5
5698
5699                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5700
5701                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5702                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5703                   cf_add_incdir="$cf_top_incdir"
5704                 else
5705                   break
5706                 fi
5707           else
5708                 break
5709           fi
5710         done
5711   done
5712 fi
5713
5714                 for cf_header in \
5715                         ncurses.h \
5716                         curses.h
5717                 do
5718
5719         cat >"conftest.$ac_ext" <<_ACEOF
5720 #line 5720 "configure"
5721 #include "confdefs.h"
5722
5723 #include <$cf_header>
5724 int
5725 main (void)
5726 {
5727
5728 #ifdef NCURSES_VERSION
5729
5730 printf("%s\\n", NCURSES_VERSION);
5731 #else
5732 #ifdef __NCURSES_H
5733 printf("old\\n");
5734 #else
5735         make an error
5736 #endif
5737 #endif
5738
5739   ;
5740   return 0;
5741 }
5742 _ACEOF
5743 rm -f "conftest.$ac_objext"
5744 if { (eval echo "$as_me:5744: \"$ac_compile\"") >&5
5745   (eval $ac_compile) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit "$ac_status"); } &&
5749          { ac_try='test -s "conftest.$ac_objext"'
5750   { (eval echo "$as_me:5750: \"$ac_try\"") >&5
5751   (eval $ac_try) 2>&5
5752   ac_status=$?
5753   echo "$as_me:5753: \$? = $ac_status" >&5
5754   (exit "$ac_status"); }; }; then
5755   cf_cv_ncurses_h2=$cf_header
5756
5757 else
5758   echo "$as_me: failed program was:" >&5
5759 cat "conftest.$ac_ext" >&5
5760 cf_cv_ncurses_h2=no
5761 fi
5762 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5763
5764                         if test "$cf_cv_ncurses_h2" != no ; then
5765                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5766                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5767                                 break
5768                         fi
5769                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5770                 done
5771                 CPPFLAGS="$cf_save2_CPPFLAGS"
5772                 test "$cf_cv_ncurses_h2" != no && break
5773         done
5774         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5774: error: not found" >&5
5775 echo "$as_me: error: not found" >&2;}
5776    { (exit 1); exit 1; }; }
5777
5778 fi
5779 echo "$as_me:5779: result: $cf_cv_ncurses_h2" >&5
5780 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5781
5782         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5783         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5784         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5785                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5786         fi
5787
5788 if test -n "$cf_1st_incdir" ; then
5789   for cf_add_incdir in $cf_1st_incdir
5790   do
5791         while test "$cf_add_incdir" != /usr/include
5792         do
5793           if test -d "$cf_add_incdir"
5794           then
5795                 cf_have_incdir=no
5796                 if test -n "$CFLAGS$CPPFLAGS" ; then
5797                   # a loop is needed to ensure we can add subdirs of existing dirs
5798                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5799                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5800                           cf_have_incdir=yes; break
5801                         fi
5802                   done
5803                 fi
5804
5805                 if test "$cf_have_incdir" = no ; then
5806                   if test "$cf_add_incdir" = /usr/local/include ; then
5807                         if test "$GCC" = yes
5808                         then
5809                           cf_save_CPPFLAGS=$CPPFLAGS
5810
5811         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5812         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5813
5814                           cat >"conftest.$ac_ext" <<_ACEOF
5815 #line 5815 "configure"
5816 #include "confdefs.h"
5817 #include <stdio.h>
5818 int
5819 main (void)
5820 {
5821 printf("Hello")
5822   ;
5823   return 0;
5824 }
5825 _ACEOF
5826 rm -f "conftest.$ac_objext"
5827 if { (eval echo "$as_me:5827: \"$ac_compile\"") >&5
5828   (eval $ac_compile) 2>&5
5829   ac_status=$?
5830   echo "$as_me:5830: \$? = $ac_status" >&5
5831   (exit "$ac_status"); } &&
5832          { ac_try='test -s "conftest.$ac_objext"'
5833   { (eval echo "$as_me:5833: \"$ac_try\"") >&5
5834   (eval $ac_try) 2>&5
5835   ac_status=$?
5836   echo "$as_me:5836: \$? = $ac_status" >&5
5837   (exit "$ac_status"); }; }; then
5838   :
5839 else
5840   echo "$as_me: failed program was:" >&5
5841 cat "conftest.$ac_ext" >&5
5842 cf_have_incdir=yes
5843 fi
5844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5845                           CPPFLAGS=$cf_save_CPPFLAGS
5846                         fi
5847                   fi
5848                 fi
5849
5850                 if test "$cf_have_incdir" = no ; then
5851                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5852
5853 echo "${as_me:-configure}:5853: testing adding $cf_add_incdir to include-path ..." 1>&5
5854
5855                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5856
5857                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5858                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5859                   cf_add_incdir="$cf_top_incdir"
5860                 else
5861                   break
5862                 fi
5863           else
5864                 break
5865           fi
5866         done
5867   done
5868 fi
5869
5870 fi
5871
5872 # Set definitions to allow ifdef'ing for ncurses.h
5873
5874 case "$cf_cv_ncurses_header" in
5875 (*ncurses.h)
5876
5877 cat >>confdefs.h <<\EOF
5878 #define HAVE_NCURSES_H 1
5879 EOF
5880
5881         ;;
5882 esac
5883
5884 case "$cf_cv_ncurses_header" in
5885 (ncurses/curses.h|ncurses/ncurses.h)
5886
5887 cat >>confdefs.h <<\EOF
5888 #define HAVE_NCURSES_NCURSES_H 1
5889 EOF
5890
5891         ;;
5892 (ncursesw/curses.h|ncursesw/ncurses.h)
5893
5894 cat >>confdefs.h <<\EOF
5895 #define HAVE_NCURSESW_NCURSES_H 1
5896 EOF
5897
5898         ;;
5899 esac
5900
5901 echo "$as_me:5901: checking for terminfo header" >&5
5902 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5903 if test "${cf_cv_term_header+set}" = set; then
5904   echo $ECHO_N "(cached) $ECHO_C" >&6
5905 else
5906
5907 case "${cf_cv_ncurses_header}" in
5908 (*/ncurses.h|*/ncursesw.h)
5909         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5910         ;;
5911 (*)
5912         cf_term_header=term.h
5913         ;;
5914 esac
5915
5916 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5917 do
5918 cat >"conftest.$ac_ext" <<_ACEOF
5919 #line 5919 "configure"
5920 #include "confdefs.h"
5921 #include <stdio.h>
5922 #include <${cf_cv_ncurses_header:-curses.h}>
5923 #include <$cf_test>
5924
5925 int
5926 main (void)
5927 {
5928 int x = auto_left_margin; (void)x
5929   ;
5930   return 0;
5931 }
5932 _ACEOF
5933 rm -f "conftest.$ac_objext"
5934 if { (eval echo "$as_me:5934: \"$ac_compile\"") >&5
5935   (eval $ac_compile) 2>&5
5936   ac_status=$?
5937   echo "$as_me:5937: \$? = $ac_status" >&5
5938   (exit "$ac_status"); } &&
5939          { ac_try='test -s "conftest.$ac_objext"'
5940   { (eval echo "$as_me:5940: \"$ac_try\"") >&5
5941   (eval $ac_try) 2>&5
5942   ac_status=$?
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit "$ac_status"); }; }; then
5945
5946         cf_cv_term_header="$cf_test"
5947 else
5948   echo "$as_me: failed program was:" >&5
5949 cat "conftest.$ac_ext" >&5
5950
5951         cf_cv_term_header=unknown
5952
5953 fi
5954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5955         test "$cf_cv_term_header" != unknown && break
5956 done
5957
5958 fi
5959 echo "$as_me:5959: result: $cf_cv_term_header" >&5
5960 echo "${ECHO_T}$cf_cv_term_header" >&6
5961
5962 # Set definitions to allow ifdef'ing to accommodate subdirectories
5963
5964 case "$cf_cv_term_header" in
5965 (*term.h)
5966
5967 cat >>confdefs.h <<\EOF
5968 #define HAVE_TERM_H 1
5969 EOF
5970
5971         ;;
5972 esac
5973
5974 case "$cf_cv_term_header" in
5975 (ncurses/term.h)
5976
5977 cat >>confdefs.h <<\EOF
5978 #define HAVE_NCURSES_TERM_H 1
5979 EOF
5980
5981         ;;
5982 (ncursesw/term.h)
5983
5984 cat >>confdefs.h <<\EOF
5985 #define HAVE_NCURSESW_TERM_H 1
5986 EOF
5987
5988         ;;
5989 esac
5990
5991 # some applications need this, but should check for NCURSES_VERSION
5992
5993 cat >>confdefs.h <<\EOF
5994 #define NCURSES 1
5995 EOF
5996
5997 echo "$as_me:5997: checking for ncurses version" >&5
5998 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5999 if test "${cf_cv_ncurses_version+set}" = set; then
6000   echo $ECHO_N "(cached) $ECHO_C" >&6
6001 else
6002
6003         cf_cv_ncurses_version=no
6004         cf_tempfile=out$$
6005         rm -f "$cf_tempfile"
6006         if test "$cross_compiling" = yes; then
6007
6008         # This will not work if the preprocessor splits the line after the
6009         # Autoconf token.  The 'unproto' program does that.
6010         cat > "conftest.$ac_ext" <<EOF
6011 #include <${cf_cv_ncurses_header:-curses.h}>
6012 #undef Autoconf
6013 #ifdef NCURSES_VERSION
6014 Autoconf NCURSES_VERSION
6015 #else
6016 #ifdef __NCURSES_H
6017 Autoconf "old"
6018 #endif
6019 ;
6020 #endif
6021 EOF
6022         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6023         { (eval echo "$as_me:6023: \"$cf_try\"") >&5
6024   (eval $cf_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit "$ac_status"); }
6028         if test -f conftest.out ; then
6029                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6030                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6031                 rm -f conftest.out
6032         fi
6033
6034 else
6035   cat >"conftest.$ac_ext" <<_ACEOF
6036 #line 6036 "configure"
6037 #include "confdefs.h"
6038
6039 #include <${cf_cv_ncurses_header:-curses.h}>
6040 #include <stdio.h>
6041 int main(void)
6042 {
6043         FILE *fp = fopen("$cf_tempfile", "w");
6044 #ifdef NCURSES_VERSION
6045 # ifdef NCURSES_VERSION_PATCH
6046         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6047 # else
6048         fprintf(fp, "%s\\n", NCURSES_VERSION);
6049 # endif
6050 #else
6051 # ifdef __NCURSES_H
6052         fprintf(fp, "old\\n");
6053 # else
6054         make an error
6055 # endif
6056 #endif
6057         ${cf_cv_main_return:-return}(0);
6058 }
6059 _ACEOF
6060 rm -f "conftest$ac_exeext"
6061 if { (eval echo "$as_me:6061: \"$ac_link\"") >&5
6062   (eval $ac_link) 2>&5
6063   ac_status=$?
6064   echo "$as_me:6064: \$? = $ac_status" >&5
6065   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6066   { (eval echo "$as_me:6066: \"$ac_try\"") >&5
6067   (eval $ac_try) 2>&5
6068   ac_status=$?
6069   echo "$as_me:6069: \$? = $ac_status" >&5
6070   (exit "$ac_status"); }; }; then
6071
6072         cf_cv_ncurses_version=`cat $cf_tempfile`
6073 else
6074   echo "$as_me: program exited with status $ac_status" >&5
6075 echo "$as_me: failed program was:" >&5
6076 cat "conftest.$ac_ext" >&5
6077 fi
6078 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6079 fi
6080         rm -f "$cf_tempfile"
6081
6082 fi
6083 echo "$as_me:6083: result: $cf_cv_ncurses_version" >&5
6084 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6085 test "$cf_cv_ncurses_version" = no ||
6086 cat >>confdefs.h <<\EOF
6087 #define NCURSES 1
6088 EOF
6089
6090 cf_nculib_root=ncurses
6091         # This works, except for the special case where we find gpm, but
6092         # ncurses is in a nonstandard location via $LIBS, and we really want
6093         # to link gpm.
6094 cf_ncurses_LIBS=""
6095 cf_ncurses_SAVE="$LIBS"
6096 echo "$as_me:6096: checking for Gpm_Open in -lgpm" >&5
6097 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6098 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6099   echo $ECHO_N "(cached) $ECHO_C" >&6
6100 else
6101   ac_check_lib_save_LIBS=$LIBS
6102 LIBS="-lgpm  $LIBS"
6103 cat >"conftest.$ac_ext" <<_ACEOF
6104 #line 6104 "configure"
6105 #include "confdefs.h"
6106
6107 /* Override any gcc2 internal prototype to avoid an error.  */
6108 #ifdef __cplusplus
6109 extern "C"
6110 #endif
6111 /* We use char because int might match the return type of a gcc2
6112    builtin and then its argument prototype would still apply.  */
6113 char Gpm_Open ();
6114 int
6115 main (void)
6116 {
6117 Gpm_Open ();
6118   ;
6119   return 0;
6120 }
6121 _ACEOF
6122 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6123 if { (eval echo "$as_me:6123: \"$ac_link\"") >&5
6124   (eval $ac_link) 2>&5
6125   ac_status=$?
6126   echo "$as_me:6126: \$? = $ac_status" >&5
6127   (exit "$ac_status"); } &&
6128          { ac_try='test -s "conftest$ac_exeext"'
6129   { (eval echo "$as_me:6129: \"$ac_try\"") >&5
6130   (eval $ac_try) 2>&5
6131   ac_status=$?
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit "$ac_status"); }; }; then
6134   ac_cv_lib_gpm_Gpm_Open=yes
6135 else
6136   echo "$as_me: failed program was:" >&5
6137 cat "conftest.$ac_ext" >&5
6138 ac_cv_lib_gpm_Gpm_Open=no
6139 fi
6140 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6141 LIBS=$ac_check_lib_save_LIBS
6142 fi
6143 echo "$as_me:6143: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6144 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6145 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6146   echo "$as_me:6146: checking for initscr in -lgpm" >&5
6147 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6148 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6149   echo $ECHO_N "(cached) $ECHO_C" >&6
6150 else
6151   ac_check_lib_save_LIBS=$LIBS
6152 LIBS="-lgpm  $LIBS"
6153 cat >"conftest.$ac_ext" <<_ACEOF
6154 #line 6154 "configure"
6155 #include "confdefs.h"
6156
6157 /* Override any gcc2 internal prototype to avoid an error.  */
6158 #ifdef __cplusplus
6159 extern "C"
6160 #endif
6161 /* We use char because int might match the return type of a gcc2
6162    builtin and then its argument prototype would still apply.  */
6163 char initscr ();
6164 int
6165 main (void)
6166 {
6167 initscr ();
6168   ;
6169   return 0;
6170 }
6171 _ACEOF
6172 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6173 if { (eval echo "$as_me:6173: \"$ac_link\"") >&5
6174   (eval $ac_link) 2>&5
6175   ac_status=$?
6176   echo "$as_me:6176: \$? = $ac_status" >&5
6177   (exit "$ac_status"); } &&
6178          { ac_try='test -s "conftest$ac_exeext"'
6179   { (eval echo "$as_me:6179: \"$ac_try\"") >&5
6180   (eval $ac_try) 2>&5
6181   ac_status=$?
6182   echo "$as_me:6182: \$? = $ac_status" >&5
6183   (exit "$ac_status"); }; }; then
6184   ac_cv_lib_gpm_initscr=yes
6185 else
6186   echo "$as_me: failed program was:" >&5
6187 cat "conftest.$ac_ext" >&5
6188 ac_cv_lib_gpm_initscr=no
6189 fi
6190 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6191 LIBS=$ac_check_lib_save_LIBS
6192 fi
6193 echo "$as_me:6193: result: $ac_cv_lib_gpm_initscr" >&5
6194 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6195 if test "$ac_cv_lib_gpm_initscr" = yes; then
6196   LIBS="$cf_ncurses_SAVE"
6197 else
6198   cf_ncurses_LIBS="-lgpm"
6199 fi
6200
6201 fi
6202
6203 case "$host_os" in
6204 (freebsd*)
6205         # This is only necessary if you are linking against an obsolete
6206         # version of ncurses (but it should do no harm, since it's static).
6207         if test "$cf_nculib_root" = ncurses ; then
6208                 echo "$as_me:6208: checking for tgoto in -lmytinfo" >&5
6209 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6210 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6211   echo $ECHO_N "(cached) $ECHO_C" >&6
6212 else
6213   ac_check_lib_save_LIBS=$LIBS
6214 LIBS="-lmytinfo  $LIBS"
6215 cat >"conftest.$ac_ext" <<_ACEOF
6216 #line 6216 "configure"
6217 #include "confdefs.h"
6218
6219 /* Override any gcc2 internal prototype to avoid an error.  */
6220 #ifdef __cplusplus
6221 extern "C"
6222 #endif
6223 /* We use char because int might match the return type of a gcc2
6224    builtin and then its argument prototype would still apply.  */
6225 char tgoto ();
6226 int
6227 main (void)
6228 {
6229 tgoto ();
6230   ;
6231   return 0;
6232 }
6233 _ACEOF
6234 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6235 if { (eval echo "$as_me:6235: \"$ac_link\"") >&5
6236   (eval $ac_link) 2>&5
6237   ac_status=$?
6238   echo "$as_me:6238: \$? = $ac_status" >&5
6239   (exit "$ac_status"); } &&
6240          { ac_try='test -s "conftest$ac_exeext"'
6241   { (eval echo "$as_me:6241: \"$ac_try\"") >&5
6242   (eval $ac_try) 2>&5
6243   ac_status=$?
6244   echo "$as_me:6244: \$? = $ac_status" >&5
6245   (exit "$ac_status"); }; }; then
6246   ac_cv_lib_mytinfo_tgoto=yes
6247 else
6248   echo "$as_me: failed program was:" >&5
6249 cat "conftest.$ac_ext" >&5
6250 ac_cv_lib_mytinfo_tgoto=no
6251 fi
6252 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6253 LIBS=$ac_check_lib_save_LIBS
6254 fi
6255 echo "$as_me:6255: result: $ac_cv_lib_mytinfo_tgoto" >&5
6256 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6257 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6258   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6259 fi
6260
6261         fi
6262         ;;
6263 esac
6264
6265 cf_add_libs="$LIBS"
6266 # reverse order
6267 cf_add_0lib=
6268 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6269 # filter duplicates
6270 for cf_add_1lib in $cf_add_0lib; do
6271         for cf_add_2lib in $cf_add_libs; do
6272                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6273                         cf_add_1lib=
6274                         break
6275                 fi
6276         done
6277         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6278 done
6279 LIBS="$cf_add_libs"
6280
6281 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6282 then
6283
6284 cf_add_libs="$LIBS"
6285 # reverse order
6286 cf_add_0lib=
6287 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6288 # filter duplicates
6289 for cf_add_1lib in $cf_add_0lib; do
6290         for cf_add_2lib in $cf_add_libs; do
6291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6292                         cf_add_1lib=
6293                         break
6294                 fi
6295         done
6296         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6297 done
6298 LIBS="$cf_add_libs"
6299
6300 else
6301
6302         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6303         cf_libdir=""
6304         echo "$as_me:6304: checking for initscr" >&5
6305 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6306 if test "${ac_cv_func_initscr+set}" = set; then
6307   echo $ECHO_N "(cached) $ECHO_C" >&6
6308 else
6309   cat >"conftest.$ac_ext" <<_ACEOF
6310 #line 6310 "configure"
6311 #include "confdefs.h"
6312 #define initscr autoconf_temporary
6313 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6314 #undef initscr
6315
6316 #ifdef __cplusplus
6317 extern "C"
6318 #endif
6319
6320 /* We use char because int might match the return type of a gcc2
6321    builtin and then its argument prototype would still apply.  */
6322 char initscr (void);
6323
6324 int
6325 main (void)
6326 {
6327
6328 /* The GNU C library defines stubs for functions which it implements
6329     to always fail with ENOSYS.  Some functions are actually named
6330     something starting with __ and the normal name is an alias.  */
6331 #if defined (__stub_initscr) || defined (__stub___initscr)
6332 #error found stub for initscr
6333 #endif
6334
6335         return initscr ();
6336   ;
6337   return 0;
6338 }
6339 _ACEOF
6340 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6341 if { (eval echo "$as_me:6341: \"$ac_link\"") >&5
6342   (eval $ac_link) 2>&5
6343   ac_status=$?
6344   echo "$as_me:6344: \$? = $ac_status" >&5
6345   (exit "$ac_status"); } &&
6346          { ac_try='test -s "conftest$ac_exeext"'
6347   { (eval echo "$as_me:6347: \"$ac_try\"") >&5
6348   (eval $ac_try) 2>&5
6349   ac_status=$?
6350   echo "$as_me:6350: \$? = $ac_status" >&5
6351   (exit "$ac_status"); }; }; then
6352   ac_cv_func_initscr=yes
6353 else
6354   echo "$as_me: failed program was:" >&5
6355 cat "conftest.$ac_ext" >&5
6356 ac_cv_func_initscr=no
6357 fi
6358 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6359 fi
6360 echo "$as_me:6360: result: $ac_cv_func_initscr" >&5
6361 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6362 if test "$ac_cv_func_initscr" = yes; then
6363   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6364 else
6365
6366                 cf_save_LIBS="$LIBS"
6367                 echo "$as_me:6367: checking for initscr in -l$cf_nculib_root" >&5
6368 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6369                 LIBS="-l$cf_nculib_root $LIBS"
6370                 cat >"conftest.$ac_ext" <<_ACEOF
6371 #line 6371 "configure"
6372 #include "confdefs.h"
6373 #include <${cf_cv_ncurses_header:-curses.h}>
6374 int
6375 main (void)
6376 {
6377 initscr()
6378   ;
6379   return 0;
6380 }
6381 _ACEOF
6382 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6383 if { (eval echo "$as_me:6383: \"$ac_link\"") >&5
6384   (eval $ac_link) 2>&5
6385   ac_status=$?
6386   echo "$as_me:6386: \$? = $ac_status" >&5
6387   (exit "$ac_status"); } &&
6388          { ac_try='test -s "conftest$ac_exeext"'
6389   { (eval echo "$as_me:6389: \"$ac_try\"") >&5
6390   (eval $ac_try) 2>&5
6391   ac_status=$?
6392   echo "$as_me:6392: \$? = $ac_status" >&5
6393   (exit "$ac_status"); }; }; then
6394   echo "$as_me:6394: result: yes" >&5
6395 echo "${ECHO_T}yes" >&6
6396                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6397
6398 else
6399   echo "$as_me: failed program was:" >&5
6400 cat "conftest.$ac_ext" >&5
6401 echo "$as_me:6401: result: no" >&5
6402 echo "${ECHO_T}no" >&6
6403
6404 cf_search=
6405 cf_library_path_list=""
6406 if test -n "${LDFLAGS}${LIBS}" ; then
6407         for cf_library_path in $LDFLAGS $LIBS
6408         do
6409                 case "$cf_library_path" in
6410                 (-L*)
6411                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6412
6413 test "x$cf_library_path" != "xNONE" && \
6414 test -d "$cf_library_path" && \
6415  {
6416         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6417         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6418         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6419         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6420         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6421         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"
6422 }
6423
6424                         cf_library_path_list="$cf_library_path_list $cf_search"
6425                         ;;
6426                 esac
6427         done
6428 fi
6429
6430 cf_search=
6431
6432 test "x$prefix" != "xNONE" && \
6433 test -d "$prefix" && \
6434  {
6435         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6436         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6437         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6438         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6439         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6440         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6441 }
6442
6443 for cf_subdir_prefix in \
6444         /usr \
6445         /usr/local \
6446         /usr/pkg \
6447         /opt \
6448         /opt/local \
6449         $HOME
6450 do
6451
6452 test "x$cf_subdir_prefix" != "x$prefix" && \
6453 test -d "$cf_subdir_prefix" && \
6454 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6455         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6456         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6457         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6458         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6459         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6460         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"
6461 }
6462
6463 done
6464
6465 cf_search="$cf_library_path_list $cf_search"
6466
6467                         for cf_libdir in $cf_search
6468                         do
6469                                 echo "$as_me:6469: checking for -l$cf_nculib_root in $cf_libdir" >&5
6470 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6471                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6472                                 cat >"conftest.$ac_ext" <<_ACEOF
6473 #line 6473 "configure"
6474 #include "confdefs.h"
6475 #include <${cf_cv_ncurses_header:-curses.h}>
6476 int
6477 main (void)
6478 {
6479 initscr()
6480   ;
6481   return 0;
6482 }
6483 _ACEOF
6484 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6485 if { (eval echo "$as_me:6485: \"$ac_link\"") >&5
6486   (eval $ac_link) 2>&5
6487   ac_status=$?
6488   echo "$as_me:6488: \$? = $ac_status" >&5
6489   (exit "$ac_status"); } &&
6490          { ac_try='test -s "conftest$ac_exeext"'
6491   { (eval echo "$as_me:6491: \"$ac_try\"") >&5
6492   (eval $ac_try) 2>&5
6493   ac_status=$?
6494   echo "$as_me:6494: \$? = $ac_status" >&5
6495   (exit "$ac_status"); }; }; then
6496   echo "$as_me:6496: result: yes" >&5
6497 echo "${ECHO_T}yes" >&6
6498                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6499                                          break
6500 else
6501   echo "$as_me: failed program was:" >&5
6502 cat "conftest.$ac_ext" >&5
6503 echo "$as_me:6503: result: no" >&5
6504 echo "${ECHO_T}no" >&6
6505                                          LIBS="$cf_save_LIBS"
6506 fi
6507 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6508                         done
6509
6510 fi
6511 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6512
6513 fi
6514
6515 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6516
6517 if test "$cf_found_library" = no ; then
6518         { { echo "$as_me:6518: error: Cannot link $cf_nculib_root library" >&5
6519 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6520    { (exit 1); exit 1; }; }
6521 fi
6522
6523 fi
6524
6525 if test -n "$cf_ncurses_LIBS" ; then
6526         echo "$as_me:6526: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6527 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6528         cf_ncurses_SAVE="$LIBS"
6529         for p in $cf_ncurses_LIBS ; do
6530                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6531                 if test "$q" != "$LIBS" ; then
6532                         LIBS="$q"
6533                 fi
6534         done
6535         cat >"conftest.$ac_ext" <<_ACEOF
6536 #line 6536 "configure"
6537 #include "confdefs.h"
6538 #include <${cf_cv_ncurses_header:-curses.h}>
6539 int
6540 main (void)
6541 {
6542 initscr(); mousemask(0,0); tigetstr((char *)0);
6543   ;
6544   return 0;
6545 }
6546 _ACEOF
6547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6548 if { (eval echo "$as_me:6548: \"$ac_link\"") >&5
6549   (eval $ac_link) 2>&5
6550   ac_status=$?
6551   echo "$as_me:6551: \$? = $ac_status" >&5
6552   (exit "$ac_status"); } &&
6553          { ac_try='test -s "conftest$ac_exeext"'
6554   { (eval echo "$as_me:6554: \"$ac_try\"") >&5
6555   (eval $ac_try) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit "$ac_status"); }; }; then
6559   echo "$as_me:6559: result: yes" >&5
6560 echo "${ECHO_T}yes" >&6
6561 else
6562   echo "$as_me: failed program was:" >&5
6563 cat "conftest.$ac_ext" >&5
6564 echo "$as_me:6564: result: no" >&5
6565 echo "${ECHO_T}no" >&6
6566                  LIBS="$cf_ncurses_SAVE"
6567 fi
6568 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6569 fi
6570
6571 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6572
6573 cat >>confdefs.h <<EOF
6574 #define $cf_nculib_ROOT 1
6575 EOF
6576
6577         fi
6578 else
6579         NCURSES_CONFIG=none
6580 fi
6581
6582 echo "$as_me:6582: checking if you want wide-character code" >&5
6583 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6584
6585 # Check whether --enable-widec or --disable-widec was given.
6586 if test "${enable_widec+set}" = set; then
6587   enableval="$enable_widec"
6588   with_widec=$enableval
6589 else
6590   with_widec=no
6591 fi;
6592 echo "$as_me:6592: result: $with_widec" >&5
6593 echo "${ECHO_T}$with_widec" >&6
6594 if test "$with_widec" = yes ; then
6595
6596 for ac_header in wchar.h
6597 do
6598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6599 echo "$as_me:6599: checking for $ac_header" >&5
6600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6602   echo $ECHO_N "(cached) $ECHO_C" >&6
6603 else
6604   cat >"conftest.$ac_ext" <<_ACEOF
6605 #line 6605 "configure"
6606 #include "confdefs.h"
6607 #include <$ac_header>
6608 _ACEOF
6609 if { (eval echo "$as_me:6609: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6610   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6611   ac_status=$?
6612   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6613   rm -f conftest.er1
6614   cat conftest.err >&5
6615   echo "$as_me:6615: \$? = $ac_status" >&5
6616   (exit "$ac_status"); } >/dev/null; then
6617   if test -s conftest.err; then
6618     ac_cpp_err=$ac_c_preproc_warn_flag
6619   else
6620     ac_cpp_err=
6621   fi
6622 else
6623   ac_cpp_err=yes
6624 fi
6625 if test -z "$ac_cpp_err"; then
6626   eval "$as_ac_Header=yes"
6627 else
6628   echo "$as_me: failed program was:" >&5
6629   cat "conftest.$ac_ext" >&5
6630   eval "$as_ac_Header=no"
6631 fi
6632 rm -f conftest.err "conftest.$ac_ext"
6633 fi
6634 echo "$as_me:6634: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6635 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6636 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6637   cat >>confdefs.h <<EOF
6638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6639 EOF
6640
6641 fi
6642 done
6643
6644 echo "$as_me:6644: checking for multibyte character support" >&5
6645 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6646 if test "${cf_cv_utf8_lib+set}" = set; then
6647   echo $ECHO_N "(cached) $ECHO_C" >&6
6648 else
6649
6650         cf_save_LIBS="$LIBS"
6651         cat >"conftest.$ac_ext" <<_ACEOF
6652 #line 6652 "configure"
6653 #include "confdefs.h"
6654
6655 #include <stdlib.h>
6656 #include <stdio.h>
6657 #ifdef HAVE_WCHAR_H
6658 #include <wchar.h>
6659 #endif
6660
6661 int
6662 main (void)
6663 {
6664 putwc(0,0);
6665   ;
6666   return 0;
6667 }
6668 _ACEOF
6669 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6670 if { (eval echo "$as_me:6670: \"$ac_link\"") >&5
6671   (eval $ac_link) 2>&5
6672   ac_status=$?
6673   echo "$as_me:6673: \$? = $ac_status" >&5
6674   (exit "$ac_status"); } &&
6675          { ac_try='test -s "conftest$ac_exeext"'
6676   { (eval echo "$as_me:6676: \"$ac_try\"") >&5
6677   (eval $ac_try) 2>&5
6678   ac_status=$?
6679   echo "$as_me:6679: \$? = $ac_status" >&5
6680   (exit "$ac_status"); }; }; then
6681   cf_cv_utf8_lib=yes
6682 else
6683   echo "$as_me: failed program was:" >&5
6684 cat "conftest.$ac_ext" >&5
6685
6686 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6687 # will be set on completion of the AC_TRY_LINK below.
6688 cf_cv_header_path_utf8=
6689 cf_cv_library_path_utf8=
6690
6691 echo "${as_me:-configure}:6691: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6692
6693 cf_save_LIBS="$LIBS"
6694
6695 cat >"conftest.$ac_ext" <<_ACEOF
6696 #line 6696 "configure"
6697 #include "confdefs.h"
6698
6699 #include <libutf8.h>
6700 int
6701 main (void)
6702 {
6703 putwc(0,0);
6704   ;
6705   return 0;
6706 }
6707 _ACEOF
6708 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6709 if { (eval echo "$as_me:6709: \"$ac_link\"") >&5
6710   (eval $ac_link) 2>&5
6711   ac_status=$?
6712   echo "$as_me:6712: \$? = $ac_status" >&5
6713   (exit "$ac_status"); } &&
6714          { ac_try='test -s "conftest$ac_exeext"'
6715   { (eval echo "$as_me:6715: \"$ac_try\"") >&5
6716   (eval $ac_try) 2>&5
6717   ac_status=$?
6718   echo "$as_me:6718: \$? = $ac_status" >&5
6719   (exit "$ac_status"); }; }; then
6720
6721         cf_cv_find_linkage_utf8=yes
6722         cf_cv_header_path_utf8=/usr/include
6723         cf_cv_library_path_utf8=/usr/lib
6724
6725 else
6726   echo "$as_me: failed program was:" >&5
6727 cat "conftest.$ac_ext" >&5
6728
6729 LIBS="-lutf8  $cf_save_LIBS"
6730
6731 cat >"conftest.$ac_ext" <<_ACEOF
6732 #line 6732 "configure"
6733 #include "confdefs.h"
6734
6735 #include <libutf8.h>
6736 int
6737 main (void)
6738 {
6739 putwc(0,0);
6740   ;
6741   return 0;
6742 }
6743 _ACEOF
6744 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6745 if { (eval echo "$as_me:6745: \"$ac_link\"") >&5
6746   (eval $ac_link) 2>&5
6747   ac_status=$?
6748   echo "$as_me:6748: \$? = $ac_status" >&5
6749   (exit "$ac_status"); } &&
6750          { ac_try='test -s "conftest$ac_exeext"'
6751   { (eval echo "$as_me:6751: \"$ac_try\"") >&5
6752   (eval $ac_try) 2>&5
6753   ac_status=$?
6754   echo "$as_me:6754: \$? = $ac_status" >&5
6755   (exit "$ac_status"); }; }; then
6756
6757         cf_cv_find_linkage_utf8=yes
6758         cf_cv_header_path_utf8=/usr/include
6759         cf_cv_library_path_utf8=/usr/lib
6760         cf_cv_library_file_utf8="-lutf8"
6761
6762 else
6763   echo "$as_me: failed program was:" >&5
6764 cat "conftest.$ac_ext" >&5
6765
6766         cf_cv_find_linkage_utf8=no
6767         LIBS="$cf_save_LIBS"
6768
6769         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6770
6771 echo "${as_me:-configure}:6771: testing find linkage for utf8 library ..." 1>&5
6772
6773 echo "${as_me:-configure}:6773: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6774
6775         cf_save_CPPFLAGS="$CPPFLAGS"
6776         cf_test_CPPFLAGS="$CPPFLAGS"
6777
6778 cf_search=
6779
6780 # collect the current set of include-directories from compiler flags
6781 cf_header_path_list=""
6782 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6783         for cf_header_path in $CPPFLAGS $CFLAGS
6784         do
6785                 case "$cf_header_path" in
6786                 (-I*)
6787                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6788
6789 test "x$cf_header_path" != "xNONE" && \
6790 test -d "$cf_header_path" && \
6791  {
6792         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6793         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6794         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6795         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6796         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6797         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6798 }
6799
6800                         cf_header_path_list="$cf_header_path_list $cf_search"
6801                         ;;
6802                 esac
6803         done
6804 fi
6805
6806 # add the variations for the package we are looking for
6807
6808 cf_search=
6809
6810 test "x$prefix" != "xNONE" && \
6811 test -d "$prefix" && \
6812  {
6813         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6814         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6815         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6816         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6817         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6818         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6819 }
6820
6821 for cf_subdir_prefix in \
6822         /usr \
6823         /usr/local \
6824         /usr/pkg \
6825         /opt \
6826         /opt/local \
6827         $HOME
6828 do
6829
6830 test "x$cf_subdir_prefix" != "x$prefix" && \
6831 test -d "$cf_subdir_prefix" && \
6832 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6833         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6834         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6835         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6836         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6837         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6838         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6839 }
6840
6841 done
6842
6843 test "$includedir" != NONE && \
6844 test "$includedir" != "/usr/include" && \
6845 test -d "$includedir" && {
6846         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6847         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6848 }
6849
6850 test "$oldincludedir" != NONE && \
6851 test "$oldincludedir" != "/usr/include" && \
6852 test -d "$oldincludedir" && {
6853         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6854         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6855 }
6856
6857 cf_search="$cf_search $cf_header_path_list"
6858
6859         for cf_cv_header_path_utf8 in $cf_search
6860         do
6861                 if test -d "$cf_cv_header_path_utf8" ; then
6862                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6863
6864 echo "${as_me:-configure}:6864: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6865
6866                         CPPFLAGS="$cf_save_CPPFLAGS"
6867
6868         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6869         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6870
6871                         cat >"conftest.$ac_ext" <<_ACEOF
6872 #line 6872 "configure"
6873 #include "confdefs.h"
6874
6875 #include <libutf8.h>
6876 int
6877 main (void)
6878 {
6879 putwc(0,0);
6880   ;
6881   return 0;
6882 }
6883 _ACEOF
6884 rm -f "conftest.$ac_objext"
6885 if { (eval echo "$as_me:6885: \"$ac_compile\"") >&5
6886   (eval $ac_compile) 2>&5
6887   ac_status=$?
6888   echo "$as_me:6888: \$? = $ac_status" >&5
6889   (exit "$ac_status"); } &&
6890          { ac_try='test -s "conftest.$ac_objext"'
6891   { (eval echo "$as_me:6891: \"$ac_try\"") >&5
6892   (eval $ac_try) 2>&5
6893   ac_status=$?
6894   echo "$as_me:6894: \$? = $ac_status" >&5
6895   (exit "$ac_status"); }; }; then
6896
6897                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6898
6899 echo "${as_me:-configure}:6899: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6900
6901                                 cf_cv_find_linkage_utf8=maybe
6902                                 cf_test_CPPFLAGS="$CPPFLAGS"
6903                                 break
6904 else
6905   echo "$as_me: failed program was:" >&5
6906 cat "conftest.$ac_ext" >&5
6907
6908                                 CPPFLAGS="$cf_save_CPPFLAGS"
6909
6910 fi
6911 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6912                 fi
6913         done
6914
6915         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6916
6917 echo "${as_me:-configure}:6917: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6918
6919                 cf_save_LIBS="$LIBS"
6920                 cf_save_LDFLAGS="$LDFLAGS"
6921
6922                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6923
6924 cf_search=
6925 cf_library_path_list=""
6926 if test -n "${LDFLAGS}${LIBS}" ; then
6927         for cf_library_path in $LDFLAGS $LIBS
6928         do
6929                 case "$cf_library_path" in
6930                 (-L*)
6931                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6932
6933 test "x$cf_library_path" != "xNONE" && \
6934 test -d "$cf_library_path" && \
6935  {
6936         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6937         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6938         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6939         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6940         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6941         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6942 }
6943
6944                         cf_library_path_list="$cf_library_path_list $cf_search"
6945                         ;;
6946                 esac
6947         done
6948 fi
6949
6950 cf_search=
6951
6952 test "x$prefix" != "xNONE" && \
6953 test -d "$prefix" && \
6954  {
6955         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6956         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6957         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6958         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6959         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6960         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6961 }
6962
6963 for cf_subdir_prefix in \
6964         /usr \
6965         /usr/local \
6966         /usr/pkg \
6967         /opt \
6968         /opt/local \
6969         $HOME
6970 do
6971
6972 test "x$cf_subdir_prefix" != "x$prefix" && \
6973 test -d "$cf_subdir_prefix" && \
6974 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6975         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6976         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6977         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6978         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6979         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6980         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6981 }
6982
6983 done
6984
6985 cf_search="$cf_library_path_list $cf_search"
6986
6987                         for cf_cv_library_path_utf8 in $cf_search
6988                         do
6989                                 if test -d "$cf_cv_library_path_utf8" ; then
6990                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6991
6992 echo "${as_me:-configure}:6992: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6993
6994                                         CPPFLAGS="$cf_test_CPPFLAGS"
6995                                         LIBS="-lutf8  $cf_save_LIBS"
6996                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6997                                         cat >"conftest.$ac_ext" <<_ACEOF
6998 #line 6998 "configure"
6999 #include "confdefs.h"
7000
7001 #include <libutf8.h>
7002 int
7003 main (void)
7004 {
7005 putwc(0,0);
7006   ;
7007   return 0;
7008 }
7009 _ACEOF
7010 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7011 if { (eval echo "$as_me:7011: \"$ac_link\"") >&5
7012   (eval $ac_link) 2>&5
7013   ac_status=$?
7014   echo "$as_me:7014: \$? = $ac_status" >&5
7015   (exit "$ac_status"); } &&
7016          { ac_try='test -s "conftest$ac_exeext"'
7017   { (eval echo "$as_me:7017: \"$ac_try\"") >&5
7018   (eval $ac_try) 2>&5
7019   ac_status=$?
7020   echo "$as_me:7020: \$? = $ac_status" >&5
7021   (exit "$ac_status"); }; }; then
7022
7023                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7024
7025 echo "${as_me:-configure}:7025: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7026
7027                                         cf_cv_find_linkage_utf8=yes
7028                                         cf_cv_library_file_utf8="-lutf8"
7029                                         break
7030 else
7031   echo "$as_me: failed program was:" >&5
7032 cat "conftest.$ac_ext" >&5
7033
7034                                         CPPFLAGS="$cf_save_CPPFLAGS"
7035                                         LIBS="$cf_save_LIBS"
7036                                         LDFLAGS="$cf_save_LDFLAGS"
7037
7038 fi
7039 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7040                                 fi
7041                         done
7042                         CPPFLAGS="$cf_save_CPPFLAGS"
7043                         LDFLAGS="$cf_save_LDFLAGS"
7044                 fi
7045
7046         else
7047                 cf_cv_find_linkage_utf8=no
7048         fi
7049
7050 fi
7051 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7052
7053 fi
7054 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7055
7056 LIBS="$cf_save_LIBS"
7057
7058 if test "$cf_cv_find_linkage_utf8" = yes ; then
7059 cf_cv_utf8_lib=add-on
7060 else
7061 cf_cv_utf8_lib=no
7062 fi
7063
7064 fi
7065 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7066 fi
7067 echo "$as_me:7067: result: $cf_cv_utf8_lib" >&5
7068 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7069
7070 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7071 # ncurses/ncursesw:
7072 if test "$cf_cv_utf8_lib" = "add-on" ; then
7073
7074 cat >>confdefs.h <<\EOF
7075 #define HAVE_LIBUTF8_H 1
7076 EOF
7077
7078 if test -n "$cf_cv_header_path_utf8" ; then
7079   for cf_add_incdir in $cf_cv_header_path_utf8
7080   do
7081         while test "$cf_add_incdir" != /usr/include
7082         do
7083           if test -d "$cf_add_incdir"
7084           then
7085                 cf_have_incdir=no
7086                 if test -n "$CFLAGS$CPPFLAGS" ; then
7087                   # a loop is needed to ensure we can add subdirs of existing dirs
7088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7090                           cf_have_incdir=yes; break
7091                         fi
7092                   done
7093                 fi
7094
7095                 if test "$cf_have_incdir" = no ; then
7096                   if test "$cf_add_incdir" = /usr/local/include ; then
7097                         if test "$GCC" = yes
7098                         then
7099                           cf_save_CPPFLAGS=$CPPFLAGS
7100
7101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7102         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7103
7104                           cat >"conftest.$ac_ext" <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107 #include <stdio.h>
7108 int
7109 main (void)
7110 {
7111 printf("Hello")
7112   ;
7113   return 0;
7114 }
7115 _ACEOF
7116 rm -f "conftest.$ac_objext"
7117 if { (eval echo "$as_me:7117: \"$ac_compile\"") >&5
7118   (eval $ac_compile) 2>&5
7119   ac_status=$?
7120   echo "$as_me:7120: \$? = $ac_status" >&5
7121   (exit "$ac_status"); } &&
7122          { ac_try='test -s "conftest.$ac_objext"'
7123   { (eval echo "$as_me:7123: \"$ac_try\"") >&5
7124   (eval $ac_try) 2>&5
7125   ac_status=$?
7126   echo "$as_me:7126: \$? = $ac_status" >&5
7127   (exit "$ac_status"); }; }; then
7128   :
7129 else
7130   echo "$as_me: failed program was:" >&5
7131 cat "conftest.$ac_ext" >&5
7132 cf_have_incdir=yes
7133 fi
7134 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7135                           CPPFLAGS=$cf_save_CPPFLAGS
7136                         fi
7137                   fi
7138                 fi
7139
7140                 if test "$cf_have_incdir" = no ; then
7141                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7142
7143 echo "${as_me:-configure}:7143: testing adding $cf_add_incdir to include-path ..." 1>&5
7144
7145                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7146
7147                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7148                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7149                   cf_add_incdir="$cf_top_incdir"
7150                 else
7151                   break
7152                 fi
7153           else
7154                 break
7155           fi
7156         done
7157   done
7158 fi
7159
7160 if test -n "$cf_cv_library_path_utf8" ; then
7161         for cf_add_libdir in $cf_cv_library_path_utf8
7162         do
7163                 if test "$cf_add_libdir" = /usr/lib ; then
7164                         :
7165                 elif test -d "$cf_add_libdir"
7166                 then
7167                         cf_have_libdir=no
7168                         if test -n "$LDFLAGS$LIBS" ; then
7169                                 # a loop is needed to ensure we can add subdirs of existing dirs
7170                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7171                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7172                                                 cf_have_libdir=yes; break
7173                                         fi
7174                                 done
7175                         fi
7176                         if test "$cf_have_libdir" = no ; then
7177                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7178
7179 echo "${as_me:-configure}:7179: testing adding $cf_add_libdir to library-path ..." 1>&5
7180
7181                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7182                         fi
7183                 fi
7184         done
7185 fi
7186
7187 cf_add_libs="$LIBS"
7188 # reverse order
7189 cf_add_0lib=
7190 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7191 # filter duplicates
7192 for cf_add_1lib in $cf_add_0lib; do
7193         for cf_add_2lib in $cf_add_libs; do
7194                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7195                         cf_add_1lib=
7196                         break
7197                 fi
7198         done
7199         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7200 done
7201 LIBS="$cf_add_libs"
7202
7203 fi
7204
7205 cf_ncuconfig_root=ncursesw
7206 cf_have_ncuconfig=no
7207
7208 if test "x${PKG_CONFIG:=none}" != xnone; then
7209         echo "$as_me:7209: checking pkg-config for $cf_ncuconfig_root" >&5
7210 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7211         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7212                 echo "$as_me:7212: result: yes" >&5
7213 echo "${ECHO_T}yes" >&6
7214
7215                 echo "$as_me:7215: checking if the $cf_ncuconfig_root package files work" >&5
7216 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7217                 cf_have_ncuconfig=unknown
7218
7219                 cf_save_CFLAGS="$CFLAGS"
7220                 cf_save_CPPFLAGS="$CPPFLAGS"
7221                 cf_save_LIBS="$LIBS"
7222
7223                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7224                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7225
7226                 # while -W for passing linker flags is prevalent, it is not "standard".
7227                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7228                 # incompatible _and_ non-standard -W option which gives an error.  Work
7229                 # around that pitfall.
7230                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7231                 (x*c[89]9@@*-W*)
7232
7233 cf_fix_cppflags=no
7234 cf_new_cflags=
7235 cf_new_cppflags=
7236 cf_new_extra_cppflags=
7237
7238 for cf_add_cflags in $cf_pkg_cflags
7239 do
7240 case "$cf_fix_cppflags" in
7241 (no)
7242         case "$cf_add_cflags" in
7243         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7244                 case "$cf_add_cflags" in
7245                 (-D*)
7246                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7247
7248                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7249                                 && test -z "${cf_tst_cflags}" \
7250                                 && cf_fix_cppflags=yes
7251
7252                         if test "$cf_fix_cppflags" = yes ; then
7253
7254         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7255         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7256
7257                                 continue
7258                         elif test "${cf_tst_cflags}" = "\"'" ; then
7259
7260         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7261         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7262
7263                                 continue
7264                         fi
7265                         ;;
7266                 esac
7267                 case "$CPPFLAGS" in
7268                 (*$cf_add_cflags)
7269                         ;;
7270                 (*)
7271                         case "$cf_add_cflags" in
7272                         (-D*)
7273                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7274
7275 CPPFLAGS=`echo "$CPPFLAGS" | \
7276         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7277                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7278
7279                                 ;;
7280                         esac
7281
7282         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7283         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7284
7285                         ;;
7286                 esac
7287                 ;;
7288         (*)
7289
7290         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7291         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7292
7293                 ;;
7294         esac
7295         ;;
7296 (yes)
7297
7298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7300
7301         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7302
7303         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7304                 && test -z "${cf_tst_cflags}" \
7305                 && cf_fix_cppflags=no
7306         ;;
7307 esac
7308 done
7309
7310 if test -n "$cf_new_cflags" ; then
7311
7312         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7313         CFLAGS="${CFLAGS}$cf_new_cflags"
7314
7315 fi
7316
7317 if test -n "$cf_new_cppflags" ; then
7318
7319         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7320         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7321
7322 fi
7323
7324 if test -n "$cf_new_extra_cppflags" ; then
7325
7326         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7327         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7328
7329 fi
7330
7331 cf_add_libs="$LIBS"
7332 # reverse order
7333 cf_add_0lib=
7334 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7335 # filter duplicates
7336 for cf_add_1lib in $cf_add_0lib; do
7337         for cf_add_2lib in $cf_add_libs; do
7338                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7339                         cf_add_1lib=
7340                         break
7341                 fi
7342         done
7343         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7344 done
7345 LIBS="$cf_add_libs"
7346
7347                         cat >"conftest.$ac_ext" <<_ACEOF
7348 #line 7348 "configure"
7349 #include "confdefs.h"
7350 #include <${cf_cv_ncurses_header:-curses.h}>
7351 int
7352 main (void)
7353 {
7354 initscr(); mousemask(0,0); tigetstr((char *)0);
7355   ;
7356   return 0;
7357 }
7358 _ACEOF
7359 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7360 if { (eval echo "$as_me:7360: \"$ac_link\"") >&5
7361   (eval $ac_link) 2>&5
7362   ac_status=$?
7363   echo "$as_me:7363: \$? = $ac_status" >&5
7364   (exit "$ac_status"); } &&
7365          { ac_try='test -s "conftest$ac_exeext"'
7366   { (eval echo "$as_me:7366: \"$ac_try\"") >&5
7367   (eval $ac_try) 2>&5
7368   ac_status=$?
7369   echo "$as_me:7369: \$? = $ac_status" >&5
7370   (exit "$ac_status"); }; }; then
7371   if test "$cross_compiling" = yes; then
7372   cf_test_ncuconfig=maybe
7373 else
7374   cat >"conftest.$ac_ext" <<_ACEOF
7375 #line 7375 "configure"
7376 #include "confdefs.h"
7377 #include <${cf_cv_ncurses_header:-curses.h}>
7378                                         int main(void)
7379                                         { const char *xx = curses_version(); return (xx == 0); }
7380 _ACEOF
7381 rm -f "conftest$ac_exeext"
7382 if { (eval echo "$as_me:7382: \"$ac_link\"") >&5
7383   (eval $ac_link) 2>&5
7384   ac_status=$?
7385   echo "$as_me:7385: \$? = $ac_status" >&5
7386   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7387   { (eval echo "$as_me:7387: \"$ac_try\"") >&5
7388   (eval $ac_try) 2>&5
7389   ac_status=$?
7390   echo "$as_me:7390: \$? = $ac_status" >&5
7391   (exit "$ac_status"); }; }; then
7392   cf_test_ncuconfig=yes
7393 else
7394   echo "$as_me: program exited with status $ac_status" >&5
7395 echo "$as_me: failed program was:" >&5
7396 cat "conftest.$ac_ext" >&5
7397 cf_test_ncuconfig=no
7398 fi
7399 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7400 fi
7401 else
7402   echo "$as_me: failed program was:" >&5
7403 cat "conftest.$ac_ext" >&5
7404 cf_test_ncuconfig=no
7405 fi
7406 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7407
7408                         CFLAGS="$cf_save_CFLAGS"
7409                         CPPFLAGS="$cf_save_CPPFLAGS"
7410                         LIBS="$cf_save_LIBS"
7411
7412                         if test "x$cf_test_ncuconfig" != xyes; then
7413                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7414                                 cf_pkg_cflags="$cf_temp"
7415                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7416                                 cf_pkg_libs="$cf_temp"
7417                         fi
7418                         ;;
7419                 esac
7420
7421 for cf_add_cflags in $cf_pkg_cflags
7422 do
7423
7424 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7425 cf_old_cflag="$CFLAGS"
7426
7427 case "$CFLAGS" in
7428 (*$cf_add_cflags=*)
7429         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
7430         ;;
7431 (*$cf_add_cflags\ *)
7432         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
7433         ;;
7434 (*$cf_add_cflags)
7435         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
7436         ;;
7437 esac
7438
7439 if test "$CFLAGS" != "$cf_old_cflag" ;
7440 then
7441
7442         CFLAGS="$cf_new_cflag"
7443 fi
7444
7445 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7446 cf_old_cflag="$CPPFLAGS"
7447
7448 case "$CPPFLAGS" in
7449 (*$cf_add_cflags=*)
7450         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
7451         ;;
7452 (*$cf_add_cflags\ *)
7453         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
7454         ;;
7455 (*$cf_add_cflags)
7456         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
7457         ;;
7458 esac
7459
7460 if test "$CPPFLAGS" != "$cf_old_cflag" ;
7461 then
7462
7463         CPPFLAGS="$cf_new_cflag"
7464 fi
7465
7466 done
7467
7468 cf_fix_cppflags=no
7469 cf_new_cflags=
7470 cf_new_cppflags=
7471 cf_new_extra_cppflags=
7472
7473 for cf_add_cflags in $cf_pkg_cflags
7474 do
7475 case "$cf_fix_cppflags" in
7476 (no)
7477         case "$cf_add_cflags" in
7478         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7479                 case "$cf_add_cflags" in
7480                 (-D*)
7481                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7482
7483                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7484                                 && test -z "${cf_tst_cflags}" \
7485                                 && cf_fix_cppflags=yes
7486
7487                         if test "$cf_fix_cppflags" = yes ; then
7488
7489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7491
7492                                 continue
7493                         elif test "${cf_tst_cflags}" = "\"'" ; then
7494
7495         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7496         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7497
7498                                 continue
7499                         fi
7500                         ;;
7501                 esac
7502                 case "$CPPFLAGS" in
7503                 (*$cf_add_cflags)
7504                         ;;
7505                 (*)
7506                         case "$cf_add_cflags" in
7507                         (-D*)
7508                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7509
7510 CPPFLAGS=`echo "$CPPFLAGS" | \
7511         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7512                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7513
7514                                 ;;
7515                         esac
7516
7517         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7518         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7519
7520                         ;;
7521                 esac
7522                 ;;
7523         (*)
7524
7525         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7526         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7527
7528                 ;;
7529         esac
7530         ;;
7531 (yes)
7532
7533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7535
7536         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7537
7538         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7539                 && test -z "${cf_tst_cflags}" \
7540                 && cf_fix_cppflags=no
7541         ;;
7542 esac
7543 done
7544
7545 if test -n "$cf_new_cflags" ; then
7546
7547         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7548         CFLAGS="${CFLAGS}$cf_new_cflags"
7549
7550 fi
7551
7552 if test -n "$cf_new_cppflags" ; then
7553
7554         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7555         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7556
7557 fi
7558
7559 if test -n "$cf_new_extra_cppflags" ; then
7560
7561         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7562         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7563
7564 fi
7565
7566 cf_add_libs="$LIBS"
7567 # reverse order
7568 cf_add_0lib=
7569 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7570 # filter duplicates
7571 for cf_add_1lib in $cf_add_0lib; do
7572         for cf_add_2lib in $cf_add_libs; do
7573                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7574                         cf_add_1lib=
7575                         break
7576                 fi
7577         done
7578         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7579 done
7580 LIBS="$cf_add_libs"
7581
7582                 cat >"conftest.$ac_ext" <<_ACEOF
7583 #line 7583 "configure"
7584 #include "confdefs.h"
7585 #include <${cf_cv_ncurses_header:-curses.h}>
7586 int
7587 main (void)
7588 {
7589 initscr(); mousemask(0,0); tigetstr((char *)0);
7590   ;
7591   return 0;
7592 }
7593 _ACEOF
7594 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7595 if { (eval echo "$as_me:7595: \"$ac_link\"") >&5
7596   (eval $ac_link) 2>&5
7597   ac_status=$?
7598   echo "$as_me:7598: \$? = $ac_status" >&5
7599   (exit "$ac_status"); } &&
7600          { ac_try='test -s "conftest$ac_exeext"'
7601   { (eval echo "$as_me:7601: \"$ac_try\"") >&5
7602   (eval $ac_try) 2>&5
7603   ac_status=$?
7604   echo "$as_me:7604: \$? = $ac_status" >&5
7605   (exit "$ac_status"); }; }; then
7606   if test "$cross_compiling" = yes; then
7607   cf_have_ncuconfig=maybe
7608 else
7609   cat >"conftest.$ac_ext" <<_ACEOF
7610 #line 7610 "configure"
7611 #include "confdefs.h"
7612 #include <${cf_cv_ncurses_header:-curses.h}>
7613                                 int main(void)
7614                                 { const char *xx = curses_version(); return (xx == 0); }
7615 _ACEOF
7616 rm -f "conftest$ac_exeext"
7617 if { (eval echo "$as_me:7617: \"$ac_link\"") >&5
7618   (eval $ac_link) 2>&5
7619   ac_status=$?
7620   echo "$as_me:7620: \$? = $ac_status" >&5
7621   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7622   { (eval echo "$as_me:7622: \"$ac_try\"") >&5
7623   (eval $ac_try) 2>&5
7624   ac_status=$?
7625   echo "$as_me:7625: \$? = $ac_status" >&5
7626   (exit "$ac_status"); }; }; then
7627   cf_have_ncuconfig=yes
7628 else
7629   echo "$as_me: program exited with status $ac_status" >&5
7630 echo "$as_me: failed program was:" >&5
7631 cat "conftest.$ac_ext" >&5
7632 cf_have_ncuconfig=no
7633 fi
7634 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7635 fi
7636 else
7637   echo "$as_me: failed program was:" >&5
7638 cat "conftest.$ac_ext" >&5
7639 cf_have_ncuconfig=no
7640 fi
7641 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7642                 echo "$as_me:7642: result: $cf_have_ncuconfig" >&5
7643 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7644                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7645                 if test "$cf_have_ncuconfig" != "yes"
7646                 then
7647                         CPPFLAGS="$cf_save_CPPFLAGS"
7648                         LIBS="$cf_save_LIBS"
7649                         NCURSES_CONFIG_PKG=none
7650                 else
7651
7652 cat >>confdefs.h <<\EOF
7653 #define NCURSES 1
7654 EOF
7655
7656                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7657
7658 echo "$as_me:7658: checking for terminfo header" >&5
7659 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7660 if test "${cf_cv_term_header+set}" = set; then
7661   echo $ECHO_N "(cached) $ECHO_C" >&6
7662 else
7663
7664 case "${cf_cv_ncurses_header}" in
7665 (*/ncurses.h|*/ncursesw.h)
7666         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7667         ;;
7668 (*)
7669         cf_term_header=term.h
7670         ;;
7671 esac
7672
7673 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7674 do
7675 cat >"conftest.$ac_ext" <<_ACEOF
7676 #line 7676 "configure"
7677 #include "confdefs.h"
7678 #include <stdio.h>
7679 #include <${cf_cv_ncurses_header:-curses.h}>
7680 #include <$cf_test>
7681
7682 int
7683 main (void)
7684 {
7685 int x = auto_left_margin; (void)x
7686   ;
7687   return 0;
7688 }
7689 _ACEOF
7690 rm -f "conftest.$ac_objext"
7691 if { (eval echo "$as_me:7691: \"$ac_compile\"") >&5
7692   (eval $ac_compile) 2>&5
7693   ac_status=$?
7694   echo "$as_me:7694: \$? = $ac_status" >&5
7695   (exit "$ac_status"); } &&
7696          { ac_try='test -s "conftest.$ac_objext"'
7697   { (eval echo "$as_me:7697: \"$ac_try\"") >&5
7698   (eval $ac_try) 2>&5
7699   ac_status=$?
7700   echo "$as_me:7700: \$? = $ac_status" >&5
7701   (exit "$ac_status"); }; }; then
7702
7703         cf_cv_term_header="$cf_test"
7704 else
7705   echo "$as_me: failed program was:" >&5
7706 cat "conftest.$ac_ext" >&5
7707
7708         cf_cv_term_header=unknown
7709
7710 fi
7711 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7712         test "$cf_cv_term_header" != unknown && break
7713 done
7714
7715 fi
7716 echo "$as_me:7716: result: $cf_cv_term_header" >&5
7717 echo "${ECHO_T}$cf_cv_term_header" >&6
7718
7719 # Set definitions to allow ifdef'ing to accommodate subdirectories
7720
7721 case "$cf_cv_term_header" in
7722 (*term.h)
7723
7724 cat >>confdefs.h <<\EOF
7725 #define HAVE_TERM_H 1
7726 EOF
7727
7728         ;;
7729 esac
7730
7731 case "$cf_cv_term_header" in
7732 (ncurses/term.h)
7733
7734 cat >>confdefs.h <<\EOF
7735 #define HAVE_NCURSES_TERM_H 1
7736 EOF
7737
7738         ;;
7739 (ncursesw/term.h)
7740
7741 cat >>confdefs.h <<\EOF
7742 #define HAVE_NCURSESW_TERM_H 1
7743 EOF
7744
7745         ;;
7746 esac
7747
7748                 fi
7749
7750         else
7751                 echo "$as_me:7751: result: no" >&5
7752 echo "${ECHO_T}no" >&6
7753                 NCURSES_CONFIG_PKG=none
7754         fi
7755 else
7756         NCURSES_CONFIG_PKG=none
7757 fi
7758
7759 if test "x$cf_have_ncuconfig" = "xno"; then
7760         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7761
7762 if test -n "$ac_tool_prefix"; then
7763   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7764   do
7765     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7766 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7767 echo "$as_me:7767: checking for $ac_word" >&5
7768 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7769 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7770   echo $ECHO_N "(cached) $ECHO_C" >&6
7771 else
7772   if test -n "$NCURSES_CONFIG"; then
7773   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7774 else
7775   ac_save_IFS=$IFS; IFS=$ac_path_separator
7776 ac_dummy="$PATH"
7777 for ac_dir in $ac_dummy; do
7778   IFS=$ac_save_IFS
7779   test -z "$ac_dir" && ac_dir=.
7780   $as_executable_p "$ac_dir/$ac_word" || continue
7781 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7782 echo "$as_me:7782: found $ac_dir/$ac_word" >&5
7783 break
7784 done
7785
7786 fi
7787 fi
7788 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7789 if test -n "$NCURSES_CONFIG"; then
7790   echo "$as_me:7790: result: $NCURSES_CONFIG" >&5
7791 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7792 else
7793   echo "$as_me:7793: result: no" >&5
7794 echo "${ECHO_T}no" >&6
7795 fi
7796
7797     test -n "$NCURSES_CONFIG" && break
7798   done
7799 fi
7800 if test -z "$NCURSES_CONFIG"; then
7801   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7802   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7803 do
7804   # Extract the first word of "$ac_prog", so it can be a program name with args.
7805 set dummy $ac_prog; ac_word=$2
7806 echo "$as_me:7806: checking for $ac_word" >&5
7807 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7808 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7809   echo $ECHO_N "(cached) $ECHO_C" >&6
7810 else
7811   if test -n "$ac_ct_NCURSES_CONFIG"; then
7812   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7813 else
7814   ac_save_IFS=$IFS; IFS=$ac_path_separator
7815 ac_dummy="$PATH"
7816 for ac_dir in $ac_dummy; do
7817   IFS=$ac_save_IFS
7818   test -z "$ac_dir" && ac_dir=.
7819   $as_executable_p "$ac_dir/$ac_word" || continue
7820 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7821 echo "$as_me:7821: found $ac_dir/$ac_word" >&5
7822 break
7823 done
7824
7825 fi
7826 fi
7827 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7828 if test -n "$ac_ct_NCURSES_CONFIG"; then
7829   echo "$as_me:7829: result: $ac_ct_NCURSES_CONFIG" >&5
7830 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7831 else
7832   echo "$as_me:7832: result: no" >&5
7833 echo "${ECHO_T}no" >&6
7834 fi
7835
7836   test -n "$ac_ct_NCURSES_CONFIG" && break
7837 done
7838 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7839
7840   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7841 fi
7842
7843         if test "$NCURSES_CONFIG" != none ; then
7844
7845 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7846 do
7847
7848 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7849 cf_old_cflag="$CFLAGS"
7850
7851 case "$CFLAGS" in
7852 (*$cf_add_cflags=*)
7853         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
7854         ;;
7855 (*$cf_add_cflags\ *)
7856         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
7857         ;;
7858 (*$cf_add_cflags)
7859         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
7860         ;;
7861 esac
7862
7863 if test "$CFLAGS" != "$cf_old_cflag" ;
7864 then
7865
7866         CFLAGS="$cf_new_cflag"
7867 fi
7868
7869 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7870 cf_old_cflag="$CPPFLAGS"
7871
7872 case "$CPPFLAGS" in
7873 (*$cf_add_cflags=*)
7874         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
7875         ;;
7876 (*$cf_add_cflags\ *)
7877         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
7878         ;;
7879 (*$cf_add_cflags)
7880         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
7881         ;;
7882 esac
7883
7884 if test "$CPPFLAGS" != "$cf_old_cflag" ;
7885 then
7886
7887         CPPFLAGS="$cf_new_cflag"
7888 fi
7889
7890 done
7891
7892 cf_fix_cppflags=no
7893 cf_new_cflags=
7894 cf_new_cppflags=
7895 cf_new_extra_cppflags=
7896
7897 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7898 do
7899 case "$cf_fix_cppflags" in
7900 (no)
7901         case "$cf_add_cflags" in
7902         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7903                 case "$cf_add_cflags" in
7904                 (-D*)
7905                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7906
7907                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7908                                 && test -z "${cf_tst_cflags}" \
7909                                 && cf_fix_cppflags=yes
7910
7911                         if test "$cf_fix_cppflags" = yes ; then
7912
7913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7915
7916                                 continue
7917                         elif test "${cf_tst_cflags}" = "\"'" ; then
7918
7919         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7920         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7921
7922                                 continue
7923                         fi
7924                         ;;
7925                 esac
7926                 case "$CPPFLAGS" in
7927                 (*$cf_add_cflags)
7928                         ;;
7929                 (*)
7930                         case "$cf_add_cflags" in
7931                         (-D*)
7932                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7933
7934 CPPFLAGS=`echo "$CPPFLAGS" | \
7935         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7936                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7937
7938                                 ;;
7939                         esac
7940
7941         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7942         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7943
7944                         ;;
7945                 esac
7946                 ;;
7947         (*)
7948
7949         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7950         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7951
7952                 ;;
7953         esac
7954         ;;
7955 (yes)
7956
7957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7959
7960         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7961
7962         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7963                 && test -z "${cf_tst_cflags}" \
7964                 && cf_fix_cppflags=no
7965         ;;
7966 esac
7967 done
7968
7969 if test -n "$cf_new_cflags" ; then
7970
7971         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7972         CFLAGS="${CFLAGS}$cf_new_cflags"
7973
7974 fi
7975
7976 if test -n "$cf_new_cppflags" ; then
7977
7978         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7979         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7980
7981 fi
7982
7983 if test -n "$cf_new_extra_cppflags" ; then
7984
7985         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7986         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7987
7988 fi
7989
7990 cf_add_libs="$LIBS"
7991 # reverse order
7992 cf_add_0lib=
7993 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7994 # filter duplicates
7995 for cf_add_1lib in $cf_add_0lib; do
7996         for cf_add_2lib in $cf_add_libs; do
7997                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7998                         cf_add_1lib=
7999                         break
8000                 fi
8001         done
8002         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8003 done
8004 LIBS="$cf_add_libs"
8005
8006                 # even with config script, some packages use no-override for curses.h
8007
8008 echo "$as_me:8008: checking if we have identified curses headers" >&5
8009 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8010 if test "${cf_cv_ncurses_header+set}" = set; then
8011   echo $ECHO_N "(cached) $ECHO_C" >&6
8012 else
8013
8014 cf_cv_ncurses_header=none
8015 for cf_header in \
8016         ncurses.h ncursesw/ncurses.h \
8017         curses.h ncursesw/curses.h
8018 do
8019 cat >"conftest.$ac_ext" <<_ACEOF
8020 #line 8020 "configure"
8021 #include "confdefs.h"
8022 #include <${cf_header}>
8023 int
8024 main (void)
8025 {
8026 initscr(); tgoto("?", 0,0)
8027   ;
8028   return 0;
8029 }
8030 _ACEOF
8031 rm -f "conftest.$ac_objext"
8032 if { (eval echo "$as_me:8032: \"$ac_compile\"") >&5
8033   (eval $ac_compile) 2>&5
8034   ac_status=$?
8035   echo "$as_me:8035: \$? = $ac_status" >&5
8036   (exit "$ac_status"); } &&
8037          { ac_try='test -s "conftest.$ac_objext"'
8038   { (eval echo "$as_me:8038: \"$ac_try\"") >&5
8039   (eval $ac_try) 2>&5
8040   ac_status=$?
8041   echo "$as_me:8041: \$? = $ac_status" >&5
8042   (exit "$ac_status"); }; }; then
8043   cf_cv_ncurses_header=$cf_header; break
8044 else
8045   echo "$as_me: failed program was:" >&5
8046 cat "conftest.$ac_ext" >&5
8047 fi
8048 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8049 done
8050
8051 fi
8052 echo "$as_me:8052: result: $cf_cv_ncurses_header" >&5
8053 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8054
8055 if test "$cf_cv_ncurses_header" = none ; then
8056         { { echo "$as_me:8056: error: No curses header-files found" >&5
8057 echo "$as_me: error: No curses header-files found" >&2;}
8058    { (exit 1); exit 1; }; }
8059 fi
8060
8061 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8062
8063 for ac_header in $cf_cv_ncurses_header
8064 do
8065 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8066 echo "$as_me:8066: checking for $ac_header" >&5
8067 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8068 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8069   echo $ECHO_N "(cached) $ECHO_C" >&6
8070 else
8071   cat >"conftest.$ac_ext" <<_ACEOF
8072 #line 8072 "configure"
8073 #include "confdefs.h"
8074 #include <$ac_header>
8075 _ACEOF
8076 if { (eval echo "$as_me:8076: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8077   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8078   ac_status=$?
8079   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8080   rm -f conftest.er1
8081   cat conftest.err >&5
8082   echo "$as_me:8082: \$? = $ac_status" >&5
8083   (exit "$ac_status"); } >/dev/null; then
8084   if test -s conftest.err; then
8085     ac_cpp_err=$ac_c_preproc_warn_flag
8086   else
8087     ac_cpp_err=
8088   fi
8089 else
8090   ac_cpp_err=yes
8091 fi
8092 if test -z "$ac_cpp_err"; then
8093   eval "$as_ac_Header=yes"
8094 else
8095   echo "$as_me: failed program was:" >&5
8096   cat "conftest.$ac_ext" >&5
8097   eval "$as_ac_Header=no"
8098 fi
8099 rm -f conftest.err "conftest.$ac_ext"
8100 fi
8101 echo "$as_me:8101: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8102 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8103 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8104   cat >>confdefs.h <<EOF
8105 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8106 EOF
8107
8108 fi
8109 done
8110
8111 cat >>confdefs.h <<\EOF
8112 #define NCURSES 1
8113 EOF
8114
8115 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8116
8117                 cat >>confdefs.h <<EOF
8118 #define $cf_nculib_ROOT 1
8119 EOF
8120
8121                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8122
8123         else
8124
8125 cf_ncuhdr_root=ncursesw
8126
8127 test -n "$cf_cv_curses_dir" && \
8128 test "$cf_cv_curses_dir" != "no" && { \
8129
8130 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8131   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8132   do
8133         while test "$cf_add_incdir" != /usr/include
8134         do
8135           if test -d "$cf_add_incdir"
8136           then
8137                 cf_have_incdir=no
8138                 if test -n "$CFLAGS$CPPFLAGS" ; then
8139                   # a loop is needed to ensure we can add subdirs of existing dirs
8140                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8141                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8142                           cf_have_incdir=yes; break
8143                         fi
8144                   done
8145                 fi
8146
8147                 if test "$cf_have_incdir" = no ; then
8148                   if test "$cf_add_incdir" = /usr/local/include ; then
8149                         if test "$GCC" = yes
8150                         then
8151                           cf_save_CPPFLAGS=$CPPFLAGS
8152
8153         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8154         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8155
8156                           cat >"conftest.$ac_ext" <<_ACEOF
8157 #line 8157 "configure"
8158 #include "confdefs.h"
8159 #include <stdio.h>
8160 int
8161 main (void)
8162 {
8163 printf("Hello")
8164   ;
8165   return 0;
8166 }
8167 _ACEOF
8168 rm -f "conftest.$ac_objext"
8169 if { (eval echo "$as_me:8169: \"$ac_compile\"") >&5
8170   (eval $ac_compile) 2>&5
8171   ac_status=$?
8172   echo "$as_me:8172: \$? = $ac_status" >&5
8173   (exit "$ac_status"); } &&
8174          { ac_try='test -s "conftest.$ac_objext"'
8175   { (eval echo "$as_me:8175: \"$ac_try\"") >&5
8176   (eval $ac_try) 2>&5
8177   ac_status=$?
8178   echo "$as_me:8178: \$? = $ac_status" >&5
8179   (exit "$ac_status"); }; }; then
8180   :
8181 else
8182   echo "$as_me: failed program was:" >&5
8183 cat "conftest.$ac_ext" >&5
8184 cf_have_incdir=yes
8185 fi
8186 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8187                           CPPFLAGS=$cf_save_CPPFLAGS
8188                         fi
8189                   fi
8190                 fi
8191
8192                 if test "$cf_have_incdir" = no ; then
8193                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8194
8195 echo "${as_me:-configure}:8195: testing adding $cf_add_incdir to include-path ..." 1>&5
8196
8197                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8198
8199                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8200                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8201                   cf_add_incdir="$cf_top_incdir"
8202                 else
8203                   break
8204                 fi
8205           else
8206                 break
8207           fi
8208         done
8209   done
8210 fi
8211
8212 }
8213
8214 echo "$as_me:8214: checking for $cf_ncuhdr_root header in include-path" >&5
8215 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8216 if test "${cf_cv_ncurses_h+set}" = set; then
8217   echo $ECHO_N "(cached) $ECHO_C" >&6
8218 else
8219
8220         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8221         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8222         for cf_header in $cf_header_list
8223         do
8224
8225         cat >"conftest.$ac_ext" <<_ACEOF
8226 #line 8226 "configure"
8227 #include "confdefs.h"
8228
8229 #define _XOPEN_SOURCE_EXTENDED
8230 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8231 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8232
8233 #include <$cf_header>
8234 int
8235 main (void)
8236 {
8237
8238 #ifdef NCURSES_VERSION
8239
8240 #ifndef WACS_BSSB
8241         make an error
8242 #endif
8243
8244 printf("%s\\n", NCURSES_VERSION);
8245 #else
8246 #ifdef __NCURSES_H
8247 printf("old\\n");
8248 #else
8249         make an error
8250 #endif
8251 #endif
8252
8253   ;
8254   return 0;
8255 }
8256 _ACEOF
8257 rm -f "conftest.$ac_objext"
8258 if { (eval echo "$as_me:8258: \"$ac_compile\"") >&5
8259   (eval $ac_compile) 2>&5
8260   ac_status=$?
8261   echo "$as_me:8261: \$? = $ac_status" >&5
8262   (exit "$ac_status"); } &&
8263          { ac_try='test -s "conftest.$ac_objext"'
8264   { (eval echo "$as_me:8264: \"$ac_try\"") >&5
8265   (eval $ac_try) 2>&5
8266   ac_status=$?
8267   echo "$as_me:8267: \$? = $ac_status" >&5
8268   (exit "$ac_status"); }; }; then
8269   cf_cv_ncurses_h=$cf_header
8270
8271 else
8272   echo "$as_me: failed program was:" >&5
8273 cat "conftest.$ac_ext" >&5
8274 cf_cv_ncurses_h=no
8275 fi
8276 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8277
8278                 test "$cf_cv_ncurses_h" != no && break
8279         done
8280
8281 fi
8282 echo "$as_me:8282: result: $cf_cv_ncurses_h" >&5
8283 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8284
8285 if test "$cf_cv_ncurses_h" != no ; then
8286         cf_cv_ncurses_header=$cf_cv_ncurses_h
8287 else
8288
8289 echo "$as_me:8289: checking for $cf_ncuhdr_root include-path" >&5
8290 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8291 if test "${cf_cv_ncurses_h2+set}" = set; then
8292   echo $ECHO_N "(cached) $ECHO_C" >&6
8293 else
8294
8295         test -n "$verbose" && echo
8296
8297 cf_search=
8298
8299 # collect the current set of include-directories from compiler flags
8300 cf_header_path_list=""
8301 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8302         for cf_header_path in $CPPFLAGS $CFLAGS
8303         do
8304                 case "$cf_header_path" in
8305                 (-I*)
8306                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8307
8308 test "x$cf_header_path" != "xNONE" && \
8309 test -d "$cf_header_path" && \
8310  {
8311         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8312         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8313         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8314         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8315         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8316         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"
8317 }
8318
8319                         cf_header_path_list="$cf_header_path_list $cf_search"
8320                         ;;
8321                 esac
8322         done
8323 fi
8324
8325 # add the variations for the package we are looking for
8326
8327 cf_search=
8328
8329 test "x$prefix" != "xNONE" && \
8330 test -d "$prefix" && \
8331  {
8332         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8333         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8334         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8335         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8336         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8337         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8338 }
8339
8340 for cf_subdir_prefix in \
8341         /usr \
8342         /usr/local \
8343         /usr/pkg \
8344         /opt \
8345         /opt/local \
8346         $HOME
8347 do
8348
8349 test "x$cf_subdir_prefix" != "x$prefix" && \
8350 test -d "$cf_subdir_prefix" && \
8351 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8352         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8353         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8354         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8355         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8356         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8357         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"
8358 }
8359
8360 done
8361
8362 test "$includedir" != NONE && \
8363 test "$includedir" != "/usr/include" && \
8364 test -d "$includedir" && {
8365         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8366         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8367 }
8368
8369 test "$oldincludedir" != NONE && \
8370 test "$oldincludedir" != "/usr/include" && \
8371 test -d "$oldincludedir" && {
8372         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8373         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8374 }
8375
8376 cf_search="$cf_search $cf_header_path_list"
8377
8378         test -n "$verbose" && echo "search path $cf_search"
8379         cf_save2_CPPFLAGS="$CPPFLAGS"
8380         for cf_incdir in $cf_search
8381         do
8382
8383 if test -n "$cf_incdir" ; then
8384   for cf_add_incdir in $cf_incdir
8385   do
8386         while test "$cf_add_incdir" != /usr/include
8387         do
8388           if test -d "$cf_add_incdir"
8389           then
8390                 cf_have_incdir=no
8391                 if test -n "$CFLAGS$CPPFLAGS" ; then
8392                   # a loop is needed to ensure we can add subdirs of existing dirs
8393                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8394                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8395                           cf_have_incdir=yes; break
8396                         fi
8397                   done
8398                 fi
8399
8400                 if test "$cf_have_incdir" = no ; then
8401                   if test "$cf_add_incdir" = /usr/local/include ; then
8402                         if test "$GCC" = yes
8403                         then
8404                           cf_save_CPPFLAGS=$CPPFLAGS
8405
8406         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8407         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8408
8409                           cat >"conftest.$ac_ext" <<_ACEOF
8410 #line 8410 "configure"
8411 #include "confdefs.h"
8412 #include <stdio.h>
8413 int
8414 main (void)
8415 {
8416 printf("Hello")
8417   ;
8418   return 0;
8419 }
8420 _ACEOF
8421 rm -f "conftest.$ac_objext"
8422 if { (eval echo "$as_me:8422: \"$ac_compile\"") >&5
8423   (eval $ac_compile) 2>&5
8424   ac_status=$?
8425   echo "$as_me:8425: \$? = $ac_status" >&5
8426   (exit "$ac_status"); } &&
8427          { ac_try='test -s "conftest.$ac_objext"'
8428   { (eval echo "$as_me:8428: \"$ac_try\"") >&5
8429   (eval $ac_try) 2>&5
8430   ac_status=$?
8431   echo "$as_me:8431: \$? = $ac_status" >&5
8432   (exit "$ac_status"); }; }; then
8433   :
8434 else
8435   echo "$as_me: failed program was:" >&5
8436 cat "conftest.$ac_ext" >&5
8437 cf_have_incdir=yes
8438 fi
8439 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8440                           CPPFLAGS=$cf_save_CPPFLAGS
8441                         fi
8442                   fi
8443                 fi
8444
8445                 if test "$cf_have_incdir" = no ; then
8446                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8447
8448 echo "${as_me:-configure}:8448: testing adding $cf_add_incdir to include-path ..." 1>&5
8449
8450                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8451
8452                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8453                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8454                   cf_add_incdir="$cf_top_incdir"
8455                 else
8456                   break
8457                 fi
8458           else
8459                 break
8460           fi
8461         done
8462   done
8463 fi
8464
8465                 for cf_header in \
8466                         ncurses.h \
8467                         curses.h
8468                 do
8469
8470         cat >"conftest.$ac_ext" <<_ACEOF
8471 #line 8471 "configure"
8472 #include "confdefs.h"
8473
8474 #include <$cf_header>
8475 int
8476 main (void)
8477 {
8478
8479 #ifdef NCURSES_VERSION
8480
8481 printf("%s\\n", NCURSES_VERSION);
8482 #else
8483 #ifdef __NCURSES_H
8484 printf("old\\n");
8485 #else
8486         make an error
8487 #endif
8488 #endif
8489
8490   ;
8491   return 0;
8492 }
8493 _ACEOF
8494 rm -f "conftest.$ac_objext"
8495 if { (eval echo "$as_me:8495: \"$ac_compile\"") >&5
8496   (eval $ac_compile) 2>&5
8497   ac_status=$?
8498   echo "$as_me:8498: \$? = $ac_status" >&5
8499   (exit "$ac_status"); } &&
8500          { ac_try='test -s "conftest.$ac_objext"'
8501   { (eval echo "$as_me:8501: \"$ac_try\"") >&5
8502   (eval $ac_try) 2>&5
8503   ac_status=$?
8504   echo "$as_me:8504: \$? = $ac_status" >&5
8505   (exit "$ac_status"); }; }; then
8506   cf_cv_ncurses_h2=$cf_header
8507
8508 else
8509   echo "$as_me: failed program was:" >&5
8510 cat "conftest.$ac_ext" >&5
8511 cf_cv_ncurses_h2=no
8512 fi
8513 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8514
8515                         if test "$cf_cv_ncurses_h2" != no ; then
8516                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8517                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8518                                 break
8519                         fi
8520                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8521                 done
8522                 CPPFLAGS="$cf_save2_CPPFLAGS"
8523                 test "$cf_cv_ncurses_h2" != no && break
8524         done
8525         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8525: error: not found" >&5
8526 echo "$as_me: error: not found" >&2;}
8527    { (exit 1); exit 1; }; }
8528
8529 fi
8530 echo "$as_me:8530: result: $cf_cv_ncurses_h2" >&5
8531 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8532
8533         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8534         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8535         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8536                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8537         fi
8538
8539 if test -n "$cf_1st_incdir" ; then
8540   for cf_add_incdir in $cf_1st_incdir
8541   do
8542         while test "$cf_add_incdir" != /usr/include
8543         do
8544           if test -d "$cf_add_incdir"
8545           then
8546                 cf_have_incdir=no
8547                 if test -n "$CFLAGS$CPPFLAGS" ; then
8548                   # a loop is needed to ensure we can add subdirs of existing dirs
8549                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8550                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8551                           cf_have_incdir=yes; break
8552                         fi
8553                   done
8554                 fi
8555
8556                 if test "$cf_have_incdir" = no ; then
8557                   if test "$cf_add_incdir" = /usr/local/include ; then
8558                         if test "$GCC" = yes
8559                         then
8560                           cf_save_CPPFLAGS=$CPPFLAGS
8561
8562         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8563         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8564
8565                           cat >"conftest.$ac_ext" <<_ACEOF
8566 #line 8566 "configure"
8567 #include "confdefs.h"
8568 #include <stdio.h>
8569 int
8570 main (void)
8571 {
8572 printf("Hello")
8573   ;
8574   return 0;
8575 }
8576 _ACEOF
8577 rm -f "conftest.$ac_objext"
8578 if { (eval echo "$as_me:8578: \"$ac_compile\"") >&5
8579   (eval $ac_compile) 2>&5
8580   ac_status=$?
8581   echo "$as_me:8581: \$? = $ac_status" >&5
8582   (exit "$ac_status"); } &&
8583          { ac_try='test -s "conftest.$ac_objext"'
8584   { (eval echo "$as_me:8584: \"$ac_try\"") >&5
8585   (eval $ac_try) 2>&5
8586   ac_status=$?
8587   echo "$as_me:8587: \$? = $ac_status" >&5
8588   (exit "$ac_status"); }; }; then
8589   :
8590 else
8591   echo "$as_me: failed program was:" >&5
8592 cat "conftest.$ac_ext" >&5
8593 cf_have_incdir=yes
8594 fi
8595 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8596                           CPPFLAGS=$cf_save_CPPFLAGS
8597                         fi
8598                   fi
8599                 fi
8600
8601                 if test "$cf_have_incdir" = no ; then
8602                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8603
8604 echo "${as_me:-configure}:8604: testing adding $cf_add_incdir to include-path ..." 1>&5
8605
8606                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8607
8608                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8609                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8610                   cf_add_incdir="$cf_top_incdir"
8611                 else
8612                   break
8613                 fi
8614           else
8615                 break
8616           fi
8617         done
8618   done
8619 fi
8620
8621 fi
8622
8623 # Set definitions to allow ifdef'ing for ncurses.h
8624
8625 case "$cf_cv_ncurses_header" in
8626 (*ncurses.h)
8627
8628 cat >>confdefs.h <<\EOF
8629 #define HAVE_NCURSES_H 1
8630 EOF
8631
8632         ;;
8633 esac
8634
8635 case "$cf_cv_ncurses_header" in
8636 (ncurses/curses.h|ncurses/ncurses.h)
8637
8638 cat >>confdefs.h <<\EOF
8639 #define HAVE_NCURSES_NCURSES_H 1
8640 EOF
8641
8642         ;;
8643 (ncursesw/curses.h|ncursesw/ncurses.h)
8644
8645 cat >>confdefs.h <<\EOF
8646 #define HAVE_NCURSESW_NCURSES_H 1
8647 EOF
8648
8649         ;;
8650 esac
8651
8652 echo "$as_me:8652: checking for terminfo header" >&5
8653 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8654 if test "${cf_cv_term_header+set}" = set; then
8655   echo $ECHO_N "(cached) $ECHO_C" >&6
8656 else
8657
8658 case "${cf_cv_ncurses_header}" in
8659 (*/ncurses.h|*/ncursesw.h)
8660         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8661         ;;
8662 (*)
8663         cf_term_header=term.h
8664         ;;
8665 esac
8666
8667 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8668 do
8669 cat >"conftest.$ac_ext" <<_ACEOF
8670 #line 8670 "configure"
8671 #include "confdefs.h"
8672 #include <stdio.h>
8673 #include <${cf_cv_ncurses_header:-curses.h}>
8674 #include <$cf_test>
8675
8676 int
8677 main (void)
8678 {
8679 int x = auto_left_margin; (void)x
8680   ;
8681   return 0;
8682 }
8683 _ACEOF
8684 rm -f "conftest.$ac_objext"
8685 if { (eval echo "$as_me:8685: \"$ac_compile\"") >&5
8686   (eval $ac_compile) 2>&5
8687   ac_status=$?
8688   echo "$as_me:8688: \$? = $ac_status" >&5
8689   (exit "$ac_status"); } &&
8690          { ac_try='test -s "conftest.$ac_objext"'
8691   { (eval echo "$as_me:8691: \"$ac_try\"") >&5
8692   (eval $ac_try) 2>&5
8693   ac_status=$?
8694   echo "$as_me:8694: \$? = $ac_status" >&5
8695   (exit "$ac_status"); }; }; then
8696
8697         cf_cv_term_header="$cf_test"
8698 else
8699   echo "$as_me: failed program was:" >&5
8700 cat "conftest.$ac_ext" >&5
8701
8702         cf_cv_term_header=unknown
8703
8704 fi
8705 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8706         test "$cf_cv_term_header" != unknown && break
8707 done
8708
8709 fi
8710 echo "$as_me:8710: result: $cf_cv_term_header" >&5
8711 echo "${ECHO_T}$cf_cv_term_header" >&6
8712
8713 # Set definitions to allow ifdef'ing to accommodate subdirectories
8714
8715 case "$cf_cv_term_header" in
8716 (*term.h)
8717
8718 cat >>confdefs.h <<\EOF
8719 #define HAVE_TERM_H 1
8720 EOF
8721
8722         ;;
8723 esac
8724
8725 case "$cf_cv_term_header" in
8726 (ncurses/term.h)
8727
8728 cat >>confdefs.h <<\EOF
8729 #define HAVE_NCURSES_TERM_H 1
8730 EOF
8731
8732         ;;
8733 (ncursesw/term.h)
8734
8735 cat >>confdefs.h <<\EOF
8736 #define HAVE_NCURSESW_TERM_H 1
8737 EOF
8738
8739         ;;
8740 esac
8741
8742 # some applications need this, but should check for NCURSES_VERSION
8743
8744 cat >>confdefs.h <<\EOF
8745 #define NCURSES 1
8746 EOF
8747
8748 echo "$as_me:8748: checking for ncurses version" >&5
8749 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8750 if test "${cf_cv_ncurses_version+set}" = set; then
8751   echo $ECHO_N "(cached) $ECHO_C" >&6
8752 else
8753
8754         cf_cv_ncurses_version=no
8755         cf_tempfile=out$$
8756         rm -f "$cf_tempfile"
8757         if test "$cross_compiling" = yes; then
8758
8759         # This will not work if the preprocessor splits the line after the
8760         # Autoconf token.  The 'unproto' program does that.
8761         cat > "conftest.$ac_ext" <<EOF
8762 #include <${cf_cv_ncurses_header:-curses.h}>
8763 #undef Autoconf
8764 #ifdef NCURSES_VERSION
8765 Autoconf NCURSES_VERSION
8766 #else
8767 #ifdef __NCURSES_H
8768 Autoconf "old"
8769 #endif
8770 ;
8771 #endif
8772 EOF
8773         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8774         { (eval echo "$as_me:8774: \"$cf_try\"") >&5
8775   (eval $cf_try) 2>&5
8776   ac_status=$?
8777   echo "$as_me:8777: \$? = $ac_status" >&5
8778   (exit "$ac_status"); }
8779         if test -f conftest.out ; then
8780                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8781                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8782                 rm -f conftest.out
8783         fi
8784
8785 else
8786   cat >"conftest.$ac_ext" <<_ACEOF
8787 #line 8787 "configure"
8788 #include "confdefs.h"
8789
8790 #include <${cf_cv_ncurses_header:-curses.h}>
8791 #include <stdio.h>
8792 int main(void)
8793 {
8794         FILE *fp = fopen("$cf_tempfile", "w");
8795 #ifdef NCURSES_VERSION
8796 # ifdef NCURSES_VERSION_PATCH
8797         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8798 # else
8799         fprintf(fp, "%s\\n", NCURSES_VERSION);
8800 # endif
8801 #else
8802 # ifdef __NCURSES_H
8803         fprintf(fp, "old\\n");
8804 # else
8805         make an error
8806 # endif
8807 #endif
8808         ${cf_cv_main_return:-return}(0);
8809 }
8810 _ACEOF
8811 rm -f "conftest$ac_exeext"
8812 if { (eval echo "$as_me:8812: \"$ac_link\"") >&5
8813   (eval $ac_link) 2>&5
8814   ac_status=$?
8815   echo "$as_me:8815: \$? = $ac_status" >&5
8816   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8817   { (eval echo "$as_me:8817: \"$ac_try\"") >&5
8818   (eval $ac_try) 2>&5
8819   ac_status=$?
8820   echo "$as_me:8820: \$? = $ac_status" >&5
8821   (exit "$ac_status"); }; }; then
8822
8823         cf_cv_ncurses_version=`cat $cf_tempfile`
8824 else
8825   echo "$as_me: program exited with status $ac_status" >&5
8826 echo "$as_me: failed program was:" >&5
8827 cat "conftest.$ac_ext" >&5
8828 fi
8829 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8830 fi
8831         rm -f "$cf_tempfile"
8832
8833 fi
8834 echo "$as_me:8834: result: $cf_cv_ncurses_version" >&5
8835 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8836 test "$cf_cv_ncurses_version" = no ||
8837 cat >>confdefs.h <<\EOF
8838 #define NCURSES 1
8839 EOF
8840
8841 cf_nculib_root=ncursesw
8842         # This works, except for the special case where we find gpm, but
8843         # ncurses is in a nonstandard location via $LIBS, and we really want
8844         # to link gpm.
8845 cf_ncurses_LIBS=""
8846 cf_ncurses_SAVE="$LIBS"
8847 echo "$as_me:8847: checking for Gpm_Open in -lgpm" >&5
8848 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8849 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8850   echo $ECHO_N "(cached) $ECHO_C" >&6
8851 else
8852   ac_check_lib_save_LIBS=$LIBS
8853 LIBS="-lgpm  $LIBS"
8854 cat >"conftest.$ac_ext" <<_ACEOF
8855 #line 8855 "configure"
8856 #include "confdefs.h"
8857
8858 /* Override any gcc2 internal prototype to avoid an error.  */
8859 #ifdef __cplusplus
8860 extern "C"
8861 #endif
8862 /* We use char because int might match the return type of a gcc2
8863    builtin and then its argument prototype would still apply.  */
8864 char Gpm_Open ();
8865 int
8866 main (void)
8867 {
8868 Gpm_Open ();
8869   ;
8870   return 0;
8871 }
8872 _ACEOF
8873 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8874 if { (eval echo "$as_me:8874: \"$ac_link\"") >&5
8875   (eval $ac_link) 2>&5
8876   ac_status=$?
8877   echo "$as_me:8877: \$? = $ac_status" >&5
8878   (exit "$ac_status"); } &&
8879          { ac_try='test -s "conftest$ac_exeext"'
8880   { (eval echo "$as_me:8880: \"$ac_try\"") >&5
8881   (eval $ac_try) 2>&5
8882   ac_status=$?
8883   echo "$as_me:8883: \$? = $ac_status" >&5
8884   (exit "$ac_status"); }; }; then
8885   ac_cv_lib_gpm_Gpm_Open=yes
8886 else
8887   echo "$as_me: failed program was:" >&5
8888 cat "conftest.$ac_ext" >&5
8889 ac_cv_lib_gpm_Gpm_Open=no
8890 fi
8891 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8892 LIBS=$ac_check_lib_save_LIBS
8893 fi
8894 echo "$as_me:8894: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8895 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8896 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8897   echo "$as_me:8897: checking for initscr in -lgpm" >&5
8898 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8899 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8900   echo $ECHO_N "(cached) $ECHO_C" >&6
8901 else
8902   ac_check_lib_save_LIBS=$LIBS
8903 LIBS="-lgpm  $LIBS"
8904 cat >"conftest.$ac_ext" <<_ACEOF
8905 #line 8905 "configure"
8906 #include "confdefs.h"
8907
8908 /* Override any gcc2 internal prototype to avoid an error.  */
8909 #ifdef __cplusplus
8910 extern "C"
8911 #endif
8912 /* We use char because int might match the return type of a gcc2
8913    builtin and then its argument prototype would still apply.  */
8914 char initscr ();
8915 int
8916 main (void)
8917 {
8918 initscr ();
8919   ;
8920   return 0;
8921 }
8922 _ACEOF
8923 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8924 if { (eval echo "$as_me:8924: \"$ac_link\"") >&5
8925   (eval $ac_link) 2>&5
8926   ac_status=$?
8927   echo "$as_me:8927: \$? = $ac_status" >&5
8928   (exit "$ac_status"); } &&
8929          { ac_try='test -s "conftest$ac_exeext"'
8930   { (eval echo "$as_me:8930: \"$ac_try\"") >&5
8931   (eval $ac_try) 2>&5
8932   ac_status=$?
8933   echo "$as_me:8933: \$? = $ac_status" >&5
8934   (exit "$ac_status"); }; }; then
8935   ac_cv_lib_gpm_initscr=yes
8936 else
8937   echo "$as_me: failed program was:" >&5
8938 cat "conftest.$ac_ext" >&5
8939 ac_cv_lib_gpm_initscr=no
8940 fi
8941 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8942 LIBS=$ac_check_lib_save_LIBS
8943 fi
8944 echo "$as_me:8944: result: $ac_cv_lib_gpm_initscr" >&5
8945 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8946 if test "$ac_cv_lib_gpm_initscr" = yes; then
8947   LIBS="$cf_ncurses_SAVE"
8948 else
8949   cf_ncurses_LIBS="-lgpm"
8950 fi
8951
8952 fi
8953
8954 case "$host_os" in
8955 (freebsd*)
8956         # This is only necessary if you are linking against an obsolete
8957         # version of ncurses (but it should do no harm, since it's static).
8958         if test "$cf_nculib_root" = ncurses ; then
8959                 echo "$as_me:8959: checking for tgoto in -lmytinfo" >&5
8960 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8961 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8962   echo $ECHO_N "(cached) $ECHO_C" >&6
8963 else
8964   ac_check_lib_save_LIBS=$LIBS
8965 LIBS="-lmytinfo  $LIBS"
8966 cat >"conftest.$ac_ext" <<_ACEOF
8967 #line 8967 "configure"
8968 #include "confdefs.h"
8969
8970 /* Override any gcc2 internal prototype to avoid an error.  */
8971 #ifdef __cplusplus
8972 extern "C"
8973 #endif
8974 /* We use char because int might match the return type of a gcc2
8975    builtin and then its argument prototype would still apply.  */
8976 char tgoto ();
8977 int
8978 main (void)
8979 {
8980 tgoto ();
8981   ;
8982   return 0;
8983 }
8984 _ACEOF
8985 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8986 if { (eval echo "$as_me:8986: \"$ac_link\"") >&5
8987   (eval $ac_link) 2>&5
8988   ac_status=$?
8989   echo "$as_me:8989: \$? = $ac_status" >&5
8990   (exit "$ac_status"); } &&
8991          { ac_try='test -s "conftest$ac_exeext"'
8992   { (eval echo "$as_me:8992: \"$ac_try\"") >&5
8993   (eval $ac_try) 2>&5
8994   ac_status=$?
8995   echo "$as_me:8995: \$? = $ac_status" >&5
8996   (exit "$ac_status"); }; }; then
8997   ac_cv_lib_mytinfo_tgoto=yes
8998 else
8999   echo "$as_me: failed program was:" >&5
9000 cat "conftest.$ac_ext" >&5
9001 ac_cv_lib_mytinfo_tgoto=no
9002 fi
9003 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9004 LIBS=$ac_check_lib_save_LIBS
9005 fi
9006 echo "$as_me:9006: result: $ac_cv_lib_mytinfo_tgoto" >&5
9007 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9008 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9009   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9010 fi
9011
9012         fi
9013         ;;
9014 esac
9015
9016 cf_add_libs="$LIBS"
9017 # reverse order
9018 cf_add_0lib=
9019 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9020 # filter duplicates
9021 for cf_add_1lib in $cf_add_0lib; do
9022         for cf_add_2lib in $cf_add_libs; do
9023                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9024                         cf_add_1lib=
9025                         break
9026                 fi
9027         done
9028         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9029 done
9030 LIBS="$cf_add_libs"
9031
9032 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9033 then
9034
9035 cf_add_libs="$LIBS"
9036 # reverse order
9037 cf_add_0lib=
9038 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9039 # filter duplicates
9040 for cf_add_1lib in $cf_add_0lib; do
9041         for cf_add_2lib in $cf_add_libs; do
9042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9043                         cf_add_1lib=
9044                         break
9045                 fi
9046         done
9047         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9048 done
9049 LIBS="$cf_add_libs"
9050
9051 else
9052
9053         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9054         cf_libdir=""
9055         echo "$as_me:9055: checking for initscr" >&5
9056 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9057 if test "${ac_cv_func_initscr+set}" = set; then
9058   echo $ECHO_N "(cached) $ECHO_C" >&6
9059 else
9060   cat >"conftest.$ac_ext" <<_ACEOF
9061 #line 9061 "configure"
9062 #include "confdefs.h"
9063 #define initscr autoconf_temporary
9064 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9065 #undef initscr
9066
9067 #ifdef __cplusplus
9068 extern "C"
9069 #endif
9070
9071 /* We use char because int might match the return type of a gcc2
9072    builtin and then its argument prototype would still apply.  */
9073 char initscr (void);
9074
9075 int
9076 main (void)
9077 {
9078
9079 /* The GNU C library defines stubs for functions which it implements
9080     to always fail with ENOSYS.  Some functions are actually named
9081     something starting with __ and the normal name is an alias.  */
9082 #if defined (__stub_initscr) || defined (__stub___initscr)
9083 #error found stub for initscr
9084 #endif
9085
9086         return initscr ();
9087   ;
9088   return 0;
9089 }
9090 _ACEOF
9091 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9092 if { (eval echo "$as_me:9092: \"$ac_link\"") >&5
9093   (eval $ac_link) 2>&5
9094   ac_status=$?
9095   echo "$as_me:9095: \$? = $ac_status" >&5
9096   (exit "$ac_status"); } &&
9097          { ac_try='test -s "conftest$ac_exeext"'
9098   { (eval echo "$as_me:9098: \"$ac_try\"") >&5
9099   (eval $ac_try) 2>&5
9100   ac_status=$?
9101   echo "$as_me:9101: \$? = $ac_status" >&5
9102   (exit "$ac_status"); }; }; then
9103   ac_cv_func_initscr=yes
9104 else
9105   echo "$as_me: failed program was:" >&5
9106 cat "conftest.$ac_ext" >&5
9107 ac_cv_func_initscr=no
9108 fi
9109 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9110 fi
9111 echo "$as_me:9111: result: $ac_cv_func_initscr" >&5
9112 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9113 if test "$ac_cv_func_initscr" = yes; then
9114   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9115 else
9116
9117                 cf_save_LIBS="$LIBS"
9118                 echo "$as_me:9118: checking for initscr in -l$cf_nculib_root" >&5
9119 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9120                 LIBS="-l$cf_nculib_root $LIBS"
9121                 cat >"conftest.$ac_ext" <<_ACEOF
9122 #line 9122 "configure"
9123 #include "confdefs.h"
9124 #include <${cf_cv_ncurses_header:-curses.h}>
9125 int
9126 main (void)
9127 {
9128 initscr()
9129   ;
9130   return 0;
9131 }
9132 _ACEOF
9133 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9134 if { (eval echo "$as_me:9134: \"$ac_link\"") >&5
9135   (eval $ac_link) 2>&5
9136   ac_status=$?
9137   echo "$as_me:9137: \$? = $ac_status" >&5
9138   (exit "$ac_status"); } &&
9139          { ac_try='test -s "conftest$ac_exeext"'
9140   { (eval echo "$as_me:9140: \"$ac_try\"") >&5
9141   (eval $ac_try) 2>&5
9142   ac_status=$?
9143   echo "$as_me:9143: \$? = $ac_status" >&5
9144   (exit "$ac_status"); }; }; then
9145   echo "$as_me:9145: result: yes" >&5
9146 echo "${ECHO_T}yes" >&6
9147                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9148
9149 else
9150   echo "$as_me: failed program was:" >&5
9151 cat "conftest.$ac_ext" >&5
9152 echo "$as_me:9152: result: no" >&5
9153 echo "${ECHO_T}no" >&6
9154
9155 cf_search=
9156 cf_library_path_list=""
9157 if test -n "${LDFLAGS}${LIBS}" ; then
9158         for cf_library_path in $LDFLAGS $LIBS
9159         do
9160                 case "$cf_library_path" in
9161                 (-L*)
9162                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9163
9164 test "x$cf_library_path" != "xNONE" && \
9165 test -d "$cf_library_path" && \
9166  {
9167         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9168         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9169         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9170         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9171         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9172         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"
9173 }
9174
9175                         cf_library_path_list="$cf_library_path_list $cf_search"
9176                         ;;
9177                 esac
9178         done
9179 fi
9180
9181 cf_search=
9182
9183 test "x$prefix" != "xNONE" && \
9184 test -d "$prefix" && \
9185  {
9186         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9187         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9188         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9189         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9190         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9191         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9192 }
9193
9194 for cf_subdir_prefix in \
9195         /usr \
9196         /usr/local \
9197         /usr/pkg \
9198         /opt \
9199         /opt/local \
9200         $HOME
9201 do
9202
9203 test "x$cf_subdir_prefix" != "x$prefix" && \
9204 test -d "$cf_subdir_prefix" && \
9205 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9206         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9207         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9208         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9209         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9210         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9211         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"
9212 }
9213
9214 done
9215
9216 cf_search="$cf_library_path_list $cf_search"
9217
9218                         for cf_libdir in $cf_search
9219                         do
9220                                 echo "$as_me:9220: checking for -l$cf_nculib_root in $cf_libdir" >&5
9221 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9222                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9223                                 cat >"conftest.$ac_ext" <<_ACEOF
9224 #line 9224 "configure"
9225 #include "confdefs.h"
9226 #include <${cf_cv_ncurses_header:-curses.h}>
9227 int
9228 main (void)
9229 {
9230 initscr()
9231   ;
9232   return 0;
9233 }
9234 _ACEOF
9235 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9236 if { (eval echo "$as_me:9236: \"$ac_link\"") >&5
9237   (eval $ac_link) 2>&5
9238   ac_status=$?
9239   echo "$as_me:9239: \$? = $ac_status" >&5
9240   (exit "$ac_status"); } &&
9241          { ac_try='test -s "conftest$ac_exeext"'
9242   { (eval echo "$as_me:9242: \"$ac_try\"") >&5
9243   (eval $ac_try) 2>&5
9244   ac_status=$?
9245   echo "$as_me:9245: \$? = $ac_status" >&5
9246   (exit "$ac_status"); }; }; then
9247   echo "$as_me:9247: result: yes" >&5
9248 echo "${ECHO_T}yes" >&6
9249                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9250                                          break
9251 else
9252   echo "$as_me: failed program was:" >&5
9253 cat "conftest.$ac_ext" >&5
9254 echo "$as_me:9254: result: no" >&5
9255 echo "${ECHO_T}no" >&6
9256                                          LIBS="$cf_save_LIBS"
9257 fi
9258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9259                         done
9260
9261 fi
9262 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9263
9264 fi
9265
9266 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9267
9268 if test "$cf_found_library" = no ; then
9269         { { echo "$as_me:9269: error: Cannot link $cf_nculib_root library" >&5
9270 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9271    { (exit 1); exit 1; }; }
9272 fi
9273
9274 fi
9275
9276 if test -n "$cf_ncurses_LIBS" ; then
9277         echo "$as_me:9277: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9278 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9279         cf_ncurses_SAVE="$LIBS"
9280         for p in $cf_ncurses_LIBS ; do
9281                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9282                 if test "$q" != "$LIBS" ; then
9283                         LIBS="$q"
9284                 fi
9285         done
9286         cat >"conftest.$ac_ext" <<_ACEOF
9287 #line 9287 "configure"
9288 #include "confdefs.h"
9289 #include <${cf_cv_ncurses_header:-curses.h}>
9290 int
9291 main (void)
9292 {
9293 initscr(); mousemask(0,0); tigetstr((char *)0);
9294   ;
9295   return 0;
9296 }
9297 _ACEOF
9298 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9299 if { (eval echo "$as_me:9299: \"$ac_link\"") >&5
9300   (eval $ac_link) 2>&5
9301   ac_status=$?
9302   echo "$as_me:9302: \$? = $ac_status" >&5
9303   (exit "$ac_status"); } &&
9304          { ac_try='test -s "conftest$ac_exeext"'
9305   { (eval echo "$as_me:9305: \"$ac_try\"") >&5
9306   (eval $ac_try) 2>&5
9307   ac_status=$?
9308   echo "$as_me:9308: \$? = $ac_status" >&5
9309   (exit "$ac_status"); }; }; then
9310   echo "$as_me:9310: result: yes" >&5
9311 echo "${ECHO_T}yes" >&6
9312 else
9313   echo "$as_me: failed program was:" >&5
9314 cat "conftest.$ac_ext" >&5
9315 echo "$as_me:9315: result: no" >&5
9316 echo "${ECHO_T}no" >&6
9317                  LIBS="$cf_ncurses_SAVE"
9318 fi
9319 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9320 fi
9321
9322 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9323
9324 cat >>confdefs.h <<EOF
9325 #define $cf_nculib_ROOT 1
9326 EOF
9327
9328         fi
9329 else
9330         NCURSES_CONFIG=none
9331 fi
9332
9333 else
9334
9335 cf_ncuconfig_root=ncurses
9336 cf_have_ncuconfig=no
9337
9338 if test "x${PKG_CONFIG:=none}" != xnone; then
9339         echo "$as_me:9339: checking pkg-config for $cf_ncuconfig_root" >&5
9340 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9341         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9342                 echo "$as_me:9342: result: yes" >&5
9343 echo "${ECHO_T}yes" >&6
9344
9345                 echo "$as_me:9345: checking if the $cf_ncuconfig_root package files work" >&5
9346 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9347                 cf_have_ncuconfig=unknown
9348
9349                 cf_save_CFLAGS="$CFLAGS"
9350                 cf_save_CPPFLAGS="$CPPFLAGS"
9351                 cf_save_LIBS="$LIBS"
9352
9353                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9354                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9355
9356                 # while -W for passing linker flags is prevalent, it is not "standard".
9357                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9358                 # incompatible _and_ non-standard -W option which gives an error.  Work
9359                 # around that pitfall.
9360                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9361                 (x*c[89]9@@*-W*)
9362
9363 cf_fix_cppflags=no
9364 cf_new_cflags=
9365 cf_new_cppflags=
9366 cf_new_extra_cppflags=
9367
9368 for cf_add_cflags in $cf_pkg_cflags
9369 do
9370 case "$cf_fix_cppflags" in
9371 (no)
9372         case "$cf_add_cflags" in
9373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9374                 case "$cf_add_cflags" in
9375                 (-D*)
9376                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9377
9378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9379                                 && test -z "${cf_tst_cflags}" \
9380                                 && cf_fix_cppflags=yes
9381
9382                         if test "$cf_fix_cppflags" = yes ; then
9383
9384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9386
9387                                 continue
9388                         elif test "${cf_tst_cflags}" = "\"'" ; then
9389
9390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9392
9393                                 continue
9394                         fi
9395                         ;;
9396                 esac
9397                 case "$CPPFLAGS" in
9398                 (*$cf_add_cflags)
9399                         ;;
9400                 (*)
9401                         case "$cf_add_cflags" in
9402                         (-D*)
9403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9404
9405 CPPFLAGS=`echo "$CPPFLAGS" | \
9406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9408
9409                                 ;;
9410                         esac
9411
9412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9414
9415                         ;;
9416                 esac
9417                 ;;
9418         (*)
9419
9420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9422
9423                 ;;
9424         esac
9425         ;;
9426 (yes)
9427
9428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9430
9431         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9432
9433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9434                 && test -z "${cf_tst_cflags}" \
9435                 && cf_fix_cppflags=no
9436         ;;
9437 esac
9438 done
9439
9440 if test -n "$cf_new_cflags" ; then
9441
9442         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9443         CFLAGS="${CFLAGS}$cf_new_cflags"
9444
9445 fi
9446
9447 if test -n "$cf_new_cppflags" ; then
9448
9449         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9450         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9451
9452 fi
9453
9454 if test -n "$cf_new_extra_cppflags" ; then
9455
9456         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9457         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9458
9459 fi
9460
9461 cf_add_libs="$LIBS"
9462 # reverse order
9463 cf_add_0lib=
9464 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9465 # filter duplicates
9466 for cf_add_1lib in $cf_add_0lib; do
9467         for cf_add_2lib in $cf_add_libs; do
9468                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9469                         cf_add_1lib=
9470                         break
9471                 fi
9472         done
9473         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9474 done
9475 LIBS="$cf_add_libs"
9476
9477                         cat >"conftest.$ac_ext" <<_ACEOF
9478 #line 9478 "configure"
9479 #include "confdefs.h"
9480 #include <${cf_cv_ncurses_header:-curses.h}>
9481 int
9482 main (void)
9483 {
9484 initscr(); mousemask(0,0); tigetstr((char *)0);
9485   ;
9486   return 0;
9487 }
9488 _ACEOF
9489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9490 if { (eval echo "$as_me:9490: \"$ac_link\"") >&5
9491   (eval $ac_link) 2>&5
9492   ac_status=$?
9493   echo "$as_me:9493: \$? = $ac_status" >&5
9494   (exit "$ac_status"); } &&
9495          { ac_try='test -s "conftest$ac_exeext"'
9496   { (eval echo "$as_me:9496: \"$ac_try\"") >&5
9497   (eval $ac_try) 2>&5
9498   ac_status=$?
9499   echo "$as_me:9499: \$? = $ac_status" >&5
9500   (exit "$ac_status"); }; }; then
9501   if test "$cross_compiling" = yes; then
9502   cf_test_ncuconfig=maybe
9503 else
9504   cat >"conftest.$ac_ext" <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507 #include <${cf_cv_ncurses_header:-curses.h}>
9508                                         int main(void)
9509                                         { const char *xx = curses_version(); return (xx == 0); }
9510 _ACEOF
9511 rm -f "conftest$ac_exeext"
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9517   { (eval echo "$as_me:9517: \"$ac_try\"") >&5
9518   (eval $ac_try) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit "$ac_status"); }; }; then
9522   cf_test_ncuconfig=yes
9523 else
9524   echo "$as_me: program exited with status $ac_status" >&5
9525 echo "$as_me: failed program was:" >&5
9526 cat "conftest.$ac_ext" >&5
9527 cf_test_ncuconfig=no
9528 fi
9529 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9530 fi
9531 else
9532   echo "$as_me: failed program was:" >&5
9533 cat "conftest.$ac_ext" >&5
9534 cf_test_ncuconfig=no
9535 fi
9536 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9537
9538                         CFLAGS="$cf_save_CFLAGS"
9539                         CPPFLAGS="$cf_save_CPPFLAGS"
9540                         LIBS="$cf_save_LIBS"
9541
9542                         if test "x$cf_test_ncuconfig" != xyes; then
9543                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9544                                 cf_pkg_cflags="$cf_temp"
9545                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9546                                 cf_pkg_libs="$cf_temp"
9547                         fi
9548                         ;;
9549                 esac
9550
9551 for cf_add_cflags in $cf_pkg_cflags
9552 do
9553
9554 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9555 cf_old_cflag="$CFLAGS"
9556
9557 case "$CFLAGS" in
9558 (*$cf_add_cflags=*)
9559         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
9560         ;;
9561 (*$cf_add_cflags\ *)
9562         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
9563         ;;
9564 (*$cf_add_cflags)
9565         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
9566         ;;
9567 esac
9568
9569 if test "$CFLAGS" != "$cf_old_cflag" ;
9570 then
9571
9572         CFLAGS="$cf_new_cflag"
9573 fi
9574
9575 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9576 cf_old_cflag="$CPPFLAGS"
9577
9578 case "$CPPFLAGS" in
9579 (*$cf_add_cflags=*)
9580         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
9581         ;;
9582 (*$cf_add_cflags\ *)
9583         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
9584         ;;
9585 (*$cf_add_cflags)
9586         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
9587         ;;
9588 esac
9589
9590 if test "$CPPFLAGS" != "$cf_old_cflag" ;
9591 then
9592
9593         CPPFLAGS="$cf_new_cflag"
9594 fi
9595
9596 done
9597
9598 cf_fix_cppflags=no
9599 cf_new_cflags=
9600 cf_new_cppflags=
9601 cf_new_extra_cppflags=
9602
9603 for cf_add_cflags in $cf_pkg_cflags
9604 do
9605 case "$cf_fix_cppflags" in
9606 (no)
9607         case "$cf_add_cflags" in
9608         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9609                 case "$cf_add_cflags" in
9610                 (-D*)
9611                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9612
9613                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9614                                 && test -z "${cf_tst_cflags}" \
9615                                 && cf_fix_cppflags=yes
9616
9617                         if test "$cf_fix_cppflags" = yes ; then
9618
9619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9621
9622                                 continue
9623                         elif test "${cf_tst_cflags}" = "\"'" ; then
9624
9625         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9626         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9627
9628                                 continue
9629                         fi
9630                         ;;
9631                 esac
9632                 case "$CPPFLAGS" in
9633                 (*$cf_add_cflags)
9634                         ;;
9635                 (*)
9636                         case "$cf_add_cflags" in
9637                         (-D*)
9638                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9639
9640 CPPFLAGS=`echo "$CPPFLAGS" | \
9641         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9642                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9643
9644                                 ;;
9645                         esac
9646
9647         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9648         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9649
9650                         ;;
9651                 esac
9652                 ;;
9653         (*)
9654
9655         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9656         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9657
9658                 ;;
9659         esac
9660         ;;
9661 (yes)
9662
9663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9665
9666         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9667
9668         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9669                 && test -z "${cf_tst_cflags}" \
9670                 && cf_fix_cppflags=no
9671         ;;
9672 esac
9673 done
9674
9675 if test -n "$cf_new_cflags" ; then
9676
9677         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9678         CFLAGS="${CFLAGS}$cf_new_cflags"
9679
9680 fi
9681
9682 if test -n "$cf_new_cppflags" ; then
9683
9684         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9685         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9686
9687 fi
9688
9689 if test -n "$cf_new_extra_cppflags" ; then
9690
9691         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9692         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9693
9694 fi
9695
9696 cf_add_libs="$LIBS"
9697 # reverse order
9698 cf_add_0lib=
9699 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9700 # filter duplicates
9701 for cf_add_1lib in $cf_add_0lib; do
9702         for cf_add_2lib in $cf_add_libs; do
9703                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9704                         cf_add_1lib=
9705                         break
9706                 fi
9707         done
9708         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9709 done
9710 LIBS="$cf_add_libs"
9711
9712                 cat >"conftest.$ac_ext" <<_ACEOF
9713 #line 9713 "configure"
9714 #include "confdefs.h"
9715 #include <${cf_cv_ncurses_header:-curses.h}>
9716 int
9717 main (void)
9718 {
9719 initscr(); mousemask(0,0); tigetstr((char *)0);
9720   ;
9721   return 0;
9722 }
9723 _ACEOF
9724 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9725 if { (eval echo "$as_me:9725: \"$ac_link\"") >&5
9726   (eval $ac_link) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit "$ac_status"); } &&
9730          { ac_try='test -s "conftest$ac_exeext"'
9731   { (eval echo "$as_me:9731: \"$ac_try\"") >&5
9732   (eval $ac_try) 2>&5
9733   ac_status=$?
9734   echo "$as_me:9734: \$? = $ac_status" >&5
9735   (exit "$ac_status"); }; }; then
9736   if test "$cross_compiling" = yes; then
9737   cf_have_ncuconfig=maybe
9738 else
9739   cat >"conftest.$ac_ext" <<_ACEOF
9740 #line 9740 "configure"
9741 #include "confdefs.h"
9742 #include <${cf_cv_ncurses_header:-curses.h}>
9743                                 int main(void)
9744                                 { const char *xx = curses_version(); return (xx == 0); }
9745 _ACEOF
9746 rm -f "conftest$ac_exeext"
9747 if { (eval echo "$as_me:9747: \"$ac_link\"") >&5
9748   (eval $ac_link) 2>&5
9749   ac_status=$?
9750   echo "$as_me:9750: \$? = $ac_status" >&5
9751   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9752   { (eval echo "$as_me:9752: \"$ac_try\"") >&5
9753   (eval $ac_try) 2>&5
9754   ac_status=$?
9755   echo "$as_me:9755: \$? = $ac_status" >&5
9756   (exit "$ac_status"); }; }; then
9757   cf_have_ncuconfig=yes
9758 else
9759   echo "$as_me: program exited with status $ac_status" >&5
9760 echo "$as_me: failed program was:" >&5
9761 cat "conftest.$ac_ext" >&5
9762 cf_have_ncuconfig=no
9763 fi
9764 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9765 fi
9766 else
9767   echo "$as_me: failed program was:" >&5
9768 cat "conftest.$ac_ext" >&5
9769 cf_have_ncuconfig=no
9770 fi
9771 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9772                 echo "$as_me:9772: result: $cf_have_ncuconfig" >&5
9773 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9774                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9775                 if test "$cf_have_ncuconfig" != "yes"
9776                 then
9777                         CPPFLAGS="$cf_save_CPPFLAGS"
9778                         LIBS="$cf_save_LIBS"
9779                         NCURSES_CONFIG_PKG=none
9780                 else
9781
9782 cat >>confdefs.h <<\EOF
9783 #define NCURSES 1
9784 EOF
9785
9786                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9787
9788 echo "$as_me:9788: checking for terminfo header" >&5
9789 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9790 if test "${cf_cv_term_header+set}" = set; then
9791   echo $ECHO_N "(cached) $ECHO_C" >&6
9792 else
9793
9794 case "${cf_cv_ncurses_header}" in
9795 (*/ncurses.h|*/ncursesw.h)
9796         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9797         ;;
9798 (*)
9799         cf_term_header=term.h
9800         ;;
9801 esac
9802
9803 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9804 do
9805 cat >"conftest.$ac_ext" <<_ACEOF
9806 #line 9806 "configure"
9807 #include "confdefs.h"
9808 #include <stdio.h>
9809 #include <${cf_cv_ncurses_header:-curses.h}>
9810 #include <$cf_test>
9811
9812 int
9813 main (void)
9814 {
9815 int x = auto_left_margin; (void)x
9816   ;
9817   return 0;
9818 }
9819 _ACEOF
9820 rm -f "conftest.$ac_objext"
9821 if { (eval echo "$as_me:9821: \"$ac_compile\"") >&5
9822   (eval $ac_compile) 2>&5
9823   ac_status=$?
9824   echo "$as_me:9824: \$? = $ac_status" >&5
9825   (exit "$ac_status"); } &&
9826          { ac_try='test -s "conftest.$ac_objext"'
9827   { (eval echo "$as_me:9827: \"$ac_try\"") >&5
9828   (eval $ac_try) 2>&5
9829   ac_status=$?
9830   echo "$as_me:9830: \$? = $ac_status" >&5
9831   (exit "$ac_status"); }; }; then
9832
9833         cf_cv_term_header="$cf_test"
9834 else
9835   echo "$as_me: failed program was:" >&5
9836 cat "conftest.$ac_ext" >&5
9837
9838         cf_cv_term_header=unknown
9839
9840 fi
9841 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9842         test "$cf_cv_term_header" != unknown && break
9843 done
9844
9845 fi
9846 echo "$as_me:9846: result: $cf_cv_term_header" >&5
9847 echo "${ECHO_T}$cf_cv_term_header" >&6
9848
9849 # Set definitions to allow ifdef'ing to accommodate subdirectories
9850
9851 case "$cf_cv_term_header" in
9852 (*term.h)
9853
9854 cat >>confdefs.h <<\EOF
9855 #define HAVE_TERM_H 1
9856 EOF
9857
9858         ;;
9859 esac
9860
9861 case "$cf_cv_term_header" in
9862 (ncurses/term.h)
9863
9864 cat >>confdefs.h <<\EOF
9865 #define HAVE_NCURSES_TERM_H 1
9866 EOF
9867
9868         ;;
9869 (ncursesw/term.h)
9870
9871 cat >>confdefs.h <<\EOF
9872 #define HAVE_NCURSESW_TERM_H 1
9873 EOF
9874
9875         ;;
9876 esac
9877
9878                 fi
9879
9880         else
9881                 echo "$as_me:9881: result: no" >&5
9882 echo "${ECHO_T}no" >&6
9883                 NCURSES_CONFIG_PKG=none
9884         fi
9885 else
9886         NCURSES_CONFIG_PKG=none
9887 fi
9888
9889 if test "x$cf_have_ncuconfig" = "xno"; then
9890         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9891
9892 if test -n "$ac_tool_prefix"; then
9893   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9894   do
9895     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9896 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9897 echo "$as_me:9897: checking for $ac_word" >&5
9898 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9899 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9900   echo $ECHO_N "(cached) $ECHO_C" >&6
9901 else
9902   if test -n "$NCURSES_CONFIG"; then
9903   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9904 else
9905   ac_save_IFS=$IFS; IFS=$ac_path_separator
9906 ac_dummy="$PATH"
9907 for ac_dir in $ac_dummy; do
9908   IFS=$ac_save_IFS
9909   test -z "$ac_dir" && ac_dir=.
9910   $as_executable_p "$ac_dir/$ac_word" || continue
9911 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9912 echo "$as_me:9912: found $ac_dir/$ac_word" >&5
9913 break
9914 done
9915
9916 fi
9917 fi
9918 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9919 if test -n "$NCURSES_CONFIG"; then
9920   echo "$as_me:9920: result: $NCURSES_CONFIG" >&5
9921 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9922 else
9923   echo "$as_me:9923: result: no" >&5
9924 echo "${ECHO_T}no" >&6
9925 fi
9926
9927     test -n "$NCURSES_CONFIG" && break
9928   done
9929 fi
9930 if test -z "$NCURSES_CONFIG"; then
9931   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9932   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9933 do
9934   # Extract the first word of "$ac_prog", so it can be a program name with args.
9935 set dummy $ac_prog; ac_word=$2
9936 echo "$as_me:9936: checking for $ac_word" >&5
9937 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9938 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9939   echo $ECHO_N "(cached) $ECHO_C" >&6
9940 else
9941   if test -n "$ac_ct_NCURSES_CONFIG"; then
9942   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9943 else
9944   ac_save_IFS=$IFS; IFS=$ac_path_separator
9945 ac_dummy="$PATH"
9946 for ac_dir in $ac_dummy; do
9947   IFS=$ac_save_IFS
9948   test -z "$ac_dir" && ac_dir=.
9949   $as_executable_p "$ac_dir/$ac_word" || continue
9950 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9951 echo "$as_me:9951: found $ac_dir/$ac_word" >&5
9952 break
9953 done
9954
9955 fi
9956 fi
9957 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9958 if test -n "$ac_ct_NCURSES_CONFIG"; then
9959   echo "$as_me:9959: result: $ac_ct_NCURSES_CONFIG" >&5
9960 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9961 else
9962   echo "$as_me:9962: result: no" >&5
9963 echo "${ECHO_T}no" >&6
9964 fi
9965
9966   test -n "$ac_ct_NCURSES_CONFIG" && break
9967 done
9968 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9969
9970   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9971 fi
9972
9973         if test "$NCURSES_CONFIG" != none ; then
9974
9975 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9976 do
9977
9978 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9979 cf_old_cflag="$CFLAGS"
9980
9981 case "$CFLAGS" in
9982 (*$cf_add_cflags=*)
9983         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
9984         ;;
9985 (*$cf_add_cflags\ *)
9986         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
9987         ;;
9988 (*$cf_add_cflags)
9989         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
9990         ;;
9991 esac
9992
9993 if test "$CFLAGS" != "$cf_old_cflag" ;
9994 then
9995
9996         CFLAGS="$cf_new_cflag"
9997 fi
9998
9999 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10000 cf_old_cflag="$CPPFLAGS"
10001
10002 case "$CPPFLAGS" in
10003 (*$cf_add_cflags=*)
10004         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
10005         ;;
10006 (*$cf_add_cflags\ *)
10007         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
10008         ;;
10009 (*$cf_add_cflags)
10010         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
10011         ;;
10012 esac
10013
10014 if test "$CPPFLAGS" != "$cf_old_cflag" ;
10015 then
10016
10017         CPPFLAGS="$cf_new_cflag"
10018 fi
10019
10020 done
10021
10022 cf_fix_cppflags=no
10023 cf_new_cflags=
10024 cf_new_cppflags=
10025 cf_new_extra_cppflags=
10026
10027 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10028 do
10029 case "$cf_fix_cppflags" in
10030 (no)
10031         case "$cf_add_cflags" in
10032         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10033                 case "$cf_add_cflags" in
10034                 (-D*)
10035                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10036
10037                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10038                                 && test -z "${cf_tst_cflags}" \
10039                                 && cf_fix_cppflags=yes
10040
10041                         if test "$cf_fix_cppflags" = yes ; then
10042
10043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10045
10046                                 continue
10047                         elif test "${cf_tst_cflags}" = "\"'" ; then
10048
10049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10051
10052                                 continue
10053                         fi
10054                         ;;
10055                 esac
10056                 case "$CPPFLAGS" in
10057                 (*$cf_add_cflags)
10058                         ;;
10059                 (*)
10060                         case "$cf_add_cflags" in
10061                         (-D*)
10062                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10063
10064 CPPFLAGS=`echo "$CPPFLAGS" | \
10065         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10066                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10067
10068                                 ;;
10069                         esac
10070
10071         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10072         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10073
10074                         ;;
10075                 esac
10076                 ;;
10077         (*)
10078
10079         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10080         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10081
10082                 ;;
10083         esac
10084         ;;
10085 (yes)
10086
10087         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10088         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10089
10090         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10091
10092         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10093                 && test -z "${cf_tst_cflags}" \
10094                 && cf_fix_cppflags=no
10095         ;;
10096 esac
10097 done
10098
10099 if test -n "$cf_new_cflags" ; then
10100
10101         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10102         CFLAGS="${CFLAGS}$cf_new_cflags"
10103
10104 fi
10105
10106 if test -n "$cf_new_cppflags" ; then
10107
10108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10109         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10110
10111 fi
10112
10113 if test -n "$cf_new_extra_cppflags" ; then
10114
10115         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10116         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10117
10118 fi
10119
10120 cf_add_libs="$LIBS"
10121 # reverse order
10122 cf_add_0lib=
10123 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10124 # filter duplicates
10125 for cf_add_1lib in $cf_add_0lib; do
10126         for cf_add_2lib in $cf_add_libs; do
10127                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10128                         cf_add_1lib=
10129                         break
10130                 fi
10131         done
10132         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10133 done
10134 LIBS="$cf_add_libs"
10135
10136                 # even with config script, some packages use no-override for curses.h
10137
10138 echo "$as_me:10138: checking if we have identified curses headers" >&5
10139 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10140 if test "${cf_cv_ncurses_header+set}" = set; then
10141   echo $ECHO_N "(cached) $ECHO_C" >&6
10142 else
10143
10144 cf_cv_ncurses_header=none
10145 for cf_header in \
10146         ncurses.h ncurses/ncurses.h \
10147         curses.h ncurses/curses.h
10148 do
10149 cat >"conftest.$ac_ext" <<_ACEOF
10150 #line 10150 "configure"
10151 #include "confdefs.h"
10152 #include <${cf_header}>
10153 int
10154 main (void)
10155 {
10156 initscr(); tgoto("?", 0,0)
10157   ;
10158   return 0;
10159 }
10160 _ACEOF
10161 rm -f "conftest.$ac_objext"
10162 if { (eval echo "$as_me:10162: \"$ac_compile\"") >&5
10163   (eval $ac_compile) 2>&5
10164   ac_status=$?
10165   echo "$as_me:10165: \$? = $ac_status" >&5
10166   (exit "$ac_status"); } &&
10167          { ac_try='test -s "conftest.$ac_objext"'
10168   { (eval echo "$as_me:10168: \"$ac_try\"") >&5
10169   (eval $ac_try) 2>&5
10170   ac_status=$?
10171   echo "$as_me:10171: \$? = $ac_status" >&5
10172   (exit "$ac_status"); }; }; then
10173   cf_cv_ncurses_header=$cf_header; break
10174 else
10175   echo "$as_me: failed program was:" >&5
10176 cat "conftest.$ac_ext" >&5
10177 fi
10178 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10179 done
10180
10181 fi
10182 echo "$as_me:10182: result: $cf_cv_ncurses_header" >&5
10183 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10184
10185 if test "$cf_cv_ncurses_header" = none ; then
10186         { { echo "$as_me:10186: error: No curses header-files found" >&5
10187 echo "$as_me: error: No curses header-files found" >&2;}
10188    { (exit 1); exit 1; }; }
10189 fi
10190
10191 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10192
10193 for ac_header in $cf_cv_ncurses_header
10194 do
10195 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10196 echo "$as_me:10196: checking for $ac_header" >&5
10197 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10198 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10199   echo $ECHO_N "(cached) $ECHO_C" >&6
10200 else
10201   cat >"conftest.$ac_ext" <<_ACEOF
10202 #line 10202 "configure"
10203 #include "confdefs.h"
10204 #include <$ac_header>
10205 _ACEOF
10206 if { (eval echo "$as_me:10206: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10207   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10208   ac_status=$?
10209   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10210   rm -f conftest.er1
10211   cat conftest.err >&5
10212   echo "$as_me:10212: \$? = $ac_status" >&5
10213   (exit "$ac_status"); } >/dev/null; then
10214   if test -s conftest.err; then
10215     ac_cpp_err=$ac_c_preproc_warn_flag
10216   else
10217     ac_cpp_err=
10218   fi
10219 else
10220   ac_cpp_err=yes
10221 fi
10222 if test -z "$ac_cpp_err"; then
10223   eval "$as_ac_Header=yes"
10224 else
10225   echo "$as_me: failed program was:" >&5
10226   cat "conftest.$ac_ext" >&5
10227   eval "$as_ac_Header=no"
10228 fi
10229 rm -f conftest.err "conftest.$ac_ext"
10230 fi
10231 echo "$as_me:10231: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10232 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10233 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10234   cat >>confdefs.h <<EOF
10235 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10236 EOF
10237
10238 fi
10239 done
10240
10241 cat >>confdefs.h <<\EOF
10242 #define NCURSES 1
10243 EOF
10244
10245 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10246
10247                 cat >>confdefs.h <<EOF
10248 #define $cf_nculib_ROOT 1
10249 EOF
10250
10251                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10252
10253         else
10254
10255 cf_ncuhdr_root=ncurses
10256
10257 test -n "$cf_cv_curses_dir" && \
10258 test "$cf_cv_curses_dir" != "no" && { \
10259
10260 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10261   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10262   do
10263         while test "$cf_add_incdir" != /usr/include
10264         do
10265           if test -d "$cf_add_incdir"
10266           then
10267                 cf_have_incdir=no
10268                 if test -n "$CFLAGS$CPPFLAGS" ; then
10269                   # a loop is needed to ensure we can add subdirs of existing dirs
10270                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10271                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10272                           cf_have_incdir=yes; break
10273                         fi
10274                   done
10275                 fi
10276
10277                 if test "$cf_have_incdir" = no ; then
10278                   if test "$cf_add_incdir" = /usr/local/include ; then
10279                         if test "$GCC" = yes
10280                         then
10281                           cf_save_CPPFLAGS=$CPPFLAGS
10282
10283         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10284         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10285
10286                           cat >"conftest.$ac_ext" <<_ACEOF
10287 #line 10287 "configure"
10288 #include "confdefs.h"
10289 #include <stdio.h>
10290 int
10291 main (void)
10292 {
10293 printf("Hello")
10294   ;
10295   return 0;
10296 }
10297 _ACEOF
10298 rm -f "conftest.$ac_objext"
10299 if { (eval echo "$as_me:10299: \"$ac_compile\"") >&5
10300   (eval $ac_compile) 2>&5
10301   ac_status=$?
10302   echo "$as_me:10302: \$? = $ac_status" >&5
10303   (exit "$ac_status"); } &&
10304          { ac_try='test -s "conftest.$ac_objext"'
10305   { (eval echo "$as_me:10305: \"$ac_try\"") >&5
10306   (eval $ac_try) 2>&5
10307   ac_status=$?
10308   echo "$as_me:10308: \$? = $ac_status" >&5
10309   (exit "$ac_status"); }; }; then
10310   :
10311 else
10312   echo "$as_me: failed program was:" >&5
10313 cat "conftest.$ac_ext" >&5
10314 cf_have_incdir=yes
10315 fi
10316 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10317                           CPPFLAGS=$cf_save_CPPFLAGS
10318                         fi
10319                   fi
10320                 fi
10321
10322                 if test "$cf_have_incdir" = no ; then
10323                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10324
10325 echo "${as_me:-configure}:10325: testing adding $cf_add_incdir to include-path ..." 1>&5
10326
10327                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10328
10329                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10330                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10331                   cf_add_incdir="$cf_top_incdir"
10332                 else
10333                   break
10334                 fi
10335           else
10336                 break
10337           fi
10338         done
10339   done
10340 fi
10341
10342 }
10343
10344 echo "$as_me:10344: checking for $cf_ncuhdr_root header in include-path" >&5
10345 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10346 if test "${cf_cv_ncurses_h+set}" = set; then
10347   echo $ECHO_N "(cached) $ECHO_C" >&6
10348 else
10349
10350         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10351         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10352         for cf_header in $cf_header_list
10353         do
10354
10355         cat >"conftest.$ac_ext" <<_ACEOF
10356 #line 10356 "configure"
10357 #include "confdefs.h"
10358
10359 #include <$cf_header>
10360 int
10361 main (void)
10362 {
10363
10364 #ifdef NCURSES_VERSION
10365
10366 printf("%s\\n", NCURSES_VERSION);
10367 #else
10368 #ifdef __NCURSES_H
10369 printf("old\\n");
10370 #else
10371         make an error
10372 #endif
10373 #endif
10374
10375   ;
10376   return 0;
10377 }
10378 _ACEOF
10379 rm -f "conftest.$ac_objext"
10380 if { (eval echo "$as_me:10380: \"$ac_compile\"") >&5
10381   (eval $ac_compile) 2>&5
10382   ac_status=$?
10383   echo "$as_me:10383: \$? = $ac_status" >&5
10384   (exit "$ac_status"); } &&
10385          { ac_try='test -s "conftest.$ac_objext"'
10386   { (eval echo "$as_me:10386: \"$ac_try\"") >&5
10387   (eval $ac_try) 2>&5
10388   ac_status=$?
10389   echo "$as_me:10389: \$? = $ac_status" >&5
10390   (exit "$ac_status"); }; }; then
10391   cf_cv_ncurses_h=$cf_header
10392
10393 else
10394   echo "$as_me: failed program was:" >&5
10395 cat "conftest.$ac_ext" >&5
10396 cf_cv_ncurses_h=no
10397 fi
10398 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10399
10400                 test "$cf_cv_ncurses_h" != no && break
10401         done
10402
10403 fi
10404 echo "$as_me:10404: result: $cf_cv_ncurses_h" >&5
10405 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10406
10407 if test "$cf_cv_ncurses_h" != no ; then
10408         cf_cv_ncurses_header=$cf_cv_ncurses_h
10409 else
10410
10411 echo "$as_me:10411: checking for $cf_ncuhdr_root include-path" >&5
10412 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10413 if test "${cf_cv_ncurses_h2+set}" = set; then
10414   echo $ECHO_N "(cached) $ECHO_C" >&6
10415 else
10416
10417         test -n "$verbose" && echo
10418
10419 cf_search=
10420
10421 # collect the current set of include-directories from compiler flags
10422 cf_header_path_list=""
10423 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10424         for cf_header_path in $CPPFLAGS $CFLAGS
10425         do
10426                 case "$cf_header_path" in
10427                 (-I*)
10428                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10429
10430 test "x$cf_header_path" != "xNONE" && \
10431 test -d "$cf_header_path" && \
10432  {
10433         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10434         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10435         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10436         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10437         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10438         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"
10439 }
10440
10441                         cf_header_path_list="$cf_header_path_list $cf_search"
10442                         ;;
10443                 esac
10444         done
10445 fi
10446
10447 # add the variations for the package we are looking for
10448
10449 cf_search=
10450
10451 test "x$prefix" != "xNONE" && \
10452 test -d "$prefix" && \
10453  {
10454         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10455         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10456         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10457         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10458         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10459         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10460 }
10461
10462 for cf_subdir_prefix in \
10463         /usr \
10464         /usr/local \
10465         /usr/pkg \
10466         /opt \
10467         /opt/local \
10468         $HOME
10469 do
10470
10471 test "x$cf_subdir_prefix" != "x$prefix" && \
10472 test -d "$cf_subdir_prefix" && \
10473 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10474         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10475         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10476         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10477         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10478         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10479         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"
10480 }
10481
10482 done
10483
10484 test "$includedir" != NONE && \
10485 test "$includedir" != "/usr/include" && \
10486 test -d "$includedir" && {
10487         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10488         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10489 }
10490
10491 test "$oldincludedir" != NONE && \
10492 test "$oldincludedir" != "/usr/include" && \
10493 test -d "$oldincludedir" && {
10494         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10495         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10496 }
10497
10498 cf_search="$cf_search $cf_header_path_list"
10499
10500         test -n "$verbose" && echo "search path $cf_search"
10501         cf_save2_CPPFLAGS="$CPPFLAGS"
10502         for cf_incdir in $cf_search
10503         do
10504
10505 if test -n "$cf_incdir" ; then
10506   for cf_add_incdir in $cf_incdir
10507   do
10508         while test "$cf_add_incdir" != /usr/include
10509         do
10510           if test -d "$cf_add_incdir"
10511           then
10512                 cf_have_incdir=no
10513                 if test -n "$CFLAGS$CPPFLAGS" ; then
10514                   # a loop is needed to ensure we can add subdirs of existing dirs
10515                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10516                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10517                           cf_have_incdir=yes; break
10518                         fi
10519                   done
10520                 fi
10521
10522                 if test "$cf_have_incdir" = no ; then
10523                   if test "$cf_add_incdir" = /usr/local/include ; then
10524                         if test "$GCC" = yes
10525                         then
10526                           cf_save_CPPFLAGS=$CPPFLAGS
10527
10528         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10529         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10530
10531                           cat >"conftest.$ac_ext" <<_ACEOF
10532 #line 10532 "configure"
10533 #include "confdefs.h"
10534 #include <stdio.h>
10535 int
10536 main (void)
10537 {
10538 printf("Hello")
10539   ;
10540   return 0;
10541 }
10542 _ACEOF
10543 rm -f "conftest.$ac_objext"
10544 if { (eval echo "$as_me:10544: \"$ac_compile\"") >&5
10545   (eval $ac_compile) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit "$ac_status"); } &&
10549          { ac_try='test -s "conftest.$ac_objext"'
10550   { (eval echo "$as_me:10550: \"$ac_try\"") >&5
10551   (eval $ac_try) 2>&5
10552   ac_status=$?
10553   echo "$as_me:10553: \$? = $ac_status" >&5
10554   (exit "$ac_status"); }; }; then
10555   :
10556 else
10557   echo "$as_me: failed program was:" >&5
10558 cat "conftest.$ac_ext" >&5
10559 cf_have_incdir=yes
10560 fi
10561 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10562                           CPPFLAGS=$cf_save_CPPFLAGS
10563                         fi
10564                   fi
10565                 fi
10566
10567                 if test "$cf_have_incdir" = no ; then
10568                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10569
10570 echo "${as_me:-configure}:10570: testing adding $cf_add_incdir to include-path ..." 1>&5
10571
10572                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10573
10574                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10575                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10576                   cf_add_incdir="$cf_top_incdir"
10577                 else
10578                   break
10579                 fi
10580           else
10581                 break
10582           fi
10583         done
10584   done
10585 fi
10586
10587                 for cf_header in \
10588                         ncurses.h \
10589                         curses.h
10590                 do
10591
10592         cat >"conftest.$ac_ext" <<_ACEOF
10593 #line 10593 "configure"
10594 #include "confdefs.h"
10595
10596 #include <$cf_header>
10597 int
10598 main (void)
10599 {
10600
10601 #ifdef NCURSES_VERSION
10602
10603 printf("%s\\n", NCURSES_VERSION);
10604 #else
10605 #ifdef __NCURSES_H
10606 printf("old\\n");
10607 #else
10608         make an error
10609 #endif
10610 #endif
10611
10612   ;
10613   return 0;
10614 }
10615 _ACEOF
10616 rm -f "conftest.$ac_objext"
10617 if { (eval echo "$as_me:10617: \"$ac_compile\"") >&5
10618   (eval $ac_compile) 2>&5
10619   ac_status=$?
10620   echo "$as_me:10620: \$? = $ac_status" >&5
10621   (exit "$ac_status"); } &&
10622          { ac_try='test -s "conftest.$ac_objext"'
10623   { (eval echo "$as_me:10623: \"$ac_try\"") >&5
10624   (eval $ac_try) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit "$ac_status"); }; }; then
10628   cf_cv_ncurses_h2=$cf_header
10629
10630 else
10631   echo "$as_me: failed program was:" >&5
10632 cat "conftest.$ac_ext" >&5
10633 cf_cv_ncurses_h2=no
10634 fi
10635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10636
10637                         if test "$cf_cv_ncurses_h2" != no ; then
10638                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10639                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10640                                 break
10641                         fi
10642                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10643                 done
10644                 CPPFLAGS="$cf_save2_CPPFLAGS"
10645                 test "$cf_cv_ncurses_h2" != no && break
10646         done
10647         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10647: error: not found" >&5
10648 echo "$as_me: error: not found" >&2;}
10649    { (exit 1); exit 1; }; }
10650
10651 fi
10652 echo "$as_me:10652: result: $cf_cv_ncurses_h2" >&5
10653 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10654
10655         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10656         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10657         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10658                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10659         fi
10660
10661 if test -n "$cf_1st_incdir" ; then
10662   for cf_add_incdir in $cf_1st_incdir
10663   do
10664         while test "$cf_add_incdir" != /usr/include
10665         do
10666           if test -d "$cf_add_incdir"
10667           then
10668                 cf_have_incdir=no
10669                 if test -n "$CFLAGS$CPPFLAGS" ; then
10670                   # a loop is needed to ensure we can add subdirs of existing dirs
10671                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10672                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10673                           cf_have_incdir=yes; break
10674                         fi
10675                   done
10676                 fi
10677
10678                 if test "$cf_have_incdir" = no ; then
10679                   if test "$cf_add_incdir" = /usr/local/include ; then
10680                         if test "$GCC" = yes
10681                         then
10682                           cf_save_CPPFLAGS=$CPPFLAGS
10683
10684         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10685         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10686
10687                           cat >"conftest.$ac_ext" <<_ACEOF
10688 #line 10688 "configure"
10689 #include "confdefs.h"
10690 #include <stdio.h>
10691 int
10692 main (void)
10693 {
10694 printf("Hello")
10695   ;
10696   return 0;
10697 }
10698 _ACEOF
10699 rm -f "conftest.$ac_objext"
10700 if { (eval echo "$as_me:10700: \"$ac_compile\"") >&5
10701   (eval $ac_compile) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit "$ac_status"); } &&
10705          { ac_try='test -s "conftest.$ac_objext"'
10706   { (eval echo "$as_me:10706: \"$ac_try\"") >&5
10707   (eval $ac_try) 2>&5
10708   ac_status=$?
10709   echo "$as_me:10709: \$? = $ac_status" >&5
10710   (exit "$ac_status"); }; }; then
10711   :
10712 else
10713   echo "$as_me: failed program was:" >&5
10714 cat "conftest.$ac_ext" >&5
10715 cf_have_incdir=yes
10716 fi
10717 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10718                           CPPFLAGS=$cf_save_CPPFLAGS
10719                         fi
10720                   fi
10721                 fi
10722
10723                 if test "$cf_have_incdir" = no ; then
10724                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10725
10726 echo "${as_me:-configure}:10726: testing adding $cf_add_incdir to include-path ..." 1>&5
10727
10728                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10729
10730                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10731                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10732                   cf_add_incdir="$cf_top_incdir"
10733                 else
10734                   break
10735                 fi
10736           else
10737                 break
10738           fi
10739         done
10740   done
10741 fi
10742
10743 fi
10744
10745 # Set definitions to allow ifdef'ing for ncurses.h
10746
10747 case "$cf_cv_ncurses_header" in
10748 (*ncurses.h)
10749
10750 cat >>confdefs.h <<\EOF
10751 #define HAVE_NCURSES_H 1
10752 EOF
10753
10754         ;;
10755 esac
10756
10757 case "$cf_cv_ncurses_header" in
10758 (ncurses/curses.h|ncurses/ncurses.h)
10759
10760 cat >>confdefs.h <<\EOF
10761 #define HAVE_NCURSES_NCURSES_H 1
10762 EOF
10763
10764         ;;
10765 (ncursesw/curses.h|ncursesw/ncurses.h)
10766
10767 cat >>confdefs.h <<\EOF
10768 #define HAVE_NCURSESW_NCURSES_H 1
10769 EOF
10770
10771         ;;
10772 esac
10773
10774 echo "$as_me:10774: checking for terminfo header" >&5
10775 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10776 if test "${cf_cv_term_header+set}" = set; then
10777   echo $ECHO_N "(cached) $ECHO_C" >&6
10778 else
10779
10780 case "${cf_cv_ncurses_header}" in
10781 (*/ncurses.h|*/ncursesw.h)
10782         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10783         ;;
10784 (*)
10785         cf_term_header=term.h
10786         ;;
10787 esac
10788
10789 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10790 do
10791 cat >"conftest.$ac_ext" <<_ACEOF
10792 #line 10792 "configure"
10793 #include "confdefs.h"
10794 #include <stdio.h>
10795 #include <${cf_cv_ncurses_header:-curses.h}>
10796 #include <$cf_test>
10797
10798 int
10799 main (void)
10800 {
10801 int x = auto_left_margin; (void)x
10802   ;
10803   return 0;
10804 }
10805 _ACEOF
10806 rm -f "conftest.$ac_objext"
10807 if { (eval echo "$as_me:10807: \"$ac_compile\"") >&5
10808   (eval $ac_compile) 2>&5
10809   ac_status=$?
10810   echo "$as_me:10810: \$? = $ac_status" >&5
10811   (exit "$ac_status"); } &&
10812          { ac_try='test -s "conftest.$ac_objext"'
10813   { (eval echo "$as_me:10813: \"$ac_try\"") >&5
10814   (eval $ac_try) 2>&5
10815   ac_status=$?
10816   echo "$as_me:10816: \$? = $ac_status" >&5
10817   (exit "$ac_status"); }; }; then
10818
10819         cf_cv_term_header="$cf_test"
10820 else
10821   echo "$as_me: failed program was:" >&5
10822 cat "conftest.$ac_ext" >&5
10823
10824         cf_cv_term_header=unknown
10825
10826 fi
10827 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10828         test "$cf_cv_term_header" != unknown && break
10829 done
10830
10831 fi
10832 echo "$as_me:10832: result: $cf_cv_term_header" >&5
10833 echo "${ECHO_T}$cf_cv_term_header" >&6
10834
10835 # Set definitions to allow ifdef'ing to accommodate subdirectories
10836
10837 case "$cf_cv_term_header" in
10838 (*term.h)
10839
10840 cat >>confdefs.h <<\EOF
10841 #define HAVE_TERM_H 1
10842 EOF
10843
10844         ;;
10845 esac
10846
10847 case "$cf_cv_term_header" in
10848 (ncurses/term.h)
10849
10850 cat >>confdefs.h <<\EOF
10851 #define HAVE_NCURSES_TERM_H 1
10852 EOF
10853
10854         ;;
10855 (ncursesw/term.h)
10856
10857 cat >>confdefs.h <<\EOF
10858 #define HAVE_NCURSESW_TERM_H 1
10859 EOF
10860
10861         ;;
10862 esac
10863
10864 # some applications need this, but should check for NCURSES_VERSION
10865
10866 cat >>confdefs.h <<\EOF
10867 #define NCURSES 1
10868 EOF
10869
10870 echo "$as_me:10870: checking for ncurses version" >&5
10871 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10872 if test "${cf_cv_ncurses_version+set}" = set; then
10873   echo $ECHO_N "(cached) $ECHO_C" >&6
10874 else
10875
10876         cf_cv_ncurses_version=no
10877         cf_tempfile=out$$
10878         rm -f "$cf_tempfile"
10879         if test "$cross_compiling" = yes; then
10880
10881         # This will not work if the preprocessor splits the line after the
10882         # Autoconf token.  The 'unproto' program does that.
10883         cat > "conftest.$ac_ext" <<EOF
10884 #include <${cf_cv_ncurses_header:-curses.h}>
10885 #undef Autoconf
10886 #ifdef NCURSES_VERSION
10887 Autoconf NCURSES_VERSION
10888 #else
10889 #ifdef __NCURSES_H
10890 Autoconf "old"
10891 #endif
10892 ;
10893 #endif
10894 EOF
10895         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10896         { (eval echo "$as_me:10896: \"$cf_try\"") >&5
10897   (eval $cf_try) 2>&5
10898   ac_status=$?
10899   echo "$as_me:10899: \$? = $ac_status" >&5
10900   (exit "$ac_status"); }
10901         if test -f conftest.out ; then
10902                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10903                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10904                 rm -f conftest.out
10905         fi
10906
10907 else
10908   cat >"conftest.$ac_ext" <<_ACEOF
10909 #line 10909 "configure"
10910 #include "confdefs.h"
10911
10912 #include <${cf_cv_ncurses_header:-curses.h}>
10913 #include <stdio.h>
10914 int main(void)
10915 {
10916         FILE *fp = fopen("$cf_tempfile", "w");
10917 #ifdef NCURSES_VERSION
10918 # ifdef NCURSES_VERSION_PATCH
10919         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10920 # else
10921         fprintf(fp, "%s\\n", NCURSES_VERSION);
10922 # endif
10923 #else
10924 # ifdef __NCURSES_H
10925         fprintf(fp, "old\\n");
10926 # else
10927         make an error
10928 # endif
10929 #endif
10930         ${cf_cv_main_return:-return}(0);
10931 }
10932 _ACEOF
10933 rm -f "conftest$ac_exeext"
10934 if { (eval echo "$as_me:10934: \"$ac_link\"") >&5
10935   (eval $ac_link) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10939   { (eval echo "$as_me:10939: \"$ac_try\"") >&5
10940   (eval $ac_try) 2>&5
10941   ac_status=$?
10942   echo "$as_me:10942: \$? = $ac_status" >&5
10943   (exit "$ac_status"); }; }; then
10944
10945         cf_cv_ncurses_version=`cat $cf_tempfile`
10946 else
10947   echo "$as_me: program exited with status $ac_status" >&5
10948 echo "$as_me: failed program was:" >&5
10949 cat "conftest.$ac_ext" >&5
10950 fi
10951 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10952 fi
10953         rm -f "$cf_tempfile"
10954
10955 fi
10956 echo "$as_me:10956: result: $cf_cv_ncurses_version" >&5
10957 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10958 test "$cf_cv_ncurses_version" = no ||
10959 cat >>confdefs.h <<\EOF
10960 #define NCURSES 1
10961 EOF
10962
10963 cf_nculib_root=ncurses
10964         # This works, except for the special case where we find gpm, but
10965         # ncurses is in a nonstandard location via $LIBS, and we really want
10966         # to link gpm.
10967 cf_ncurses_LIBS=""
10968 cf_ncurses_SAVE="$LIBS"
10969 echo "$as_me:10969: checking for Gpm_Open in -lgpm" >&5
10970 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10971 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10972   echo $ECHO_N "(cached) $ECHO_C" >&6
10973 else
10974   ac_check_lib_save_LIBS=$LIBS
10975 LIBS="-lgpm  $LIBS"
10976 cat >"conftest.$ac_ext" <<_ACEOF
10977 #line 10977 "configure"
10978 #include "confdefs.h"
10979
10980 /* Override any gcc2 internal prototype to avoid an error.  */
10981 #ifdef __cplusplus
10982 extern "C"
10983 #endif
10984 /* We use char because int might match the return type of a gcc2
10985    builtin and then its argument prototype would still apply.  */
10986 char Gpm_Open ();
10987 int
10988 main (void)
10989 {
10990 Gpm_Open ();
10991   ;
10992   return 0;
10993 }
10994 _ACEOF
10995 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10996 if { (eval echo "$as_me:10996: \"$ac_link\"") >&5
10997   (eval $ac_link) 2>&5
10998   ac_status=$?
10999   echo "$as_me:10999: \$? = $ac_status" >&5
11000   (exit "$ac_status"); } &&
11001          { ac_try='test -s "conftest$ac_exeext"'
11002   { (eval echo "$as_me:11002: \"$ac_try\"") >&5
11003   (eval $ac_try) 2>&5
11004   ac_status=$?
11005   echo "$as_me:11005: \$? = $ac_status" >&5
11006   (exit "$ac_status"); }; }; then
11007   ac_cv_lib_gpm_Gpm_Open=yes
11008 else
11009   echo "$as_me: failed program was:" >&5
11010 cat "conftest.$ac_ext" >&5
11011 ac_cv_lib_gpm_Gpm_Open=no
11012 fi
11013 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11014 LIBS=$ac_check_lib_save_LIBS
11015 fi
11016 echo "$as_me:11016: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11017 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11018 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11019   echo "$as_me:11019: checking for initscr in -lgpm" >&5
11020 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11021 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11022   echo $ECHO_N "(cached) $ECHO_C" >&6
11023 else
11024   ac_check_lib_save_LIBS=$LIBS
11025 LIBS="-lgpm  $LIBS"
11026 cat >"conftest.$ac_ext" <<_ACEOF
11027 #line 11027 "configure"
11028 #include "confdefs.h"
11029
11030 /* Override any gcc2 internal prototype to avoid an error.  */
11031 #ifdef __cplusplus
11032 extern "C"
11033 #endif
11034 /* We use char because int might match the return type of a gcc2
11035    builtin and then its argument prototype would still apply.  */
11036 char initscr ();
11037 int
11038 main (void)
11039 {
11040 initscr ();
11041   ;
11042   return 0;
11043 }
11044 _ACEOF
11045 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11046 if { (eval echo "$as_me:11046: \"$ac_link\"") >&5
11047   (eval $ac_link) 2>&5
11048   ac_status=$?
11049   echo "$as_me:11049: \$? = $ac_status" >&5
11050   (exit "$ac_status"); } &&
11051          { ac_try='test -s "conftest$ac_exeext"'
11052   { (eval echo "$as_me:11052: \"$ac_try\"") >&5
11053   (eval $ac_try) 2>&5
11054   ac_status=$?
11055   echo "$as_me:11055: \$? = $ac_status" >&5
11056   (exit "$ac_status"); }; }; then
11057   ac_cv_lib_gpm_initscr=yes
11058 else
11059   echo "$as_me: failed program was:" >&5
11060 cat "conftest.$ac_ext" >&5
11061 ac_cv_lib_gpm_initscr=no
11062 fi
11063 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11064 LIBS=$ac_check_lib_save_LIBS
11065 fi
11066 echo "$as_me:11066: result: $ac_cv_lib_gpm_initscr" >&5
11067 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11068 if test "$ac_cv_lib_gpm_initscr" = yes; then
11069   LIBS="$cf_ncurses_SAVE"
11070 else
11071   cf_ncurses_LIBS="-lgpm"
11072 fi
11073
11074 fi
11075
11076 case "$host_os" in
11077 (freebsd*)
11078         # This is only necessary if you are linking against an obsolete
11079         # version of ncurses (but it should do no harm, since it's static).
11080         if test "$cf_nculib_root" = ncurses ; then
11081                 echo "$as_me:11081: checking for tgoto in -lmytinfo" >&5
11082 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11083 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11084   echo $ECHO_N "(cached) $ECHO_C" >&6
11085 else
11086   ac_check_lib_save_LIBS=$LIBS
11087 LIBS="-lmytinfo  $LIBS"
11088 cat >"conftest.$ac_ext" <<_ACEOF
11089 #line 11089 "configure"
11090 #include "confdefs.h"
11091
11092 /* Override any gcc2 internal prototype to avoid an error.  */
11093 #ifdef __cplusplus
11094 extern "C"
11095 #endif
11096 /* We use char because int might match the return type of a gcc2
11097    builtin and then its argument prototype would still apply.  */
11098 char tgoto ();
11099 int
11100 main (void)
11101 {
11102 tgoto ();
11103   ;
11104   return 0;
11105 }
11106 _ACEOF
11107 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11108 if { (eval echo "$as_me:11108: \"$ac_link\"") >&5
11109   (eval $ac_link) 2>&5
11110   ac_status=$?
11111   echo "$as_me:11111: \$? = $ac_status" >&5
11112   (exit "$ac_status"); } &&
11113          { ac_try='test -s "conftest$ac_exeext"'
11114   { (eval echo "$as_me:11114: \"$ac_try\"") >&5
11115   (eval $ac_try) 2>&5
11116   ac_status=$?
11117   echo "$as_me:11117: \$? = $ac_status" >&5
11118   (exit "$ac_status"); }; }; then
11119   ac_cv_lib_mytinfo_tgoto=yes
11120 else
11121   echo "$as_me: failed program was:" >&5
11122 cat "conftest.$ac_ext" >&5
11123 ac_cv_lib_mytinfo_tgoto=no
11124 fi
11125 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11126 LIBS=$ac_check_lib_save_LIBS
11127 fi
11128 echo "$as_me:11128: result: $ac_cv_lib_mytinfo_tgoto" >&5
11129 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11130 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11131   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11132 fi
11133
11134         fi
11135         ;;
11136 esac
11137
11138 cf_add_libs="$LIBS"
11139 # reverse order
11140 cf_add_0lib=
11141 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11142 # filter duplicates
11143 for cf_add_1lib in $cf_add_0lib; do
11144         for cf_add_2lib in $cf_add_libs; do
11145                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11146                         cf_add_1lib=
11147                         break
11148                 fi
11149         done
11150         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11151 done
11152 LIBS="$cf_add_libs"
11153
11154 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11155 then
11156
11157 cf_add_libs="$LIBS"
11158 # reverse order
11159 cf_add_0lib=
11160 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11161 # filter duplicates
11162 for cf_add_1lib in $cf_add_0lib; do
11163         for cf_add_2lib in $cf_add_libs; do
11164                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11165                         cf_add_1lib=
11166                         break
11167                 fi
11168         done
11169         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11170 done
11171 LIBS="$cf_add_libs"
11172
11173 else
11174
11175         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11176         cf_libdir=""
11177         echo "$as_me:11177: checking for initscr" >&5
11178 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11179 if test "${ac_cv_func_initscr+set}" = set; then
11180   echo $ECHO_N "(cached) $ECHO_C" >&6
11181 else
11182   cat >"conftest.$ac_ext" <<_ACEOF
11183 #line 11183 "configure"
11184 #include "confdefs.h"
11185 #define initscr autoconf_temporary
11186 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11187 #undef initscr
11188
11189 #ifdef __cplusplus
11190 extern "C"
11191 #endif
11192
11193 /* We use char because int might match the return type of a gcc2
11194    builtin and then its argument prototype would still apply.  */
11195 char initscr (void);
11196
11197 int
11198 main (void)
11199 {
11200
11201 /* The GNU C library defines stubs for functions which it implements
11202     to always fail with ENOSYS.  Some functions are actually named
11203     something starting with __ and the normal name is an alias.  */
11204 #if defined (__stub_initscr) || defined (__stub___initscr)
11205 #error found stub for initscr
11206 #endif
11207
11208         return initscr ();
11209   ;
11210   return 0;
11211 }
11212 _ACEOF
11213 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11214 if { (eval echo "$as_me:11214: \"$ac_link\"") >&5
11215   (eval $ac_link) 2>&5
11216   ac_status=$?
11217   echo "$as_me:11217: \$? = $ac_status" >&5
11218   (exit "$ac_status"); } &&
11219          { ac_try='test -s "conftest$ac_exeext"'
11220   { (eval echo "$as_me:11220: \"$ac_try\"") >&5
11221   (eval $ac_try) 2>&5
11222   ac_status=$?
11223   echo "$as_me:11223: \$? = $ac_status" >&5
11224   (exit "$ac_status"); }; }; then
11225   ac_cv_func_initscr=yes
11226 else
11227   echo "$as_me: failed program was:" >&5
11228 cat "conftest.$ac_ext" >&5
11229 ac_cv_func_initscr=no
11230 fi
11231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11232 fi
11233 echo "$as_me:11233: result: $ac_cv_func_initscr" >&5
11234 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11235 if test "$ac_cv_func_initscr" = yes; then
11236   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11237 else
11238
11239                 cf_save_LIBS="$LIBS"
11240                 echo "$as_me:11240: checking for initscr in -l$cf_nculib_root" >&5
11241 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11242                 LIBS="-l$cf_nculib_root $LIBS"
11243                 cat >"conftest.$ac_ext" <<_ACEOF
11244 #line 11244 "configure"
11245 #include "confdefs.h"
11246 #include <${cf_cv_ncurses_header:-curses.h}>
11247 int
11248 main (void)
11249 {
11250 initscr()
11251   ;
11252   return 0;
11253 }
11254 _ACEOF
11255 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11256 if { (eval echo "$as_me:11256: \"$ac_link\"") >&5
11257   (eval $ac_link) 2>&5
11258   ac_status=$?
11259   echo "$as_me:11259: \$? = $ac_status" >&5
11260   (exit "$ac_status"); } &&
11261          { ac_try='test -s "conftest$ac_exeext"'
11262   { (eval echo "$as_me:11262: \"$ac_try\"") >&5
11263   (eval $ac_try) 2>&5
11264   ac_status=$?
11265   echo "$as_me:11265: \$? = $ac_status" >&5
11266   (exit "$ac_status"); }; }; then
11267   echo "$as_me:11267: result: yes" >&5
11268 echo "${ECHO_T}yes" >&6
11269                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11270
11271 else
11272   echo "$as_me: failed program was:" >&5
11273 cat "conftest.$ac_ext" >&5
11274 echo "$as_me:11274: result: no" >&5
11275 echo "${ECHO_T}no" >&6
11276
11277 cf_search=
11278 cf_library_path_list=""
11279 if test -n "${LDFLAGS}${LIBS}" ; then
11280         for cf_library_path in $LDFLAGS $LIBS
11281         do
11282                 case "$cf_library_path" in
11283                 (-L*)
11284                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11285
11286 test "x$cf_library_path" != "xNONE" && \
11287 test -d "$cf_library_path" && \
11288  {
11289         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11290         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11291         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11292         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11293         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11294         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"
11295 }
11296
11297                         cf_library_path_list="$cf_library_path_list $cf_search"
11298                         ;;
11299                 esac
11300         done
11301 fi
11302
11303 cf_search=
11304
11305 test "x$prefix" != "xNONE" && \
11306 test -d "$prefix" && \
11307  {
11308         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11309         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11310         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11311         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11312         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11313         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11314 }
11315
11316 for cf_subdir_prefix in \
11317         /usr \
11318         /usr/local \
11319         /usr/pkg \
11320         /opt \
11321         /opt/local \
11322         $HOME
11323 do
11324
11325 test "x$cf_subdir_prefix" != "x$prefix" && \
11326 test -d "$cf_subdir_prefix" && \
11327 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11328         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11329         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11330         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11331         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11332         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11333         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"
11334 }
11335
11336 done
11337
11338 cf_search="$cf_library_path_list $cf_search"
11339
11340                         for cf_libdir in $cf_search
11341                         do
11342                                 echo "$as_me:11342: checking for -l$cf_nculib_root in $cf_libdir" >&5
11343 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11344                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11345                                 cat >"conftest.$ac_ext" <<_ACEOF
11346 #line 11346 "configure"
11347 #include "confdefs.h"
11348 #include <${cf_cv_ncurses_header:-curses.h}>
11349 int
11350 main (void)
11351 {
11352 initscr()
11353   ;
11354   return 0;
11355 }
11356 _ACEOF
11357 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11358 if { (eval echo "$as_me:11358: \"$ac_link\"") >&5
11359   (eval $ac_link) 2>&5
11360   ac_status=$?
11361   echo "$as_me:11361: \$? = $ac_status" >&5
11362   (exit "$ac_status"); } &&
11363          { ac_try='test -s "conftest$ac_exeext"'
11364   { (eval echo "$as_me:11364: \"$ac_try\"") >&5
11365   (eval $ac_try) 2>&5
11366   ac_status=$?
11367   echo "$as_me:11367: \$? = $ac_status" >&5
11368   (exit "$ac_status"); }; }; then
11369   echo "$as_me:11369: result: yes" >&5
11370 echo "${ECHO_T}yes" >&6
11371                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11372                                          break
11373 else
11374   echo "$as_me: failed program was:" >&5
11375 cat "conftest.$ac_ext" >&5
11376 echo "$as_me:11376: result: no" >&5
11377 echo "${ECHO_T}no" >&6
11378                                          LIBS="$cf_save_LIBS"
11379 fi
11380 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11381                         done
11382
11383 fi
11384 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11385
11386 fi
11387
11388 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11389
11390 if test "$cf_found_library" = no ; then
11391         { { echo "$as_me:11391: error: Cannot link $cf_nculib_root library" >&5
11392 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11393    { (exit 1); exit 1; }; }
11394 fi
11395
11396 fi
11397
11398 if test -n "$cf_ncurses_LIBS" ; then
11399         echo "$as_me:11399: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11400 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11401         cf_ncurses_SAVE="$LIBS"
11402         for p in $cf_ncurses_LIBS ; do
11403                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11404                 if test "$q" != "$LIBS" ; then
11405                         LIBS="$q"
11406                 fi
11407         done
11408         cat >"conftest.$ac_ext" <<_ACEOF
11409 #line 11409 "configure"
11410 #include "confdefs.h"
11411 #include <${cf_cv_ncurses_header:-curses.h}>
11412 int
11413 main (void)
11414 {
11415 initscr(); mousemask(0,0); tigetstr((char *)0);
11416   ;
11417   return 0;
11418 }
11419 _ACEOF
11420 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11421 if { (eval echo "$as_me:11421: \"$ac_link\"") >&5
11422   (eval $ac_link) 2>&5
11423   ac_status=$?
11424   echo "$as_me:11424: \$? = $ac_status" >&5
11425   (exit "$ac_status"); } &&
11426          { ac_try='test -s "conftest$ac_exeext"'
11427   { (eval echo "$as_me:11427: \"$ac_try\"") >&5
11428   (eval $ac_try) 2>&5
11429   ac_status=$?
11430   echo "$as_me:11430: \$? = $ac_status" >&5
11431   (exit "$ac_status"); }; }; then
11432   echo "$as_me:11432: result: yes" >&5
11433 echo "${ECHO_T}yes" >&6
11434 else
11435   echo "$as_me: failed program was:" >&5
11436 cat "conftest.$ac_ext" >&5
11437 echo "$as_me:11437: result: no" >&5
11438 echo "${ECHO_T}no" >&6
11439                  LIBS="$cf_ncurses_SAVE"
11440 fi
11441 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11442 fi
11443
11444 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11445
11446 cat >>confdefs.h <<EOF
11447 #define $cf_nculib_ROOT 1
11448 EOF
11449
11450         fi
11451 else
11452         NCURSES_CONFIG=none
11453 fi
11454
11455 fi
11456
11457 if test "$NCURSES_CONFIG_PKG" != none ; then
11458         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11459
11460         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11461         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11462         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11463
11464         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11465         if test -z "$cf_cv_abi_version"
11466         then
11467                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11468         fi
11469
11470 elif test "$NCURSES_CONFIG" != none ; then
11471
11472         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11473
11474         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11475         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11476         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11477
11478         # ABI version is not available from headers
11479         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11480
11481 else
11482
11483         for cf_name in MAJOR MINOR PATCH
11484         do
11485         cat >conftest.$ac_ext <<CF_EOF
11486         #include <${cf_cv_ncurses_header:-curses.h}>
11487         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11488 CF_EOF
11489                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11490                 { (eval echo "$as_me:11490: \"$cf_try\"") >&5
11491   (eval $cf_try) 2>&5
11492   ac_status=$?
11493   echo "$as_me:11493: \$? = $ac_status" >&5
11494   (exit "$ac_status"); }
11495                 if test -f conftest.out ; then
11496                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11497                         eval NCURSES_$cf_name=\"$cf_result\"
11498                         # cat conftest.$ac_ext
11499                         # cat conftest.out
11500                 fi
11501         done
11502
11503         cf_cv_abi_version=${NCURSES_MAJOR}
11504
11505 fi
11506
11507 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11508
11509 cf_cv_timestamp=`date`
11510
11511 echo "$as_me:11511: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11512 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11513
11514 echo "$as_me:11514: checking if you want to have a library-prefix" >&5
11515 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11516
11517 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11518 if test "${with_lib_prefix+set}" = set; then
11519   withval="$with_lib_prefix"
11520   with_lib_prefix=$withval
11521 else
11522   with_lib_prefix=auto
11523 fi;
11524 echo "$as_me:11524: result: $with_lib_prefix" >&5
11525 echo "${ECHO_T}$with_lib_prefix" >&6
11526
11527 if test "$with_lib_prefix" = auto
11528 then
11529
11530         case "$cf_cv_system_name" in
11531         (OS/2*|os2*)
11532                 if test "$DFT_LWR_MODEL" = libtool; then
11533                         LIB_PREFIX='lib'
11534                 else
11535                         LIB_PREFIX=''
11536                 fi
11537                 ;;
11538         (*-msvc*)
11539                 LIB_PREFIX=''
11540                 ;;
11541         (*)     LIB_PREFIX='lib'
11542                 ;;
11543         esac
11544 cf_prefix=$LIB_PREFIX
11545
11546 elif test "$with_lib_prefix" = no
11547 then
11548         LIB_PREFIX=
11549 else
11550         LIB_PREFIX=$with_lib_prefix
11551 fi
11552
11553 LIB_SUFFIX=
11554
11555 ###############################################################################
11556
11557 if test X"$CC_G_OPT" = X"" ; then
11558         CC_G_OPT='-g'
11559         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11560 fi
11561
11562 echo "$as_me:11562: checking for default loader flags" >&5
11563 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11564 case $DFT_LWR_MODEL in
11565 (normal)  LD_MODEL=''   ;;
11566 (debug)   LD_MODEL=$CC_G_OPT ;;
11567 (profile) LD_MODEL='-pg';;
11568 (shared)  LD_MODEL=''   ;;
11569 esac
11570 echo "$as_me:11570: result: $LD_MODEL" >&5
11571 echo "${ECHO_T}$LD_MODEL" >&6
11572
11573 LD_RPATH_OPT=
11574 if test "x$cf_cv_enable_rpath" != xno
11575 then
11576         echo "$as_me:11576: checking for an rpath option" >&5
11577 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11578         case "$cf_cv_system_name" in
11579         (irix*)
11580                 if test "$GCC" = yes; then
11581                         LD_RPATH_OPT="-Wl,-rpath,"
11582                 else
11583                         LD_RPATH_OPT="-rpath "
11584                 fi
11585                 ;;
11586         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11587                 LD_RPATH_OPT="-Wl,-rpath,"
11588                 ;;
11589         (openbsd[2-9].*|mirbsd*)
11590                 LD_RPATH_OPT="-Wl,-rpath,"
11591                 ;;
11592         (dragonfly*)
11593                 LD_RPATH_OPT="-rpath "
11594                 ;;
11595         (netbsd*)
11596                 LD_RPATH_OPT="-Wl,-rpath,"
11597                 ;;
11598         (osf*|mls+*)
11599                 LD_RPATH_OPT="-rpath "
11600                 ;;
11601         (solaris2*)
11602                 LD_RPATH_OPT="-R"
11603                 ;;
11604         (*)
11605                 ;;
11606         esac
11607         echo "$as_me:11607: result: $LD_RPATH_OPT" >&5
11608 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11609
11610         case "x$LD_RPATH_OPT" in
11611         (x-R*)
11612                 echo "$as_me:11612: checking if we need a space after rpath option" >&5
11613 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11614                 cf_save_LIBS="$LIBS"
11615
11616 cf_add_libs="$LIBS"
11617 # reverse order
11618 cf_add_0lib=
11619 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11620 # filter duplicates
11621 for cf_add_1lib in $cf_add_0lib; do
11622         for cf_add_2lib in $cf_add_libs; do
11623                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11624                         cf_add_1lib=
11625                         break
11626                 fi
11627         done
11628         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11629 done
11630 LIBS="$cf_add_libs"
11631
11632                 cat >"conftest.$ac_ext" <<_ACEOF
11633 #line 11633 "configure"
11634 #include "confdefs.h"
11635
11636 int
11637 main (void)
11638 {
11639
11640   ;
11641   return 0;
11642 }
11643 _ACEOF
11644 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11645 if { (eval echo "$as_me:11645: \"$ac_link\"") >&5
11646   (eval $ac_link) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit "$ac_status"); } &&
11650          { ac_try='test -s "conftest$ac_exeext"'
11651   { (eval echo "$as_me:11651: \"$ac_try\"") >&5
11652   (eval $ac_try) 2>&5
11653   ac_status=$?
11654   echo "$as_me:11654: \$? = $ac_status" >&5
11655   (exit "$ac_status"); }; }; then
11656   cf_rpath_space=no
11657 else
11658   echo "$as_me: failed program was:" >&5
11659 cat "conftest.$ac_ext" >&5
11660 cf_rpath_space=yes
11661 fi
11662 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11663                 LIBS="$cf_save_LIBS"
11664                 echo "$as_me:11664: result: $cf_rpath_space" >&5
11665 echo "${ECHO_T}$cf_rpath_space" >&6
11666                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11667                 ;;
11668         esac
11669 fi
11670
11671         RM_SHARED_OPTS=
11672         LOCAL_LDFLAGS=
11673         LOCAL_LDFLAGS2=
11674         LD_SHARED_OPTS=
11675         INSTALL_LIB="-m 644"
11676         : ${rel_builddir:=.}
11677
11678         shlibdir=$libdir
11679
11680         MAKE_DLLS="#"
11681
11682         cf_cv_do_symlinks=no
11683         cf_ld_rpath_opt=
11684         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11685
11686         echo "$as_me:11686: checking if release/abi version should be used for shared libs" >&5
11687 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11688
11689 # Check whether --with-shlib-version or --without-shlib-version was given.
11690 if test "${with_shlib_version+set}" = set; then
11691   withval="$with_shlib_version"
11692   test -z "$withval" && withval=auto
11693         case "$withval" in
11694         (yes)
11695                 cf_cv_shlib_version=auto
11696                 ;;
11697         (rel|abi|auto)
11698                 cf_cv_shlib_version=$withval
11699                 ;;
11700         (*)
11701                 echo "$as_me:11701: result: $withval" >&5
11702 echo "${ECHO_T}$withval" >&6
11703                 { { echo "$as_me:11703: error: option value must be one of: rel, abi, or auto" >&5
11704 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11705    { (exit 1); exit 1; }; }
11706                 ;;
11707         esac
11708
11709 else
11710   cf_cv_shlib_version=auto
11711 fi;
11712         echo "$as_me:11712: result: $cf_cv_shlib_version" >&5
11713 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11714
11715         cf_cv_rm_so_locs=no
11716         cf_try_cflags=
11717
11718         # Some less-capable ports of gcc support only -fpic
11719         CC_SHARED_OPTS=
11720
11721         cf_try_fPIC=no
11722         if test "$GCC" = yes
11723         then
11724                 cf_try_fPIC=yes
11725         else
11726                 case "$cf_cv_system_name" in
11727                 (*linux*)       # e.g., PGI compiler
11728                         cf_try_fPIC=yes
11729                         ;;
11730                 esac
11731         fi
11732
11733         if test "$cf_try_fPIC" = yes
11734         then
11735                 echo "$as_me:11735: checking which $CC option to use" >&5
11736 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11737                 cf_save_CFLAGS="$CFLAGS"
11738                 for CC_SHARED_OPTS in -fPIC -fpic ''
11739                 do
11740                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11741                         cat >"conftest.$ac_ext" <<_ACEOF
11742 #line 11742 "configure"
11743 #include "confdefs.h"
11744 #include <stdio.h>
11745 int
11746 main (void)
11747 {
11748 int x = 1
11749   ;
11750   return 0;
11751 }
11752 _ACEOF
11753 rm -f "conftest.$ac_objext"
11754 if { (eval echo "$as_me:11754: \"$ac_compile\"") >&5
11755   (eval $ac_compile) 2>&5
11756   ac_status=$?
11757   echo "$as_me:11757: \$? = $ac_status" >&5
11758   (exit "$ac_status"); } &&
11759          { ac_try='test -s "conftest.$ac_objext"'
11760   { (eval echo "$as_me:11760: \"$ac_try\"") >&5
11761   (eval $ac_try) 2>&5
11762   ac_status=$?
11763   echo "$as_me:11763: \$? = $ac_status" >&5
11764   (exit "$ac_status"); }; }; then
11765   break
11766 else
11767   echo "$as_me: failed program was:" >&5
11768 cat "conftest.$ac_ext" >&5
11769 fi
11770 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11771                 done
11772                 echo "$as_me:11772: result: $CC_SHARED_OPTS" >&5
11773 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11774                 CFLAGS="$cf_save_CFLAGS"
11775         fi
11776
11777         cf_cv_shlib_version_infix=no
11778
11779         case "$cf_cv_system_name" in
11780         (aix4.3-9*|aix[5-7]*)
11781                 if test "$GCC" = yes; then
11782                         CC_SHARED_OPTS='-Wl,-brtl'
11783                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11784                 else
11785                         CC_SHARED_OPTS='-brtl'
11786                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11787                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11788                 fi
11789                 ;;
11790         (beos*)
11791                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11792                 ;;
11793         (cygwin*)
11794                 CC_SHARED_OPTS=
11795                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11796                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11797                 cf_cv_shlib_version=cygdll
11798                 cf_cv_shlib_version_infix=cygdll
11799                 shlibdir=$bindir
11800                 MAKE_DLLS=
11801                 cat >mk_shared_lib.sh <<-CF_EOF
11802                 #!$SHELL
11803                 SHARED_LIB=\$1
11804                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11805                 shift
11806                 cat <<-EOF
11807                 Linking shared library
11808                 ** SHARED_LIB \$SHARED_LIB
11809                 ** IMPORT_LIB \$IMPORT_LIB
11810 EOF
11811                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11812 CF_EOF
11813                 chmod +x mk_shared_lib.sh
11814                 ;;
11815         (msys*)
11816                 CC_SHARED_OPTS=
11817                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11818                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11819                 cf_cv_shlib_version=msysdll
11820                 cf_cv_shlib_version_infix=msysdll
11821                 shlibdir=$bindir
11822                 MAKE_DLLS=
11823                 cat >mk_shared_lib.sh <<-CF_EOF
11824                 #!$SHELL
11825                 SHARED_LIB=\$1
11826                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11827                 shift
11828                 cat <<-EOF
11829                 Linking shared library
11830                 ** SHARED_LIB \$SHARED_LIB
11831                 ** IMPORT_LIB \$IMPORT_LIB
11832 EOF
11833                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11834 CF_EOF
11835                 chmod +x mk_shared_lib.sh
11836                 ;;
11837         (darwin*)
11838                 cf_try_cflags="no-cpp-precomp"
11839                 CC_SHARED_OPTS="-dynamic"
11840                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11841                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11842                 cf_cv_shlib_version_infix=yes
11843                 echo "$as_me:11843: checking if ld -search_paths_first works" >&5
11844 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11845 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11846   echo $ECHO_N "(cached) $ECHO_C" >&6
11847 else
11848
11849                         cf_save_LDFLAGS=$LDFLAGS
11850                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11851                         cat >"conftest.$ac_ext" <<_ACEOF
11852 #line 11852 "configure"
11853 #include "confdefs.h"
11854
11855 int
11856 main (void)
11857 {
11858 int i;
11859   ;
11860   return 0;
11861 }
11862 _ACEOF
11863 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11864 if { (eval echo "$as_me:11864: \"$ac_link\"") >&5
11865   (eval $ac_link) 2>&5
11866   ac_status=$?
11867   echo "$as_me:11867: \$? = $ac_status" >&5
11868   (exit "$ac_status"); } &&
11869          { ac_try='test -s "conftest$ac_exeext"'
11870   { (eval echo "$as_me:11870: \"$ac_try\"") >&5
11871   (eval $ac_try) 2>&5
11872   ac_status=$?
11873   echo "$as_me:11873: \$? = $ac_status" >&5
11874   (exit "$ac_status"); }; }; then
11875   cf_cv_ldflags_search_paths_first=yes
11876 else
11877   echo "$as_me: failed program was:" >&5
11878 cat "conftest.$ac_ext" >&5
11879 cf_cv_ldflags_search_paths_first=no
11880 fi
11881 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11882                                 LDFLAGS=$cf_save_LDFLAGS
11883 fi
11884 echo "$as_me:11884: result: $cf_cv_ldflags_search_paths_first" >&5
11885 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11886                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11887                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11888                 fi
11889                 ;;
11890         (haiku*)
11891
11892         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11893         if test "$cf_cv_shlib_version" = rel; then
11894                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11895         else
11896                 cf_cv_shared_soname='`basename $@`'
11897         fi
11898
11899                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11900                 ;;
11901         (hpux[7-8]*)
11902                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11903                 if test "$GCC" != yes; then
11904                         CC_SHARED_OPTS='+Z'
11905                 fi
11906                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11907                 INSTALL_LIB="-m 555"
11908                 ;;
11909         (hpux*)
11910                 # (tested with gcc 2.7.2 -- I don't have c89)
11911                 if test "$GCC" = yes; then
11912                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11913                 else
11914                         CC_SHARED_OPTS='+Z'
11915                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11916                 fi
11917                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11918                 # HP-UX shared libraries must be executable, and should be
11919                 # readonly to exploit a quirk in the memory manager.
11920                 INSTALL_LIB="-m 555"
11921                 ;;
11922         (interix*)
11923                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11924                 if test "$cf_cv_shlib_version" = rel; then
11925                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11926                 else
11927                         cf_shared_soname='`basename $@`'
11928                 fi
11929                 CC_SHARED_OPTS=
11930                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11931                 ;;
11932         (irix*)
11933                 if test "$cf_cv_enable_rpath" = yes ; then
11934                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11935                 fi
11936                 # tested with IRIX 5.2 and 'cc'.
11937                 if test "$GCC" != yes; then
11938                         CC_SHARED_OPTS='-KPIC'
11939                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11940                 else
11941                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11942                 fi
11943                 cf_cv_rm_so_locs=yes
11944                 ;;
11945         (linux*|gnu*|k*bsd*-gnu)
11946                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11947                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11948                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11949                 fi
11950                 if test "$cf_cv_enable_rpath" = yes ; then
11951                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11952                 fi
11953
11954         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11955         if test "$cf_cv_shlib_version" = rel; then
11956                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11957         else
11958                 cf_cv_shared_soname='`basename $@`'
11959         fi
11960
11961                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11962                 ;;
11963         (mingw*msvc*)
11964                 cf_cv_shlib_version=msvcdll
11965                 cf_cv_shlib_version_infix=msvcdll
11966                 shlibdir=$bindir
11967                 MAKE_DLLS=
11968                 if test "$DFT_LWR_MODEL" = "shared" ; then
11969                         LOCAL_LDFLAGS="-link -dll"
11970                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11971                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11972                 fi
11973                 CC_SHARED_OPTS=
11974                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11975                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11976                 cat >mk_shared_lib.sh <<-CF_EOF
11977                 #!$SHELL
11978                 SHARED_LIB=\$1
11979                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11980                 shift
11981                 my_ld=\$1
11982                 shift
11983                 cat <<-EOF
11984                 Linking shared library
11985                 ** SHARED LIB \$SHARED_LIB
11986                 ** IMPORT_LIB \$IMPORT_LIB
11987 EOF
11988                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11989                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11990                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11991 CF_EOF
11992                 chmod +x mk_shared_lib.sh
11993                 cat >mk_prog.sh <<-CF_EOF
11994                 #!$SHELL
11995                 shift
11996                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11997                 LD="$LD"
11998                 clopts=()
11999                 ldopts=("/subsystem:console")
12000                 libs=()
12001                 isdll=0
12002                 while test \$# -gt 0; do
12003                         case "\$1" in
12004                                 -link)
12005                                         # ignore -link argument
12006                                         ;;
12007                                 -M[TD] | -M[TD]d)
12008                                         # ignore runtime-library option
12009                                         ;;
12010                                 -dll)
12011                                         isdll=1
12012                                         ;;
12013                                 -W* | -w*)
12014                                         # ignore warnings
12015                                         ;;
12016                                 -D*)
12017                                         clopts+=("\$1")
12018                                         ;;
12019                                 -I*)
12020                                         clopts+=("\$1")
12021                                         ;;
12022                                 -l*)
12023                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12024                                         ;;
12025                                 -L*)
12026                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12027                                         ;;
12028                                 *.obj | *.o)
12029                                         ldopts+=("\$1")
12030                                         ;;
12031                                 -Wl,*)
12032                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12033                                                 ldopts+=("\${linkarg}")
12034                                         done
12035                                         ;;
12036                                 *.lib)
12037                                         ldopts+=("\$1")
12038                                         ;;
12039                                 -o)
12040                                         shift
12041                                         ldopts+=("-out:\$1")
12042                                         ;;
12043                                 *)
12044                                         clopts+=("\$1")
12045                                         ldopts+=("\$1")
12046                                         ;;
12047                         esac
12048                         shift
12049                 done
12050                 if [ "\$isdll" -ne 0 ]; then
12051                         for lib in \${libs[*]}; do
12052                                 ldopts+=("\$lib.dll.lib")
12053                         done
12054                 else
12055                         for lib in \${libs[*]}; do
12056                                 ldopts+=("\$lib.lib")
12057                         done
12058                 fi
12059                 cat <<-EOF
12060                 Creating program
12061                 ** ld options:   "\${ldopts[@]}"
12062 EOF
12063                 exec \$LD \${ldopts[@]}
12064 CF_EOF
12065                 chmod +x mk_prog.sh
12066                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12067                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12068                 ;;
12069         (mingw*)
12070                 cf_cv_shlib_version=mingw
12071                 cf_cv_shlib_version_infix=mingw
12072                 shlibdir=$bindir
12073                 MAKE_DLLS=
12074                 if test "$DFT_LWR_MODEL" = "shared" ; then
12075                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12076                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12077                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12078                 fi
12079                 CC_SHARED_OPTS=
12080                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12081                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12082                 cat >mk_shared_lib.sh <<-CF_EOF
12083                 #!$SHELL
12084                 SHARED_LIB=\$1
12085                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12086                 shift
12087                 cat <<-EOF
12088                 Linking shared library
12089                 ** SHARED_LIB \$SHARED_LIB
12090                 ** IMPORT_LIB \$IMPORT_LIB
12091 EOF
12092                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12093 CF_EOF
12094                 chmod +x mk_shared_lib.sh
12095                 ;;
12096         (openbsd[2-9].*|mirbsd*)
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                 if test "$cf_cv_enable_rpath" = yes ; then
12102                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12103                 fi
12104                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12105
12106         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12107         if test "$cf_cv_shlib_version" = rel; then
12108                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12109         else
12110                 cf_cv_shared_soname='`basename $@`'
12111         fi
12112
12113                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12114                 ;;
12115         (nskJ*)
12116                 CC_SHARED_OPTS=
12117                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12118                 ;;
12119         (nskL*)
12120                 CC_SHARED_OPTS=
12121                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12122                 ;;
12123         (nto-qnx*|openbsd*|freebsd[12].*)
12124                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12125                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12126                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12127                 ;;
12128         (dragonfly*|freebsd*)
12129                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12130                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12131                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12132                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12133                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $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                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12144                 ;;
12145         (netbsd*)
12146                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12147                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12148                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12149                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12150                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12151                         if test "$cf_cv_shlib_version" = auto; then
12152                         if test -f /usr/libexec/ld.elf_so; then
12153                                 cf_cv_shlib_version=abi
12154                         else
12155                                 cf_cv_shlib_version=rel
12156                         fi
12157                         fi
12158
12159         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12160         if test "$cf_cv_shlib_version" = rel; then
12161                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12162         else
12163                 cf_cv_shared_soname='`basename $@`'
12164         fi
12165
12166                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12167                 else
12168                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12169                 fi
12170                 ;;
12171         (osf*|mls+*)
12172                 # tested with OSF/1 V3.2 and 'cc'
12173                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12174                 # link with shared libs).
12175                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12176                 case "$host_os" in
12177                 (osf4*)
12178                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12179                         ;;
12180                 esac
12181                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12182                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12183                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12184                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12185                 fi
12186                 cf_cv_rm_so_locs=yes
12187                 ;;
12188         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12189                 # tested with osr5.0.5
12190                 if test "$GCC" != yes; then
12191                         CC_SHARED_OPTS='-belf -KPIC'
12192                 fi
12193                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12194                 if test "$cf_cv_enable_rpath" = yes ; then
12195                         # only way is to set LD_RUN_PATH but no switch for it
12196                         RUN_PATH=$libdir
12197                 fi
12198                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12199                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12200                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12201                 ;;
12202         (sunos4*)
12203                 # tested with SunOS 4.1.1 and gcc 2.7.0
12204                 if test "$GCC" != yes; then
12205                         CC_SHARED_OPTS='-KPIC'
12206                 fi
12207                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12208                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12209                 ;;
12210         (solaris2*)
12211                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12212                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12213                 if test "$DFT_LWR_MODEL" = "shared" ; then
12214                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12215                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12216                 fi
12217                 if test "$cf_cv_enable_rpath" = yes ; then
12218                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12219                 fi
12220
12221         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12222         if test "$cf_cv_shlib_version" = rel; then
12223                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12224         else
12225                 cf_cv_shared_soname='`basename $@`'
12226         fi
12227
12228                 if test "$GCC" != yes; then
12229                         cf_save_CFLAGS="$CFLAGS"
12230                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12231                         do
12232                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12233                                 cat >"conftest.$ac_ext" <<_ACEOF
12234 #line 12234 "configure"
12235 #include "confdefs.h"
12236 #include <stdio.h>
12237 int
12238 main (void)
12239 {
12240 printf("Hello\\n");
12241   ;
12242   return 0;
12243 }
12244 _ACEOF
12245 rm -f "conftest.$ac_objext"
12246 if { (eval echo "$as_me:12246: \"$ac_compile\"") >&5
12247   (eval $ac_compile) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit "$ac_status"); } &&
12251          { ac_try='test -s "conftest.$ac_objext"'
12252   { (eval echo "$as_me:12252: \"$ac_try\"") >&5
12253   (eval $ac_try) 2>&5
12254   ac_status=$?
12255   echo "$as_me:12255: \$? = $ac_status" >&5
12256   (exit "$ac_status"); }; }; then
12257   break
12258 else
12259   echo "$as_me: failed program was:" >&5
12260 cat "conftest.$ac_ext" >&5
12261 fi
12262 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12263                         done
12264                         CFLAGS="$cf_save_CFLAGS"
12265                         CC_SHARED_OPTS=$cf_shared_opts
12266                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12267                 else
12268                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12269                 fi
12270                 ;;
12271         (sysv5uw7*|unix_sv*)
12272                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12273                 if test "$GCC" != yes; then
12274                         CC_SHARED_OPTS='-KPIC'
12275                 fi
12276                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12277                 ;;
12278         (*)
12279                 CC_SHARED_OPTS='unknown'
12280                 MK_SHARED_LIB='echo unknown'
12281                 ;;
12282         esac
12283
12284         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12285         case "$cf_cv_shlib_version" in
12286         (rel|abi)
12287                 case "$MK_SHARED_LIB" in
12288                 (*'-o $@')
12289                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12290                         ;;
12291                 (*)
12292                         { echo "$as_me:12292: WARNING: ignored --with-shlib-version" >&5
12293 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12294                         ;;
12295                 esac
12296                 ;;
12297         esac
12298
12299         if test -n "$cf_try_cflags"
12300         then
12301 cat > conftest.$ac_ext <<EOF
12302 #line 12302 "${as_me:-configure}"
12303 #include <stdio.h>
12304 int main(int argc, char *argv[])
12305 {
12306         printf("hello\\n");
12307         return (argv[argc-1] == 0) ;
12308 }
12309 EOF
12310                 cf_save_CFLAGS="$CFLAGS"
12311                 for cf_opt in $cf_try_cflags
12312                 do
12313                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12314                         echo "$as_me:12314: checking if CFLAGS option -$cf_opt works" >&5
12315 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12316                         if { (eval echo "$as_me:12316: \"$ac_compile\"") >&5
12317   (eval $ac_compile) 2>&5
12318   ac_status=$?
12319   echo "$as_me:12319: \$? = $ac_status" >&5
12320   (exit "$ac_status"); }; then
12321                                 echo "$as_me:12321: result: yes" >&5
12322 echo "${ECHO_T}yes" >&6
12323                                 cf_save_CFLAGS="$CFLAGS"
12324                         else
12325                                 echo "$as_me:12325: result: no" >&5
12326 echo "${ECHO_T}no" >&6
12327                         fi
12328                 done
12329                 CFLAGS="$cf_save_CFLAGS"
12330         fi
12331
12332         # RPATH_LIST is a colon-separated list of directories
12333         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12334         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12335
12336         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12337
12338         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12339
12340 echo "${as_me:-configure}:12340: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12341
12342         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12343
12344 echo "${as_me:-configure}:12344: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12345
12346 # The test/sample programs in the original tree link using rpath option.
12347 # Make it optional for packagers.
12348 if test -n "$LOCAL_LDFLAGS"
12349 then
12350         echo "$as_me:12350: checking if you want to link sample programs with rpath option" >&5
12351 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12352
12353 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12354 if test "${enable_rpath_link+set}" = set; then
12355   enableval="$enable_rpath_link"
12356   with_rpath_link=$enableval
12357 else
12358   with_rpath_link=yes
12359 fi;
12360         echo "$as_me:12360: result: $with_rpath_link" >&5
12361 echo "${ECHO_T}$with_rpath_link" >&6
12362         if test "$with_rpath_link" = no
12363         then
12364                 LOCAL_LDFLAGS=
12365                 LOCAL_LDFLAGS2=
12366         fi
12367 fi
12368
12369 ###############################################################################
12370
12371 ###   use option --enable-broken-linker to force on use of broken-linker support
12372
12373 echo "$as_me:12373: checking if you want broken-linker support code" >&5
12374 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12375
12376 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12377 if test "${enable_broken_linker+set}" = set; then
12378   enableval="$enable_broken_linker"
12379   with_broken_linker=$enableval
12380 else
12381   with_broken_linker=no
12382 fi;
12383 echo "$as_me:12383: result: $with_broken_linker" >&5
12384 echo "${ECHO_T}$with_broken_linker" >&6
12385
12386 : "${BROKEN_LINKER:=0}"
12387 if test "x$with_broken_linker" = xyes ; then
12388
12389 cat >>confdefs.h <<\EOF
12390 #define BROKEN_LINKER 1
12391 EOF
12392
12393         BROKEN_LINKER=1
12394 fi
12395
12396 # Check to define _XOPEN_SOURCE "automatically"
12397
12398 echo "$as_me:12398: checking if the POSIX test-macros are already defined" >&5
12399 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12400 if test "${cf_cv_posix_visible+set}" = set; then
12401   echo $ECHO_N "(cached) $ECHO_C" >&6
12402 else
12403
12404 cat >"conftest.$ac_ext" <<_ACEOF
12405 #line 12405 "configure"
12406 #include "confdefs.h"
12407 #include <stdio.h>
12408 int
12409 main (void)
12410 {
12411
12412 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12413         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12414         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12415         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12416 #error conflicting symbols found
12417 #endif
12418
12419   ;
12420   return 0;
12421 }
12422 _ACEOF
12423 rm -f "conftest.$ac_objext"
12424 if { (eval echo "$as_me:12424: \"$ac_compile\"") >&5
12425   (eval $ac_compile) 2>&5
12426   ac_status=$?
12427   echo "$as_me:12427: \$? = $ac_status" >&5
12428   (exit "$ac_status"); } &&
12429          { ac_try='test -s "conftest.$ac_objext"'
12430   { (eval echo "$as_me:12430: \"$ac_try\"") >&5
12431   (eval $ac_try) 2>&5
12432   ac_status=$?
12433   echo "$as_me:12433: \$? = $ac_status" >&5
12434   (exit "$ac_status"); }; }; then
12435   cf_cv_posix_visible=no
12436 else
12437   echo "$as_me: failed program was:" >&5
12438 cat "conftest.$ac_ext" >&5
12439 cf_cv_posix_visible=yes
12440 fi
12441 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12442
12443 fi
12444 echo "$as_me:12444: result: $cf_cv_posix_visible" >&5
12445 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12446
12447 if test "$cf_cv_posix_visible" = no; then
12448
12449 cf_XOPEN_SOURCE=600
12450 cf_POSIX_C_SOURCE=199506L
12451 cf_xopen_source=
12452
12453 case "$host_os" in
12454 (aix[4-7]*)
12455         cf_xopen_source="-D_ALL_SOURCE"
12456         ;;
12457 (msys)
12458         cf_XOPEN_SOURCE=600
12459         ;;
12460 (darwin[0-8].*)
12461         cf_xopen_source="-D_APPLE_C_SOURCE"
12462         ;;
12463 (darwin*)
12464         cf_xopen_source="-D_DARWIN_C_SOURCE"
12465         cf_XOPEN_SOURCE=
12466         ;;
12467 (freebsd*|dragonfly*|midnightbsd*)
12468         # 5.x headers associate
12469         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12470         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12471         cf_POSIX_C_SOURCE=200112L
12472         cf_XOPEN_SOURCE=600
12473         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12474         ;;
12475 (hpux11*)
12476         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12477         ;;
12478 (hpux*)
12479         cf_xopen_source="-D_HPUX_SOURCE"
12480         ;;
12481 (irix[56].*)
12482         cf_xopen_source="-D_SGI_SOURCE"
12483         cf_XOPEN_SOURCE=
12484         ;;
12485 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12486
12487 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12488
12489 echo "$as_me:12489: checking if this is the GNU C library" >&5
12490 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12491 if test "${cf_cv_gnu_library+set}" = set; then
12492   echo $ECHO_N "(cached) $ECHO_C" >&6
12493 else
12494
12495 cat >"conftest.$ac_ext" <<_ACEOF
12496 #line 12496 "configure"
12497 #include "confdefs.h"
12498 #include <sys/types.h>
12499 int
12500 main (void)
12501 {
12502
12503         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12504                 return 0;
12505         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12506                 return 0;
12507         #else
12508         #       error not GNU C library
12509         #endif
12510   ;
12511   return 0;
12512 }
12513 _ACEOF
12514 rm -f "conftest.$ac_objext"
12515 if { (eval echo "$as_me:12515: \"$ac_compile\"") >&5
12516   (eval $ac_compile) 2>&5
12517   ac_status=$?
12518   echo "$as_me:12518: \$? = $ac_status" >&5
12519   (exit "$ac_status"); } &&
12520          { ac_try='test -s "conftest.$ac_objext"'
12521   { (eval echo "$as_me:12521: \"$ac_try\"") >&5
12522   (eval $ac_try) 2>&5
12523   ac_status=$?
12524   echo "$as_me:12524: \$? = $ac_status" >&5
12525   (exit "$ac_status"); }; }; then
12526   cf_cv_gnu_library=yes
12527 else
12528   echo "$as_me: failed program was:" >&5
12529 cat "conftest.$ac_ext" >&5
12530 cf_cv_gnu_library=no
12531 fi
12532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12533
12534 fi
12535 echo "$as_me:12535: result: $cf_cv_gnu_library" >&5
12536 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12537
12538 if test x$cf_cv_gnu_library = xyes; then
12539
12540         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12541         # was changed to help a little.  newlib incorporated the change about 4
12542         # years later.
12543         echo "$as_me:12543: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12544 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12545 if test "${cf_cv_gnu_library_219+set}" = set; then
12546   echo $ECHO_N "(cached) $ECHO_C" >&6
12547 else
12548
12549                 cf_save="$CPPFLAGS"
12550
12551         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12552         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12553
12554                 cat >"conftest.$ac_ext" <<_ACEOF
12555 #line 12555 "configure"
12556 #include "confdefs.h"
12557 #include <sys/types.h>
12558 int
12559 main (void)
12560 {
12561
12562                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12563                                 return 0;
12564                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12565                                 return 0;
12566                         #else
12567                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12568                         #endif
12569   ;
12570   return 0;
12571 }
12572 _ACEOF
12573 rm -f "conftest.$ac_objext"
12574 if { (eval echo "$as_me:12574: \"$ac_compile\"") >&5
12575   (eval $ac_compile) 2>&5
12576   ac_status=$?
12577   echo "$as_me:12577: \$? = $ac_status" >&5
12578   (exit "$ac_status"); } &&
12579          { ac_try='test -s "conftest.$ac_objext"'
12580   { (eval echo "$as_me:12580: \"$ac_try\"") >&5
12581   (eval $ac_try) 2>&5
12582   ac_status=$?
12583   echo "$as_me:12583: \$? = $ac_status" >&5
12584   (exit "$ac_status"); }; }; then
12585   cf_cv_gnu_library_219=yes
12586 else
12587   echo "$as_me: failed program was:" >&5
12588 cat "conftest.$ac_ext" >&5
12589 cf_cv_gnu_library_219=no
12590 fi
12591 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12592                 CPPFLAGS="$cf_save"
12593
12594 fi
12595 echo "$as_me:12595: result: $cf_cv_gnu_library_219" >&5
12596 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12597
12598         if test "x$cf_cv_gnu_library_219" = xyes; then
12599                 cf_save="$CPPFLAGS"
12600                 echo "$as_me:12600: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12601 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12602 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12603   echo $ECHO_N "(cached) $ECHO_C" >&6
12604 else
12605
12606 cf_fix_cppflags=no
12607 cf_new_cflags=
12608 cf_new_cppflags=
12609 cf_new_extra_cppflags=
12610
12611 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12612 do
12613 case "$cf_fix_cppflags" in
12614 (no)
12615         case "$cf_add_cflags" in
12616         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12617                 case "$cf_add_cflags" in
12618                 (-D*)
12619                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12620
12621                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12622                                 && test -z "${cf_tst_cflags}" \
12623                                 && cf_fix_cppflags=yes
12624
12625                         if test "$cf_fix_cppflags" = yes ; then
12626
12627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12629
12630                                 continue
12631                         elif test "${cf_tst_cflags}" = "\"'" ; then
12632
12633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12635
12636                                 continue
12637                         fi
12638                         ;;
12639                 esac
12640                 case "$CPPFLAGS" in
12641                 (*$cf_add_cflags)
12642                         ;;
12643                 (*)
12644                         case "$cf_add_cflags" in
12645                         (-D*)
12646                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12647
12648 CPPFLAGS=`echo "$CPPFLAGS" | \
12649         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12650                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12651
12652                                 ;;
12653                         esac
12654
12655         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12656         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12657
12658                         ;;
12659                 esac
12660                 ;;
12661         (*)
12662
12663         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12664         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12665
12666                 ;;
12667         esac
12668         ;;
12669 (yes)
12670
12671         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12672         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12673
12674         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12675
12676         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12677                 && test -z "${cf_tst_cflags}" \
12678                 && cf_fix_cppflags=no
12679         ;;
12680 esac
12681 done
12682
12683 if test -n "$cf_new_cflags" ; then
12684
12685         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12686         CFLAGS="${CFLAGS}$cf_new_cflags"
12687
12688 fi
12689
12690 if test -n "$cf_new_cppflags" ; then
12691
12692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12693         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12694
12695 fi
12696
12697 if test -n "$cf_new_extra_cppflags" ; then
12698
12699         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12700         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12701
12702 fi
12703
12704                         cat >"conftest.$ac_ext" <<_ACEOF
12705 #line 12705 "configure"
12706 #include "confdefs.h"
12707
12708                                 #include <limits.h>
12709                                 #include <sys/types.h>
12710
12711 int
12712 main (void)
12713 {
12714
12715                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12716                                         return 0;
12717                                 #else
12718                                 #       error GNU C library is too old
12719                                 #endif
12720   ;
12721   return 0;
12722 }
12723 _ACEOF
12724 rm -f "conftest.$ac_objext"
12725 if { (eval echo "$as_me:12725: \"$ac_compile\"") >&5
12726   (eval $ac_compile) 2>&5
12727   ac_status=$?
12728   echo "$as_me:12728: \$? = $ac_status" >&5
12729   (exit "$ac_status"); } &&
12730          { ac_try='test -s "conftest.$ac_objext"'
12731   { (eval echo "$as_me:12731: \"$ac_try\"") >&5
12732   (eval $ac_try) 2>&5
12733   ac_status=$?
12734   echo "$as_me:12734: \$? = $ac_status" >&5
12735   (exit "$ac_status"); }; }; then
12736   cf_cv_gnu_dftsrc_219=yes
12737 else
12738   echo "$as_me: failed program was:" >&5
12739 cat "conftest.$ac_ext" >&5
12740 cf_cv_gnu_dftsrc_219=no
12741 fi
12742 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12743
12744 fi
12745 echo "$as_me:12745: result: $cf_cv_gnu_dftsrc_219" >&5
12746 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12747                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12748         else
12749                 cf_cv_gnu_dftsrc_219=maybe
12750         fi
12751
12752         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12753
12754                 echo "$as_me:12754: checking if we must define _GNU_SOURCE" >&5
12755 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12756 if test "${cf_cv_gnu_source+set}" = set; then
12757   echo $ECHO_N "(cached) $ECHO_C" >&6
12758 else
12759
12760                 cat >"conftest.$ac_ext" <<_ACEOF
12761 #line 12761 "configure"
12762 #include "confdefs.h"
12763 #include <sys/types.h>
12764 int
12765 main (void)
12766 {
12767
12768                         #ifndef _XOPEN_SOURCE
12769                         #error  expected _XOPEN_SOURCE to be defined
12770                         #endif
12771   ;
12772   return 0;
12773 }
12774 _ACEOF
12775 rm -f "conftest.$ac_objext"
12776 if { (eval echo "$as_me:12776: \"$ac_compile\"") >&5
12777   (eval $ac_compile) 2>&5
12778   ac_status=$?
12779   echo "$as_me:12779: \$? = $ac_status" >&5
12780   (exit "$ac_status"); } &&
12781          { ac_try='test -s "conftest.$ac_objext"'
12782   { (eval echo "$as_me:12782: \"$ac_try\"") >&5
12783   (eval $ac_try) 2>&5
12784   ac_status=$?
12785   echo "$as_me:12785: \$? = $ac_status" >&5
12786   (exit "$ac_status"); }; }; then
12787   cf_cv_gnu_source=no
12788 else
12789   echo "$as_me: failed program was:" >&5
12790 cat "conftest.$ac_ext" >&5
12791 cf_save="$CPPFLAGS"
12792
12793 cf_fix_cppflags=no
12794 cf_new_cflags=
12795 cf_new_cppflags=
12796 cf_new_extra_cppflags=
12797
12798 for cf_add_cflags in -D_GNU_SOURCE
12799 do
12800 case "$cf_fix_cppflags" in
12801 (no)
12802         case "$cf_add_cflags" in
12803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12804                 case "$cf_add_cflags" in
12805                 (-D*)
12806                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12807
12808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12809                                 && test -z "${cf_tst_cflags}" \
12810                                 && cf_fix_cppflags=yes
12811
12812                         if test "$cf_fix_cppflags" = yes ; then
12813
12814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12816
12817                                 continue
12818                         elif test "${cf_tst_cflags}" = "\"'" ; then
12819
12820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12822
12823                                 continue
12824                         fi
12825                         ;;
12826                 esac
12827                 case "$CPPFLAGS" in
12828                 (*$cf_add_cflags)
12829                         ;;
12830                 (*)
12831                         case "$cf_add_cflags" in
12832                         (-D*)
12833                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12834
12835 CPPFLAGS=`echo "$CPPFLAGS" | \
12836         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12837                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12838
12839                                 ;;
12840                         esac
12841
12842         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12843         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12844
12845                         ;;
12846                 esac
12847                 ;;
12848         (*)
12849
12850         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12851         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12852
12853                 ;;
12854         esac
12855         ;;
12856 (yes)
12857
12858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12860
12861         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12862
12863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12864                 && test -z "${cf_tst_cflags}" \
12865                 && cf_fix_cppflags=no
12866         ;;
12867 esac
12868 done
12869
12870 if test -n "$cf_new_cflags" ; then
12871
12872         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12873         CFLAGS="${CFLAGS}$cf_new_cflags"
12874
12875 fi
12876
12877 if test -n "$cf_new_cppflags" ; then
12878
12879         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12880         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12881
12882 fi
12883
12884 if test -n "$cf_new_extra_cppflags" ; then
12885
12886         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12887         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12888
12889 fi
12890
12891                          cat >"conftest.$ac_ext" <<_ACEOF
12892 #line 12892 "configure"
12893 #include "confdefs.h"
12894 #include <sys/types.h>
12895 int
12896 main (void)
12897 {
12898
12899                                 #ifdef _XOPEN_SOURCE
12900                                 #error  expected _XOPEN_SOURCE to be undefined
12901                                 #endif
12902   ;
12903   return 0;
12904 }
12905 _ACEOF
12906 rm -f "conftest.$ac_objext"
12907 if { (eval echo "$as_me:12907: \"$ac_compile\"") >&5
12908   (eval $ac_compile) 2>&5
12909   ac_status=$?
12910   echo "$as_me:12910: \$? = $ac_status" >&5
12911   (exit "$ac_status"); } &&
12912          { ac_try='test -s "conftest.$ac_objext"'
12913   { (eval echo "$as_me:12913: \"$ac_try\"") >&5
12914   (eval $ac_try) 2>&5
12915   ac_status=$?
12916   echo "$as_me:12916: \$? = $ac_status" >&5
12917   (exit "$ac_status"); }; }; then
12918   cf_cv_gnu_source=no
12919 else
12920   echo "$as_me: failed program was:" >&5
12921 cat "conftest.$ac_ext" >&5
12922 cf_cv_gnu_source=yes
12923 fi
12924 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12925                         CPPFLAGS="$cf_save"
12926
12927 fi
12928 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12929
12930 fi
12931 echo "$as_me:12931: result: $cf_cv_gnu_source" >&5
12932 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12933
12934                 if test "$cf_cv_gnu_source" = yes
12935                 then
12936                 echo "$as_me:12936: checking if we should also define _DEFAULT_SOURCE" >&5
12937 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12938 if test "${cf_cv_default_source+set}" = set; then
12939   echo $ECHO_N "(cached) $ECHO_C" >&6
12940 else
12941
12942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12943         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12944
12945                         cat >"conftest.$ac_ext" <<_ACEOF
12946 #line 12946 "configure"
12947 #include "confdefs.h"
12948 #include <sys/types.h>
12949 int
12950 main (void)
12951 {
12952
12953                                 #ifdef _DEFAULT_SOURCE
12954                                 #error  expected _DEFAULT_SOURCE to be undefined
12955                                 #endif
12956   ;
12957   return 0;
12958 }
12959 _ACEOF
12960 rm -f "conftest.$ac_objext"
12961 if { (eval echo "$as_me:12961: \"$ac_compile\"") >&5
12962   (eval $ac_compile) 2>&5
12963   ac_status=$?
12964   echo "$as_me:12964: \$? = $ac_status" >&5
12965   (exit "$ac_status"); } &&
12966          { ac_try='test -s "conftest.$ac_objext"'
12967   { (eval echo "$as_me:12967: \"$ac_try\"") >&5
12968   (eval $ac_try) 2>&5
12969   ac_status=$?
12970   echo "$as_me:12970: \$? = $ac_status" >&5
12971   (exit "$ac_status"); }; }; then
12972   cf_cv_default_source=no
12973 else
12974   echo "$as_me: failed program was:" >&5
12975 cat "conftest.$ac_ext" >&5
12976 cf_cv_default_source=yes
12977 fi
12978 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12979
12980 fi
12981 echo "$as_me:12981: result: $cf_cv_default_source" >&5
12982 echo "${ECHO_T}$cf_cv_default_source" >&6
12983                         if test "$cf_cv_default_source" = yes
12984                         then
12985
12986         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12987         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12988
12989                         fi
12990                 fi
12991         fi
12992
12993 fi
12994
12995         ;;
12996 (minix*)
12997         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12998         ;;
12999 (mirbsd*)
13000         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
13001         cf_XOPEN_SOURCE=
13002
13003 if test "$cf_cv_posix_visible" = no; then
13004
13005 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13006
13007 cf_save_CFLAGS="$CFLAGS"
13008 cf_save_CPPFLAGS="$CPPFLAGS"
13009
13010 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13011         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13012                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13013
13014 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13015         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13016                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13017
13018 echo "$as_me:13018: checking if we should define _POSIX_C_SOURCE" >&5
13019 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13020 if test "${cf_cv_posix_c_source+set}" = set; then
13021   echo $ECHO_N "(cached) $ECHO_C" >&6
13022 else
13023
13024 echo "${as_me:-configure}:13024: testing if the symbol is already defined go no further ..." 1>&5
13025
13026         cat >"conftest.$ac_ext" <<_ACEOF
13027 #line 13027 "configure"
13028 #include "confdefs.h"
13029 #include <sys/types.h>
13030 int
13031 main (void)
13032 {
13033
13034 #ifndef _POSIX_C_SOURCE
13035 make an error
13036 #endif
13037   ;
13038   return 0;
13039 }
13040 _ACEOF
13041 rm -f "conftest.$ac_objext"
13042 if { (eval echo "$as_me:13042: \"$ac_compile\"") >&5
13043   (eval $ac_compile) 2>&5
13044   ac_status=$?
13045   echo "$as_me:13045: \$? = $ac_status" >&5
13046   (exit "$ac_status"); } &&
13047          { ac_try='test -s "conftest.$ac_objext"'
13048   { (eval echo "$as_me:13048: \"$ac_try\"") >&5
13049   (eval $ac_try) 2>&5
13050   ac_status=$?
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit "$ac_status"); }; }; then
13053   cf_cv_posix_c_source=no
13054 else
13055   echo "$as_me: failed program was:" >&5
13056 cat "conftest.$ac_ext" >&5
13057 cf_want_posix_source=no
13058          case .$cf_POSIX_C_SOURCE in
13059          (.[12]??*)
13060                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13061                 ;;
13062          (.2)
13063                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13064                 cf_want_posix_source=yes
13065                 ;;
13066          (.*)
13067                 cf_want_posix_source=yes
13068                 ;;
13069          esac
13070          if test "$cf_want_posix_source" = yes ; then
13071                 cat >"conftest.$ac_ext" <<_ACEOF
13072 #line 13072 "configure"
13073 #include "confdefs.h"
13074 #include <sys/types.h>
13075 int
13076 main (void)
13077 {
13078
13079 #ifdef _POSIX_SOURCE
13080 make an error
13081 #endif
13082   ;
13083   return 0;
13084 }
13085 _ACEOF
13086 rm -f "conftest.$ac_objext"
13087 if { (eval echo "$as_me:13087: \"$ac_compile\"") >&5
13088   (eval $ac_compile) 2>&5
13089   ac_status=$?
13090   echo "$as_me:13090: \$? = $ac_status" >&5
13091   (exit "$ac_status"); } &&
13092          { ac_try='test -s "conftest.$ac_objext"'
13093   { (eval echo "$as_me:13093: \"$ac_try\"") >&5
13094   (eval $ac_try) 2>&5
13095   ac_status=$?
13096   echo "$as_me:13096: \$? = $ac_status" >&5
13097   (exit "$ac_status"); }; }; then
13098   :
13099 else
13100   echo "$as_me: failed program was:" >&5
13101 cat "conftest.$ac_ext" >&5
13102 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13103 fi
13104 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13105          fi
13106
13107 echo "${as_me:-configure}:13107: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13108
13109          CFLAGS="$cf_trim_CFLAGS"
13110          CPPFLAGS="$cf_trim_CPPFLAGS"
13111
13112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13113         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13114
13115 echo "${as_me:-configure}:13115: testing if the second compile does not leave our definition intact error ..." 1>&5
13116
13117          cat >"conftest.$ac_ext" <<_ACEOF
13118 #line 13118 "configure"
13119 #include "confdefs.h"
13120 #include <sys/types.h>
13121 int
13122 main (void)
13123 {
13124
13125 #ifndef _POSIX_C_SOURCE
13126 make an error
13127 #endif
13128   ;
13129   return 0;
13130 }
13131 _ACEOF
13132 rm -f "conftest.$ac_objext"
13133 if { (eval echo "$as_me:13133: \"$ac_compile\"") >&5
13134   (eval $ac_compile) 2>&5
13135   ac_status=$?
13136   echo "$as_me:13136: \$? = $ac_status" >&5
13137   (exit "$ac_status"); } &&
13138          { ac_try='test -s "conftest.$ac_objext"'
13139   { (eval echo "$as_me:13139: \"$ac_try\"") >&5
13140   (eval $ac_try) 2>&5
13141   ac_status=$?
13142   echo "$as_me:13142: \$? = $ac_status" >&5
13143   (exit "$ac_status"); }; }; then
13144   :
13145 else
13146   echo "$as_me: failed program was:" >&5
13147 cat "conftest.$ac_ext" >&5
13148 cf_cv_posix_c_source=no
13149 fi
13150 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13151          CFLAGS="$cf_save_CFLAGS"
13152          CPPFLAGS="$cf_save_CPPFLAGS"
13153
13154 fi
13155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13156
13157 fi
13158 echo "$as_me:13158: result: $cf_cv_posix_c_source" >&5
13159 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13160
13161 if test "$cf_cv_posix_c_source" != no ; then
13162         CFLAGS="$cf_trim_CFLAGS"
13163         CPPFLAGS="$cf_trim_CPPFLAGS"
13164
13165 cf_fix_cppflags=no
13166 cf_new_cflags=
13167 cf_new_cppflags=
13168 cf_new_extra_cppflags=
13169
13170 for cf_add_cflags in $cf_cv_posix_c_source
13171 do
13172 case "$cf_fix_cppflags" in
13173 (no)
13174         case "$cf_add_cflags" in
13175         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13176                 case "$cf_add_cflags" in
13177                 (-D*)
13178                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13179
13180                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13181                                 && test -z "${cf_tst_cflags}" \
13182                                 && cf_fix_cppflags=yes
13183
13184                         if test "$cf_fix_cppflags" = yes ; then
13185
13186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13188
13189                                 continue
13190                         elif test "${cf_tst_cflags}" = "\"'" ; then
13191
13192         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13193         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13194
13195                                 continue
13196                         fi
13197                         ;;
13198                 esac
13199                 case "$CPPFLAGS" in
13200                 (*$cf_add_cflags)
13201                         ;;
13202                 (*)
13203                         case "$cf_add_cflags" in
13204                         (-D*)
13205                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13206
13207 CPPFLAGS=`echo "$CPPFLAGS" | \
13208         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13209                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13210
13211                                 ;;
13212                         esac
13213
13214         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13215         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13216
13217                         ;;
13218                 esac
13219                 ;;
13220         (*)
13221
13222         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13223         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13224
13225                 ;;
13226         esac
13227         ;;
13228 (yes)
13229
13230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13232
13233         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13234
13235         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13236                 && test -z "${cf_tst_cflags}" \
13237                 && cf_fix_cppflags=no
13238         ;;
13239 esac
13240 done
13241
13242 if test -n "$cf_new_cflags" ; then
13243
13244         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13245         CFLAGS="${CFLAGS}$cf_new_cflags"
13246
13247 fi
13248
13249 if test -n "$cf_new_cppflags" ; then
13250
13251         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13252         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13253
13254 fi
13255
13256 if test -n "$cf_new_extra_cppflags" ; then
13257
13258         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13259         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13260
13261 fi
13262
13263 fi
13264
13265 fi # cf_cv_posix_visible
13266
13267         ;;
13268 (netbsd*)
13269         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13270         ;;
13271 (openbsd[6-9]*)
13272         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13273         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13274         # Abusing the conformance level is a workaround.
13275         { echo "$as_me:13275: WARNING: this system does not provide usable locale support" >&5
13276 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13277         cf_xopen_source="-D_BSD_SOURCE"
13278         cf_XOPEN_SOURCE=700
13279         ;;
13280 (openbsd[4-5]*)
13281         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13282         cf_xopen_source="-D_BSD_SOURCE"
13283         cf_XOPEN_SOURCE=600
13284         ;;
13285 (openbsd*)
13286         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13287         ;;
13288 (osf[45]*)
13289         cf_xopen_source="-D_OSF_SOURCE"
13290         ;;
13291 (nto-qnx*)
13292         cf_xopen_source="-D_QNX_SOURCE"
13293         ;;
13294 (sco*)
13295         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13296         ;;
13297 (solaris2.*)
13298         cf_xopen_source="-D__EXTENSIONS__"
13299         cf_cv_xopen_source=broken
13300         ;;
13301 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13302         cf_XOPEN_SOURCE=
13303         cf_POSIX_C_SOURCE=
13304         ;;
13305 (*)
13306
13307 echo "$as_me:13307: checking if we should define _XOPEN_SOURCE" >&5
13308 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13309 if test "${cf_cv_xopen_source+set}" = set; then
13310   echo $ECHO_N "(cached) $ECHO_C" >&6
13311 else
13312
13313         cat >"conftest.$ac_ext" <<_ACEOF
13314 #line 13314 "configure"
13315 #include "confdefs.h"
13316
13317 #include <stdlib.h>
13318 #include <string.h>
13319 #include <sys/types.h>
13320
13321 int
13322 main (void)
13323 {
13324
13325 #ifndef _XOPEN_SOURCE
13326 make an error
13327 #endif
13328   ;
13329   return 0;
13330 }
13331 _ACEOF
13332 rm -f "conftest.$ac_objext"
13333 if { (eval echo "$as_me:13333: \"$ac_compile\"") >&5
13334   (eval $ac_compile) 2>&5
13335   ac_status=$?
13336   echo "$as_me:13336: \$? = $ac_status" >&5
13337   (exit "$ac_status"); } &&
13338          { ac_try='test -s "conftest.$ac_objext"'
13339   { (eval echo "$as_me:13339: \"$ac_try\"") >&5
13340   (eval $ac_try) 2>&5
13341   ac_status=$?
13342   echo "$as_me:13342: \$? = $ac_status" >&5
13343   (exit "$ac_status"); }; }; then
13344   cf_cv_xopen_source=no
13345 else
13346   echo "$as_me: failed program was:" >&5
13347 cat "conftest.$ac_ext" >&5
13348 cf_save="$CPPFLAGS"
13349
13350         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13351         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13352
13353          cat >"conftest.$ac_ext" <<_ACEOF
13354 #line 13354 "configure"
13355 #include "confdefs.h"
13356
13357 #include <stdlib.h>
13358 #include <string.h>
13359 #include <sys/types.h>
13360
13361 int
13362 main (void)
13363 {
13364
13365 #ifdef _XOPEN_SOURCE
13366 make an error
13367 #endif
13368   ;
13369   return 0;
13370 }
13371 _ACEOF
13372 rm -f "conftest.$ac_objext"
13373 if { (eval echo "$as_me:13373: \"$ac_compile\"") >&5
13374   (eval $ac_compile) 2>&5
13375   ac_status=$?
13376   echo "$as_me:13376: \$? = $ac_status" >&5
13377   (exit "$ac_status"); } &&
13378          { ac_try='test -s "conftest.$ac_objext"'
13379   { (eval echo "$as_me:13379: \"$ac_try\"") >&5
13380   (eval $ac_try) 2>&5
13381   ac_status=$?
13382   echo "$as_me:13382: \$? = $ac_status" >&5
13383   (exit "$ac_status"); }; }; then
13384   cf_cv_xopen_source=no
13385 else
13386   echo "$as_me: failed program was:" >&5
13387 cat "conftest.$ac_ext" >&5
13388 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13389 fi
13390 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13391         CPPFLAGS="$cf_save"
13392
13393 fi
13394 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13395
13396 fi
13397 echo "$as_me:13397: result: $cf_cv_xopen_source" >&5
13398 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13399
13400 if test "$cf_cv_xopen_source" != no ; then
13401
13402 CFLAGS=`echo "$CFLAGS" | \
13403         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13404                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13405
13406 CPPFLAGS=`echo "$CPPFLAGS" | \
13407         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13408                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13409
13410         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13411
13412 for cf_add_cflags in $cf_temp_xopen_source
13413 do
13414
13415 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13416 cf_old_cflag="$CFLAGS"
13417
13418 case "$CFLAGS" in
13419 (*$cf_add_cflags=*)
13420         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
13421         ;;
13422 (*$cf_add_cflags\ *)
13423         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
13424         ;;
13425 (*$cf_add_cflags)
13426         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
13427         ;;
13428 esac
13429
13430 if test "$CFLAGS" != "$cf_old_cflag" ;
13431 then
13432
13433         CFLAGS="$cf_new_cflag"
13434 fi
13435
13436 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13437 cf_old_cflag="$CPPFLAGS"
13438
13439 case "$CPPFLAGS" in
13440 (*$cf_add_cflags=*)
13441         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
13442         ;;
13443 (*$cf_add_cflags\ *)
13444         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
13445         ;;
13446 (*$cf_add_cflags)
13447         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
13448         ;;
13449 esac
13450
13451 if test "$CPPFLAGS" != "$cf_old_cflag" ;
13452 then
13453
13454         CPPFLAGS="$cf_new_cflag"
13455 fi
13456
13457 done
13458
13459 cf_fix_cppflags=no
13460 cf_new_cflags=
13461 cf_new_cppflags=
13462 cf_new_extra_cppflags=
13463
13464 for cf_add_cflags in $cf_temp_xopen_source
13465 do
13466 case "$cf_fix_cppflags" in
13467 (no)
13468         case "$cf_add_cflags" in
13469         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13470                 case "$cf_add_cflags" in
13471                 (-D*)
13472                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13473
13474                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13475                                 && test -z "${cf_tst_cflags}" \
13476                                 && cf_fix_cppflags=yes
13477
13478                         if test "$cf_fix_cppflags" = yes ; then
13479
13480         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13481         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13482
13483                                 continue
13484                         elif test "${cf_tst_cflags}" = "\"'" ; then
13485
13486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13488
13489                                 continue
13490                         fi
13491                         ;;
13492                 esac
13493                 case "$CPPFLAGS" in
13494                 (*$cf_add_cflags)
13495                         ;;
13496                 (*)
13497                         case "$cf_add_cflags" in
13498                         (-D*)
13499                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13500
13501 CPPFLAGS=`echo "$CPPFLAGS" | \
13502         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13503                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13504
13505                                 ;;
13506                         esac
13507
13508         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13509         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13510
13511                         ;;
13512                 esac
13513                 ;;
13514         (*)
13515
13516         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13517         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13518
13519                 ;;
13520         esac
13521         ;;
13522 (yes)
13523
13524         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13525         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13526
13527         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13528
13529         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13530                 && test -z "${cf_tst_cflags}" \
13531                 && cf_fix_cppflags=no
13532         ;;
13533 esac
13534 done
13535
13536 if test -n "$cf_new_cflags" ; then
13537
13538         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13539         CFLAGS="${CFLAGS}$cf_new_cflags"
13540
13541 fi
13542
13543 if test -n "$cf_new_cppflags" ; then
13544
13545         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13546         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13547
13548 fi
13549
13550 if test -n "$cf_new_extra_cppflags" ; then
13551
13552         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13553         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13554
13555 fi
13556
13557 fi
13558
13559 if test "$cf_cv_posix_visible" = no; then
13560
13561 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13562
13563 cf_save_CFLAGS="$CFLAGS"
13564 cf_save_CPPFLAGS="$CPPFLAGS"
13565
13566 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13567         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13568                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13569
13570 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13571         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13572                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13573
13574 echo "$as_me:13574: checking if we should define _POSIX_C_SOURCE" >&5
13575 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13576 if test "${cf_cv_posix_c_source+set}" = set; then
13577   echo $ECHO_N "(cached) $ECHO_C" >&6
13578 else
13579
13580 echo "${as_me:-configure}:13580: testing if the symbol is already defined go no further ..." 1>&5
13581
13582         cat >"conftest.$ac_ext" <<_ACEOF
13583 #line 13583 "configure"
13584 #include "confdefs.h"
13585 #include <sys/types.h>
13586 int
13587 main (void)
13588 {
13589
13590 #ifndef _POSIX_C_SOURCE
13591 make an error
13592 #endif
13593   ;
13594   return 0;
13595 }
13596 _ACEOF
13597 rm -f "conftest.$ac_objext"
13598 if { (eval echo "$as_me:13598: \"$ac_compile\"") >&5
13599   (eval $ac_compile) 2>&5
13600   ac_status=$?
13601   echo "$as_me:13601: \$? = $ac_status" >&5
13602   (exit "$ac_status"); } &&
13603          { ac_try='test -s "conftest.$ac_objext"'
13604   { (eval echo "$as_me:13604: \"$ac_try\"") >&5
13605   (eval $ac_try) 2>&5
13606   ac_status=$?
13607   echo "$as_me:13607: \$? = $ac_status" >&5
13608   (exit "$ac_status"); }; }; then
13609   cf_cv_posix_c_source=no
13610 else
13611   echo "$as_me: failed program was:" >&5
13612 cat "conftest.$ac_ext" >&5
13613 cf_want_posix_source=no
13614          case .$cf_POSIX_C_SOURCE in
13615          (.[12]??*)
13616                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13617                 ;;
13618          (.2)
13619                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13620                 cf_want_posix_source=yes
13621                 ;;
13622          (.*)
13623                 cf_want_posix_source=yes
13624                 ;;
13625          esac
13626          if test "$cf_want_posix_source" = yes ; then
13627                 cat >"conftest.$ac_ext" <<_ACEOF
13628 #line 13628 "configure"
13629 #include "confdefs.h"
13630 #include <sys/types.h>
13631 int
13632 main (void)
13633 {
13634
13635 #ifdef _POSIX_SOURCE
13636 make an error
13637 #endif
13638   ;
13639   return 0;
13640 }
13641 _ACEOF
13642 rm -f "conftest.$ac_objext"
13643 if { (eval echo "$as_me:13643: \"$ac_compile\"") >&5
13644   (eval $ac_compile) 2>&5
13645   ac_status=$?
13646   echo "$as_me:13646: \$? = $ac_status" >&5
13647   (exit "$ac_status"); } &&
13648          { ac_try='test -s "conftest.$ac_objext"'
13649   { (eval echo "$as_me:13649: \"$ac_try\"") >&5
13650   (eval $ac_try) 2>&5
13651   ac_status=$?
13652   echo "$as_me:13652: \$? = $ac_status" >&5
13653   (exit "$ac_status"); }; }; then
13654   :
13655 else
13656   echo "$as_me: failed program was:" >&5
13657 cat "conftest.$ac_ext" >&5
13658 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13659 fi
13660 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13661          fi
13662
13663 echo "${as_me:-configure}:13663: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13664
13665          CFLAGS="$cf_trim_CFLAGS"
13666          CPPFLAGS="$cf_trim_CPPFLAGS"
13667
13668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13669         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13670
13671 echo "${as_me:-configure}:13671: testing if the second compile does not leave our definition intact error ..." 1>&5
13672
13673          cat >"conftest.$ac_ext" <<_ACEOF
13674 #line 13674 "configure"
13675 #include "confdefs.h"
13676 #include <sys/types.h>
13677 int
13678 main (void)
13679 {
13680
13681 #ifndef _POSIX_C_SOURCE
13682 make an error
13683 #endif
13684   ;
13685   return 0;
13686 }
13687 _ACEOF
13688 rm -f "conftest.$ac_objext"
13689 if { (eval echo "$as_me:13689: \"$ac_compile\"") >&5
13690   (eval $ac_compile) 2>&5
13691   ac_status=$?
13692   echo "$as_me:13692: \$? = $ac_status" >&5
13693   (exit "$ac_status"); } &&
13694          { ac_try='test -s "conftest.$ac_objext"'
13695   { (eval echo "$as_me:13695: \"$ac_try\"") >&5
13696   (eval $ac_try) 2>&5
13697   ac_status=$?
13698   echo "$as_me:13698: \$? = $ac_status" >&5
13699   (exit "$ac_status"); }; }; then
13700   :
13701 else
13702   echo "$as_me: failed program was:" >&5
13703 cat "conftest.$ac_ext" >&5
13704 cf_cv_posix_c_source=no
13705 fi
13706 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13707          CFLAGS="$cf_save_CFLAGS"
13708          CPPFLAGS="$cf_save_CPPFLAGS"
13709
13710 fi
13711 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13712
13713 fi
13714 echo "$as_me:13714: result: $cf_cv_posix_c_source" >&5
13715 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13716
13717 if test "$cf_cv_posix_c_source" != no ; then
13718         CFLAGS="$cf_trim_CFLAGS"
13719         CPPFLAGS="$cf_trim_CPPFLAGS"
13720
13721 cf_fix_cppflags=no
13722 cf_new_cflags=
13723 cf_new_cppflags=
13724 cf_new_extra_cppflags=
13725
13726 for cf_add_cflags in $cf_cv_posix_c_source
13727 do
13728 case "$cf_fix_cppflags" in
13729 (no)
13730         case "$cf_add_cflags" in
13731         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13732                 case "$cf_add_cflags" in
13733                 (-D*)
13734                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13735
13736                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13737                                 && test -z "${cf_tst_cflags}" \
13738                                 && cf_fix_cppflags=yes
13739
13740                         if test "$cf_fix_cppflags" = yes ; then
13741
13742         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13743         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13744
13745                                 continue
13746                         elif test "${cf_tst_cflags}" = "\"'" ; then
13747
13748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13750
13751                                 continue
13752                         fi
13753                         ;;
13754                 esac
13755                 case "$CPPFLAGS" in
13756                 (*$cf_add_cflags)
13757                         ;;
13758                 (*)
13759                         case "$cf_add_cflags" in
13760                         (-D*)
13761                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13762
13763 CPPFLAGS=`echo "$CPPFLAGS" | \
13764         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13765                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13766
13767                                 ;;
13768                         esac
13769
13770         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13771         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13772
13773                         ;;
13774                 esac
13775                 ;;
13776         (*)
13777
13778         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13779         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13780
13781                 ;;
13782         esac
13783         ;;
13784 (yes)
13785
13786         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13787         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13788
13789         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13790
13791         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13792                 && test -z "${cf_tst_cflags}" \
13793                 && cf_fix_cppflags=no
13794         ;;
13795 esac
13796 done
13797
13798 if test -n "$cf_new_cflags" ; then
13799
13800         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13801         CFLAGS="${CFLAGS}$cf_new_cflags"
13802
13803 fi
13804
13805 if test -n "$cf_new_cppflags" ; then
13806
13807         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13808         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13809
13810 fi
13811
13812 if test -n "$cf_new_extra_cppflags" ; then
13813
13814         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13815         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13816
13817 fi
13818
13819 fi
13820
13821 fi # cf_cv_posix_visible
13822
13823         ;;
13824 esac
13825
13826 if test -n "$cf_xopen_source" ; then
13827
13828 for cf_add_cflags in $cf_xopen_source
13829 do
13830
13831 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13832 cf_old_cflag="$CFLAGS"
13833
13834 case "$CFLAGS" in
13835 (*$cf_add_cflags=*)
13836         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
13837         ;;
13838 (*$cf_add_cflags\ *)
13839         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
13840         ;;
13841 (*$cf_add_cflags)
13842         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
13843         ;;
13844 esac
13845
13846 if test "$CFLAGS" != "$cf_old_cflag" ;
13847 then
13848         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13849
13850 echo "${as_me:-configure}:13850: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13851
13852         CFLAGS="$cf_new_cflag"
13853 fi
13854
13855 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13856 cf_old_cflag="$CPPFLAGS"
13857
13858 case "$CPPFLAGS" in
13859 (*$cf_add_cflags=*)
13860         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
13861         ;;
13862 (*$cf_add_cflags\ *)
13863         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
13864         ;;
13865 (*$cf_add_cflags)
13866         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
13867         ;;
13868 esac
13869
13870 if test "$CPPFLAGS" != "$cf_old_cflag" ;
13871 then
13872         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13873
13874 echo "${as_me:-configure}:13874: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13875
13876         CPPFLAGS="$cf_new_cflag"
13877 fi
13878
13879 done
13880
13881 cf_fix_cppflags=no
13882 cf_new_cflags=
13883 cf_new_cppflags=
13884 cf_new_extra_cppflags=
13885
13886 for cf_add_cflags in $cf_xopen_source
13887 do
13888 case "$cf_fix_cppflags" in
13889 (no)
13890         case "$cf_add_cflags" in
13891         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13892                 case "$cf_add_cflags" in
13893                 (-D*)
13894                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13895
13896                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13897                                 && test -z "${cf_tst_cflags}" \
13898                                 && cf_fix_cppflags=yes
13899
13900                         if test "$cf_fix_cppflags" = yes ; then
13901
13902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13904
13905                                 continue
13906                         elif test "${cf_tst_cflags}" = "\"'" ; then
13907
13908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13910
13911                                 continue
13912                         fi
13913                         ;;
13914                 esac
13915                 case "$CPPFLAGS" in
13916                 (*$cf_add_cflags)
13917                         ;;
13918                 (*)
13919                         case "$cf_add_cflags" in
13920                         (-D*)
13921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13922
13923 CPPFLAGS=`echo "$CPPFLAGS" | \
13924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13926
13927                                 ;;
13928                         esac
13929
13930         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13931         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13932
13933                         ;;
13934                 esac
13935                 ;;
13936         (*)
13937
13938         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13939         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13940
13941                 ;;
13942         esac
13943         ;;
13944 (yes)
13945
13946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13948
13949         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13950
13951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13952                 && test -z "${cf_tst_cflags}" \
13953                 && cf_fix_cppflags=no
13954         ;;
13955 esac
13956 done
13957
13958 if test -n "$cf_new_cflags" ; then
13959         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13960
13961 echo "${as_me:-configure}:13961: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13962
13963         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13964         CFLAGS="${CFLAGS}$cf_new_cflags"
13965
13966 fi
13967
13968 if test -n "$cf_new_cppflags" ; then
13969         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13970
13971 echo "${as_me:-configure}:13971: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13972
13973         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13974         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13975
13976 fi
13977
13978 if test -n "$cf_new_extra_cppflags" ; then
13979         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13980
13981 echo "${as_me:-configure}:13981: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13982
13983         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13984         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13985
13986 fi
13987
13988 fi
13989
13990 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13991         echo "$as_me:13991: checking if _XOPEN_SOURCE really is set" >&5
13992 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13993         cat >"conftest.$ac_ext" <<_ACEOF
13994 #line 13994 "configure"
13995 #include "confdefs.h"
13996 #include <stdlib.h>
13997 int
13998 main (void)
13999 {
14000
14001 #ifndef _XOPEN_SOURCE
14002 make an error
14003 #endif
14004   ;
14005   return 0;
14006 }
14007 _ACEOF
14008 rm -f "conftest.$ac_objext"
14009 if { (eval echo "$as_me:14009: \"$ac_compile\"") >&5
14010   (eval $ac_compile) 2>&5
14011   ac_status=$?
14012   echo "$as_me:14012: \$? = $ac_status" >&5
14013   (exit "$ac_status"); } &&
14014          { ac_try='test -s "conftest.$ac_objext"'
14015   { (eval echo "$as_me:14015: \"$ac_try\"") >&5
14016   (eval $ac_try) 2>&5
14017   ac_status=$?
14018   echo "$as_me:14018: \$? = $ac_status" >&5
14019   (exit "$ac_status"); }; }; then
14020   cf_XOPEN_SOURCE_set=yes
14021 else
14022   echo "$as_me: failed program was:" >&5
14023 cat "conftest.$ac_ext" >&5
14024 cf_XOPEN_SOURCE_set=no
14025 fi
14026 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14027         echo "$as_me:14027: result: $cf_XOPEN_SOURCE_set" >&5
14028 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14029         if test "$cf_XOPEN_SOURCE_set" = yes
14030         then
14031                 cat >"conftest.$ac_ext" <<_ACEOF
14032 #line 14032 "configure"
14033 #include "confdefs.h"
14034 #include <stdlib.h>
14035 int
14036 main (void)
14037 {
14038
14039 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14040 make an error
14041 #endif
14042   ;
14043   return 0;
14044 }
14045 _ACEOF
14046 rm -f "conftest.$ac_objext"
14047 if { (eval echo "$as_me:14047: \"$ac_compile\"") >&5
14048   (eval $ac_compile) 2>&5
14049   ac_status=$?
14050   echo "$as_me:14050: \$? = $ac_status" >&5
14051   (exit "$ac_status"); } &&
14052          { ac_try='test -s "conftest.$ac_objext"'
14053   { (eval echo "$as_me:14053: \"$ac_try\"") >&5
14054   (eval $ac_try) 2>&5
14055   ac_status=$?
14056   echo "$as_me:14056: \$? = $ac_status" >&5
14057   (exit "$ac_status"); }; }; then
14058   cf_XOPEN_SOURCE_set_ok=yes
14059 else
14060   echo "$as_me: failed program was:" >&5
14061 cat "conftest.$ac_ext" >&5
14062 cf_XOPEN_SOURCE_set_ok=no
14063 fi
14064 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14065                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14066                 then
14067                         { echo "$as_me:14067: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14068 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14069                 fi
14070         else
14071
14072 echo "$as_me:14072: checking if we should define _XOPEN_SOURCE" >&5
14073 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14074 if test "${cf_cv_xopen_source+set}" = set; then
14075   echo $ECHO_N "(cached) $ECHO_C" >&6
14076 else
14077
14078         cat >"conftest.$ac_ext" <<_ACEOF
14079 #line 14079 "configure"
14080 #include "confdefs.h"
14081
14082 #include <stdlib.h>
14083 #include <string.h>
14084 #include <sys/types.h>
14085
14086 int
14087 main (void)
14088 {
14089
14090 #ifndef _XOPEN_SOURCE
14091 make an error
14092 #endif
14093   ;
14094   return 0;
14095 }
14096 _ACEOF
14097 rm -f "conftest.$ac_objext"
14098 if { (eval echo "$as_me:14098: \"$ac_compile\"") >&5
14099   (eval $ac_compile) 2>&5
14100   ac_status=$?
14101   echo "$as_me:14101: \$? = $ac_status" >&5
14102   (exit "$ac_status"); } &&
14103          { ac_try='test -s "conftest.$ac_objext"'
14104   { (eval echo "$as_me:14104: \"$ac_try\"") >&5
14105   (eval $ac_try) 2>&5
14106   ac_status=$?
14107   echo "$as_me:14107: \$? = $ac_status" >&5
14108   (exit "$ac_status"); }; }; then
14109   cf_cv_xopen_source=no
14110 else
14111   echo "$as_me: failed program was:" >&5
14112 cat "conftest.$ac_ext" >&5
14113 cf_save="$CPPFLAGS"
14114
14115         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14116         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14117
14118          cat >"conftest.$ac_ext" <<_ACEOF
14119 #line 14119 "configure"
14120 #include "confdefs.h"
14121
14122 #include <stdlib.h>
14123 #include <string.h>
14124 #include <sys/types.h>
14125
14126 int
14127 main (void)
14128 {
14129
14130 #ifdef _XOPEN_SOURCE
14131 make an error
14132 #endif
14133   ;
14134   return 0;
14135 }
14136 _ACEOF
14137 rm -f "conftest.$ac_objext"
14138 if { (eval echo "$as_me:14138: \"$ac_compile\"") >&5
14139   (eval $ac_compile) 2>&5
14140   ac_status=$?
14141   echo "$as_me:14141: \$? = $ac_status" >&5
14142   (exit "$ac_status"); } &&
14143          { ac_try='test -s "conftest.$ac_objext"'
14144   { (eval echo "$as_me:14144: \"$ac_try\"") >&5
14145   (eval $ac_try) 2>&5
14146   ac_status=$?
14147   echo "$as_me:14147: \$? = $ac_status" >&5
14148   (exit "$ac_status"); }; }; then
14149   cf_cv_xopen_source=no
14150 else
14151   echo "$as_me: failed program was:" >&5
14152 cat "conftest.$ac_ext" >&5
14153 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14154 fi
14155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14156         CPPFLAGS="$cf_save"
14157
14158 fi
14159 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14160
14161 fi
14162 echo "$as_me:14162: result: $cf_cv_xopen_source" >&5
14163 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14164
14165 if test "$cf_cv_xopen_source" != no ; then
14166
14167 CFLAGS=`echo "$CFLAGS" | \
14168         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14169                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14170
14171 CPPFLAGS=`echo "$CPPFLAGS" | \
14172         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14173                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14174
14175         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14176
14177 for cf_add_cflags in $cf_temp_xopen_source
14178 do
14179
14180 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14181 cf_old_cflag="$CFLAGS"
14182
14183 case "$CFLAGS" in
14184 (*$cf_add_cflags=*)
14185         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
14186         ;;
14187 (*$cf_add_cflags\ *)
14188         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
14189         ;;
14190 (*$cf_add_cflags)
14191         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
14192         ;;
14193 esac
14194
14195 if test "$CFLAGS" != "$cf_old_cflag" ;
14196 then
14197
14198         CFLAGS="$cf_new_cflag"
14199 fi
14200
14201 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14202 cf_old_cflag="$CPPFLAGS"
14203
14204 case "$CPPFLAGS" in
14205 (*$cf_add_cflags=*)
14206         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
14207         ;;
14208 (*$cf_add_cflags\ *)
14209         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
14210         ;;
14211 (*$cf_add_cflags)
14212         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
14213         ;;
14214 esac
14215
14216 if test "$CPPFLAGS" != "$cf_old_cflag" ;
14217 then
14218
14219         CPPFLAGS="$cf_new_cflag"
14220 fi
14221
14222 done
14223
14224 cf_fix_cppflags=no
14225 cf_new_cflags=
14226 cf_new_cppflags=
14227 cf_new_extra_cppflags=
14228
14229 for cf_add_cflags in $cf_temp_xopen_source
14230 do
14231 case "$cf_fix_cppflags" in
14232 (no)
14233         case "$cf_add_cflags" in
14234         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14235                 case "$cf_add_cflags" in
14236                 (-D*)
14237                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14238
14239                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14240                                 && test -z "${cf_tst_cflags}" \
14241                                 && cf_fix_cppflags=yes
14242
14243                         if test "$cf_fix_cppflags" = yes ; then
14244
14245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14247
14248                                 continue
14249                         elif test "${cf_tst_cflags}" = "\"'" ; then
14250
14251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14253
14254                                 continue
14255                         fi
14256                         ;;
14257                 esac
14258                 case "$CPPFLAGS" in
14259                 (*$cf_add_cflags)
14260                         ;;
14261                 (*)
14262                         case "$cf_add_cflags" in
14263                         (-D*)
14264                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14265
14266 CPPFLAGS=`echo "$CPPFLAGS" | \
14267         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14268                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14269
14270                                 ;;
14271                         esac
14272
14273         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14274         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14275
14276                         ;;
14277                 esac
14278                 ;;
14279         (*)
14280
14281         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14282         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14283
14284                 ;;
14285         esac
14286         ;;
14287 (yes)
14288
14289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14291
14292         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14293
14294         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14295                 && test -z "${cf_tst_cflags}" \
14296                 && cf_fix_cppflags=no
14297         ;;
14298 esac
14299 done
14300
14301 if test -n "$cf_new_cflags" ; then
14302
14303         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14304         CFLAGS="${CFLAGS}$cf_new_cflags"
14305
14306 fi
14307
14308 if test -n "$cf_new_cppflags" ; then
14309
14310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14311         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14312
14313 fi
14314
14315 if test -n "$cf_new_extra_cppflags" ; then
14316
14317         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14318         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14319
14320 fi
14321
14322 fi
14323
14324         fi
14325 fi
14326 fi # cf_cv_posix_visible
14327
14328 # Check whether --enable-largefile or --disable-largefile was given.
14329 if test "${enable_largefile+set}" = set; then
14330   enableval="$enable_largefile"
14331
14332 fi;
14333 if test "$enable_largefile" != no; then
14334
14335   echo "$as_me:14335: checking for special C compiler options needed for large files" >&5
14336 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14337 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14338   echo $ECHO_N "(cached) $ECHO_C" >&6
14339 else
14340   ac_cv_sys_largefile_CC=no
14341      if test "$GCC" != yes; then
14342        ac_save_CC=$CC
14343        while :; do
14344          # IRIX 6.2 and later do not support large files by default,
14345          # so use the C compiler's -n32 option if that helps.
14346          cat >"conftest.$ac_ext" <<_ACEOF
14347 #line 14347 "configure"
14348 #include "confdefs.h"
14349 #include <sys/types.h>
14350  /* Check that off_t can represent 2**63 - 1 correctly.
14351     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14352     since some C++ compilers masquerading as C compilers
14353     incorrectly reject 9223372036854775807.  */
14354 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14355   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14356                        && LARGE_OFF_T % 2147483647 == 1)
14357                       ? 1 : -1];
14358 int
14359 main (void)
14360 {
14361
14362   ;
14363   return 0;
14364 }
14365 _ACEOF
14366          rm -f "conftest.$ac_objext"
14367 if { (eval echo "$as_me:14367: \"$ac_compile\"") >&5
14368   (eval $ac_compile) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit "$ac_status"); } &&
14372          { ac_try='test -s "conftest.$ac_objext"'
14373   { (eval echo "$as_me:14373: \"$ac_try\"") >&5
14374   (eval $ac_try) 2>&5
14375   ac_status=$?
14376   echo "$as_me:14376: \$? = $ac_status" >&5
14377   (exit "$ac_status"); }; }; then
14378   break
14379 else
14380   echo "$as_me: failed program was:" >&5
14381 cat "conftest.$ac_ext" >&5
14382 fi
14383 rm -f "conftest.$ac_objext"
14384          CC="$CC -n32"
14385          rm -f "conftest.$ac_objext"
14386 if { (eval echo "$as_me:14386: \"$ac_compile\"") >&5
14387   (eval $ac_compile) 2>&5
14388   ac_status=$?
14389   echo "$as_me:14389: \$? = $ac_status" >&5
14390   (exit "$ac_status"); } &&
14391          { ac_try='test -s "conftest.$ac_objext"'
14392   { (eval echo "$as_me:14392: \"$ac_try\"") >&5
14393   (eval $ac_try) 2>&5
14394   ac_status=$?
14395   echo "$as_me:14395: \$? = $ac_status" >&5
14396   (exit "$ac_status"); }; }; then
14397   ac_cv_sys_largefile_CC=' -n32'; break
14398 else
14399   echo "$as_me: failed program was:" >&5
14400 cat "conftest.$ac_ext" >&5
14401 fi
14402 rm -f "conftest.$ac_objext"
14403          break
14404        done
14405        CC=$ac_save_CC
14406        rm -f "conftest.$ac_ext"
14407     fi
14408 fi
14409 echo "$as_me:14409: result: $ac_cv_sys_largefile_CC" >&5
14410 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14411   if test "$ac_cv_sys_largefile_CC" != no; then
14412     CC=$CC$ac_cv_sys_largefile_CC
14413   fi
14414
14415   echo "$as_me:14415: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14416 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14417 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14418   echo $ECHO_N "(cached) $ECHO_C" >&6
14419 else
14420   while :; do
14421   ac_cv_sys_file_offset_bits=no
14422   cat >"conftest.$ac_ext" <<_ACEOF
14423 #line 14423 "configure"
14424 #include "confdefs.h"
14425 #include <sys/types.h>
14426  /* Check that off_t can represent 2**63 - 1 correctly.
14427     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14428     since some C++ compilers masquerading as C compilers
14429     incorrectly reject 9223372036854775807.  */
14430 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14431   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14432                        && LARGE_OFF_T % 2147483647 == 1)
14433                       ? 1 : -1];
14434 int
14435 main (void)
14436 {
14437
14438   ;
14439   return 0;
14440 }
14441 _ACEOF
14442 rm -f "conftest.$ac_objext"
14443 if { (eval echo "$as_me:14443: \"$ac_compile\"") >&5
14444   (eval $ac_compile) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit "$ac_status"); } &&
14448          { ac_try='test -s "conftest.$ac_objext"'
14449   { (eval echo "$as_me:14449: \"$ac_try\"") >&5
14450   (eval $ac_try) 2>&5
14451   ac_status=$?
14452   echo "$as_me:14452: \$? = $ac_status" >&5
14453   (exit "$ac_status"); }; }; then
14454   break
14455 else
14456   echo "$as_me: failed program was:" >&5
14457 cat "conftest.$ac_ext" >&5
14458 fi
14459 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14460   cat >"conftest.$ac_ext" <<_ACEOF
14461 #line 14461 "configure"
14462 #include "confdefs.h"
14463 #define _FILE_OFFSET_BITS 64
14464 #include <sys/types.h>
14465  /* Check that off_t can represent 2**63 - 1 correctly.
14466     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14467     since some C++ compilers masquerading as C compilers
14468     incorrectly reject 9223372036854775807.  */
14469 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14470   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14471                        && LARGE_OFF_T % 2147483647 == 1)
14472                       ? 1 : -1];
14473 int
14474 main (void)
14475 {
14476
14477   ;
14478   return 0;
14479 }
14480 _ACEOF
14481 rm -f "conftest.$ac_objext"
14482 if { (eval echo "$as_me:14482: \"$ac_compile\"") >&5
14483   (eval $ac_compile) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit "$ac_status"); } &&
14487          { ac_try='test -s "conftest.$ac_objext"'
14488   { (eval echo "$as_me:14488: \"$ac_try\"") >&5
14489   (eval $ac_try) 2>&5
14490   ac_status=$?
14491   echo "$as_me:14491: \$? = $ac_status" >&5
14492   (exit "$ac_status"); }; }; then
14493   ac_cv_sys_file_offset_bits=64; break
14494 else
14495   echo "$as_me: failed program was:" >&5
14496 cat "conftest.$ac_ext" >&5
14497 fi
14498 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14499   break
14500 done
14501 fi
14502 echo "$as_me:14502: result: $ac_cv_sys_file_offset_bits" >&5
14503 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14504 if test "$ac_cv_sys_file_offset_bits" != no; then
14505
14506 cat >>confdefs.h <<EOF
14507 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14508 EOF
14509
14510 fi
14511 rm -rf conftest*
14512   echo "$as_me:14512: checking for _LARGE_FILES value needed for large files" >&5
14513 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14514 if test "${ac_cv_sys_large_files+set}" = set; then
14515   echo $ECHO_N "(cached) $ECHO_C" >&6
14516 else
14517   while :; do
14518   ac_cv_sys_large_files=no
14519   cat >"conftest.$ac_ext" <<_ACEOF
14520 #line 14520 "configure"
14521 #include "confdefs.h"
14522 #include <sys/types.h>
14523  /* Check that off_t can represent 2**63 - 1 correctly.
14524     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14525     since some C++ compilers masquerading as C compilers
14526     incorrectly reject 9223372036854775807.  */
14527 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14528   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14529                        && LARGE_OFF_T % 2147483647 == 1)
14530                       ? 1 : -1];
14531 int
14532 main (void)
14533 {
14534
14535   ;
14536   return 0;
14537 }
14538 _ACEOF
14539 rm -f "conftest.$ac_objext"
14540 if { (eval echo "$as_me:14540: \"$ac_compile\"") >&5
14541   (eval $ac_compile) 2>&5
14542   ac_status=$?
14543   echo "$as_me:14543: \$? = $ac_status" >&5
14544   (exit "$ac_status"); } &&
14545          { ac_try='test -s "conftest.$ac_objext"'
14546   { (eval echo "$as_me:14546: \"$ac_try\"") >&5
14547   (eval $ac_try) 2>&5
14548   ac_status=$?
14549   echo "$as_me:14549: \$? = $ac_status" >&5
14550   (exit "$ac_status"); }; }; then
14551   break
14552 else
14553   echo "$as_me: failed program was:" >&5
14554 cat "conftest.$ac_ext" >&5
14555 fi
14556 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14557   cat >"conftest.$ac_ext" <<_ACEOF
14558 #line 14558 "configure"
14559 #include "confdefs.h"
14560 #define _LARGE_FILES 1
14561 #include <sys/types.h>
14562  /* Check that off_t can represent 2**63 - 1 correctly.
14563     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14564     since some C++ compilers masquerading as C compilers
14565     incorrectly reject 9223372036854775807.  */
14566 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14567   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14568                        && LARGE_OFF_T % 2147483647 == 1)
14569                       ? 1 : -1];
14570 int
14571 main (void)
14572 {
14573
14574   ;
14575   return 0;
14576 }
14577 _ACEOF
14578 rm -f "conftest.$ac_objext"
14579 if { (eval echo "$as_me:14579: \"$ac_compile\"") >&5
14580   (eval $ac_compile) 2>&5
14581   ac_status=$?
14582   echo "$as_me:14582: \$? = $ac_status" >&5
14583   (exit "$ac_status"); } &&
14584          { ac_try='test -s "conftest.$ac_objext"'
14585   { (eval echo "$as_me:14585: \"$ac_try\"") >&5
14586   (eval $ac_try) 2>&5
14587   ac_status=$?
14588   echo "$as_me:14588: \$? = $ac_status" >&5
14589   (exit "$ac_status"); }; }; then
14590   ac_cv_sys_large_files=1; break
14591 else
14592   echo "$as_me: failed program was:" >&5
14593 cat "conftest.$ac_ext" >&5
14594 fi
14595 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14596   break
14597 done
14598 fi
14599 echo "$as_me:14599: result: $ac_cv_sys_large_files" >&5
14600 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14601 if test "$ac_cv_sys_large_files" != no; then
14602
14603 cat >>confdefs.h <<EOF
14604 #define _LARGE_FILES $ac_cv_sys_large_files
14605 EOF
14606
14607 fi
14608 rm -rf conftest*
14609 fi
14610
14611         if test "$enable_largefile" != no ; then
14612         echo "$as_me:14612: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14613 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14614 if test "${ac_cv_sys_largefile_source+set}" = set; then
14615   echo $ECHO_N "(cached) $ECHO_C" >&6
14616 else
14617   while :; do
14618   ac_cv_sys_largefile_source=no
14619   cat >"conftest.$ac_ext" <<_ACEOF
14620 #line 14620 "configure"
14621 #include "confdefs.h"
14622 #include <stdio.h>
14623 int
14624 main (void)
14625 {
14626 return !fseeko;
14627   ;
14628   return 0;
14629 }
14630 _ACEOF
14631 rm -f "conftest.$ac_objext"
14632 if { (eval echo "$as_me:14632: \"$ac_compile\"") >&5
14633   (eval $ac_compile) 2>&5
14634   ac_status=$?
14635   echo "$as_me:14635: \$? = $ac_status" >&5
14636   (exit "$ac_status"); } &&
14637          { ac_try='test -s "conftest.$ac_objext"'
14638   { (eval echo "$as_me:14638: \"$ac_try\"") >&5
14639   (eval $ac_try) 2>&5
14640   ac_status=$?
14641   echo "$as_me:14641: \$? = $ac_status" >&5
14642   (exit "$ac_status"); }; }; then
14643   break
14644 else
14645   echo "$as_me: failed program was:" >&5
14646 cat "conftest.$ac_ext" >&5
14647 fi
14648 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14649   cat >"conftest.$ac_ext" <<_ACEOF
14650 #line 14650 "configure"
14651 #include "confdefs.h"
14652 #define _LARGEFILE_SOURCE 1
14653 #include <stdio.h>
14654 int
14655 main (void)
14656 {
14657 return !fseeko;
14658   ;
14659   return 0;
14660 }
14661 _ACEOF
14662 rm -f "conftest.$ac_objext"
14663 if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5
14664   (eval $ac_compile) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit "$ac_status"); } &&
14668          { ac_try='test -s "conftest.$ac_objext"'
14669   { (eval echo "$as_me:14669: \"$ac_try\"") >&5
14670   (eval $ac_try) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit "$ac_status"); }; }; then
14674   ac_cv_sys_largefile_source=1; break
14675 else
14676   echo "$as_me: failed program was:" >&5
14677 cat "conftest.$ac_ext" >&5
14678 fi
14679 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14680   break
14681 done
14682 fi
14683 echo "$as_me:14683: result: $ac_cv_sys_largefile_source" >&5
14684 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14685 if test "$ac_cv_sys_largefile_source" != no; then
14686
14687 cat >>confdefs.h <<EOF
14688 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14689 EOF
14690
14691 fi
14692 rm -rf conftest*
14693
14694 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14695 # in glibc 2.1.3, but that breaks too many other things.
14696 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14697 echo "$as_me:14697: checking for fseeko" >&5
14698 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14699 if test "${ac_cv_func_fseeko+set}" = set; then
14700   echo $ECHO_N "(cached) $ECHO_C" >&6
14701 else
14702   cat >"conftest.$ac_ext" <<_ACEOF
14703 #line 14703 "configure"
14704 #include "confdefs.h"
14705 #include <stdio.h>
14706 int
14707 main (void)
14708 {
14709 return fseeko && fseeko (stdin, 0, 0);
14710   ;
14711   return 0;
14712 }
14713 _ACEOF
14714 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14715 if { (eval echo "$as_me:14715: \"$ac_link\"") >&5
14716   (eval $ac_link) 2>&5
14717   ac_status=$?
14718   echo "$as_me:14718: \$? = $ac_status" >&5
14719   (exit "$ac_status"); } &&
14720          { ac_try='test -s "conftest$ac_exeext"'
14721   { (eval echo "$as_me:14721: \"$ac_try\"") >&5
14722   (eval $ac_try) 2>&5
14723   ac_status=$?
14724   echo "$as_me:14724: \$? = $ac_status" >&5
14725   (exit "$ac_status"); }; }; then
14726   ac_cv_func_fseeko=yes
14727 else
14728   echo "$as_me: failed program was:" >&5
14729 cat "conftest.$ac_ext" >&5
14730 ac_cv_func_fseeko=no
14731 fi
14732 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14733 fi
14734 echo "$as_me:14734: result: $ac_cv_func_fseeko" >&5
14735 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14736 if test $ac_cv_func_fseeko = yes; then
14737
14738 cat >>confdefs.h <<\EOF
14739 #define HAVE_FSEEKO 1
14740 EOF
14741
14742 fi
14743
14744         # Normally we would collect these definitions in the config.h,
14745         # but (like _XOPEN_SOURCE), some environments rely on having these
14746         # defined before any of the system headers are included.  Another
14747         # case comes up with C++, e.g., on AIX the compiler compiles the
14748         # header files by themselves before looking at the body files it is
14749         # told to compile.  For ncurses, those header files do not include
14750         # the config.h
14751         if test "$ac_cv_sys_large_files" != no
14752         then
14753
14754         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14755         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14756
14757         fi
14758         if test "$ac_cv_sys_largefile_source" != no
14759         then
14760
14761         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14762         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14763
14764         fi
14765         if test "$ac_cv_sys_file_offset_bits" != no
14766         then
14767
14768         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14769         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14770
14771         fi
14772
14773         echo "$as_me:14773: checking whether to use struct dirent64" >&5
14774 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14775 if test "${cf_cv_struct_dirent64+set}" = set; then
14776   echo $ECHO_N "(cached) $ECHO_C" >&6
14777 else
14778
14779                 cat >"conftest.$ac_ext" <<_ACEOF
14780 #line 14780 "configure"
14781 #include "confdefs.h"
14782
14783 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14784 #include <sys/types.h>
14785 #include <dirent.h>
14786
14787 int
14788 main (void)
14789 {
14790
14791                 /* if transitional largefile support is setup, this is true */
14792                 extern struct dirent64 * readdir(DIR *);
14793                 struct dirent64 *x = readdir((DIR *)0);
14794                 struct dirent *y = readdir((DIR *)0);
14795                 int z = x - y;
14796                 (void)z;
14797
14798   ;
14799   return 0;
14800 }
14801 _ACEOF
14802 rm -f "conftest.$ac_objext"
14803 if { (eval echo "$as_me:14803: \"$ac_compile\"") >&5
14804   (eval $ac_compile) 2>&5
14805   ac_status=$?
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit "$ac_status"); } &&
14808          { ac_try='test -s "conftest.$ac_objext"'
14809   { (eval echo "$as_me:14809: \"$ac_try\"") >&5
14810   (eval $ac_try) 2>&5
14811   ac_status=$?
14812   echo "$as_me:14812: \$? = $ac_status" >&5
14813   (exit "$ac_status"); }; }; then
14814   cf_cv_struct_dirent64=yes
14815 else
14816   echo "$as_me: failed program was:" >&5
14817 cat "conftest.$ac_ext" >&5
14818 cf_cv_struct_dirent64=no
14819 fi
14820 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14821
14822 fi
14823 echo "$as_me:14823: result: $cf_cv_struct_dirent64" >&5
14824 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14825         test "$cf_cv_struct_dirent64" = yes &&
14826 cat >>confdefs.h <<\EOF
14827 #define HAVE_STRUCT_DIRENT64 1
14828 EOF
14829
14830         fi
14831
14832 ### Enable compiling-in rcs id's
14833 echo "$as_me:14833: checking if RCS identifiers should be compiled-in" >&5
14834 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14835
14836 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14837 if test "${with_rcs_ids+set}" = set; then
14838   withval="$with_rcs_ids"
14839   with_rcs_ids=$withval
14840 else
14841   with_rcs_ids=no
14842 fi;
14843 echo "$as_me:14843: result: $with_rcs_ids" >&5
14844 echo "${ECHO_T}$with_rcs_ids" >&6
14845 test "$with_rcs_ids" = yes &&
14846 cat >>confdefs.h <<\EOF
14847 #define USE_RCS_IDS 1
14848 EOF
14849
14850 ###############################################################################
14851
14852 ### Note that some functions (such as const) are normally disabled anyway.
14853 echo "$as_me:14853: checking if you want to build with function extensions" >&5
14854 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14855
14856 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14857 if test "${enable_ext_funcs+set}" = set; then
14858   enableval="$enable_ext_funcs"
14859   with_ext_funcs=$enableval
14860 else
14861   with_ext_funcs=yes
14862 fi;
14863 echo "$as_me:14863: result: $with_ext_funcs" >&5
14864 echo "${ECHO_T}$with_ext_funcs" >&6
14865 if test "$with_ext_funcs" = yes ; then
14866         NCURSES_EXT_FUNCS=1
14867
14868 cat >>confdefs.h <<\EOF
14869 #define HAVE_USE_DEFAULT_COLORS 1
14870 EOF
14871
14872 cat >>confdefs.h <<\EOF
14873 #define NCURSES_EXT_FUNCS 1
14874 EOF
14875
14876 else
14877         NCURSES_EXT_FUNCS=0
14878 fi
14879
14880 ###   use option --enable-const to turn on use of const beyond that in XSI.
14881 echo "$as_me:14881: checking for extended use of const keyword" >&5
14882 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14883
14884 # Check whether --enable-const or --disable-const was given.
14885 if test "${enable_const+set}" = set; then
14886   enableval="$enable_const"
14887   with_ext_const=$enableval
14888 else
14889   with_ext_const=no
14890 fi;
14891 echo "$as_me:14891: result: $with_ext_const" >&5
14892 echo "${ECHO_T}$with_ext_const" >&6
14893 NCURSES_CONST='/*nothing*/'
14894 if test "$with_ext_const" = yes ; then
14895         NCURSES_CONST=const
14896 fi
14897
14898 ###############################################################################
14899 # These options are relatively safe to experiment with.
14900
14901 echo "$as_me:14901: checking if you want all development code" >&5
14902 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14903
14904 # Check whether --with-develop or --without-develop was given.
14905 if test "${with_develop+set}" = set; then
14906   withval="$with_develop"
14907   with_develop=$withval
14908 else
14909   with_develop=no
14910 fi;
14911 echo "$as_me:14911: result: $with_develop" >&5
14912 echo "${ECHO_T}$with_develop" >&6
14913
14914 ###############################################################################
14915 # These are just experimental, probably should not be in a package:
14916
14917 # This is still experimental (20080329), but should ultimately be moved to
14918 # the script-block --with-normal, etc.
14919
14920 echo "$as_me:14920: checking if you want to link with the pthread library" >&5
14921 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14922
14923 # Check whether --with-pthread or --without-pthread was given.
14924 if test "${with_pthread+set}" = set; then
14925   withval="$with_pthread"
14926   with_pthread=$withval
14927 else
14928   with_pthread=no
14929 fi;
14930 echo "$as_me:14930: result: $with_pthread" >&5
14931 echo "${ECHO_T}$with_pthread" >&6
14932
14933 if test "$with_pthread" != no ; then
14934         echo "$as_me:14934: checking for pthread.h" >&5
14935 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14936 if test "${ac_cv_header_pthread_h+set}" = set; then
14937   echo $ECHO_N "(cached) $ECHO_C" >&6
14938 else
14939   cat >"conftest.$ac_ext" <<_ACEOF
14940 #line 14940 "configure"
14941 #include "confdefs.h"
14942 #include <pthread.h>
14943 _ACEOF
14944 if { (eval echo "$as_me:14944: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14945   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14946   ac_status=$?
14947   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14948   rm -f conftest.er1
14949   cat conftest.err >&5
14950   echo "$as_me:14950: \$? = $ac_status" >&5
14951   (exit "$ac_status"); } >/dev/null; then
14952   if test -s conftest.err; then
14953     ac_cpp_err=$ac_c_preproc_warn_flag
14954   else
14955     ac_cpp_err=
14956   fi
14957 else
14958   ac_cpp_err=yes
14959 fi
14960 if test -z "$ac_cpp_err"; then
14961   ac_cv_header_pthread_h=yes
14962 else
14963   echo "$as_me: failed program was:" >&5
14964   cat "conftest.$ac_ext" >&5
14965   ac_cv_header_pthread_h=no
14966 fi
14967 rm -f conftest.err "conftest.$ac_ext"
14968 fi
14969 echo "$as_me:14969: result: $ac_cv_header_pthread_h" >&5
14970 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14971 if test "$ac_cv_header_pthread_h" = yes; then
14972
14973 cat >>confdefs.h <<\EOF
14974 #define HAVE_PTHREADS_H 1
14975 EOF
14976
14977         for cf_lib_pthread in pthread c_r
14978         do
14979             echo "$as_me:14979: checking if we can link with the $cf_lib_pthread library" >&5
14980 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14981             cf_save_LIBS="$LIBS"
14982
14983 cf_add_libs="$LIBS"
14984 # reverse order
14985 cf_add_0lib=
14986 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14987 # filter duplicates
14988 for cf_add_1lib in $cf_add_0lib; do
14989         for cf_add_2lib in $cf_add_libs; do
14990                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14991                         cf_add_1lib=
14992                         break
14993                 fi
14994         done
14995         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14996 done
14997 LIBS="$cf_add_libs"
14998
14999             cat >"conftest.$ac_ext" <<_ACEOF
15000 #line 15000 "configure"
15001 #include "confdefs.h"
15002
15003 #include <pthread.h>
15004
15005 int
15006 main (void)
15007 {
15008
15009                 int rc = pthread_create(0,0,0,0);
15010                 int r2 = pthread_mutexattr_settype(0, 0);
15011
15012   ;
15013   return 0;
15014 }
15015 _ACEOF
15016 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15017 if { (eval echo "$as_me:15017: \"$ac_link\"") >&5
15018   (eval $ac_link) 2>&5
15019   ac_status=$?
15020   echo "$as_me:15020: \$? = $ac_status" >&5
15021   (exit "$ac_status"); } &&
15022          { ac_try='test -s "conftest$ac_exeext"'
15023   { (eval echo "$as_me:15023: \"$ac_try\"") >&5
15024   (eval $ac_try) 2>&5
15025   ac_status=$?
15026   echo "$as_me:15026: \$? = $ac_status" >&5
15027   (exit "$ac_status"); }; }; then
15028   with_pthread=yes
15029 else
15030   echo "$as_me: failed program was:" >&5
15031 cat "conftest.$ac_ext" >&5
15032 with_pthread=no
15033 fi
15034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15035             LIBS="$cf_save_LIBS"
15036             echo "$as_me:15036: result: $with_pthread" >&5
15037 echo "${ECHO_T}$with_pthread" >&6
15038             test "$with_pthread" = yes && break
15039         done
15040
15041         if test "$with_pthread" = yes ; then
15042
15043 cf_add_libs="$LIBS"
15044 # reverse order
15045 cf_add_0lib=
15046 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15047 # filter duplicates
15048 for cf_add_1lib in $cf_add_0lib; do
15049         for cf_add_2lib in $cf_add_libs; do
15050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15051                         cf_add_1lib=
15052                         break
15053                 fi
15054         done
15055         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15056 done
15057 LIBS="$cf_add_libs"
15058
15059 cat >>confdefs.h <<\EOF
15060 #define HAVE_LIBPTHREADS 1
15061 EOF
15062
15063         else
15064             { { echo "$as_me:15064: error: Cannot link with pthread library" >&5
15065 echo "$as_me: error: Cannot link with pthread library" >&2;}
15066    { (exit 1); exit 1; }; }
15067         fi
15068
15069 fi
15070
15071 fi
15072
15073 echo "$as_me:15073: checking if you want to use weak-symbols for pthreads" >&5
15074 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15075
15076 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15077 if test "${enable_weak_symbols+set}" = set; then
15078   enableval="$enable_weak_symbols"
15079   use_weak_symbols=$withval
15080 else
15081   use_weak_symbols=no
15082 fi;
15083 echo "$as_me:15083: result: $use_weak_symbols" >&5
15084 echo "${ECHO_T}$use_weak_symbols" >&6
15085 if test "$use_weak_symbols" = yes ; then
15086
15087 echo "$as_me:15087: checking if $CC supports weak symbols" >&5
15088 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15089 if test "${cf_cv_weak_symbols+set}" = set; then
15090   echo $ECHO_N "(cached) $ECHO_C" >&6
15091 else
15092
15093 cat >"conftest.$ac_ext" <<_ACEOF
15094 #line 15094 "configure"
15095 #include "confdefs.h"
15096
15097 #include <stdio.h>
15098 int
15099 main (void)
15100 {
15101
15102 #if defined(__GNUC__)
15103 #  if defined __USE_ISOC99
15104 #    define _cat_pragma(exp)    _Pragma(#exp)
15105 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15106 #  else
15107 #    define _weak_pragma(exp)
15108 #  endif
15109 #  define _declare(name)        __extension__ extern __typeof__(name) name
15110 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15111 #endif
15112
15113 weak_symbol(fopen);
15114
15115   ;
15116   return 0;
15117 }
15118 _ACEOF
15119 rm -f "conftest.$ac_objext"
15120 if { (eval echo "$as_me:15120: \"$ac_compile\"") >&5
15121   (eval $ac_compile) 2>&5
15122   ac_status=$?
15123   echo "$as_me:15123: \$? = $ac_status" >&5
15124   (exit "$ac_status"); } &&
15125          { ac_try='test -s "conftest.$ac_objext"'
15126   { (eval echo "$as_me:15126: \"$ac_try\"") >&5
15127   (eval $ac_try) 2>&5
15128   ac_status=$?
15129   echo "$as_me:15129: \$? = $ac_status" >&5
15130   (exit "$ac_status"); }; }; then
15131   cf_cv_weak_symbols=yes
15132 else
15133   echo "$as_me: failed program was:" >&5
15134 cat "conftest.$ac_ext" >&5
15135 cf_cv_weak_symbols=no
15136 fi
15137 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15138
15139 fi
15140 echo "$as_me:15140: result: $cf_cv_weak_symbols" >&5
15141 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15142
15143 else
15144         cf_cv_weak_symbols=no
15145 fi
15146
15147 if test $cf_cv_weak_symbols = yes ; then
15148
15149 cat >>confdefs.h <<\EOF
15150 #define USE_WEAK_SYMBOLS 1
15151 EOF
15152
15153 fi
15154
15155 PTHREAD=
15156 if test "$with_pthread" = "yes" ; then
15157
15158 cat >>confdefs.h <<\EOF
15159 #define USE_PTHREADS 1
15160 EOF
15161
15162         enable_reentrant=yes
15163         if test $cf_cv_weak_symbols = yes ; then
15164                 PTHREAD=-lpthread
15165         fi
15166 fi
15167
15168 # OpenSUSE is installing ncurses6, using reentrant option.
15169 echo "$as_me:15169: checking for _nc_TABSIZE" >&5
15170 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15171 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15172   echo $ECHO_N "(cached) $ECHO_C" >&6
15173 else
15174   cat >"conftest.$ac_ext" <<_ACEOF
15175 #line 15175 "configure"
15176 #include "confdefs.h"
15177 #define _nc_TABSIZE autoconf_temporary
15178 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15179 #undef _nc_TABSIZE
15180
15181 #ifdef __cplusplus
15182 extern "C"
15183 #endif
15184
15185 /* We use char because int might match the return type of a gcc2
15186    builtin and then its argument prototype would still apply.  */
15187 char _nc_TABSIZE (void);
15188
15189 int
15190 main (void)
15191 {
15192
15193 /* The GNU C library defines stubs for functions which it implements
15194     to always fail with ENOSYS.  Some functions are actually named
15195     something starting with __ and the normal name is an alias.  */
15196 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15197 #error found stub for _nc_TABSIZE
15198 #endif
15199
15200         return _nc_TABSIZE ();
15201   ;
15202   return 0;
15203 }
15204 _ACEOF
15205 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15206 if { (eval echo "$as_me:15206: \"$ac_link\"") >&5
15207   (eval $ac_link) 2>&5
15208   ac_status=$?
15209   echo "$as_me:15209: \$? = $ac_status" >&5
15210   (exit "$ac_status"); } &&
15211          { ac_try='test -s "conftest$ac_exeext"'
15212   { (eval echo "$as_me:15212: \"$ac_try\"") >&5
15213   (eval $ac_try) 2>&5
15214   ac_status=$?
15215   echo "$as_me:15215: \$? = $ac_status" >&5
15216   (exit "$ac_status"); }; }; then
15217   ac_cv_func__nc_TABSIZE=yes
15218 else
15219   echo "$as_me: failed program was:" >&5
15220 cat "conftest.$ac_ext" >&5
15221 ac_cv_func__nc_TABSIZE=no
15222 fi
15223 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15224 fi
15225 echo "$as_me:15225: result: $ac_cv_func__nc_TABSIZE" >&5
15226 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15227 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15228   assume_reentrant=yes
15229 else
15230   assume_reentrant=no
15231 fi
15232
15233 # Reentrant code has to be opaque; there's little advantage to making ncurses
15234 # opaque outside of that, so there is no --enable-opaque option.  We can use
15235 # this option without --with-pthreads, but this will be always set for
15236 # pthreads.
15237 echo "$as_me:15237: checking if you want experimental reentrant code" >&5
15238 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15239
15240 # Check whether --enable-reentrant or --disable-reentrant was given.
15241 if test "${enable_reentrant+set}" = set; then
15242   enableval="$enable_reentrant"
15243   with_reentrant=$enableval
15244 else
15245   with_reentrant=$assume_reentrant
15246 fi;
15247 echo "$as_me:15247: result: $with_reentrant" >&5
15248 echo "${ECHO_T}$with_reentrant" >&6
15249 if test "$with_reentrant" = yes ; then
15250         cf_cv_enable_reentrant=1
15251         if test $cf_cv_weak_symbols = yes ; then
15252
15253 # remove pthread library from $LIBS
15254 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15255
15256         elif test "$assume_reentrant" = no ; then
15257                 LIB_SUFFIX="t${LIB_SUFFIX}"
15258         fi
15259
15260 cat >>confdefs.h <<\EOF
15261 #define USE_REENTRANT 1
15262 EOF
15263
15264 else
15265         cf_cv_enable_reentrant=0
15266 fi
15267
15268 ### Allow using a different wrap-prefix
15269 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15270         echo "$as_me:15270: checking for prefix used to wrap public variables" >&5
15271 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15272
15273 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15274 if test "${with_wrap_prefix+set}" = set; then
15275   withval="$with_wrap_prefix"
15276   NCURSES_WRAP_PREFIX=$withval
15277 else
15278   NCURSES_WRAP_PREFIX=_nc_
15279 fi;
15280         echo "$as_me:15280: result: $NCURSES_WRAP_PREFIX" >&5
15281 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15282 else
15283         NCURSES_WRAP_PREFIX=_nc_
15284 fi
15285
15286 cat >>confdefs.h <<EOF
15287 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15288 EOF
15289
15290 ###############################################################################
15291
15292 ###     use option --disable-echo to suppress full display compiling commands
15293
15294 echo "$as_me:15294: checking if you want to see long compiling messages" >&5
15295 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15296
15297 # Check whether --enable-echo or --disable-echo was given.
15298 if test "${enable_echo+set}" = set; then
15299   enableval="$enable_echo"
15300   test "$enableval" != no && enableval=yes
15301         if test "$enableval" != "yes" ; then
15302
15303         ECHO_LT='--silent'
15304         ECHO_LD='@echo linking $@;'
15305         RULE_CC='@echo compiling $<'
15306         SHOW_CC='@echo compiling $@'
15307         ECHO_CC='@'
15308
15309         else
15310
15311         ECHO_LT=''
15312         ECHO_LD=''
15313         RULE_CC=''
15314         SHOW_CC=''
15315         ECHO_CC=''
15316
15317         fi
15318 else
15319   enableval=yes
15320
15321         ECHO_LT=''
15322         ECHO_LD=''
15323         RULE_CC=''
15324         SHOW_CC=''
15325         ECHO_CC=''
15326
15327 fi;
15328 echo "$as_me:15328: result: $enableval" >&5
15329 echo "${ECHO_T}$enableval" >&6
15330
15331 echo "$as_me:15331: checking if you want to use C11 _Noreturn feature" >&5
15332 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15333
15334 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15335 if test "${enable_stdnoreturn+set}" = set; then
15336   enableval="$enable_stdnoreturn"
15337   test "$enableval" != yes && enableval=no
15338         if test "$enableval" != "no" ; then
15339     enable_stdnoreturn=yes
15340         else
15341                 enable_stdnoreturn=no
15342         fi
15343 else
15344   enableval=no
15345         enable_stdnoreturn=no
15346
15347 fi;
15348 echo "$as_me:15348: result: $enable_stdnoreturn" >&5
15349 echo "${ECHO_T}$enable_stdnoreturn" >&6
15350
15351 if test $enable_stdnoreturn = yes; then
15352 echo "$as_me:15352: checking for C11 _Noreturn feature" >&5
15353 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15354 if test "${cf_cv_c11_noreturn+set}" = set; then
15355   echo $ECHO_N "(cached) $ECHO_C" >&6
15356 else
15357   cat >"conftest.$ac_ext" <<_ACEOF
15358 #line 15358 "configure"
15359 #include "confdefs.h"
15360
15361 #include <stdio.h>
15362 #include <stdlib.h>
15363 #include <stdnoreturn.h>
15364 static _Noreturn void giveup(void) { exit(0); }
15365
15366 int
15367 main (void)
15368 {
15369 if (feof(stdin)) giveup()
15370   ;
15371   return 0;
15372 }
15373 _ACEOF
15374 rm -f "conftest.$ac_objext"
15375 if { (eval echo "$as_me:15375: \"$ac_compile\"") >&5
15376   (eval $ac_compile) 2>&5
15377   ac_status=$?
15378   echo "$as_me:15378: \$? = $ac_status" >&5
15379   (exit "$ac_status"); } &&
15380          { ac_try='test -s "conftest.$ac_objext"'
15381   { (eval echo "$as_me:15381: \"$ac_try\"") >&5
15382   (eval $ac_try) 2>&5
15383   ac_status=$?
15384   echo "$as_me:15384: \$? = $ac_status" >&5
15385   (exit "$ac_status"); }; }; then
15386   cf_cv_c11_noreturn=yes
15387 else
15388   echo "$as_me: failed program was:" >&5
15389 cat "conftest.$ac_ext" >&5
15390 cf_cv_c11_noreturn=no
15391 fi
15392 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15393
15394 fi
15395 echo "$as_me:15395: result: $cf_cv_c11_noreturn" >&5
15396 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15397 else
15398         cf_cv_c11_noreturn=no,
15399 fi
15400
15401 if test "$cf_cv_c11_noreturn" = yes; then
15402
15403 cat >>confdefs.h <<\EOF
15404 #define HAVE_STDNORETURN_H 1
15405 EOF
15406
15407 cat >>confdefs.h <<EOF
15408 #define STDC_NORETURN _Noreturn
15409 EOF
15410
15411         HAVE_STDNORETURN_H=1
15412 else
15413         HAVE_STDNORETURN_H=0
15414 fi
15415
15416 if test "$GCC" = yes || test "$GXX" = yes
15417 then
15418
15419 if test "$GCC" = yes || test "$GXX" = yes
15420 then
15421         case $CFLAGS in
15422         (*-Werror=*)
15423                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15424
15425 echo "${as_me:-configure}:15425: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15426
15427                 cf_temp_flags=
15428                 for cf_temp_scan in $CFLAGS
15429                 do
15430                         case "x$cf_temp_scan" in
15431                         (x-Werror=*)
15432
15433         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15434         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15435
15436                                 ;;
15437                         (*)
15438
15439         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15440         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15441
15442                                 ;;
15443                         esac
15444                 done
15445                 CFLAGS="$cf_temp_flags"
15446                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15447
15448 echo "${as_me:-configure}:15448: testing ... fixed $CFLAGS ..." 1>&5
15449
15450                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15451
15452 echo "${as_me:-configure}:15452: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15453
15454                 ;;
15455         esac
15456 fi
15457
15458 if test "$GCC" = yes || test "$GXX" = yes
15459 then
15460         case $CPPFLAGS in
15461         (*-Werror=*)
15462                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15463
15464 echo "${as_me:-configure}:15464: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15465
15466                 cf_temp_flags=
15467                 for cf_temp_scan in $CPPFLAGS
15468                 do
15469                         case "x$cf_temp_scan" in
15470                         (x-Werror=*)
15471
15472         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15473         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15474
15475                                 ;;
15476                         (*)
15477
15478         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15479         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15480
15481                                 ;;
15482                         esac
15483                 done
15484                 CPPFLAGS="$cf_temp_flags"
15485                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15486
15487 echo "${as_me:-configure}:15487: testing ... fixed $CPPFLAGS ..." 1>&5
15488
15489                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15490
15491 echo "${as_me:-configure}:15491: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15492
15493                 ;;
15494         esac
15495 fi
15496
15497 if test "$GCC" = yes || test "$GXX" = yes
15498 then
15499         case $LDFLAGS in
15500         (*-Werror=*)
15501                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15502
15503 echo "${as_me:-configure}:15503: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15504
15505                 cf_temp_flags=
15506                 for cf_temp_scan in $LDFLAGS
15507                 do
15508                         case "x$cf_temp_scan" in
15509                         (x-Werror=*)
15510
15511         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15512         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15513
15514                                 ;;
15515                         (*)
15516
15517         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15518         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15519
15520                                 ;;
15521                         esac
15522                 done
15523                 LDFLAGS="$cf_temp_flags"
15524                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15525
15526 echo "${as_me:-configure}:15526: testing ... fixed $LDFLAGS ..." 1>&5
15527
15528                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15529
15530 echo "${as_me:-configure}:15530: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15531
15532                 ;;
15533         esac
15534 fi
15535
15536 echo "$as_me:15536: checking if you want to turn on gcc warnings" >&5
15537 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15538
15539 # Check whether --enable-warnings or --disable-warnings was given.
15540 if test "${enable_warnings+set}" = set; then
15541   enableval="$enable_warnings"
15542   test "$enableval" != yes && enableval=no
15543         if test "$enableval" != "no" ; then
15544     enable_warnings=yes
15545         else
15546                 enable_warnings=no
15547         fi
15548 else
15549   enableval=no
15550         enable_warnings=no
15551
15552 fi;
15553 echo "$as_me:15553: result: $enable_warnings" >&5
15554 echo "${ECHO_T}$enable_warnings" >&6
15555 if test "$enable_warnings" = "yes"
15556 then
15557
15558 if test "x$have_x" = xyes; then
15559
15560 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15561 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15562 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15563 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15564 for cf_X_CFLAGS in $X_CFLAGS
15565 do
15566         case "x$cf_X_CFLAGS" in
15567         x-[IUD]*)
15568                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15569                 ;;
15570         *)
15571                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15572                 ;;
15573         esac
15574 done
15575
15576 cat >"conftest.$ac_ext" <<_ACEOF
15577 #line 15577 "configure"
15578 #include "confdefs.h"
15579
15580 #include <stdlib.h>
15581 #include <X11/Intrinsic.h>
15582
15583 int
15584 main (void)
15585 {
15586 String foo = malloc(1); free((void*)foo)
15587   ;
15588   return 0;
15589 }
15590 _ACEOF
15591 rm -f "conftest.$ac_objext"
15592 if { (eval echo "$as_me:15592: \"$ac_compile\"") >&5
15593   (eval $ac_compile) 2>&5
15594   ac_status=$?
15595   echo "$as_me:15595: \$? = $ac_status" >&5
15596   (exit "$ac_status"); } &&
15597          { ac_try='test -s "conftest.$ac_objext"'
15598   { (eval echo "$as_me:15598: \"$ac_try\"") >&5
15599   (eval $ac_try) 2>&5
15600   ac_status=$?
15601   echo "$as_me:15601: \$? = $ac_status" >&5
15602   (exit "$ac_status"); }; }; then
15603
15604 echo "$as_me:15604: checking for X11/Xt const-feature" >&5
15605 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15606 if test "${cf_cv_const_x_string+set}" = set; then
15607   echo $ECHO_N "(cached) $ECHO_C" >&6
15608 else
15609
15610         cat >"conftest.$ac_ext" <<_ACEOF
15611 #line 15611 "configure"
15612 #include "confdefs.h"
15613
15614 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15615 #undef  XTSTRINGDEFINES /* X11R5 and later */
15616 #include <stdlib.h>
15617 #include <X11/Intrinsic.h>
15618
15619 int
15620 main (void)
15621 {
15622 String foo = malloc(1); *foo = 0
15623   ;
15624   return 0;
15625 }
15626 _ACEOF
15627 rm -f "conftest.$ac_objext"
15628 if { (eval echo "$as_me:15628: \"$ac_compile\"") >&5
15629   (eval $ac_compile) 2>&5
15630   ac_status=$?
15631   echo "$as_me:15631: \$? = $ac_status" >&5
15632   (exit "$ac_status"); } &&
15633          { ac_try='test -s "conftest.$ac_objext"'
15634   { (eval echo "$as_me:15634: \"$ac_try\"") >&5
15635   (eval $ac_try) 2>&5
15636   ac_status=$?
15637   echo "$as_me:15637: \$? = $ac_status" >&5
15638   (exit "$ac_status"); }; }; then
15639
15640                         cf_cv_const_x_string=no
15641
15642 else
15643   echo "$as_me: failed program was:" >&5
15644 cat "conftest.$ac_ext" >&5
15645
15646                         cf_cv_const_x_string=yes
15647
15648 fi
15649 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15650
15651 fi
15652 echo "$as_me:15652: result: $cf_cv_const_x_string" >&5
15653 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15654
15655 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15656 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15657 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15658
15659 case "$cf_cv_const_x_string" in
15660 (no)
15661
15662         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15663         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15664
15665         ;;
15666 (*)
15667
15668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15669         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15670
15671         ;;
15672 esac
15673
15674 else
15675   echo "$as_me: failed program was:" >&5
15676 cat "conftest.$ac_ext" >&5
15677 fi
15678 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15679  fi
15680 cat > "conftest.$ac_ext" <<EOF
15681 #line 15681 "${as_me:-configure}"
15682 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15683 EOF
15684 if test "$INTEL_COMPILER" = yes
15685 then
15686 # The "-wdXXX" options suppress warnings:
15687 # remark #1419: external declaration in primary source file
15688 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15689 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15690 # remark #193: zero used for undefined preprocessing identifier
15691 # remark #593: variable "curs_sb_left_arrow" was set but never used
15692 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15693 # remark #869: parameter "tw" was never referenced
15694 # remark #981: operands are evaluated in unspecified order
15695 # warning #279: controlling expression is constant
15696
15697         { echo "$as_me:15697: checking for $CC warning options..." >&5
15698 echo "$as_me: checking for $CC warning options..." >&6;}
15699         cf_save_CFLAGS="$CFLAGS"
15700         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15701         for cf_opt in \
15702                 wd1419 \
15703                 wd1683 \
15704                 wd1684 \
15705                 wd193 \
15706                 wd593 \
15707                 wd279 \
15708                 wd810 \
15709                 wd869 \
15710                 wd981
15711         do
15712                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15713                 if { (eval echo "$as_me:15713: \"$ac_compile\"") >&5
15714   (eval $ac_compile) 2>&5
15715   ac_status=$?
15716   echo "$as_me:15716: \$? = $ac_status" >&5
15717   (exit "$ac_status"); }; then
15718                         test -n "$verbose" && echo "$as_me:15718: result: ... -$cf_opt" >&5
15719 echo "${ECHO_T}... -$cf_opt" >&6
15720                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15721                 fi
15722         done
15723         CFLAGS="$cf_save_CFLAGS"
15724 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15725 then
15726         { echo "$as_me:15726: checking for $CC warning options..." >&5
15727 echo "$as_me: checking for $CC warning options..." >&6;}
15728         cf_save_CFLAGS="$CFLAGS"
15729         cf_warn_CONST=""
15730         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15731         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15732         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15733         for cf_opt in W Wall \
15734                 Wbad-function-cast \
15735                 Wcast-align \
15736                 Wcast-qual \
15737                 Wdeclaration-after-statement \
15738                 Wextra \
15739                 Winline \
15740                 Wmissing-declarations \
15741                 Wmissing-prototypes \
15742                 Wnested-externs \
15743                 Wpointer-arith \
15744                 Wshadow \
15745                 Wstrict-prototypes \
15746                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15747         do
15748                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15749                 if { (eval echo "$as_me:15749: \"$ac_compile\"") >&5
15750   (eval $ac_compile) 2>&5
15751   ac_status=$?
15752   echo "$as_me:15752: \$? = $ac_status" >&5
15753   (exit "$ac_status"); }; then
15754                         test -n "$verbose" && echo "$as_me:15754: result: ... -$cf_opt" >&5
15755 echo "${ECHO_T}... -$cf_opt" >&6
15756                         case "$cf_opt" in
15757                         (Winline)
15758                                 case "$GCC_VERSION" in
15759                                 ([34].*)
15760                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15761
15762 echo "${as_me:-configure}:15762: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15763
15764                                         continue;;
15765                                 esac
15766                                 ;;
15767                         (Wpointer-arith)
15768                                 case "$GCC_VERSION" in
15769                                 ([12].*)
15770                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15771
15772 echo "${as_me:-configure}:15772: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15773
15774                                         continue;;
15775                                 esac
15776                                 ;;
15777                         esac
15778                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15779                 fi
15780         done
15781         CFLAGS="$cf_save_CFLAGS"
15782 fi
15783 rm -rf ./conftest*
15784
15785 fi
15786
15787 if test "$GCC" = yes || test "$GXX" = yes
15788 then
15789 cat > conftest.i <<EOF
15790 #ifndef GCC_PRINTF
15791 #define GCC_PRINTF 0
15792 #endif
15793 #ifndef GCC_SCANF
15794 #define GCC_SCANF 0
15795 #endif
15796 #ifndef GCC_NORETURN
15797 #define GCC_NORETURN /* nothing */
15798 #endif
15799 #ifndef GCC_UNUSED
15800 #define GCC_UNUSED /* nothing */
15801 #endif
15802 EOF
15803 if test "$GCC" = yes
15804 then
15805         { echo "$as_me:15805: checking for $CC __attribute__ directives..." >&5
15806 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15807 cat > "conftest.$ac_ext" <<EOF
15808 #line 15808 "${as_me:-configure}"
15809 #include "confdefs.h"
15810 #include "conftest.h"
15811 #include "conftest.i"
15812 #if     GCC_PRINTF
15813 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15814 #else
15815 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15816 #endif
15817 #if     GCC_SCANF
15818 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15819 #else
15820 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15821 #endif
15822 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15823 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15824 extern GCC_NORETURN void foo(void);
15825 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15826 EOF
15827         cf_printf_attribute=no
15828         cf_scanf_attribute=no
15829         for cf_attribute in scanf printf unused noreturn
15830         do
15831
15832 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15833
15834                 cf_directive="__attribute__(($cf_attribute))"
15835                 echo "checking for $CC $cf_directive" 1>&5
15836
15837                 case "$cf_attribute" in
15838                 (printf)
15839                         cf_printf_attribute=yes
15840                         cat >conftest.h <<EOF
15841 #define GCC_$cf_ATTRIBUTE 1
15842 EOF
15843                         ;;
15844                 (scanf)
15845                         cf_scanf_attribute=yes
15846                         cat >conftest.h <<EOF
15847 #define GCC_$cf_ATTRIBUTE 1
15848 EOF
15849                         ;;
15850                 (*)
15851                         cat >conftest.h <<EOF
15852 #define GCC_$cf_ATTRIBUTE $cf_directive
15853 EOF
15854                         ;;
15855                 esac
15856
15857                 if { (eval echo "$as_me:15857: \"$ac_compile\"") >&5
15858   (eval $ac_compile) 2>&5
15859   ac_status=$?
15860   echo "$as_me:15860: \$? = $ac_status" >&5
15861   (exit "$ac_status"); }; then
15862                         test -n "$verbose" && echo "$as_me:15862: result: ... $cf_attribute" >&5
15863 echo "${ECHO_T}... $cf_attribute" >&6
15864                         cat conftest.h >>confdefs.h
15865                         case "$cf_attribute" in
15866                         (noreturn)
15867
15868 cat >>confdefs.h <<EOF
15869 #define GCC_NORETURN $cf_directive
15870 EOF
15871
15872                                 ;;
15873                         (printf)
15874                                 cf_value='/* nothing */'
15875                                 if test "$cf_printf_attribute" != no ; then
15876                                         cf_value='__attribute__((format(printf,fmt,var)))'
15877
15878 cat >>confdefs.h <<\EOF
15879 #define GCC_PRINTF 1
15880 EOF
15881
15882                                 fi
15883
15884 cat >>confdefs.h <<EOF
15885 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15886 EOF
15887
15888                                 ;;
15889                         (scanf)
15890                                 cf_value='/* nothing */'
15891                                 if test "$cf_scanf_attribute" != no ; then
15892                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15893
15894 cat >>confdefs.h <<\EOF
15895 #define GCC_SCANF 1
15896 EOF
15897
15898                                 fi
15899
15900 cat >>confdefs.h <<EOF
15901 #define GCC_SCANFLIKE(fmt,var) $cf_value
15902 EOF
15903
15904                                 ;;
15905                         (unused)
15906
15907 cat >>confdefs.h <<EOF
15908 #define GCC_UNUSED $cf_directive
15909 EOF
15910
15911                                 ;;
15912                         esac
15913                 fi
15914         done
15915 else
15916         ${FGREP-fgrep} define conftest.i >>confdefs.h
15917 fi
15918 rm -rf ./conftest*
15919 fi
15920
15921 fi
15922
15923 if test "x$enable_warnings" = "xyes"; then
15924
15925         ADAFLAGS="$ADAFLAGS -gnatg"
15926
15927 fi
15928
15929 ###     use option --enable-assertions to turn on generation of assertion code
15930 echo "$as_me:15930: checking if you want to enable runtime assertions" >&5
15931 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15932
15933 # Check whether --enable-assertions or --disable-assertions was given.
15934 if test "${enable_assertions+set}" = set; then
15935   enableval="$enable_assertions"
15936   with_assertions=$enableval
15937 else
15938   with_assertions=no
15939 fi;
15940 echo "$as_me:15940: result: $with_assertions" >&5
15941 echo "${ECHO_T}$with_assertions" >&6
15942 if test -n "$GCC"
15943 then
15944         if test "$with_assertions" = no
15945         then
15946                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15947         else
15948
15949         ADAFLAGS="$ADAFLAGS -gnata"
15950
15951         fi
15952 fi
15953
15954 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15955
15956 cat >>confdefs.h <<\EOF
15957 #define HAVE_NC_ALLOC_H 1
15958 EOF
15959
15960 ###     use option --enable-expanded to generate certain macros as functions
15961
15962 # Check whether --enable-expanded or --disable-expanded was given.
15963 if test "${enable_expanded+set}" = set; then
15964   enableval="$enable_expanded"
15965   test "$enableval" = yes &&
15966 cat >>confdefs.h <<\EOF
15967 #define NCURSES_EXPANDED 1
15968 EOF
15969
15970 fi;
15971
15972 ###     use option --disable-macros to suppress macros in favor of functions
15973
15974 # Check whether --enable-macros or --disable-macros was given.
15975 if test "${enable_macros+set}" = set; then
15976   enableval="$enable_macros"
15977   test "$enableval" = no &&
15978 cat >>confdefs.h <<\EOF
15979 #define NCURSES_NOMACROS 1
15980 EOF
15981
15982 fi;
15983
15984 # Normally we only add trace() to the debug-library.  Allow this to be
15985 # extended to all models of the ncurses library:
15986 cf_all_traces=no
15987 case "$CFLAGS $CPPFLAGS" in
15988 (*-DTRACE*)
15989         cf_all_traces=yes
15990         ;;
15991 esac
15992
15993 echo "$as_me:15993: checking whether to add trace feature to all models" >&5
15994 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15995
15996 # Check whether --with-trace or --without-trace was given.
15997 if test "${with_trace+set}" = set; then
15998   withval="$with_trace"
15999   cf_with_trace=$withval
16000 else
16001   cf_with_trace=$cf_all_traces
16002 fi;
16003 echo "$as_me:16003: result: $cf_with_trace" >&5
16004 echo "${ECHO_T}$cf_with_trace" >&6
16005
16006 if test "$cf_with_trace" = yes ; then
16007         ADA_TRACE=TRUE
16008
16009 cf_fix_cppflags=no
16010 cf_new_cflags=
16011 cf_new_cppflags=
16012 cf_new_extra_cppflags=
16013
16014 for cf_add_cflags in -DTRACE
16015 do
16016 case "$cf_fix_cppflags" in
16017 (no)
16018         case "$cf_add_cflags" in
16019         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16020                 case "$cf_add_cflags" in
16021                 (-D*)
16022                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16023
16024                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16025                                 && test -z "${cf_tst_cflags}" \
16026                                 && cf_fix_cppflags=yes
16027
16028                         if test "$cf_fix_cppflags" = yes ; then
16029
16030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16032
16033                                 continue
16034                         elif test "${cf_tst_cflags}" = "\"'" ; then
16035
16036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16038
16039                                 continue
16040                         fi
16041                         ;;
16042                 esac
16043                 case "$CPPFLAGS" in
16044                 (*$cf_add_cflags)
16045                         ;;
16046                 (*)
16047                         case "$cf_add_cflags" in
16048                         (-D*)
16049                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16050
16051 CPPFLAGS=`echo "$CPPFLAGS" | \
16052         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16053                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16054
16055                                 ;;
16056                         esac
16057
16058         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16059         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16060
16061                         ;;
16062                 esac
16063                 ;;
16064         (*)
16065
16066         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16067         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16068
16069                 ;;
16070         esac
16071         ;;
16072 (yes)
16073
16074         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16075         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16076
16077         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16078
16079         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16080                 && test -z "${cf_tst_cflags}" \
16081                 && cf_fix_cppflags=no
16082         ;;
16083 esac
16084 done
16085
16086 if test -n "$cf_new_cflags" ; then
16087
16088         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16089         CFLAGS="${CFLAGS}$cf_new_cflags"
16090
16091 fi
16092
16093 if test -n "$cf_new_cppflags" ; then
16094
16095         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16096         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16097
16098 fi
16099
16100 if test -n "$cf_new_extra_cppflags" ; then
16101
16102         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16103         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16104
16105 fi
16106
16107 else
16108         ADA_TRACE=FALSE
16109 fi
16110
16111 echo "$as_me:16111: checking if we want to use GNAT projects" >&5
16112 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16113
16114 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16115 if test "${enable_gnat_projects+set}" = set; then
16116   enableval="$enable_gnat_projects"
16117   test "$enableval" != no && enableval=yes
16118         if test "$enableval" != "yes" ; then
16119     enable_gnat_projects=no
16120         else
16121                 enable_gnat_projects=yes
16122         fi
16123 else
16124   enableval=yes
16125         enable_gnat_projects=yes
16126
16127 fi;
16128 echo "$as_me:16128: result: $enable_gnat_projects" >&5
16129 echo "${ECHO_T}$enable_gnat_projects" >&6
16130
16131 ###     Checks for libraries.
16132 case $cf_cv_system_name in
16133 (*mingw32*)
16134         ;;
16135 (*)
16136 echo "$as_me:16136: checking for gettimeofday" >&5
16137 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16138 if test "${ac_cv_func_gettimeofday+set}" = set; then
16139   echo $ECHO_N "(cached) $ECHO_C" >&6
16140 else
16141   cat >"conftest.$ac_ext" <<_ACEOF
16142 #line 16142 "configure"
16143 #include "confdefs.h"
16144 #define gettimeofday autoconf_temporary
16145 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16146 #undef gettimeofday
16147
16148 #ifdef __cplusplus
16149 extern "C"
16150 #endif
16151
16152 /* We use char because int might match the return type of a gcc2
16153    builtin and then its argument prototype would still apply.  */
16154 char gettimeofday (void);
16155
16156 int
16157 main (void)
16158 {
16159
16160 /* The GNU C library defines stubs for functions which it implements
16161     to always fail with ENOSYS.  Some functions are actually named
16162     something starting with __ and the normal name is an alias.  */
16163 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16164 #error found stub for gettimeofday
16165 #endif
16166
16167         return gettimeofday ();
16168   ;
16169   return 0;
16170 }
16171 _ACEOF
16172 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16173 if { (eval echo "$as_me:16173: \"$ac_link\"") >&5
16174   (eval $ac_link) 2>&5
16175   ac_status=$?
16176   echo "$as_me:16176: \$? = $ac_status" >&5
16177   (exit "$ac_status"); } &&
16178          { ac_try='test -s "conftest$ac_exeext"'
16179   { (eval echo "$as_me:16179: \"$ac_try\"") >&5
16180   (eval $ac_try) 2>&5
16181   ac_status=$?
16182   echo "$as_me:16182: \$? = $ac_status" >&5
16183   (exit "$ac_status"); }; }; then
16184   ac_cv_func_gettimeofday=yes
16185 else
16186   echo "$as_me: failed program was:" >&5
16187 cat "conftest.$ac_ext" >&5
16188 ac_cv_func_gettimeofday=no
16189 fi
16190 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16191 fi
16192 echo "$as_me:16192: result: $ac_cv_func_gettimeofday" >&5
16193 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16194 if test "$ac_cv_func_gettimeofday" = yes; then
16195   cat >>confdefs.h <<\EOF
16196 #define HAVE_GETTIMEOFDAY 1
16197 EOF
16198
16199 else
16200
16201 echo "$as_me:16201: checking for gettimeofday in -lbsd" >&5
16202 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16203 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16204   echo $ECHO_N "(cached) $ECHO_C" >&6
16205 else
16206   ac_check_lib_save_LIBS=$LIBS
16207 LIBS="-lbsd  $LIBS"
16208 cat >"conftest.$ac_ext" <<_ACEOF
16209 #line 16209 "configure"
16210 #include "confdefs.h"
16211
16212 /* Override any gcc2 internal prototype to avoid an error.  */
16213 #ifdef __cplusplus
16214 extern "C"
16215 #endif
16216 /* We use char because int might match the return type of a gcc2
16217    builtin and then its argument prototype would still apply.  */
16218 char gettimeofday ();
16219 int
16220 main (void)
16221 {
16222 gettimeofday ();
16223   ;
16224   return 0;
16225 }
16226 _ACEOF
16227 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16228 if { (eval echo "$as_me:16228: \"$ac_link\"") >&5
16229   (eval $ac_link) 2>&5
16230   ac_status=$?
16231   echo "$as_me:16231: \$? = $ac_status" >&5
16232   (exit "$ac_status"); } &&
16233          { ac_try='test -s "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   ac_cv_lib_bsd_gettimeofday=yes
16240 else
16241   echo "$as_me: failed program was:" >&5
16242 cat "conftest.$ac_ext" >&5
16243 ac_cv_lib_bsd_gettimeofday=no
16244 fi
16245 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16246 LIBS=$ac_check_lib_save_LIBS
16247 fi
16248 echo "$as_me:16248: result: $ac_cv_lib_bsd_gettimeofday" >&5
16249 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16250 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16251
16252 cat >>confdefs.h <<\EOF
16253 #define HAVE_GETTIMEOFDAY 1
16254 EOF
16255
16256         LIBS="$LIBS -lbsd"
16257 fi
16258
16259 fi
16260         ;;
16261 esac
16262
16263 ###     Checks for header files.
16264 echo "$as_me:16264: checking for ANSI C header files" >&5
16265 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16266 if test "${ac_cv_header_stdc+set}" = set; then
16267   echo $ECHO_N "(cached) $ECHO_C" >&6
16268 else
16269   cat >"conftest.$ac_ext" <<_ACEOF
16270 #line 16270 "configure"
16271 #include "confdefs.h"
16272 #include <stdlib.h>
16273 #include <stdarg.h>
16274 #include <string.h>
16275 #include <float.h>
16276
16277 _ACEOF
16278 if { (eval echo "$as_me:16278: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16279   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16280   ac_status=$?
16281   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16282   rm -f conftest.er1
16283   cat conftest.err >&5
16284   echo "$as_me:16284: \$? = $ac_status" >&5
16285   (exit "$ac_status"); } >/dev/null; then
16286   if test -s conftest.err; then
16287     ac_cpp_err=$ac_c_preproc_warn_flag
16288   else
16289     ac_cpp_err=
16290   fi
16291 else
16292   ac_cpp_err=yes
16293 fi
16294 if test -z "$ac_cpp_err"; then
16295   ac_cv_header_stdc=yes
16296 else
16297   echo "$as_me: failed program was:" >&5
16298   cat "conftest.$ac_ext" >&5
16299   ac_cv_header_stdc=no
16300 fi
16301 rm -f conftest.err "conftest.$ac_ext"
16302
16303 if test $ac_cv_header_stdc = yes; then
16304   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16305   cat >"conftest.$ac_ext" <<_ACEOF
16306 #line 16306 "configure"
16307 #include "confdefs.h"
16308 #include <string.h>
16309
16310 _ACEOF
16311 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16312   $EGREP "memchr" >/dev/null 2>&1; then
16313   :
16314 else
16315   ac_cv_header_stdc=no
16316 fi
16317 rm -rf conftest*
16318
16319 fi
16320
16321 if test $ac_cv_header_stdc = yes; then
16322   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16323   cat >"conftest.$ac_ext" <<_ACEOF
16324 #line 16324 "configure"
16325 #include "confdefs.h"
16326 #include <stdlib.h>
16327
16328 _ACEOF
16329 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16330   $EGREP "free" >/dev/null 2>&1; then
16331   :
16332 else
16333   ac_cv_header_stdc=no
16334 fi
16335 rm -rf conftest*
16336
16337 fi
16338
16339 if test $ac_cv_header_stdc = yes; then
16340   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16341   if test "$cross_compiling" = yes; then
16342   :
16343 else
16344   cat >"conftest.$ac_ext" <<_ACEOF
16345 #line 16345 "configure"
16346 #include "confdefs.h"
16347 #include <ctype.h>
16348 #if ((' ' & 0x0FF) == 0x020)
16349 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16350 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16351 #else
16352 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16353                      || ('j' <= (c) && (c) <= 'r') \
16354                      || ('s' <= (c) && (c) <= 'z'))
16355 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16356 #endif
16357
16358 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16359 int
16360 main (void)
16361 {
16362   int i;
16363   for (i = 0; i < 256; i++)
16364     if (XOR (islower (i), ISLOWER (i))
16365         || toupper (i) != TOUPPER (i))
16366       $ac_main_return(2);
16367   $ac_main_return (0);
16368 }
16369 _ACEOF
16370 rm -f "conftest$ac_exeext"
16371 if { (eval echo "$as_me:16371: \"$ac_link\"") >&5
16372   (eval $ac_link) 2>&5
16373   ac_status=$?
16374   echo "$as_me:16374: \$? = $ac_status" >&5
16375   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16376   { (eval echo "$as_me:16376: \"$ac_try\"") >&5
16377   (eval $ac_try) 2>&5
16378   ac_status=$?
16379   echo "$as_me:16379: \$? = $ac_status" >&5
16380   (exit "$ac_status"); }; }; then
16381   :
16382 else
16383   echo "$as_me: program exited with status $ac_status" >&5
16384 echo "$as_me: failed program was:" >&5
16385 cat "conftest.$ac_ext" >&5
16386 ac_cv_header_stdc=no
16387 fi
16388 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16389 fi
16390 fi
16391 fi
16392 echo "$as_me:16392: result: $ac_cv_header_stdc" >&5
16393 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16394 if test $ac_cv_header_stdc = yes; then
16395
16396 cat >>confdefs.h <<\EOF
16397 #define STDC_HEADERS 1
16398 EOF
16399
16400 fi
16401
16402 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16403
16404 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16405                   inttypes.h stdint.h unistd.h
16406 do
16407 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16408 echo "$as_me:16408: checking for $ac_header" >&5
16409 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16410 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16411   echo $ECHO_N "(cached) $ECHO_C" >&6
16412 else
16413   cat >"conftest.$ac_ext" <<_ACEOF
16414 #line 16414 "configure"
16415 #include "confdefs.h"
16416 $ac_includes_default
16417 #include <$ac_header>
16418 _ACEOF
16419 rm -f "conftest.$ac_objext"
16420 if { (eval echo "$as_me:16420: \"$ac_compile\"") >&5
16421   (eval $ac_compile) 2>&5
16422   ac_status=$?
16423   echo "$as_me:16423: \$? = $ac_status" >&5
16424   (exit "$ac_status"); } &&
16425          { ac_try='test -s "conftest.$ac_objext"'
16426   { (eval echo "$as_me:16426: \"$ac_try\"") >&5
16427   (eval $ac_try) 2>&5
16428   ac_status=$?
16429   echo "$as_me:16429: \$? = $ac_status" >&5
16430   (exit "$ac_status"); }; }; then
16431   eval "$as_ac_Header=yes"
16432 else
16433   echo "$as_me: failed program was:" >&5
16434 cat "conftest.$ac_ext" >&5
16435 eval "$as_ac_Header=no"
16436 fi
16437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16438 fi
16439 echo "$as_me:16439: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16440 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16441 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16442   cat >>confdefs.h <<EOF
16443 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16444 EOF
16445
16446 fi
16447 done
16448
16449 echo "$as_me:16449: checking for signed char" >&5
16450 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16451 if test "${ac_cv_type_signed_char+set}" = set; then
16452   echo $ECHO_N "(cached) $ECHO_C" >&6
16453 else
16454   cat >"conftest.$ac_ext" <<_ACEOF
16455 #line 16455 "configure"
16456 #include "confdefs.h"
16457 $ac_includes_default
16458 int
16459 main (void)
16460 {
16461 if ((signed char *) 0)
16462   return 0;
16463 if (sizeof (signed char))
16464   return 0;
16465   ;
16466   return 0;
16467 }
16468 _ACEOF
16469 rm -f "conftest.$ac_objext"
16470 if { (eval echo "$as_me:16470: \"$ac_compile\"") >&5
16471   (eval $ac_compile) 2>&5
16472   ac_status=$?
16473   echo "$as_me:16473: \$? = $ac_status" >&5
16474   (exit "$ac_status"); } &&
16475          { ac_try='test -s "conftest.$ac_objext"'
16476   { (eval echo "$as_me:16476: \"$ac_try\"") >&5
16477   (eval $ac_try) 2>&5
16478   ac_status=$?
16479   echo "$as_me:16479: \$? = $ac_status" >&5
16480   (exit "$ac_status"); }; }; then
16481   ac_cv_type_signed_char=yes
16482 else
16483   echo "$as_me: failed program was:" >&5
16484 cat "conftest.$ac_ext" >&5
16485 ac_cv_type_signed_char=no
16486 fi
16487 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16488 fi
16489 echo "$as_me:16489: result: $ac_cv_type_signed_char" >&5
16490 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16491
16492 echo "$as_me:16492: checking size of signed char" >&5
16493 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16494 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16495   echo $ECHO_N "(cached) $ECHO_C" >&6
16496 else
16497   if test "$ac_cv_type_signed_char" = yes; then
16498   if test "$cross_compiling" = yes; then
16499   # Depending upon the size, compute the lo and hi bounds.
16500 cat >"conftest.$ac_ext" <<_ACEOF
16501 #line 16501 "configure"
16502 #include "confdefs.h"
16503 $ac_includes_default
16504 int
16505 main (void)
16506 {
16507 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16508   ;
16509   return 0;
16510 }
16511 _ACEOF
16512 rm -f "conftest.$ac_objext"
16513 if { (eval echo "$as_me:16513: \"$ac_compile\"") >&5
16514   (eval $ac_compile) 2>&5
16515   ac_status=$?
16516   echo "$as_me:16516: \$? = $ac_status" >&5
16517   (exit "$ac_status"); } &&
16518          { ac_try='test -s "conftest.$ac_objext"'
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_lo=0 ac_mid=0
16525   while :; do
16526     cat >"conftest.$ac_ext" <<_ACEOF
16527 #line 16527 "configure"
16528 #include "confdefs.h"
16529 $ac_includes_default
16530 int
16531 main (void)
16532 {
16533 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16534   ;
16535   return 0;
16536 }
16537 _ACEOF
16538 rm -f "conftest.$ac_objext"
16539 if { (eval echo "$as_me:16539: \"$ac_compile\"") >&5
16540   (eval $ac_compile) 2>&5
16541   ac_status=$?
16542   echo "$as_me:16542: \$? = $ac_status" >&5
16543   (exit "$ac_status"); } &&
16544          { ac_try='test -s "conftest.$ac_objext"'
16545   { (eval echo "$as_me:16545: \"$ac_try\"") >&5
16546   (eval $ac_try) 2>&5
16547   ac_status=$?
16548   echo "$as_me:16548: \$? = $ac_status" >&5
16549   (exit "$ac_status"); }; }; then
16550   ac_hi=$ac_mid; break
16551 else
16552   echo "$as_me: failed program was:" >&5
16553 cat "conftest.$ac_ext" >&5
16554 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16555 fi
16556 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16557   done
16558 else
16559   echo "$as_me: failed program was:" >&5
16560 cat "conftest.$ac_ext" >&5
16561 ac_hi=-1 ac_mid=-1
16562   while :; do
16563     cat >"conftest.$ac_ext" <<_ACEOF
16564 #line 16564 "configure"
16565 #include "confdefs.h"
16566 $ac_includes_default
16567 int
16568 main (void)
16569 {
16570 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16571   ;
16572   return 0;
16573 }
16574 _ACEOF
16575 rm -f "conftest.$ac_objext"
16576 if { (eval echo "$as_me:16576: \"$ac_compile\"") >&5
16577   (eval $ac_compile) 2>&5
16578   ac_status=$?
16579   echo "$as_me:16579: \$? = $ac_status" >&5
16580   (exit "$ac_status"); } &&
16581          { ac_try='test -s "conftest.$ac_objext"'
16582   { (eval echo "$as_me:16582: \"$ac_try\"") >&5
16583   (eval $ac_try) 2>&5
16584   ac_status=$?
16585   echo "$as_me:16585: \$? = $ac_status" >&5
16586   (exit "$ac_status"); }; }; then
16587   ac_lo=$ac_mid; break
16588 else
16589   echo "$as_me: failed program was:" >&5
16590 cat "conftest.$ac_ext" >&5
16591 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16592 fi
16593 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16594   done
16595 fi
16596 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16597 # Binary search between lo and hi bounds.
16598 while test "x$ac_lo" != "x$ac_hi"; do
16599   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16600   cat >"conftest.$ac_ext" <<_ACEOF
16601 #line 16601 "configure"
16602 #include "confdefs.h"
16603 $ac_includes_default
16604 int
16605 main (void)
16606 {
16607 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16608   ;
16609   return 0;
16610 }
16611 _ACEOF
16612 rm -f "conftest.$ac_objext"
16613 if { (eval echo "$as_me:16613: \"$ac_compile\"") >&5
16614   (eval $ac_compile) 2>&5
16615   ac_status=$?
16616   echo "$as_me:16616: \$? = $ac_status" >&5
16617   (exit "$ac_status"); } &&
16618          { ac_try='test -s "conftest.$ac_objext"'
16619   { (eval echo "$as_me:16619: \"$ac_try\"") >&5
16620   (eval $ac_try) 2>&5
16621   ac_status=$?
16622   echo "$as_me:16622: \$? = $ac_status" >&5
16623   (exit "$ac_status"); }; }; then
16624   ac_hi=$ac_mid
16625 else
16626   echo "$as_me: failed program was:" >&5
16627 cat "conftest.$ac_ext" >&5
16628 ac_lo=`expr "$ac_mid" + 1`
16629 fi
16630 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16631 done
16632 ac_cv_sizeof_signed_char=$ac_lo
16633 else
16634   if test "$cross_compiling" = yes; then
16635   { { echo "$as_me:16635: error: cannot run test program while cross compiling" >&5
16636 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16637    { (exit 1); exit 1; }; }
16638 else
16639   cat >"conftest.$ac_ext" <<_ACEOF
16640 #line 16640 "configure"
16641 #include "confdefs.h"
16642 $ac_includes_default
16643 int
16644 main (void)
16645 {
16646 FILE *f = fopen ("conftest.val", "w");
16647 if (!f)
16648   $ac_main_return (1);
16649 fprintf (f, "%ld", (long)(sizeof (signed char)));
16650 fclose (f);
16651   ;
16652   return 0;
16653 }
16654 _ACEOF
16655 rm -f "conftest$ac_exeext"
16656 if { (eval echo "$as_me:16656: \"$ac_link\"") >&5
16657   (eval $ac_link) 2>&5
16658   ac_status=$?
16659   echo "$as_me:16659: \$? = $ac_status" >&5
16660   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16661   { (eval echo "$as_me:16661: \"$ac_try\"") >&5
16662   (eval $ac_try) 2>&5
16663   ac_status=$?
16664   echo "$as_me:16664: \$? = $ac_status" >&5
16665   (exit "$ac_status"); }; }; then
16666   ac_cv_sizeof_signed_char=`cat conftest.val`
16667 else
16668   echo "$as_me: program exited with status $ac_status" >&5
16669 echo "$as_me: failed program was:" >&5
16670 cat "conftest.$ac_ext" >&5
16671 fi
16672 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16673 fi
16674 fi
16675 rm -f conftest.val
16676 else
16677   ac_cv_sizeof_signed_char=0
16678 fi
16679 fi
16680 echo "$as_me:16680: result: $ac_cv_sizeof_signed_char" >&5
16681 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16682 cat >>confdefs.h <<EOF
16683 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16684 EOF
16685
16686 echo "$as_me:16686: checking for ANSI C header files" >&5
16687 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16688 if test "${ac_cv_header_stdc+set}" = set; then
16689   echo $ECHO_N "(cached) $ECHO_C" >&6
16690 else
16691   cat >"conftest.$ac_ext" <<_ACEOF
16692 #line 16692 "configure"
16693 #include "confdefs.h"
16694 #include <stdlib.h>
16695 #include <stdarg.h>
16696 #include <string.h>
16697 #include <float.h>
16698
16699 _ACEOF
16700 if { (eval echo "$as_me:16700: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16701   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16702   ac_status=$?
16703   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16704   rm -f conftest.er1
16705   cat conftest.err >&5
16706   echo "$as_me:16706: \$? = $ac_status" >&5
16707   (exit "$ac_status"); } >/dev/null; then
16708   if test -s conftest.err; then
16709     ac_cpp_err=$ac_c_preproc_warn_flag
16710   else
16711     ac_cpp_err=
16712   fi
16713 else
16714   ac_cpp_err=yes
16715 fi
16716 if test -z "$ac_cpp_err"; then
16717   ac_cv_header_stdc=yes
16718 else
16719   echo "$as_me: failed program was:" >&5
16720   cat "conftest.$ac_ext" >&5
16721   ac_cv_header_stdc=no
16722 fi
16723 rm -f conftest.err "conftest.$ac_ext"
16724
16725 if test $ac_cv_header_stdc = yes; then
16726   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16727   cat >"conftest.$ac_ext" <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730 #include <string.h>
16731
16732 _ACEOF
16733 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16734   $EGREP "memchr" >/dev/null 2>&1; then
16735   :
16736 else
16737   ac_cv_header_stdc=no
16738 fi
16739 rm -rf conftest*
16740
16741 fi
16742
16743 if test $ac_cv_header_stdc = yes; then
16744   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16745   cat >"conftest.$ac_ext" <<_ACEOF
16746 #line 16746 "configure"
16747 #include "confdefs.h"
16748 #include <stdlib.h>
16749
16750 _ACEOF
16751 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16752   $EGREP "free" >/dev/null 2>&1; then
16753   :
16754 else
16755   ac_cv_header_stdc=no
16756 fi
16757 rm -rf conftest*
16758
16759 fi
16760
16761 if test $ac_cv_header_stdc = yes; then
16762   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16763   if test "$cross_compiling" = yes; then
16764   :
16765 else
16766   cat >"conftest.$ac_ext" <<_ACEOF
16767 #line 16767 "configure"
16768 #include "confdefs.h"
16769 #include <ctype.h>
16770 #if ((' ' & 0x0FF) == 0x020)
16771 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16772 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16773 #else
16774 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16775                      || ('j' <= (c) && (c) <= 'r') \
16776                      || ('s' <= (c) && (c) <= 'z'))
16777 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16778 #endif
16779
16780 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16781 int
16782 main (void)
16783 {
16784   int i;
16785   for (i = 0; i < 256; i++)
16786     if (XOR (islower (i), ISLOWER (i))
16787         || toupper (i) != TOUPPER (i))
16788       $ac_main_return(2);
16789   $ac_main_return (0);
16790 }
16791 _ACEOF
16792 rm -f "conftest$ac_exeext"
16793 if { (eval echo "$as_me:16793: \"$ac_link\"") >&5
16794   (eval $ac_link) 2>&5
16795   ac_status=$?
16796   echo "$as_me:16796: \$? = $ac_status" >&5
16797   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16798   { (eval echo "$as_me:16798: \"$ac_try\"") >&5
16799   (eval $ac_try) 2>&5
16800   ac_status=$?
16801   echo "$as_me:16801: \$? = $ac_status" >&5
16802   (exit "$ac_status"); }; }; then
16803   :
16804 else
16805   echo "$as_me: program exited with status $ac_status" >&5
16806 echo "$as_me: failed program was:" >&5
16807 cat "conftest.$ac_ext" >&5
16808 ac_cv_header_stdc=no
16809 fi
16810 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16811 fi
16812 fi
16813 fi
16814 echo "$as_me:16814: result: $ac_cv_header_stdc" >&5
16815 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16816 if test $ac_cv_header_stdc = yes; then
16817
16818 cat >>confdefs.h <<\EOF
16819 #define STDC_HEADERS 1
16820 EOF
16821
16822 fi
16823
16824 ac_header_dirent=no
16825 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16826   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16827 echo "$as_me:16827: checking for $ac_hdr that defines DIR" >&5
16828 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16829 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16830   echo $ECHO_N "(cached) $ECHO_C" >&6
16831 else
16832   cat >"conftest.$ac_ext" <<_ACEOF
16833 #line 16833 "configure"
16834 #include "confdefs.h"
16835 #include <sys/types.h>
16836 #include <$ac_hdr>
16837
16838 int
16839 main (void)
16840 {
16841 if ((DIR *) 0)
16842 return 0;
16843   ;
16844   return 0;
16845 }
16846 _ACEOF
16847 rm -f "conftest.$ac_objext"
16848 if { (eval echo "$as_me:16848: \"$ac_compile\"") >&5
16849   (eval $ac_compile) 2>&5
16850   ac_status=$?
16851   echo "$as_me:16851: \$? = $ac_status" >&5
16852   (exit "$ac_status"); } &&
16853          { ac_try='test -s "conftest.$ac_objext"'
16854   { (eval echo "$as_me:16854: \"$ac_try\"") >&5
16855   (eval $ac_try) 2>&5
16856   ac_status=$?
16857   echo "$as_me:16857: \$? = $ac_status" >&5
16858   (exit "$ac_status"); }; }; then
16859   eval "$as_ac_Header=yes"
16860 else
16861   echo "$as_me: failed program was:" >&5
16862 cat "conftest.$ac_ext" >&5
16863 eval "$as_ac_Header=no"
16864 fi
16865 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16866 fi
16867 echo "$as_me:16867: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16868 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16869 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16870   cat >>confdefs.h <<EOF
16871 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16872 EOF
16873
16874 ac_header_dirent=$ac_hdr; break
16875 fi
16876
16877 done
16878 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16879 if test $ac_header_dirent = dirent.h; then
16880   echo "$as_me:16880: checking for opendir in -ldir" >&5
16881 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16882 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16883   echo $ECHO_N "(cached) $ECHO_C" >&6
16884 else
16885   ac_check_lib_save_LIBS=$LIBS
16886 LIBS="-ldir  $LIBS"
16887 cat >"conftest.$ac_ext" <<_ACEOF
16888 #line 16888 "configure"
16889 #include "confdefs.h"
16890
16891 /* Override any gcc2 internal prototype to avoid an error.  */
16892 #ifdef __cplusplus
16893 extern "C"
16894 #endif
16895 /* We use char because int might match the return type of a gcc2
16896    builtin and then its argument prototype would still apply.  */
16897 char opendir ();
16898 int
16899 main (void)
16900 {
16901 opendir ();
16902   ;
16903   return 0;
16904 }
16905 _ACEOF
16906 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16907 if { (eval echo "$as_me:16907: \"$ac_link\"") >&5
16908   (eval $ac_link) 2>&5
16909   ac_status=$?
16910   echo "$as_me:16910: \$? = $ac_status" >&5
16911   (exit "$ac_status"); } &&
16912          { ac_try='test -s "conftest$ac_exeext"'
16913   { (eval echo "$as_me:16913: \"$ac_try\"") >&5
16914   (eval $ac_try) 2>&5
16915   ac_status=$?
16916   echo "$as_me:16916: \$? = $ac_status" >&5
16917   (exit "$ac_status"); }; }; then
16918   ac_cv_lib_dir_opendir=yes
16919 else
16920   echo "$as_me: failed program was:" >&5
16921 cat "conftest.$ac_ext" >&5
16922 ac_cv_lib_dir_opendir=no
16923 fi
16924 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16925 LIBS=$ac_check_lib_save_LIBS
16926 fi
16927 echo "$as_me:16927: result: $ac_cv_lib_dir_opendir" >&5
16928 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16929 if test "$ac_cv_lib_dir_opendir" = yes; then
16930   LIBS="$LIBS -ldir"
16931 fi
16932
16933 else
16934   echo "$as_me:16934: checking for opendir in -lx" >&5
16935 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16936 if test "${ac_cv_lib_x_opendir+set}" = set; then
16937   echo $ECHO_N "(cached) $ECHO_C" >&6
16938 else
16939   ac_check_lib_save_LIBS=$LIBS
16940 LIBS="-lx  $LIBS"
16941 cat >"conftest.$ac_ext" <<_ACEOF
16942 #line 16942 "configure"
16943 #include "confdefs.h"
16944
16945 /* Override any gcc2 internal prototype to avoid an error.  */
16946 #ifdef __cplusplus
16947 extern "C"
16948 #endif
16949 /* We use char because int might match the return type of a gcc2
16950    builtin and then its argument prototype would still apply.  */
16951 char opendir ();
16952 int
16953 main (void)
16954 {
16955 opendir ();
16956   ;
16957   return 0;
16958 }
16959 _ACEOF
16960 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16961 if { (eval echo "$as_me:16961: \"$ac_link\"") >&5
16962   (eval $ac_link) 2>&5
16963   ac_status=$?
16964   echo "$as_me:16964: \$? = $ac_status" >&5
16965   (exit "$ac_status"); } &&
16966          { ac_try='test -s "conftest$ac_exeext"'
16967   { (eval echo "$as_me:16967: \"$ac_try\"") >&5
16968   (eval $ac_try) 2>&5
16969   ac_status=$?
16970   echo "$as_me:16970: \$? = $ac_status" >&5
16971   (exit "$ac_status"); }; }; then
16972   ac_cv_lib_x_opendir=yes
16973 else
16974   echo "$as_me: failed program was:" >&5
16975 cat "conftest.$ac_ext" >&5
16976 ac_cv_lib_x_opendir=no
16977 fi
16978 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16979 LIBS=$ac_check_lib_save_LIBS
16980 fi
16981 echo "$as_me:16981: result: $ac_cv_lib_x_opendir" >&5
16982 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16983 if test "$ac_cv_lib_x_opendir" = yes; then
16984   LIBS="$LIBS -lx"
16985 fi
16986
16987 fi
16988
16989 echo "$as_me:16989: checking whether time.h and sys/time.h may both be included" >&5
16990 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16991 if test "${ac_cv_header_time+set}" = set; then
16992   echo $ECHO_N "(cached) $ECHO_C" >&6
16993 else
16994   cat >"conftest.$ac_ext" <<_ACEOF
16995 #line 16995 "configure"
16996 #include "confdefs.h"
16997 #include <sys/types.h>
16998 #include <sys/time.h>
16999 #include <time.h>
17000
17001 int
17002 main (void)
17003 {
17004 if ((struct tm *) 0)
17005 return 0;
17006   ;
17007   return 0;
17008 }
17009 _ACEOF
17010 rm -f "conftest.$ac_objext"
17011 if { (eval echo "$as_me:17011: \"$ac_compile\"") >&5
17012   (eval $ac_compile) 2>&5
17013   ac_status=$?
17014   echo "$as_me:17014: \$? = $ac_status" >&5
17015   (exit "$ac_status"); } &&
17016          { ac_try='test -s "conftest.$ac_objext"'
17017   { (eval echo "$as_me:17017: \"$ac_try\"") >&5
17018   (eval $ac_try) 2>&5
17019   ac_status=$?
17020   echo "$as_me:17020: \$? = $ac_status" >&5
17021   (exit "$ac_status"); }; }; then
17022   ac_cv_header_time=yes
17023 else
17024   echo "$as_me: failed program was:" >&5
17025 cat "conftest.$ac_ext" >&5
17026 ac_cv_header_time=no
17027 fi
17028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17029 fi
17030 echo "$as_me:17030: result: $ac_cv_header_time" >&5
17031 echo "${ECHO_T}$ac_cv_header_time" >&6
17032 if test $ac_cv_header_time = yes; then
17033
17034 cat >>confdefs.h <<\EOF
17035 #define TIME_WITH_SYS_TIME 1
17036 EOF
17037
17038 fi
17039
17040 ###     checks for compiler characteristics
17041 ac_ext=c
17042 ac_cpp='$CPP $CPPFLAGS'
17043 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17044 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17045 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17046 ac_main_return="return"
17047
17048 echo "$as_me:17048: checking for an ANSI C-conforming const" >&5
17049 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17050 if test "${ac_cv_c_const+set}" = set; then
17051   echo $ECHO_N "(cached) $ECHO_C" >&6
17052 else
17053   cat >"conftest.$ac_ext" <<_ACEOF
17054 #line 17054 "configure"
17055 #include "confdefs.h"
17056
17057 int
17058 main (void)
17059 {
17060 /* FIXME: Include the comments suggested by Paul. */
17061 #ifndef __cplusplus
17062   /* Ultrix mips cc rejects this.  */
17063   typedef int charset[2];
17064   const charset x;
17065   /* SunOS 4.1.1 cc rejects this.  */
17066   char const *const *ccp;
17067   char **p;
17068   /* NEC SVR4.0.2 mips cc rejects this.  */
17069   struct point {int x, y;};
17070   static struct point const zero = {0,0};
17071   /* AIX XL C 1.02.0.0 rejects this.
17072      It does not let you subtract one const X* pointer from another in
17073      an arm of an if-expression whose if-part is not a constant
17074      expression */
17075   const char *g = "string";
17076   ccp = &g + (g ? g-g : 0);
17077   /* HPUX 7.0 cc rejects these. */
17078   ++ccp;
17079   p = (char**) ccp;
17080   ccp = (char const *const *) p;
17081   { /* SCO 3.2v4 cc rejects this.  */
17082     char *t;
17083     char const *s = 0 ? (char *) 0 : (char const *) 0;
17084
17085     *t++ = 0;
17086   }
17087   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17088     int x[] = {25, 17};
17089     const int *foo = &x[0];
17090     ++foo;
17091   }
17092   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17093     typedef const int *iptr;
17094     iptr p = 0;
17095     ++p;
17096   }
17097   { /* AIX XL C 1.02.0.0 rejects this saying
17098        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17099     struct s { int j; const int *ap[3]; };
17100     struct s *b; b->j = 5;
17101   }
17102   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17103     const int foo = 10;
17104   }
17105 #endif
17106
17107   ;
17108   return 0;
17109 }
17110 _ACEOF
17111 rm -f "conftest.$ac_objext"
17112 if { (eval echo "$as_me:17112: \"$ac_compile\"") >&5
17113   (eval $ac_compile) 2>&5
17114   ac_status=$?
17115   echo "$as_me:17115: \$? = $ac_status" >&5
17116   (exit "$ac_status"); } &&
17117          { ac_try='test -s "conftest.$ac_objext"'
17118   { (eval echo "$as_me:17118: \"$ac_try\"") >&5
17119   (eval $ac_try) 2>&5
17120   ac_status=$?
17121   echo "$as_me:17121: \$? = $ac_status" >&5
17122   (exit "$ac_status"); }; }; then
17123   ac_cv_c_const=yes
17124 else
17125   echo "$as_me: failed program was:" >&5
17126 cat "conftest.$ac_ext" >&5
17127 ac_cv_c_const=no
17128 fi
17129 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17130 fi
17131 echo "$as_me:17131: result: $ac_cv_c_const" >&5
17132 echo "${ECHO_T}$ac_cv_c_const" >&6
17133 if test $ac_cv_c_const = no; then
17134
17135 cat >>confdefs.h <<\EOF
17136 #define const
17137 EOF
17138
17139 fi
17140
17141 ###     Checks for external-data
17142
17143 echo "$as_me:17143: checking if data-only library module links" >&5
17144 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17145 if test "${cf_cv_link_dataonly+set}" = set; then
17146   echo $ECHO_N "(cached) $ECHO_C" >&6
17147 else
17148
17149         rm -f conftest.a
17150         cat >conftest.$ac_ext <<EOF
17151 #line 17151 "configure"
17152 int     testdata[3] = { 123, 456, 789 };
17153 EOF
17154         if { (eval echo "$as_me:17154: \"$ac_compile\"") >&5
17155   (eval $ac_compile) 2>&5
17156   ac_status=$?
17157   echo "$as_me:17157: \$? = $ac_status" >&5
17158   (exit "$ac_status"); } ; then
17159                 mv conftest.o data.o && \
17160                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17161         fi
17162         rm -f conftest.$ac_ext data.o
17163         cat >conftest.$ac_ext <<EOF
17164 #line 17164 "configure"
17165 int     testfunc(void)
17166 {
17167 #if defined(NeXT)
17168         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17169 #else
17170         extern int testdata[3];
17171         return testdata[0] == 123
17172            &&  testdata[1] == 456
17173            &&  testdata[2] == 789;
17174 #endif
17175 }
17176 EOF
17177         if { (eval echo "$as_me:17177: \"$ac_compile\"") >&5
17178   (eval $ac_compile) 2>&5
17179   ac_status=$?
17180   echo "$as_me:17180: \$? = $ac_status" >&5
17181   (exit "$ac_status"); }; then
17182                 mv conftest.o func.o && \
17183                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17184         fi
17185         rm -f conftest.$ac_ext func.o
17186         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17187         cf_saveLIBS="$LIBS"
17188         LIBS="conftest.a $LIBS"
17189         if test "$cross_compiling" = yes; then
17190   cf_cv_link_dataonly=unknown
17191 else
17192   cat >"conftest.$ac_ext" <<_ACEOF
17193 #line 17193 "configure"
17194 #include "confdefs.h"
17195
17196         int main(void)
17197         {
17198                 extern int testfunc();
17199                 ${cf_cv_main_return:-return} (!testfunc());
17200         }
17201
17202 _ACEOF
17203 rm -f "conftest$ac_exeext"
17204 if { (eval echo "$as_me:17204: \"$ac_link\"") >&5
17205   (eval $ac_link) 2>&5
17206   ac_status=$?
17207   echo "$as_me:17207: \$? = $ac_status" >&5
17208   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17209   { (eval echo "$as_me:17209: \"$ac_try\"") >&5
17210   (eval $ac_try) 2>&5
17211   ac_status=$?
17212   echo "$as_me:17212: \$? = $ac_status" >&5
17213   (exit "$ac_status"); }; }; then
17214   cf_cv_link_dataonly=yes
17215 else
17216   echo "$as_me: program exited with status $ac_status" >&5
17217 echo "$as_me: failed program was:" >&5
17218 cat "conftest.$ac_ext" >&5
17219 cf_cv_link_dataonly=no
17220 fi
17221 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17222 fi
17223         LIBS="$cf_saveLIBS"
17224
17225 fi
17226
17227 echo "$as_me:17227: result: $cf_cv_link_dataonly" >&5
17228 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17229
17230 if test "$cf_cv_link_dataonly" = no ; then
17231
17232 cat >>confdefs.h <<\EOF
17233 #define BROKEN_LINKER 1
17234 EOF
17235
17236         BROKEN_LINKER=1
17237 fi
17238
17239 ###     Checks for library functions.
17240
17241 for ac_header in \
17242 unistd.h \
17243
17244 do
17245 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17246 echo "$as_me:17246: checking for $ac_header" >&5
17247 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17248 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17249   echo $ECHO_N "(cached) $ECHO_C" >&6
17250 else
17251   cat >"conftest.$ac_ext" <<_ACEOF
17252 #line 17252 "configure"
17253 #include "confdefs.h"
17254 #include <$ac_header>
17255 _ACEOF
17256 if { (eval echo "$as_me:17256: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17257   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17258   ac_status=$?
17259   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17260   rm -f conftest.er1
17261   cat conftest.err >&5
17262   echo "$as_me:17262: \$? = $ac_status" >&5
17263   (exit "$ac_status"); } >/dev/null; then
17264   if test -s conftest.err; then
17265     ac_cpp_err=$ac_c_preproc_warn_flag
17266   else
17267     ac_cpp_err=
17268   fi
17269 else
17270   ac_cpp_err=yes
17271 fi
17272 if test -z "$ac_cpp_err"; then
17273   eval "$as_ac_Header=yes"
17274 else
17275   echo "$as_me: failed program was:" >&5
17276   cat "conftest.$ac_ext" >&5
17277   eval "$as_ac_Header=no"
17278 fi
17279 rm -f conftest.err "conftest.$ac_ext"
17280 fi
17281 echo "$as_me:17281: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17282 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17283 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17284   cat >>confdefs.h <<EOF
17285 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17286 EOF
17287
17288 fi
17289 done
17290
17291 echo "$as_me:17291: checking for working mkstemp" >&5
17292 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17293 if test "${cf_cv_func_mkstemp+set}" = set; then
17294   echo $ECHO_N "(cached) $ECHO_C" >&6
17295 else
17296
17297 rm -rf ./conftest*
17298 if test "$cross_compiling" = yes; then
17299   cf_cv_func_mkstemp=maybe
17300 else
17301   cat >"conftest.$ac_ext" <<_ACEOF
17302 #line 17302 "configure"
17303 #include "confdefs.h"
17304
17305 #include <sys/types.h>
17306 #ifdef HAVE_UNISTD_H
17307 #include <unistd.h>
17308 #endif
17309 #include <stdlib.h>
17310 #include <stdio.h>
17311 #include <string.h>
17312 #include <sys/stat.h>
17313 int main(void)
17314 {
17315         char *tmpl = "conftestXXXXXX";
17316         char name[2][80];
17317         int n;
17318         int result = 0;
17319         int fd;
17320         struct stat sb;
17321
17322         umask(077);
17323         for (n = 0; n < 2; ++n) {
17324                 strcpy(name[n], tmpl);
17325                 if ((fd = mkstemp(name[n])) >= 0) {
17326                         if (!strcmp(name[n], tmpl)
17327                          || stat(name[n], &sb) != 0
17328                          || (sb.st_mode & S_IFMT) != S_IFREG
17329                          || (sb.st_mode & 077) != 0) {
17330                                 result = 1;
17331                         }
17332                         close(fd);
17333                 }
17334         }
17335         if (result == 0
17336          && !strcmp(name[0], name[1]))
17337                 result = 1;
17338         ${cf_cv_main_return:-return}(result);
17339 }
17340
17341 _ACEOF
17342 rm -f "conftest$ac_exeext"
17343 if { (eval echo "$as_me:17343: \"$ac_link\"") >&5
17344   (eval $ac_link) 2>&5
17345   ac_status=$?
17346   echo "$as_me:17346: \$? = $ac_status" >&5
17347   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17348   { (eval echo "$as_me:17348: \"$ac_try\"") >&5
17349   (eval $ac_try) 2>&5
17350   ac_status=$?
17351   echo "$as_me:17351: \$? = $ac_status" >&5
17352   (exit "$ac_status"); }; }; then
17353   cf_cv_func_mkstemp=yes
17354
17355 else
17356   echo "$as_me: program exited with status $ac_status" >&5
17357 echo "$as_me: failed program was:" >&5
17358 cat "conftest.$ac_ext" >&5
17359 cf_cv_func_mkstemp=no
17360
17361 fi
17362 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17363 fi
17364
17365 fi
17366 echo "$as_me:17366: result: $cf_cv_func_mkstemp" >&5
17367 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17368 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17369         echo "$as_me:17369: checking for mkstemp" >&5
17370 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17371 if test "${ac_cv_func_mkstemp+set}" = set; then
17372   echo $ECHO_N "(cached) $ECHO_C" >&6
17373 else
17374   cat >"conftest.$ac_ext" <<_ACEOF
17375 #line 17375 "configure"
17376 #include "confdefs.h"
17377 #define mkstemp autoconf_temporary
17378 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17379 #undef mkstemp
17380
17381 #ifdef __cplusplus
17382 extern "C"
17383 #endif
17384
17385 /* We use char because int might match the return type of a gcc2
17386    builtin and then its argument prototype would still apply.  */
17387 char mkstemp (void);
17388
17389 int
17390 main (void)
17391 {
17392
17393 /* The GNU C library defines stubs for functions which it implements
17394     to always fail with ENOSYS.  Some functions are actually named
17395     something starting with __ and the normal name is an alias.  */
17396 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17397 #error found stub for mkstemp
17398 #endif
17399
17400         return mkstemp ();
17401   ;
17402   return 0;
17403 }
17404 _ACEOF
17405 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17406 if { (eval echo "$as_me:17406: \"$ac_link\"") >&5
17407   (eval $ac_link) 2>&5
17408   ac_status=$?
17409   echo "$as_me:17409: \$? = $ac_status" >&5
17410   (exit "$ac_status"); } &&
17411          { ac_try='test -s "conftest$ac_exeext"'
17412   { (eval echo "$as_me:17412: \"$ac_try\"") >&5
17413   (eval $ac_try) 2>&5
17414   ac_status=$?
17415   echo "$as_me:17415: \$? = $ac_status" >&5
17416   (exit "$ac_status"); }; }; then
17417   ac_cv_func_mkstemp=yes
17418 else
17419   echo "$as_me: failed program was:" >&5
17420 cat "conftest.$ac_ext" >&5
17421 ac_cv_func_mkstemp=no
17422 fi
17423 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17424 fi
17425 echo "$as_me:17425: result: $ac_cv_func_mkstemp" >&5
17426 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17427
17428 fi
17429 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17430
17431 cat >>confdefs.h <<\EOF
17432 #define HAVE_MKSTEMP 1
17433 EOF
17434
17435 fi
17436
17437 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17438         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17439         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17440 fi
17441
17442 cf_with_ada=yes
17443 if test "$cf_with_ada" != "no" ; then
17444
17445 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17446 do
17447
17448 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17449
17450         unset ac_cv_path_cf_TEMP_gnat
17451         unset cf_TEMP_gnat
17452         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17453 set dummy $cf_prog_gnat; ac_word=$2
17454 echo "$as_me:17454: checking for $ac_word" >&5
17455 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17456 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17457   echo $ECHO_N "(cached) $ECHO_C" >&6
17458 else
17459   case $cf_TEMP_gnat in
17460   [\\/]* | ?:[\\/]*)
17461   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17462   ;;
17463   *)
17464   ac_save_IFS=$IFS; IFS=$ac_path_separator
17465 ac_dummy="$PATH"
17466 for ac_dir in $ac_dummy; do
17467   IFS=$ac_save_IFS
17468   test -z "$ac_dir" && ac_dir=.
17469   if $as_executable_p "$ac_dir/$ac_word"; then
17470    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17471    echo "$as_me:17471: found $ac_dir/$ac_word" >&5
17472    break
17473 fi
17474 done
17475
17476   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17477   ;;
17478 esac
17479 fi
17480 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17481
17482 if test -n "$cf_TEMP_gnat"; then
17483   echo "$as_me:17483: result: $cf_TEMP_gnat" >&5
17484 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17485 else
17486   echo "$as_me:17486: result: no" >&5
17487 echo "${ECHO_T}no" >&6
17488 fi
17489
17490         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17491
17492         if test "x$cf_TEMP_gnat" != xno; then
17493                 unset cf_cv_gnat_version
17494                 unset cf_TEMP_gnat
17495
17496 echo "$as_me:17496: checking for $cf_prog_gnat version" >&5
17497 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17498 if test "${cf_cv_gnat_version+set}" = set; then
17499   echo $ECHO_N "(cached) $ECHO_C" >&6
17500 else
17501
17502 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17503         grep '[0-9].[0-9][0-9]*' |\
17504         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17505
17506 fi
17507 echo "$as_me:17507: result: $cf_cv_gnat_version" >&5
17508 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17509 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17510 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17511
17512         fi
17513         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17514
17515         unset cf_TEMP_gnat
17516         unset cf_cv_gnat_version
17517         unset ac_cv_path_cf_TEMP_gnat
17518 done
17519
17520 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17521         cf_ada_make=
17522         cf_cv_prog_gnat_correct=no
17523 else
17524         cf_ada_make=gnatmake
17525         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17526                 # gprconfig is newer than gnatmake; we can continue...
17527                 cf_ada_config="##"
17528         else
17529                 rm -rf ./conftest* ./*~conftest*
17530                 if mkdir conftest.src
17531                 then
17532                         cf_ada_config=""
17533                         cd conftest.src
17534                         for cf_gprconfig in Ada C
17535                         do
17536                                 echo "$as_me:17536: checking for gprconfig name for $cf_gprconfig" >&5
17537 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17538                                 if test "$cf_gprconfig" = C
17539                                 then
17540                                         for cf_gprconfig_param in \
17541                                                 "$cf_gprconfig,,,,GNATGCC" \
17542                                                 "$cf_gprconfig,,,,GCC" \
17543                                                 "$cf_gprconfig"
17544                                         do
17545                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17546                                                 test -n "$cf_gprconfig_value" && break
17547                                         done
17548                                 else
17549                                         cf_gprconfig_param=$cf_gprconfig
17550                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17551                                 fi
17552                                 if test -n "$cf_gprconfig_value"
17553                                 then
17554                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17555                                         echo "$as_me:17555: result: $cf_gprconfig_value" >&5
17556 echo "${ECHO_T}$cf_gprconfig_value" >&6
17557                                 else
17558                                         echo "$as_me:17558: result: missing" >&5
17559 echo "${ECHO_T}missing" >&6
17560                                         cf_ada_config="#"
17561                                         break
17562                                 fi
17563                         done
17564                         cd ..
17565                         rm -rf ./conftest* ./*~conftest*
17566                 fi
17567         fi
17568         if test "x$cf_ada_config" != "x#"
17569         then
17570
17571 echo "$as_me:17571: checking for gnat version" >&5
17572 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17573 if test "${cf_cv_gnat_version+set}" = set; then
17574   echo $ECHO_N "(cached) $ECHO_C" >&6
17575 else
17576
17577 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17578         grep '[0-9].[0-9][0-9]*' |\
17579         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17580
17581 fi
17582 echo "$as_me:17582: result: $cf_cv_gnat_version" >&5
17583 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17584 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17585
17586 case "$cf_cv_gnat_version" in
17587 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17588         cf_cv_prog_gnat_correct=yes
17589         ;;
17590 (*)
17591         { echo "$as_me:17591: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17592 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17593         cf_cv_prog_gnat_correct=no
17594         ;;
17595 esac
17596
17597                 # Extract the first word of "m4", so it can be a program name with args.
17598 set dummy m4; ac_word=$2
17599 echo "$as_me:17599: checking for $ac_word" >&5
17600 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17601 if test "${ac_cv_prog_M4_exists+set}" = set; then
17602   echo $ECHO_N "(cached) $ECHO_C" >&6
17603 else
17604   if test -n "$M4_exists"; then
17605   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17606 else
17607   ac_save_IFS=$IFS; IFS=$ac_path_separator
17608 ac_dummy="$PATH"
17609 for ac_dir in $ac_dummy; do
17610   IFS=$ac_save_IFS
17611   test -z "$ac_dir" && ac_dir=.
17612   $as_executable_p "$ac_dir/$ac_word" || continue
17613 ac_cv_prog_M4_exists="yes"
17614 echo "$as_me:17614: found $ac_dir/$ac_word" >&5
17615 break
17616 done
17617
17618   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17619 fi
17620 fi
17621 M4_exists=$ac_cv_prog_M4_exists
17622 if test -n "$M4_exists"; then
17623   echo "$as_me:17623: result: $M4_exists" >&5
17624 echo "${ECHO_T}$M4_exists" >&6
17625 else
17626   echo "$as_me:17626: result: no" >&5
17627 echo "${ECHO_T}no" >&6
17628 fi
17629
17630                 if test "$ac_cv_prog_M4_exists" = no; then
17631                         cf_cv_prog_gnat_correct=no
17632                         { echo "$as_me:17632: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17633 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17634                 fi
17635                 if test "$cf_cv_prog_gnat_correct" = yes; then
17636                         echo "$as_me:17636: checking if GNAT works" >&5
17637 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17638
17639 rm -rf ./conftest* ./*~conftest*
17640 cat >>conftest.ads <<CF_EOF
17641 procedure conftest;
17642 CF_EOF
17643 cat >>conftest.adb <<CF_EOF
17644 with Text_IO;
17645 with GNAT.OS_Lib;
17646 procedure conftest is
17647 begin
17648    Text_IO.Put ("Hello World");
17649    Text_IO.New_Line;
17650    GNAT.OS_Lib.OS_Exit (0);
17651 end conftest;
17652 CF_EOF
17653 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17654    if ( ./conftest 1>&5 2>&1 ) ; then
17655       cf_cv_prog_gnat_correct=yes
17656    else
17657       cf_cv_prog_gnat_correct=no
17658    fi
17659 else
17660    cf_cv_prog_gnat_correct=no
17661 fi
17662 rm -rf ./conftest* ./*~conftest*
17663
17664                         echo "$as_me:17664: result: $cf_cv_prog_gnat_correct" >&5
17665 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17666                 fi
17667         else
17668                 cf_cv_prog_gnat_correct=no
17669         fi
17670 fi
17671
17672         if test "$cf_cv_prog_gnat_correct" = yes; then
17673
17674         echo "$as_me:17674: checking optimization options for ADAFLAGS" >&5
17675 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17676         case "$CFLAGS" in
17677         (*-g*)
17678
17679         ADAFLAGS="$ADAFLAGS -g"
17680
17681                 ;;
17682         esac
17683         case "$CFLAGS" in
17684         (*-O*)
17685                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17686
17687         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17688
17689                 ;;
17690         esac
17691         echo "$as_me:17691: result: $ADAFLAGS" >&5
17692 echo "${ECHO_T}$ADAFLAGS" >&6
17693
17694 echo "$as_me:17694: checking if GNATPREP supports -T option" >&5
17695 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17696 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17697   echo $ECHO_N "(cached) $ECHO_C" >&6
17698 else
17699
17700 cf_cv_gnatprep_opt_t=no
17701 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17702
17703 fi
17704 echo "$as_me:17704: result: $cf_cv_gnatprep_opt_t" >&5
17705 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17706 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17707
17708 echo "$as_me:17708: checking if GNAT supports generics" >&5
17709 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17710 case "$cf_cv_gnat_version" in
17711 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17712         cf_gnat_generics=yes
17713         ;;
17714 (*)
17715         cf_gnat_generics=no
17716         ;;
17717 esac
17718 echo "$as_me:17718: result: $cf_gnat_generics" >&5
17719 echo "${ECHO_T}$cf_gnat_generics" >&6
17720
17721 if test "$cf_gnat_generics" = yes
17722 then
17723         cf_compile_generics=generics
17724         cf_generic_objects="\${GENOBJS}"
17725 else
17726         cf_compile_generics=
17727         cf_generic_objects=
17728 fi
17729
17730 echo "$as_me:17730: checking if GNAT supports SIGINT" >&5
17731 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17732 if test "${cf_cv_gnat_sigint+set}" = set; then
17733   echo $ECHO_N "(cached) $ECHO_C" >&6
17734 else
17735
17736 rm -rf ./conftest* ./*~conftest*
17737 cat >>conftest.ads <<CF_EOF
17738 with Ada.Interrupts.Names;
17739
17740 package ConfTest is
17741
17742    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17743    pragma Unreserve_All_Interrupts;
17744    pragma Warnings (On);
17745
17746    protected Process is
17747       procedure Stop;
17748       function Continue return Boolean;
17749       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17750    private
17751       Done : Boolean := False;
17752    end Process;
17753
17754 end ConfTest;
17755 CF_EOF
17756 cat >>conftest.adb <<CF_EOF
17757 package body ConfTest is
17758    protected body Process is
17759       procedure Stop is
17760       begin
17761          Done := True;
17762       end Stop;
17763       function Continue return Boolean is
17764       begin
17765          return not Done;
17766       end Continue;
17767    end Process;
17768 end ConfTest;
17769 CF_EOF
17770 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17771       cf_cv_gnat_sigint=yes
17772 else
17773    cf_cv_gnat_sigint=no
17774 fi
17775 rm -rf ./conftest* ./*~conftest*
17776
17777 fi
17778 echo "$as_me:17778: result: $cf_cv_gnat_sigint" >&5
17779 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17780
17781 if test "$cf_cv_gnat_sigint" = yes ; then
17782         USE_GNAT_SIGINT=""
17783 else
17784         USE_GNAT_SIGINT="#"
17785 fi
17786
17787 cf_gnat_libraries=no
17788 cf_gnat_projects=no
17789
17790 if test "$enable_gnat_projects" != no ; then
17791 echo "$as_me:17791: checking if GNAT supports project files" >&5
17792 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17793 case "$cf_cv_gnat_version" in
17794 (3.[0-9]*)
17795         ;;
17796 (*)
17797         case "$cf_cv_system_name" in
17798         (cygwin*|msys*)
17799                 ;;
17800         (*)
17801                 rm -rf ./conftest* ./*~conftest*
17802                 if mkdir conftest.src conftest.bin conftest.lib
17803                 then
17804                         cd conftest.src
17805                         rm -rf ./conftest* ./*~conftest*
17806                         cat >>library.gpr <<CF_EOF
17807 project Library is
17808   Kind := External ("LIB_KIND");
17809   for Library_Name use "ConfTest";
17810   for Object_Dir use ".";
17811   for Library_ALI_Dir use External("LIBRARY_DIR");
17812   for Library_Version use External ("SONAME");
17813   for Library_Kind use Kind;
17814   for Library_Dir use External("BUILD_DIR");
17815   Source_Dir := External ("SOURCE_DIR");
17816   for Source_Dirs use (Source_Dir);
17817 end Library;
17818 CF_EOF
17819                         cat >>confpackage.ads <<CF_EOF
17820 package ConfPackage is
17821    procedure conftest;
17822 end ConfPackage;
17823 CF_EOF
17824                         cat >>confpackage.adb <<CF_EOF
17825 with Text_IO;
17826 package body ConfPackage is
17827    procedure conftest is
17828    begin
17829       Text_IO.Put ("Hello World");
17830       Text_IO.New_Line;
17831    end conftest;
17832 end ConfPackage;
17833 CF_EOF
17834                         if ( "$cf_ada_make" $ADAFLAGS \
17835                                         -Plibrary.gpr \
17836                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17837                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17838                                         -XSOURCE_DIR="`pwd`" \
17839                                         -XSONAME=libConfTest.so.1 \
17840                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17841                                 cf_gnat_projects=yes
17842                         fi
17843                         cd ..
17844                 fi
17845                 if test -f conftest.lib/confpackage.ali
17846                 then
17847                         cf_gnat_libraries=yes
17848                 fi
17849                 rm -rf ./conftest* ./*~conftest*
17850                 ;;
17851         esac
17852         ;;
17853 esac
17854 echo "$as_me:17854: result: $cf_gnat_projects" >&5
17855 echo "${ECHO_T}$cf_gnat_projects" >&6
17856 fi # enable_gnat_projects
17857
17858 if test "$cf_gnat_projects" = yes
17859 then
17860         echo "$as_me:17860: checking if GNAT supports libraries" >&5
17861 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17862         echo "$as_me:17862: result: $cf_gnat_libraries" >&5
17863 echo "${ECHO_T}$cf_gnat_libraries" >&6
17864 fi
17865
17866 USE_OLD_MAKERULES=""
17867 USE_GNAT_PROJECTS="#"
17868 USE_GNAT_MAKE_GPR="#"
17869 USE_GNAT_GPRBUILD="#"
17870
17871 if test "$cf_gnat_projects" = yes
17872 then
17873         USE_OLD_MAKERULES="#"
17874         USE_GNAT_PROJECTS=""
17875         if test "$cf_cv_VERSION_GPRBUILD" != no
17876         then
17877                 USE_GNAT_GPRBUILD=""
17878         elif test "$cf_cv_VERSION_GNATMAKE" != no
17879         then
17880                 USE_GNAT_MAKE_GPR=""
17881         else
17882                 { echo "$as_me:17882: WARNING: use old makefile rules since tools are missing" >&5
17883 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17884         fi
17885 fi
17886
17887 if test "$cf_gnat_libraries" = yes
17888 then
17889         USE_GNAT_LIBRARIES=""
17890 else
17891         USE_GNAT_LIBRARIES="#"
17892 fi
17893
17894 echo "$as_me:17894: checking for ada-compiler" >&5
17895 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17896
17897 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17898 if test "${with_ada_compiler+set}" = set; then
17899   withval="$with_ada_compiler"
17900   cf_ada_compiler=$withval
17901 else
17902   cf_ada_compiler=gnatmake
17903 fi;
17904
17905 echo "$as_me:17905: result: $cf_ada_compiler" >&5
17906 echo "${ECHO_T}$cf_ada_compiler" >&6
17907
17908                 cf_ada_package=terminal_interface
17909
17910 echo "$as_me:17910: checking for ada-include" >&5
17911 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17912
17913 # Check whether --with-ada-include or --without-ada-include was given.
17914 if test "${with_ada_include+set}" = set; then
17915   withval="$with_ada_include"
17916
17917 else
17918   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17919 fi; if test -n "$prefix/share/ada/adainclude" ; then
17920
17921 if test "x$prefix" != xNONE; then
17922         cf_path_syntax="$prefix"
17923 else
17924         cf_path_syntax="$ac_default_prefix"
17925 fi
17926
17927 case ".$withval" in
17928 (.\$\(*\)*|.\'*\'*)
17929         ;;
17930 (..|./*|.\\*)
17931         ;;
17932 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17933         ;;
17934 (.\$\{*prefix\}*|.\$\{*dir\}*)
17935         eval withval="$withval"
17936         case ".$withval" in
17937         (.NONE/*)
17938                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17939                 ;;
17940         esac
17941         ;;
17942 (.no|.NONE/*)
17943         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17944         ;;
17945 (*)
17946         { { echo "$as_me:17946: error: expected a pathname, not \"$withval\"" >&5
17947 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17948    { (exit 1); exit 1; }; }
17949         ;;
17950 esac
17951
17952 fi
17953 eval ADA_INCLUDE="$withval"
17954
17955 echo "$as_me:17955: result: $ADA_INCLUDE" >&5
17956 echo "${ECHO_T}$ADA_INCLUDE" >&6
17957
17958 echo "$as_me:17958: checking for ada-objects" >&5
17959 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17960
17961 # Check whether --with-ada-objects or --without-ada-objects was given.
17962 if test "${with_ada_objects+set}" = set; then
17963   withval="$with_ada_objects"
17964
17965 else
17966   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17967 fi; if test -n "$prefix/lib/ada/adalib" ; then
17968
17969 if test "x$prefix" != xNONE; then
17970         cf_path_syntax="$prefix"
17971 else
17972         cf_path_syntax="$ac_default_prefix"
17973 fi
17974
17975 case ".$withval" in
17976 (.\$\(*\)*|.\'*\'*)
17977         ;;
17978 (..|./*|.\\*)
17979         ;;
17980 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17981         ;;
17982 (.\$\{*prefix\}*|.\$\{*dir\}*)
17983         eval withval="$withval"
17984         case ".$withval" in
17985         (.NONE/*)
17986                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17987                 ;;
17988         esac
17989         ;;
17990 (.no|.NONE/*)
17991         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17992         ;;
17993 (*)
17994         { { echo "$as_me:17994: error: expected a pathname, not \"$withval\"" >&5
17995 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17996    { (exit 1); exit 1; }; }
17997         ;;
17998 esac
17999
18000 fi
18001 eval ADA_OBJECTS="$withval"
18002
18003 echo "$as_me:18003: result: $ADA_OBJECTS" >&5
18004 echo "${ECHO_T}$ADA_OBJECTS" >&6
18005
18006 echo "$as_me:18006: checking if an Ada95 shared-library should be built" >&5
18007 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18008
18009 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18010 if test "${with_ada_sharedlib+set}" = set; then
18011   withval="$with_ada_sharedlib"
18012   with_ada_sharedlib=$withval
18013 else
18014   with_ada_sharedlib=no
18015 fi;
18016 echo "$as_me:18016: result: $with_ada_sharedlib" >&5
18017 echo "${ECHO_T}$with_ada_sharedlib" >&6
18018
18019 if test "x$with_ada_sharedlib" != xno
18020 then
18021         if test "x$cf_gnat_projects" != xyes
18022         then
18023                 { echo "$as_me:18023: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18024 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18025                 with_ada_sharedlib=no
18026         fi
18027 fi
18028
18029 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18030 MAKE_ADA_SHAREDLIB="#"
18031
18032 if test "x$with_ada_sharedlib" != xno
18033 then
18034         MAKE_ADA_SHAREDLIB=
18035         if test "x$with_ada_sharedlib" != xyes
18036         then
18037                 ADA_SHAREDLIB="$with_ada_sharedlib"
18038         fi
18039 fi
18040
18041                 # allow the Ada binding to be renamed
18042
18043 echo "$as_me:18043: checking for ada-libname" >&5
18044 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18045
18046 # Check whether --with-ada-libname or --without-ada-libname was given.
18047 if test "${with_ada_libname+set}" = set; then
18048   withval="$with_ada_libname"
18049   ADA_LIBNAME=$withval
18050 else
18051   ADA_LIBNAME=AdaCurses
18052 fi;
18053 case "x$ADA_LIBNAME" in
18054 (x|xyes|xno)
18055         ADA_LIBNAME=AdaCurses
18056         ;;
18057 esac
18058
18059 echo "$as_me:18059: result: $ADA_LIBNAME" >&5
18060 echo "${ECHO_T}$ADA_LIBNAME" >&6
18061
18062         else
18063                 { { echo "$as_me:18063: error: No usable Ada compiler found" >&5
18064 echo "$as_me: error: No usable Ada compiler found" >&2;}
18065    { (exit 1); exit 1; }; }
18066         fi
18067 else
18068         { { echo "$as_me:18068: error: The Ada compiler is needed for this package" >&5
18069 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18070    { (exit 1); exit 1; }; }
18071 fi
18072
18073 ################################################################################
18074
18075 # not needed
18076 TINFO_LDFLAGS2=
18077
18078 TINFO_LIBS=
18079
18080 ### Construct the list of include-directories to be generated
18081
18082 if test "$srcdir" != "."; then
18083         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18084 fi
18085 CPPFLAGS="-I../include $CPPFLAGS"
18086 if test "$srcdir" != "."; then
18087         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18088 fi
18089 CPPFLAGS="-I. $CPPFLAGS"
18090
18091 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18092 if test "$srcdir" != "."; then
18093         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18094 fi
18095 if test "$GCC" != yes; then
18096         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18097 elif test "$includedir" != "/usr/include"; then
18098         if test "$includedir" = '${prefix}/include' ; then
18099                 if test x$prefix != x/usr ; then
18100                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18101                 fi
18102         else
18103                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18104         fi
18105 fi
18106
18107 ### Build up pieces for makefile rules
18108 echo "$as_me:18108: checking default library suffix" >&5
18109 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18110
18111         case $DFT_LWR_MODEL in
18112         (libtool) DFT_ARG_SUFFIX=''   ;;
18113         (normal)  DFT_ARG_SUFFIX=''   ;;
18114         (debug)   DFT_ARG_SUFFIX='_g' ;;
18115         (profile) DFT_ARG_SUFFIX='_p' ;;
18116         (shared)  DFT_ARG_SUFFIX=''   ;;
18117         esac
18118         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18119 echo "$as_me:18119: result: $DFT_ARG_SUFFIX" >&5
18120 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18121
18122 echo "$as_me:18122: checking default library-dependency suffix" >&5
18123 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18124
18125         case X$DFT_LWR_MODEL in
18126         (Xlibtool)
18127                 DFT_LIB_SUFFIX='.la'
18128                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18129                 ;;
18130         (Xdebug)
18131                 case "$cf_cv_system_name" in
18132                 (*-msvc*)
18133                         DFT_LIB_SUFFIX='_g.lib'
18134                         ;;
18135                 (*)
18136                         DFT_LIB_SUFFIX='_g.a'
18137                         ;;
18138                 esac
18139                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18140                 ;;
18141         (Xprofile)
18142                 case "$cf_cv_system_name" in
18143                 (*-msvc*)
18144                         DFT_LIB_SUFFIX='_p.lib'
18145                         ;;
18146                 (*)
18147                         DFT_LIB_SUFFIX='_p.a'
18148                         ;;
18149                 esac
18150                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18151                 ;;
18152         (Xshared)
18153                 case "$cf_cv_system_name" in
18154                 (aix[5-7]*)
18155                         DFT_LIB_SUFFIX='.so'
18156                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18157                         ;;
18158                 (*-msvc*)
18159                         DFT_LIB_SUFFIX='.dll'
18160                         DFT_DEP_SUFFIX='.dll.lib'
18161                         ;;
18162                 (cygwin*|msys*|mingw*)
18163                         DFT_LIB_SUFFIX='.dll'
18164                         DFT_DEP_SUFFIX='.dll.a'
18165                         ;;
18166                 (darwin*)
18167                         DFT_LIB_SUFFIX='.dylib'
18168                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18169                         ;;
18170                 (hpux*)
18171                         case "$target" in
18172                         (ia64*)
18173                                 DFT_LIB_SUFFIX='.so'
18174                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18175                                 ;;
18176                         (*)
18177                                 DFT_LIB_SUFFIX='.sl'
18178                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18179                                 ;;
18180                         esac
18181                         ;;
18182                 (*)
18183                         DFT_LIB_SUFFIX='.so'
18184                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18185                         ;;
18186                 esac
18187                 ;;
18188         (*)
18189                 case "$target" in
18190                 (*-msvc*)
18191                         DFT_LIB_SUFFIX='.lib'
18192                         ;;
18193                 (*)
18194                         DFT_LIB_SUFFIX='.a'
18195                         ;;
18196                 esac
18197                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18198                 ;;
18199         esac
18200         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18201         then
18202                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18203                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18204         fi
18205 echo "$as_me:18205: result: $DFT_DEP_SUFFIX" >&5
18206 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18207
18208 echo "$as_me:18208: checking default object directory" >&5
18209 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18210
18211         case $DFT_LWR_MODEL in
18212         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18213         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18214         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18215         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18216         (shared)
18217                 case "$cf_cv_system_name" in
18218                 (cygwin|msys)
18219                         DFT_OBJ_SUBDIR='objects' ;;
18220                 (*)
18221                         DFT_OBJ_SUBDIR='obj_s' ;;
18222                 esac
18223         esac
18224 echo "$as_me:18224: result: $DFT_OBJ_SUBDIR" >&5
18225 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18226
18227 ### Set up low-level terminfo dependencies for makefiles.
18228
18229 if test "$DFT_LWR_MODEL" = shared ; then
18230         case $cf_cv_system_name in
18231         (cygwin*)
18232                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18233                 ;;
18234         (msys*)
18235                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18236                 ;;
18237         esac
18238 fi
18239
18240 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18241
18242 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18243
18244 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18245
18246 ### Construct the list of subdirectories for which we'll customize makefiles
18247 ### with the appropriate compile-rules.
18248
18249 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18250
18251 cat >>confdefs.h <<EOF
18252 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18253 EOF
18254
18255 ################################################################################
18256
18257 TEST_ARG2=
18258
18259 TEST_LIBS2=
18260
18261 NCURSES_SHLIB2="sh -c"
18262
18263 ADA_SUBDIRS="include gen src doc"
18264 if test "x$cf_with_tests" != "xno" ; then
18265         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18266 fi
18267 for cf_dir in $ADA_SUBDIRS
18268 do
18269         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18270 done
18271
18272 NCURSES_TREE="#"
18273
18274 EXTERNAL_TREE=
18275
18276 # match layout used by make-tar.sh
18277 ADAHTML_DIR=../doc/ada
18278
18279 if test "x$cross_compiling" = xyes ; then
18280         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18281 else
18282         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18283 fi
18284
18285 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"
18286 ac_config_commands="$ac_config_commands default"
18287 cat >confcache <<\_ACEOF
18288 # This file is a shell script that caches the results of configure
18289 # tests run on this system so they can be shared between configure
18290 # scripts and configure runs, see configure's option --config-cache.
18291 # It is not useful on other systems.  If it contains results you don't
18292 # want to keep, you may remove or edit it.
18293 #
18294 # config.status only pays attention to the cache file if you give it
18295 # the --recheck option to rerun configure.
18296 #
18297 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18298 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18299 # following values.
18300
18301 _ACEOF
18302
18303 # The following way of writing the cache mishandles newlines in values,
18304 # but we know of no workaround that is simple, portable, and efficient.
18305 # So, don't put newlines in cache variables' values.
18306 # Ultrix sh set writes to stderr and can't be redirected directly,
18307 # and sets the high bit in the cache file unless we assign to the vars.
18308 {
18309   (set) 2>&1 |
18310     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18311     *ac_space=\ *)
18312       # `set' does not quote correctly, so add quotes (double-quote
18313       # substitution turns \\\\ into \\, and sed turns \\ into \).
18314       sed -n \
18315         "s/'/'\\\\''/g;
18316           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18317       ;;
18318     *)
18319       # `set' quotes correctly as required by POSIX, so do not add quotes.
18320       sed -n \
18321         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18322       ;;
18323     esac;
18324 } |
18325   sed '
18326      t clear
18327      : clear
18328      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18329      t end
18330      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18331      : end' >>confcache
18332 if cmp -s $cache_file confcache; then :; else
18333   if test -w $cache_file; then
18334     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18335     cat confcache >$cache_file
18336   else
18337     echo "not updating unwritable cache $cache_file"
18338   fi
18339 fi
18340 rm -f confcache
18341
18342 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18343 # Let make expand exec_prefix.
18344 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18345
18346 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18347 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18348 # trailing colons and then remove the whole line if VPATH becomes empty
18349 # (actually we leave an empty line to preserve line numbers).
18350 if test "x$srcdir" = x.; then
18351   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18352 s/:*\$(srcdir):*/:/;
18353 s/:*\${srcdir}:*/:/;
18354 s/:*@srcdir@:*/:/;
18355 s/^\([^=]*=[    ]*\):*/\1/;
18356 s/:*$//;
18357 s/^[^=]*=[      ]*$//;
18358 }'
18359 fi
18360
18361 DEFS=-DHAVE_CONFIG_H
18362
18363 : "${CONFIG_STATUS=./config.status}"
18364 ac_clean_files_save=$ac_clean_files
18365 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18366 { echo "$as_me:18366: creating $CONFIG_STATUS" >&5
18367 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18368 cat >"$CONFIG_STATUS" <<_ACEOF
18369 #! $SHELL
18370 # Generated automatically by configure.
18371 # Run this file to recreate the current configuration.
18372 # Compiler output produced by configure, useful for debugging
18373 # configure, is in config.log if it exists.
18374
18375 debug=false
18376 SHELL=\${CONFIG_SHELL-$SHELL}
18377 ac_cs_invocation="\$0 \$@"
18378
18379 CLICOLOR_FORCE= GREP_OPTIONS=
18380 unset CLICOLOR_FORCE GREP_OPTIONS
18381 _ACEOF
18382
18383 cat >>"$CONFIG_STATUS" <<\_ACEOF
18384 # Be Bourne compatible
18385 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18386   emulate sh
18387   NULLCMD=:
18388 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18389   set -o posix
18390 fi
18391
18392 # Name of the executable.
18393 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18394
18395 if expr a : '\(a\)' >/dev/null 2>&1; then
18396   as_expr=expr
18397 else
18398   as_expr=false
18399 fi
18400
18401 rm -f conf$$ conf$$.exe conf$$.file
18402 echo >conf$$.file
18403 if ln -s conf$$.file conf$$ 2>/dev/null; then
18404   # We could just check for DJGPP; but this test a) works b) is more generic
18405   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18406   if test -f conf$$.exe; then
18407     # Don't use ln at all; we don't have any links
18408     as_ln_s='cp -p'
18409   else
18410     as_ln_s='ln -s'
18411   fi
18412 elif ln conf$$.file conf$$ 2>/dev/null; then
18413   as_ln_s=ln
18414 else
18415   as_ln_s='cp -p'
18416 fi
18417 rm -f conf$$ conf$$.exe conf$$.file
18418
18419 as_executable_p="test -f"
18420
18421 # Support unset when possible.
18422 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18423   as_unset="unset"
18424 else
18425   as_unset="false"
18426 fi
18427
18428 # NLS nuisances.
18429 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18430 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18431 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18432 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18433 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18434 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18435 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18436 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18437
18438 # IFS
18439 # We need space, tab and new line, in precisely that order.
18440 as_nl='
18441 '
18442 IFS="   $as_nl"
18443
18444 # CDPATH.
18445 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18446
18447 exec 6>&1
18448
18449 _ACEOF
18450
18451 # Files that config.status was made for.
18452 if test -n "$ac_config_files"; then
18453   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18454 fi
18455
18456 if test -n "$ac_config_headers"; then
18457   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18458 fi
18459
18460 if test -n "$ac_config_links"; then
18461   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18462 fi
18463
18464 if test -n "$ac_config_commands"; then
18465   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18466 fi
18467
18468 cat >>"$CONFIG_STATUS" <<\EOF
18469
18470 ac_cs_usage="\
18471 \`$as_me' instantiates files from templates according to the
18472 current configuration.
18473
18474 Usage: $0 [OPTIONS] [FILE]...
18475
18476   -h, --help       print this help, then exit
18477   -V, --version    print version number, then exit
18478   -d, --debug      don't remove temporary files
18479       --recheck    update $as_me by reconfiguring in the same conditions
18480   --file=FILE[:TEMPLATE]
18481                    instantiate the configuration file FILE
18482   --header=FILE[:TEMPLATE]
18483                    instantiate the configuration header FILE
18484
18485 Configuration files:
18486 $config_files
18487
18488 Configuration headers:
18489 $config_headers
18490
18491 Configuration commands:
18492 $config_commands
18493
18494 Report bugs to <dickey@invisible-island.net>."
18495 EOF
18496
18497 cat >>"$CONFIG_STATUS" <<EOF
18498 ac_cs_version="\\
18499 config.status
18500 configured by $0, generated by GNU Autoconf 2.52.20210509,
18501   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18502
18503 Copyright 2003-2020,2021        Thomas E. Dickey
18504 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18505 Free Software Foundation, Inc.
18506 This config.status script is free software; the Free Software Foundation
18507 gives unlimited permission to copy, distribute and modify it."
18508 srcdir="$srcdir"
18509 INSTALL="$INSTALL"
18510 EOF
18511
18512 cat >>"$CONFIG_STATUS" <<\EOF
18513 # If no file are specified by the user, then we need to provide default
18514 # value.  By we need to know if files were specified by the user.
18515 ac_need_defaults=:
18516 while test $# != 0
18517 do
18518   case $1 in
18519   --*=*)
18520     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18521     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18522     shift
18523     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18524     shift
18525     ;;
18526   -*);;
18527   *) # This is not an option, so the user has probably given explicit
18528      # arguments.
18529      ac_need_defaults=false;;
18530   esac
18531
18532   case $1 in
18533   # Handling of the options.
18534 EOF
18535 cat >>"$CONFIG_STATUS" <<EOF
18536   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18537     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18538     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18539 EOF
18540 cat >>"$CONFIG_STATUS" <<\EOF
18541   --version | --vers* | -V )
18542     echo "$ac_cs_version"; exit 0 ;;
18543   --he | --h)
18544     # Conflict between --help and --header
18545     { { echo "$as_me:18545: error: ambiguous option: $1
18546 Try \`$0 --help' for more information." >&5
18547 echo "$as_me: error: ambiguous option: $1
18548 Try \`$0 --help' for more information." >&2;}
18549    { (exit 1); exit 1; }; };;
18550   --help | --hel | -h )
18551     echo "$ac_cs_usage"; exit 0 ;;
18552   --debug | --d* | -d )
18553     debug=: ;;
18554   --file | --fil | --fi | --f )
18555     shift
18556     CONFIG_FILES="$CONFIG_FILES $1"
18557     ac_need_defaults=false;;
18558   --header | --heade | --head | --hea )
18559     shift
18560     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18561     ac_need_defaults=false;;
18562
18563   # This is an error.
18564   -*) { { echo "$as_me:18564: error: unrecognized option: $1
18565 Try \`$0 --help' for more information." >&5
18566 echo "$as_me: error: unrecognized option: $1
18567 Try \`$0 --help' for more information." >&2;}
18568    { (exit 1); exit 1; }; } ;;
18569
18570   *) ac_config_targets="$ac_config_targets $1" ;;
18571
18572   esac
18573   shift
18574 done
18575
18576 exec 5>>config.log
18577 cat >&5 << _ACEOF
18578
18579 ## ----------------------- ##
18580 ## Running config.status.  ##
18581 ## ----------------------- ##
18582
18583 This file was extended by $as_me 2.52.20210509, executed with
18584   CONFIG_FILES    = $CONFIG_FILES
18585   CONFIG_HEADERS  = $CONFIG_HEADERS
18586   CONFIG_LINKS    = $CONFIG_LINKS
18587   CONFIG_COMMANDS = $CONFIG_COMMANDS
18588   > "$ac_cs_invocation"
18589 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18590
18591 _ACEOF
18592 EOF
18593
18594 cat >>"$CONFIG_STATUS" <<EOF
18595 #
18596 # INIT-COMMANDS section.
18597 #
18598
18599 ### Special initialization commands, used to pass information from the
18600 ### configuration-run into config.status
18601
18602 AWK="$AWK"
18603 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18604 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18605 LIB_NAME="$LIB_NAME"
18606 LIB_PREFIX="$LIB_PREFIX"
18607 LIB_SUFFIX="$LIB_SUFFIX"
18608 LN_S="$LN_S"
18609 NCURSES_MAJOR="$NCURSES_MAJOR"
18610 NCURSES_MINOR="$NCURSES_MINOR"
18611 NCURSES_PATCH="$NCURSES_PATCH"
18612 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18613 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18614 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18615 cf_cv_abi_version="$cf_cv_abi_version"
18616 cf_cv_rel_version="$cf_cv_rel_version"
18617 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18618 cf_cv_shared_soname='$cf_cv_shared_soname'
18619 cf_cv_shlib_version="$cf_cv_shlib_version"
18620 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18621 cf_cv_system_name="$cf_cv_system_name"
18622 host="$host"
18623 target="$target"
18624
18625 EOF
18626
18627 cat >>"$CONFIG_STATUS" <<\EOF
18628 for ac_config_target in $ac_config_targets
18629 do
18630   case "$ac_config_target" in
18631   # Handling of arguments.
18632   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18633   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18634   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18635   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18636   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18637   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18638   *) { { echo "$as_me:18638: error: invalid argument: $ac_config_target" >&5
18639 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18640    { (exit 1); exit 1; }; };;
18641   esac
18642 done
18643
18644 # If the user did not use the arguments to specify the items to instantiate,
18645 # then the envvar interface is used.  Set only those that are not.
18646 # We use the long form for the default assignment because of an extremely
18647 # bizarre bug on SunOS 4.1.3.
18648 if "$ac_need_defaults"; then
18649   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18650   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18651   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18652 fi
18653
18654 # Create a temporary directory, and hook for its removal unless debugging.
18655 $debug ||
18656 {
18657   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18658   trap '{ (exit 1); exit 1; }' 1 2 13 15
18659 }
18660
18661 # Create a (secure) tmp directory for tmp files.
18662 : ${TMPDIR=/tmp}
18663 {
18664   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18665   test -n "$tmp" && test -d "$tmp"
18666 }  ||
18667 {
18668   tmp=$TMPDIR/cs$$-$RANDOM
18669   (umask 077 && mkdir $tmp)
18670 } ||
18671 {
18672    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18673    { (exit 1); exit 1; }
18674 }
18675
18676 EOF
18677
18678 cat >>"$CONFIG_STATUS" <<EOF
18679
18680 #
18681 # CONFIG_FILES section.
18682 #
18683
18684 # No need to generate the scripts if there are no CONFIG_FILES.
18685 # This happens for instance when ./config.status config.h
18686 if test -n "\$CONFIG_FILES"; then
18687   # Protect against being on the right side of a sed subst in config.status.
18688   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18689    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18690 s,@SHELL@,$SHELL,;t t
18691 s,@exec_prefix@,$exec_prefix,;t t
18692 s,@prefix@,$prefix,;t t
18693 s,@program_transform_name@,$program_transform_name,;t t
18694 s,@bindir@,$bindir,;t t
18695 s,@sbindir@,$sbindir,;t t
18696 s,@libexecdir@,$libexecdir,;t t
18697 s,@datarootdir@,$datarootdir,;t t
18698 s,@datadir@,$datadir,;t t
18699 s,@sysconfdir@,$sysconfdir,;t t
18700 s,@sharedstatedir@,$sharedstatedir,;t t
18701 s,@localstatedir@,$localstatedir,;t t
18702 s,@runstatedir@,$runstatedir,;t t
18703 s,@libdir@,$libdir,;t t
18704 s,@includedir@,$includedir,;t t
18705 s,@oldincludedir@,$oldincludedir,;t t
18706 s,@infodir@,$infodir,;t t
18707 s,@mandir@,$mandir,;t t
18708 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18709 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18710 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18711 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18712 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18713 s,@build_alias@,$build_alias,;t t
18714 s,@host_alias@,$host_alias,;t t
18715 s,@target_alias@,$target_alias,;t t
18716 s,@ECHO_C@,$ECHO_C,;t t
18717 s,@ECHO_N@,$ECHO_N,;t t
18718 s,@ECHO_T@,$ECHO_T,;t t
18719 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18720 s,@DEFS@,$DEFS,;t t
18721 s,@LIBS@,$LIBS,;t t
18722 s,@top_builddir@,$top_builddir,;t t
18723 s,@build@,$build,;t t
18724 s,@build_cpu@,$build_cpu,;t t
18725 s,@build_vendor@,$build_vendor,;t t
18726 s,@build_os@,$build_os,;t t
18727 s,@host@,$host,;t t
18728 s,@host_cpu@,$host_cpu,;t t
18729 s,@host_vendor@,$host_vendor,;t t
18730 s,@host_os@,$host_os,;t t
18731 s,@target@,$target,;t t
18732 s,@target_cpu@,$target_cpu,;t t
18733 s,@target_vendor@,$target_vendor,;t t
18734 s,@target_os@,$target_os,;t t
18735 s,@GREP@,$GREP,;t t
18736 s,@FGREP@,$FGREP,;t t
18737 s,@CC@,$CC,;t t
18738 s,@CFLAGS@,$CFLAGS,;t t
18739 s,@LDFLAGS@,$LDFLAGS,;t t
18740 s,@CPPFLAGS@,$CPPFLAGS,;t t
18741 s,@ac_ct_CC@,$ac_ct_CC,;t t
18742 s,@EXEEXT@,$EXEEXT,;t t
18743 s,@OBJEXT@,$OBJEXT,;t t
18744 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18745 s,@CPP@,$CPP,;t t
18746 s,@EGREP@,$EGREP,;t t
18747 s,@AWK@,$AWK,;t t
18748 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18749 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18750 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18751 s,@LN_S@,$LN_S,;t t
18752 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18753 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18754 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18755 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18756 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18757 s,@SET_MAKE@,$SET_MAKE,;t t
18758 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18759 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18760 s,@CTAGS@,$CTAGS,;t t
18761 s,@ETAGS@,$ETAGS,;t t
18762 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18763 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18764 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18765 s,@RANLIB@,$RANLIB,;t t
18766 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18767 s,@LD@,$LD,;t t
18768 s,@ac_ct_LD@,$ac_ct_LD,;t t
18769 s,@AR@,$AR,;t t
18770 s,@ac_ct_AR@,$ac_ct_AR,;t t
18771 s,@ARFLAGS@,$ARFLAGS,;t t
18772 s,@DESTDIR@,$DESTDIR,;t t
18773 s,@BUILD_CC@,$BUILD_CC,;t t
18774 s,@BUILD_CPP@,$BUILD_CPP,;t t
18775 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18776 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18777 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18778 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18779 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18780 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18781 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18782 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18783 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18784 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18785 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18786 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18787 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18788 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18789 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18790 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18791 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18792 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18793 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18794 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18795 s,@CC_G_OPT@,$CC_G_OPT,;t t
18796 s,@LD_MODEL@,$LD_MODEL,;t t
18797 s,@shlibdir@,$shlibdir,;t t
18798 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18799 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18800 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18801 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18802 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18803 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18804 s,@LINK_PROGS@,$LINK_PROGS,;t t
18805 s,@LINK_TESTS@,$LINK_TESTS,;t t
18806 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18807 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18808 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18809 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18810 s,@RPATH_LIST@,$RPATH_LIST,;t t
18811 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18812 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18813 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18814 s,@PTHREAD@,$PTHREAD,;t t
18815 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18816 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18817 s,@ECHO_LT@,$ECHO_LT,;t t
18818 s,@ECHO_LD@,$ECHO_LD,;t t
18819 s,@RULE_CC@,$RULE_CC,;t t
18820 s,@SHOW_CC@,$SHOW_CC,;t t
18821 s,@ECHO_CC@,$ECHO_CC,;t t
18822 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18823 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18824 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18825 s,@ADAFLAGS@,$ADAFLAGS,;t t
18826 s,@ADA_TRACE@,$ADA_TRACE,;t t
18827 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18828 s,@M4_exists@,$M4_exists,;t t
18829 s,@cf_ada_make@,$cf_ada_make,;t t
18830 s,@cf_ada_config@,$cf_ada_config,;t t
18831 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18832 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18833 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18834 s,@cf_compile_generics@,$cf_compile_generics,;t t
18835 s,@cf_generic_objects@,$cf_generic_objects,;t t
18836 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18837 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18838 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18839 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18840 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18841 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18842 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18843 s,@cf_ada_package@,$cf_ada_package,;t t
18844 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18845 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18846 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18847 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18848 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18849 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18850 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18851 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18852 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18853 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18854 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18855 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18856 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18857 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18858 s,@TEST_ARG2@,$TEST_ARG2,;t t
18859 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18860 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18861 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18862 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18863 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18864 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18865 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18866 CEOF
18867
18868 EOF
18869
18870   cat >>"$CONFIG_STATUS" <<\EOF
18871   # Split the substitutions into bite-sized pieces for seds with
18872   # small command number limits, like on Digital OSF/1 and HP-UX.
18873   ac_max_sed_lines=48
18874   ac_sed_frag=1 # Number of current file.
18875   ac_beg=1 # First line for current file.
18876   ac_end=$ac_max_sed_lines # Line after last line for current file.
18877   ac_more_lines=:
18878   ac_sed_cmds=
18879   while "$ac_more_lines"; do
18880     if test "$ac_beg" -gt 1; then
18881       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18882     else
18883       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18884     fi
18885     if test ! -s $tmp/subs.frag; then
18886       ac_more_lines=false
18887     else
18888       # The purpose of the label and of the branching condition is to
18889       # speed up the sed processing (if there are no `@' at all, there
18890       # is no need to browse any of the substitutions).
18891       # These are the two extra sed commands mentioned above.
18892       (echo ':t
18893   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18894       # It is possible to make a multiline substitution using escaped newlines.
18895       # Ensure that we do not split the substitution between script fragments.
18896       ac_BEG=$ac_end
18897       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18898       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18899       if test -s $tmp/subs.next; then
18900         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18901         if test ! -s $tmp/subs.edit; then
18902           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18903           if test ! -s $tmp/subs.edit; then
18904             if test "$ac_beg" -gt 1; then
18905               ac_end=`expr "$ac_end" - 1`
18906               continue
18907             fi
18908           fi
18909         fi
18910       fi
18911
18912       if test -z "$ac_sed_cmds"; then
18913         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18914       else
18915         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18916       fi
18917       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18918       ac_beg=$ac_end
18919       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18920     fi
18921   done
18922   if test -z "$ac_sed_cmds"; then
18923     ac_sed_cmds=cat
18924   fi
18925 fi # test -n "$CONFIG_FILES"
18926
18927 EOF
18928 cat >>"$CONFIG_STATUS" <<\EOF
18929 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18930   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18931   case "$ac_file" in
18932   - | *:- | *:-:* ) # input from stdin
18933         cat >$tmp/stdin
18934         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18935         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18936   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18937         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18938   * )   ac_file_in=$ac_file.in ;;
18939   esac
18940
18941   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18942   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18943          X"$ac_file" : 'X\(//\)[^/]' \| \
18944          X"$ac_file" : 'X\(//\)$' \| \
18945          X"$ac_file" : 'X\(/\)' \| \
18946          .     : '\(.\)' 2>/dev/null ||
18947 echo X"$ac_file" |
18948     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18949           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18950           /^X\(\/\/\)$/{ s//\1/; q; }
18951           /^X\(\/\).*/{ s//\1/; q; }
18952           s/.*/./; q'`
18953   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18954     { case "$ac_dir" in
18955   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18956   *)                      as_incr_dir=.;;
18957 esac
18958 as_dummy="$ac_dir"
18959 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18960   case $as_mkdir_dir in
18961     # Skip DOS drivespec
18962     ?:) as_incr_dir=$as_mkdir_dir ;;
18963     *)
18964       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18965       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18966     ;;
18967   esac
18968 done; }
18969
18970     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18971     # A "../" for each directory in $ac_dir_suffix.
18972     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18973   else
18974     ac_dir_suffix= ac_dots=
18975   fi
18976
18977   case "$srcdir" in
18978   .)  ac_srcdir=.
18979       if test -z "$ac_dots"; then
18980          ac_top_srcdir=.
18981       else
18982          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18983       fi ;;
18984   [\\/]* | ?:[\\/]* )
18985       ac_srcdir="$srcdir$ac_dir_suffix";
18986       ac_top_srcdir="$srcdir" ;;
18987   *) # Relative path.
18988     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18989     ac_top_srcdir="$ac_dots$srcdir" ;;
18990   esac
18991
18992   case $INSTALL in
18993   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18994   *) ac_INSTALL=$ac_dots$INSTALL ;;
18995   esac
18996
18997   if test x"$ac_file" != x-; then
18998     { echo "$as_me:18998: creating $ac_file" >&5
18999 echo "$as_me: creating $ac_file" >&6;}
19000     rm -f "$ac_file"
19001   fi
19002   # Let's still pretend it is `configure' which instantiates (i.e., don't
19003   # use $as_me), people would be surprised to read:
19004   #    /* config.h.  Generated automatically by config.status.  */
19005   configure_input="Generated automatically from `echo $ac_file_in |
19006                                                  sed 's,.*/,,'` by configure."
19007
19008   # First look for the input files in the build tree, otherwise in the
19009   # src tree.
19010   ac_file_inputs=`IFS=:
19011     for f in $ac_file_in; do
19012       case $f in
19013       -) echo $tmp/stdin ;;
19014       [\\/$]*)
19015          # Absolute (can't be DOS-style, as IFS=:)
19016          test -f "$f" || { { echo "$as_me:19016: error: cannot find input file: $f" >&5
19017 echo "$as_me: error: cannot find input file: $f" >&2;}
19018    { (exit 1); exit 1; }; }
19019          echo $f;;
19020       *) # Relative
19021          if test -f "$f"; then
19022            # Build tree
19023            echo $f
19024          elif test -f "$srcdir/$f"; then
19025            # Source tree
19026            echo "$srcdir/$f"
19027          else
19028            # /dev/null tree
19029            { { echo "$as_me:19029: error: cannot find input file: $f" >&5
19030 echo "$as_me: error: cannot find input file: $f" >&2;}
19031    { (exit 1); exit 1; }; }
19032          fi;;
19033       esac
19034     done` || { (exit 1); exit 1; }
19035 EOF
19036 cat >>"$CONFIG_STATUS" <<\EOF
19037   ac_warn_datarootdir=no
19038   if test x"$ac_file" != x-; then
19039     for ac_item in $ac_file_inputs
19040     do
19041       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19042       if test -n "$ac_seen"; then
19043         ac_used=`grep '@datarootdir@' "$ac_item"`
19044         if test -z "$ac_used"; then
19045           { echo "$as_me:19045: WARNING: datarootdir was used implicitly but not set:
19046 $ac_seen" >&5
19047 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19048 $ac_seen" >&2;}
19049           ac_warn_datarootdir=yes
19050         fi
19051       fi
19052       ac_seen=`grep '${datarootdir}' "$ac_item"`
19053       if test -n "$ac_seen"; then
19054         { echo "$as_me:19054: WARNING: datarootdir was used explicitly but not set:
19055 $ac_seen" >&5
19056 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19057 $ac_seen" >&2;}
19058         ac_warn_datarootdir=yes
19059       fi
19060     done
19061   fi
19062
19063 if test "x$ac_warn_datarootdir" = xyes; then
19064   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19065 fi
19066
19067 EOF
19068 cat >>"$CONFIG_STATUS" <<EOF
19069   sed "$ac_vpsub
19070 $extrasub
19071 EOF
19072 cat >>"$CONFIG_STATUS" <<\EOF
19073 :t
19074 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19075 s,@configure_input@,$configure_input,;t t
19076 s,@srcdir@,$ac_srcdir,;t t
19077 s,@top_srcdir@,$ac_top_srcdir,;t t
19078 s,@INSTALL@,$ac_INSTALL,;t t
19079 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19080   rm -f $tmp/stdin
19081   if test x"$ac_file" != x-; then
19082     cp "$tmp/out" "$ac_file"
19083
19084     for ac_name in prefix exec_prefix datarootdir
19085     do
19086         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
19087         if test -n "$ac_seen"; then
19088             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19089             if test -z "$ac_init"; then
19090               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19091               { echo "$as_me:19091: WARNING: Variable $ac_name is used but was not set:
19092 $ac_seen" >&5
19093 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19094 $ac_seen" >&2;}
19095             fi
19096         fi
19097     done
19098     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
19099     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
19100     if test -s $tmp/out; then
19101       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19102       { echo "$as_me:19102: WARNING: Some variables may not be substituted:
19103 $ac_seen" >&5
19104 echo "$as_me: WARNING: Some variables may not be substituted:
19105 $ac_seen" >&2;}
19106     fi
19107   else
19108     cat $tmp/out
19109   fi
19110   rm -f $tmp/out
19111
19112 done
19113 EOF
19114 cat >>"$CONFIG_STATUS" <<\EOF
19115
19116 #
19117 # CONFIG_HEADER section.
19118 #
19119
19120 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19121 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19122 #
19123 # ac_d sets the value in "#define NAME VALUE" lines.
19124 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19125 ac_dB='[        ].*$,\1#\2'
19126 ac_dC=' '
19127 ac_dD=',;t'
19128 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19129 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19130 ac_iB='\([      ]\),\1#\2define\3'
19131 ac_iC=' '
19132 ac_iD='\4,;t'
19133 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19134 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19135 ac_uB='$,\1#\2define\3'
19136 ac_uC=' '
19137 ac_uD=',;t'
19138
19139 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19140   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19141   case "$ac_file" in
19142   - | *:- | *:-:* ) # input from stdin
19143         cat >$tmp/stdin
19144         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19145         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19146   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19147         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19148   * )   ac_file_in=$ac_file.in ;;
19149   esac
19150
19151   test x"$ac_file" != x- && { echo "$as_me:19151: creating $ac_file" >&5
19152 echo "$as_me: creating $ac_file" >&6;}
19153
19154   # First look for the input files in the build tree, otherwise in the
19155   # src tree.
19156   ac_file_inputs=`IFS=:
19157     for f in $ac_file_in; do
19158       case $f in
19159       -) echo $tmp/stdin ;;
19160       [\\/$]*)
19161          # Absolute (can't be DOS-style, as IFS=:)
19162          test -f "$f" || { { echo "$as_me:19162: error: cannot find input file: $f" >&5
19163 echo "$as_me: error: cannot find input file: $f" >&2;}
19164    { (exit 1); exit 1; }; }
19165          echo $f;;
19166       *) # Relative
19167          if test -f "$f"; then
19168            # Build tree
19169            echo $f
19170          elif test -f "$srcdir/$f"; then
19171            # Source tree
19172            echo "$srcdir/$f"
19173          else
19174            # /dev/null tree
19175            { { echo "$as_me:19175: error: cannot find input file: $f" >&5
19176 echo "$as_me: error: cannot find input file: $f" >&2;}
19177    { (exit 1); exit 1; }; }
19178          fi;;
19179       esac
19180     done` || { (exit 1); exit 1; }
19181   # Remove the trailing spaces.
19182   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19183
19184 EOF
19185
19186 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19187 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19188 # be either 'cat' or 'sort'.
19189 cat confdefs.h | uniq >conftest.vals
19190
19191 # Break up conftest.vals because some shells have a limit on
19192 # the size of here documents, and old seds have small limits too.
19193
19194 rm -f conftest.tail
19195 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19196 while grep . conftest.vals >/dev/null
19197 do
19198   # Write chunks of a limited-size here document to conftest.frag.
19199   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19200   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19201   echo 'CEOF' >> "$CONFIG_STATUS"
19202   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19203   rm -f conftest.vals
19204   mv conftest.tail conftest.vals
19205 done
19206 rm -f conftest.vals
19207
19208 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19209 # marker @DEFS@.
19210 echo '  cat >> conftest.edit <<CEOF
19211 /@DEFS@/r conftest.frag
19212 /@DEFS@/d
19213 CEOF
19214 sed -f conftest.edit $tmp/in > $tmp/out
19215 rm -f $tmp/in
19216 mv $tmp/out $tmp/in
19217 rm -f conftest.edit conftest.frag
19218 ' >> "$CONFIG_STATUS"
19219
19220 cat >>"$CONFIG_STATUS" <<\EOF
19221   # Let's still pretend it is `configure' which instantiates (i.e., don't
19222   # use $as_me), people would be surprised to read:
19223   #    /* config.h.  Generated automatically by config.status.  */
19224   if test x"$ac_file" = x-; then
19225     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19226   else
19227     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19228   fi
19229   cat $tmp/in >>$tmp/config.h
19230   rm -f $tmp/in
19231   if test x"$ac_file" != x-; then
19232     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19233       { echo "$as_me:19233: $ac_file is unchanged" >&5
19234 echo "$as_me: $ac_file is unchanged" >&6;}
19235     else
19236       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19237          X"$ac_file" : 'X\(//\)[^/]' \| \
19238          X"$ac_file" : 'X\(//\)$' \| \
19239          X"$ac_file" : 'X\(/\)' \| \
19240          .     : '\(.\)' 2>/dev/null ||
19241 echo X"$ac_file" |
19242     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19243           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19244           /^X\(\/\/\)$/{ s//\1/; q; }
19245           /^X\(\/\).*/{ s//\1/; q; }
19246           s/.*/./; q'`
19247       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19248         { case "$ac_dir" in
19249   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19250   *)                      as_incr_dir=.;;
19251 esac
19252 as_dummy="$ac_dir"
19253 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19254   case $as_mkdir_dir in
19255     # Skip DOS drivespec
19256     ?:) as_incr_dir=$as_mkdir_dir ;;
19257     *)
19258       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19259       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19260     ;;
19261   esac
19262 done; }
19263
19264       fi
19265       rm -f "$ac_file"
19266       mv "$tmp/config.h" "$ac_file"
19267     fi
19268   else
19269     cat $tmp/config.h
19270     rm -f $tmp/config.h
19271   fi
19272 done
19273 EOF
19274 cat >>"$CONFIG_STATUS" <<\EOF
19275 #
19276 # CONFIG_COMMANDS section.
19277 #
19278 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19279   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19280   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19281
19282   case "$ac_dest" in
19283     default )
19284 if test -z "$USE_OLD_MAKERULES" ; then
19285         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19286 fi
19287  ;;
19288   esac
19289 done
19290 EOF
19291
19292 cat >>"$CONFIG_STATUS" <<\EOF
19293
19294 { (exit 0); exit 0; }
19295 EOF
19296 chmod +x "$CONFIG_STATUS"
19297 ac_clean_files=$ac_clean_files_save
19298
19299 # configure is writing to config.log, and then calls config.status.
19300 # config.status does its own redirection, appending to config.log.
19301 # Unfortunately, on DOS this fails, as config.log is still kept open
19302 # by configure, so config.status won't be able to write to it; its
19303 # output is simply discarded.  So we exec the FD to /dev/null,
19304 # effectively closing config.log, so it can be properly (re)opened and
19305 # appended to by config.status.  When coming back to configure, we
19306 # need to make the FD available again.
19307 if test "$no_create" != yes; then
19308   ac_cs_success=:
19309   exec 5>/dev/null
19310   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19311   exec 5>>config.log
19312   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19313   # would make configure fail if this is the last instruction.
19314   "$ac_cs_success" || { (exit 1); exit 1; }
19315 fi
19316 ${MAKE:-make} preinstall