]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.3 - patch 20211120
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.84 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr=expr
38 else
39   as_expr=false
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s=ln
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 # if $PKG_CONFIG_LIBDIR is set, try to use that
3283 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3284
3285 # if the option is used, let that override.  otherwise default to "libdir"
3286
3287 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3288 if test "${with_pkg_config_libdir+set}" = set; then
3289   withval="$with_pkg_config_libdir"
3290   cf_search_path=$withval
3291 else
3292   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3293 fi;
3294
3295 case x$cf_search_path in
3296 (xlibdir)
3297         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3298         echo "$as_me:3298: result: $PKG_CONFIG_LIBDIR" >&5
3299 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3300         cf_search_path=
3301         ;;
3302 (x)
3303         ;;
3304 (x/*)
3305         PKG_CONFIG_LIBDIR="$cf_search_path"
3306         echo "$as_me:3306: result: $PKG_CONFIG_LIBDIR" >&5
3307 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3308         cf_search_path=
3309         ;;
3310 (xyes|xauto)
3311         echo "$as_me:3311: result: auto" >&5
3312 echo "${ECHO_T}auto" >&6
3313         cf_search_path=
3314         # Look for the library directory using the same prefix as the executable
3315         echo "$as_me:3315: checking for search-list" >&5
3316 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3317         if test "x$PKG_CONFIG" != xnone
3318         then
3319                 # works for pkg-config since version 0.24 (2009)
3320                 # works for pkgconf since version 0.8.3 (2012)
3321                 for cf_pkg_program in \
3322                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3323                         pkg-config \
3324                         pkgconf
3325                 do
3326                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3327                         test -n "$cf_search_path" && break
3328                 done
3329
3330                 # works for pkg-config since import in 2005 of original 2001 HP code.
3331                 test -z "$cf_search_path" && \
3332                 cf_search_path=`
3333                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3334 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3335         sub(\"^[^']*'\",\"\"); \
3336         sub(\"'.*\",\"\"); \
3337         printf \" %s\", \\$0; } \
3338 { next; } \
3339 "`
3340         fi
3341
3342         echo "$as_me:3342: result: $cf_search_path" >&5
3343 echo "${ECHO_T}$cf_search_path" >&6
3344         ;;
3345 (*)
3346         { { echo "$as_me:3346: error: Unexpected option value: $cf_search_path" >&5
3347 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3348    { (exit 1); exit 1; }; }
3349         ;;
3350 esac
3351
3352 if test -n "$cf_search_path"
3353 then
3354         echo "$as_me:3354: checking for first directory" >&5
3355 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3356         cf_pkg_config_path=none
3357         for cf_config in $cf_search_path
3358         do
3359                 if test -d "$cf_config"
3360                 then
3361                         cf_pkg_config_path=$cf_config
3362                         break
3363                 fi
3364         done
3365         echo "$as_me:3365: result: $cf_pkg_config_path" >&5
3366 echo "${ECHO_T}$cf_pkg_config_path" >&6
3367
3368         if test "x$cf_pkg_config_path" != xnone ; then
3369                 # limit this to the first directory found
3370                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3371         fi
3372
3373         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3374         then
3375                 echo "$as_me:3375: checking for workaround" >&5
3376 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3377                 if test "$prefix" = "NONE" ; then
3378                         cf_prefix="$ac_default_prefix"
3379                 else
3380                         cf_prefix="$prefix"
3381                 fi
3382                 eval cf_libdir=$libdir
3383                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3384                 cf_backup=
3385                 for cf_config in $cf_search_path
3386                 do
3387                         case $cf_config in
3388                         $cf_libdir/pkgconfig)
3389                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3390                                 break
3391                                 ;;
3392                         *)
3393                                 test -z "$cf_backup" && cf_backup=$cf_config
3394                                 ;;
3395                         esac
3396                 done
3397                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3398                 echo "$as_me:3398: result: $PKG_CONFIG_LIBDIR" >&5
3399 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3400         fi
3401 fi
3402
3403 echo "$as_me:3403: checking if you want to build test-programs" >&5
3404 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3405
3406 # Check whether --with-tests or --without-tests was given.
3407 if test "${with_tests+set}" = set; then
3408   withval="$with_tests"
3409   cf_with_tests=$withval
3410 else
3411   cf_with_tests=yes
3412 fi;
3413 echo "$as_me:3413: result: $cf_with_tests" >&5
3414 echo "${ECHO_T}$cf_with_tests" >&6
3415
3416 echo "$as_me:3416: checking if we should assume mixed-case filenames" >&5
3417 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3418
3419 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3420 if test "${enable_mixed_case+set}" = set; then
3421   enableval="$enable_mixed_case"
3422   enable_mixedcase=$enableval
3423 else
3424   enable_mixedcase=auto
3425 fi;
3426 echo "$as_me:3426: result: $enable_mixedcase" >&5
3427 echo "${ECHO_T}$enable_mixedcase" >&6
3428 if test "$enable_mixedcase" = "auto" ; then
3429
3430 echo "$as_me:3430: checking if filesystem supports mixed-case filenames" >&5
3431 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3432 if test "${cf_cv_mixedcase+set}" = set; then
3433   echo $ECHO_N "(cached) $ECHO_C" >&6
3434 else
3435
3436 if test "$cross_compiling" = yes ; then
3437         case "$target_alias" in
3438         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3439                 cf_cv_mixedcase=no
3440                 ;;
3441         (*)
3442                 cf_cv_mixedcase=yes
3443                 ;;
3444         esac
3445 else
3446         rm -f conftest CONFTEST
3447         echo test >conftest
3448         if test -f CONFTEST ; then
3449                 cf_cv_mixedcase=no
3450         else
3451                 cf_cv_mixedcase=yes
3452         fi
3453         rm -f conftest CONFTEST
3454 fi
3455
3456 fi
3457 echo "$as_me:3457: result: $cf_cv_mixedcase" >&5
3458 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3459 test "$cf_cv_mixedcase" = yes &&
3460 cat >>confdefs.h <<\EOF
3461 #define MIXEDCASE_FILENAMES 1
3462 EOF
3463
3464 else
3465         cf_cv_mixedcase=$enable_mixedcase
3466         if test "$enable_mixedcase" = "yes" ; then
3467                 cat >>confdefs.h <<\EOF
3468 #define MIXEDCASE_FILENAMES 1
3469 EOF
3470
3471         fi
3472 fi
3473
3474 # do this after mixed-case option (tags/TAGS is not as important as tic).
3475 echo "$as_me:3475: checking whether ${MAKE-make} sets \${MAKE}" >&5
3476 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3477 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3478 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3479   echo $ECHO_N "(cached) $ECHO_C" >&6
3480 else
3481   cat >conftest.make <<\EOF
3482 all:
3483         @echo 'ac_maketemp="${MAKE}"'
3484 EOF
3485 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3486 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3487 if test -n "$ac_maketemp"; then
3488   eval ac_cv_prog_make_${ac_make}_set=yes
3489 else
3490   eval ac_cv_prog_make_${ac_make}_set=no
3491 fi
3492 rm -f conftest.make
3493 fi
3494 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3495   echo "$as_me:3495: result: yes" >&5
3496 echo "${ECHO_T}yes" >&6
3497   SET_MAKE=
3498 else
3499   echo "$as_me:3499: result: no" >&5
3500 echo "${ECHO_T}no" >&6
3501   SET_MAKE="MAKE=${MAKE-make}"
3502 fi
3503
3504 echo "$as_me:3504: checking for \".PHONY\" make-support" >&5
3505 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3506 if test "${cf_cv_make_PHONY+set}" = set; then
3507   echo $ECHO_N "(cached) $ECHO_C" >&6
3508 else
3509
3510         rm -rf conftest*
3511         (
3512                 mkdir conftest || exit 1
3513                 cd conftest
3514                 cat >makefile <<'CF_EOF'
3515 .PHONY: always
3516 DATA=0
3517 always: always.out
3518         @echo "** making $@ $(DATA)"
3519 once: once.out
3520         @echo "** making $@ $(DATA)"
3521 always.out:
3522         @echo "** making $@ $(DATA)"
3523         echo $(DATA) > $@
3524 once.out:
3525         @echo "** making $@ $(DATA)"
3526         echo $(DATA) > $@
3527 CF_EOF
3528                 for cf_data in 1 2 3
3529                 do
3530                         ${MAKE:-make} always DATA=$cf_data
3531                         ${MAKE:-make} once   DATA=$cf_data
3532                         ${MAKE:-make} -t always once
3533                         if test -f always ; then
3534                                 echo "no (case 1)" > ../conftest.tmp
3535                         elif test ! -f always.out ; then
3536                                 echo "no (case 2)" > ../conftest.tmp
3537                         elif test ! -f once.out ; then
3538                                 echo "no (case 3)" > ../conftest.tmp
3539                         elif ! cmp -s always.out once.out ; then
3540                                 echo "no (case 4)" > ../conftest.tmp
3541                                 diff always.out once.out
3542                         else
3543                                 cf_check="`cat always.out`"
3544                                 if test "x$cf_check" != "x$cf_data" ; then
3545                                         echo "no (case 5)" > ../conftest.tmp
3546                                 else
3547                                         echo yes > ../conftest.tmp
3548                                         rm -f ./*.out
3549                                         continue
3550                                 fi
3551                         fi
3552                         break
3553                 done
3554         ) >&5 2>&1
3555         cf_cv_make_PHONY="`cat conftest.tmp`"
3556         rm -rf conftest*
3557
3558 fi
3559 echo "$as_me:3559: result: $cf_cv_make_PHONY" >&5
3560 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3561 MAKE_NO_PHONY="#"
3562 MAKE_PHONY="#"
3563 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3564 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3565
3566 for ac_prog in exctags ctags
3567 do
3568   # Extract the first word of "$ac_prog", so it can be a program name with args.
3569 set dummy $ac_prog; ac_word=$2
3570 echo "$as_me:3570: checking for $ac_word" >&5
3571 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3572 if test "${ac_cv_prog_CTAGS+set}" = set; then
3573   echo $ECHO_N "(cached) $ECHO_C" >&6
3574 else
3575   if test -n "$CTAGS"; then
3576   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3577 else
3578   ac_save_IFS=$IFS; IFS=$ac_path_separator
3579 ac_dummy="$PATH"
3580 for ac_dir in $ac_dummy; do
3581   IFS=$ac_save_IFS
3582   test -z "$ac_dir" && ac_dir=.
3583   $as_executable_p "$ac_dir/$ac_word" || continue
3584 ac_cv_prog_CTAGS="$ac_prog"
3585 echo "$as_me:3585: found $ac_dir/$ac_word" >&5
3586 break
3587 done
3588
3589 fi
3590 fi
3591 CTAGS=$ac_cv_prog_CTAGS
3592 if test -n "$CTAGS"; then
3593   echo "$as_me:3593: result: $CTAGS" >&5
3594 echo "${ECHO_T}$CTAGS" >&6
3595 else
3596   echo "$as_me:3596: result: no" >&5
3597 echo "${ECHO_T}no" >&6
3598 fi
3599
3600   test -n "$CTAGS" && break
3601 done
3602
3603 for ac_prog in exetags etags
3604 do
3605   # Extract the first word of "$ac_prog", so it can be a program name with args.
3606 set dummy $ac_prog; ac_word=$2
3607 echo "$as_me:3607: checking for $ac_word" >&5
3608 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3609 if test "${ac_cv_prog_ETAGS+set}" = set; then
3610   echo $ECHO_N "(cached) $ECHO_C" >&6
3611 else
3612   if test -n "$ETAGS"; then
3613   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3614 else
3615   ac_save_IFS=$IFS; IFS=$ac_path_separator
3616 ac_dummy="$PATH"
3617 for ac_dir in $ac_dummy; do
3618   IFS=$ac_save_IFS
3619   test -z "$ac_dir" && ac_dir=.
3620   $as_executable_p "$ac_dir/$ac_word" || continue
3621 ac_cv_prog_ETAGS="$ac_prog"
3622 echo "$as_me:3622: found $ac_dir/$ac_word" >&5
3623 break
3624 done
3625
3626 fi
3627 fi
3628 ETAGS=$ac_cv_prog_ETAGS
3629 if test -n "$ETAGS"; then
3630   echo "$as_me:3630: result: $ETAGS" >&5
3631 echo "${ECHO_T}$ETAGS" >&6
3632 else
3633   echo "$as_me:3633: result: no" >&5
3634 echo "${ECHO_T}no" >&6
3635 fi
3636
3637   test -n "$ETAGS" && break
3638 done
3639
3640 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3641 set dummy ${CTAGS:-ctags}; ac_word=$2
3642 echo "$as_me:3642: checking for $ac_word" >&5
3643 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3644 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3645   echo $ECHO_N "(cached) $ECHO_C" >&6
3646 else
3647   if test -n "$MAKE_LOWER_TAGS"; then
3648   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3649 else
3650   ac_save_IFS=$IFS; IFS=$ac_path_separator
3651 ac_dummy="$PATH"
3652 for ac_dir in $ac_dummy; do
3653   IFS=$ac_save_IFS
3654   test -z "$ac_dir" && ac_dir=.
3655   $as_executable_p "$ac_dir/$ac_word" || continue
3656 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3657 echo "$as_me:3657: found $ac_dir/$ac_word" >&5
3658 break
3659 done
3660
3661   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3662 fi
3663 fi
3664 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3665 if test -n "$MAKE_LOWER_TAGS"; then
3666   echo "$as_me:3666: result: $MAKE_LOWER_TAGS" >&5
3667 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3668 else
3669   echo "$as_me:3669: result: no" >&5
3670 echo "${ECHO_T}no" >&6
3671 fi
3672
3673 if test "$cf_cv_mixedcase" = yes ; then
3674         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3675 set dummy ${ETAGS:-etags}; ac_word=$2
3676 echo "$as_me:3676: checking for $ac_word" >&5
3677 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3678 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3679   echo $ECHO_N "(cached) $ECHO_C" >&6
3680 else
3681   if test -n "$MAKE_UPPER_TAGS"; then
3682   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3683 else
3684   ac_save_IFS=$IFS; IFS=$ac_path_separator
3685 ac_dummy="$PATH"
3686 for ac_dir in $ac_dummy; do
3687   IFS=$ac_save_IFS
3688   test -z "$ac_dir" && ac_dir=.
3689   $as_executable_p "$ac_dir/$ac_word" || continue
3690 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3691 echo "$as_me:3691: found $ac_dir/$ac_word" >&5
3692 break
3693 done
3694
3695   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3696 fi
3697 fi
3698 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3699 if test -n "$MAKE_UPPER_TAGS"; then
3700   echo "$as_me:3700: result: $MAKE_UPPER_TAGS" >&5
3701 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3702 else
3703   echo "$as_me:3703: result: no" >&5
3704 echo "${ECHO_T}no" >&6
3705 fi
3706
3707 else
3708         MAKE_UPPER_TAGS=no
3709 fi
3710
3711 if test "$MAKE_UPPER_TAGS" = yes ; then
3712         MAKE_UPPER_TAGS=
3713 else
3714         MAKE_UPPER_TAGS="#"
3715 fi
3716
3717 if test "$MAKE_LOWER_TAGS" = yes ; then
3718         MAKE_LOWER_TAGS=
3719 else
3720         MAKE_LOWER_TAGS="#"
3721 fi
3722
3723 echo "$as_me:3723: checking for makeflags variable" >&5
3724 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3725 if test "${cf_cv_makeflags+set}" = set; then
3726   echo $ECHO_N "(cached) $ECHO_C" >&6
3727 else
3728
3729         cf_cv_makeflags=''
3730         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3731         do
3732                 cat >cf_makeflags.tmp <<CF_EOF
3733 SHELL = $SHELL
3734 all :
3735         @ echo '.$cf_option'
3736 CF_EOF
3737                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3738                 case "$cf_result" in
3739                 (.*k|.*kw)
3740                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3741                         case "$cf_result" in
3742                         (.*CC=*)        cf_cv_makeflags=
3743                                 ;;
3744                         (*)     cf_cv_makeflags=$cf_option
3745                                 ;;
3746                         esac
3747                         break
3748                         ;;
3749                 (.-)
3750                         ;;
3751                 (*)
3752
3753 echo "${as_me:-configure}:3753: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3754
3755                         ;;
3756                 esac
3757         done
3758         rm -f cf_makeflags.tmp
3759
3760 fi
3761 echo "$as_me:3761: result: $cf_cv_makeflags" >&5
3762 echo "${ECHO_T}$cf_cv_makeflags" >&6
3763
3764 if test -n "$ac_tool_prefix"; then
3765   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3766 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3767 echo "$as_me:3767: checking for $ac_word" >&5
3768 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3769 if test "${ac_cv_prog_RANLIB+set}" = set; then
3770   echo $ECHO_N "(cached) $ECHO_C" >&6
3771 else
3772   if test -n "$RANLIB"; then
3773   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3774 else
3775   ac_save_IFS=$IFS; IFS=$ac_path_separator
3776 ac_dummy="$PATH"
3777 for ac_dir in $ac_dummy; do
3778   IFS=$ac_save_IFS
3779   test -z "$ac_dir" && ac_dir=.
3780   $as_executable_p "$ac_dir/$ac_word" || continue
3781 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3782 echo "$as_me:3782: found $ac_dir/$ac_word" >&5
3783 break
3784 done
3785
3786 fi
3787 fi
3788 RANLIB=$ac_cv_prog_RANLIB
3789 if test -n "$RANLIB"; then
3790   echo "$as_me:3790: result: $RANLIB" >&5
3791 echo "${ECHO_T}$RANLIB" >&6
3792 else
3793   echo "$as_me:3793: result: no" >&5
3794 echo "${ECHO_T}no" >&6
3795 fi
3796
3797 fi
3798 if test -z "$ac_cv_prog_RANLIB"; then
3799   ac_ct_RANLIB=$RANLIB
3800   # Extract the first word of "ranlib", so it can be a program name with args.
3801 set dummy ranlib; ac_word=$2
3802 echo "$as_me:3802: checking for $ac_word" >&5
3803 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3804 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3805   echo $ECHO_N "(cached) $ECHO_C" >&6
3806 else
3807   if test -n "$ac_ct_RANLIB"; then
3808   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3809 else
3810   ac_save_IFS=$IFS; IFS=$ac_path_separator
3811 ac_dummy="$PATH"
3812 for ac_dir in $ac_dummy; do
3813   IFS=$ac_save_IFS
3814   test -z "$ac_dir" && ac_dir=.
3815   $as_executable_p "$ac_dir/$ac_word" || continue
3816 ac_cv_prog_ac_ct_RANLIB="ranlib"
3817 echo "$as_me:3817: found $ac_dir/$ac_word" >&5
3818 break
3819 done
3820
3821   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3822 fi
3823 fi
3824 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3825 if test -n "$ac_ct_RANLIB"; then
3826   echo "$as_me:3826: result: $ac_ct_RANLIB" >&5
3827 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3828 else
3829   echo "$as_me:3829: result: no" >&5
3830 echo "${ECHO_T}no" >&6
3831 fi
3832
3833   RANLIB=$ac_ct_RANLIB
3834 else
3835   RANLIB="$ac_cv_prog_RANLIB"
3836 fi
3837
3838 if test -n "$ac_tool_prefix"; then
3839   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3840 set dummy ${ac_tool_prefix}ld; ac_word=$2
3841 echo "$as_me:3841: checking for $ac_word" >&5
3842 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3843 if test "${ac_cv_prog_LD+set}" = set; then
3844   echo $ECHO_N "(cached) $ECHO_C" >&6
3845 else
3846   if test -n "$LD"; then
3847   ac_cv_prog_LD="$LD" # Let the user override the test.
3848 else
3849   ac_save_IFS=$IFS; IFS=$ac_path_separator
3850 ac_dummy="$PATH"
3851 for ac_dir in $ac_dummy; do
3852   IFS=$ac_save_IFS
3853   test -z "$ac_dir" && ac_dir=.
3854   $as_executable_p "$ac_dir/$ac_word" || continue
3855 ac_cv_prog_LD="${ac_tool_prefix}ld"
3856 echo "$as_me:3856: found $ac_dir/$ac_word" >&5
3857 break
3858 done
3859
3860 fi
3861 fi
3862 LD=$ac_cv_prog_LD
3863 if test -n "$LD"; then
3864   echo "$as_me:3864: result: $LD" >&5
3865 echo "${ECHO_T}$LD" >&6
3866 else
3867   echo "$as_me:3867: result: no" >&5
3868 echo "${ECHO_T}no" >&6
3869 fi
3870
3871 fi
3872 if test -z "$ac_cv_prog_LD"; then
3873   ac_ct_LD=$LD
3874   # Extract the first word of "ld", so it can be a program name with args.
3875 set dummy ld; ac_word=$2
3876 echo "$as_me:3876: checking for $ac_word" >&5
3877 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3878 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3879   echo $ECHO_N "(cached) $ECHO_C" >&6
3880 else
3881   if test -n "$ac_ct_LD"; then
3882   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3883 else
3884   ac_save_IFS=$IFS; IFS=$ac_path_separator
3885 ac_dummy="$PATH"
3886 for ac_dir in $ac_dummy; do
3887   IFS=$ac_save_IFS
3888   test -z "$ac_dir" && ac_dir=.
3889   $as_executable_p "$ac_dir/$ac_word" || continue
3890 ac_cv_prog_ac_ct_LD="ld"
3891 echo "$as_me:3891: found $ac_dir/$ac_word" >&5
3892 break
3893 done
3894
3895   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3896 fi
3897 fi
3898 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3899 if test -n "$ac_ct_LD"; then
3900   echo "$as_me:3900: result: $ac_ct_LD" >&5
3901 echo "${ECHO_T}$ac_ct_LD" >&6
3902 else
3903   echo "$as_me:3903: result: no" >&5
3904 echo "${ECHO_T}no" >&6
3905 fi
3906
3907   LD=$ac_ct_LD
3908 else
3909   LD="$ac_cv_prog_LD"
3910 fi
3911
3912 if test -n "$ac_tool_prefix"; then
3913   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3914 set dummy ${ac_tool_prefix}ar; ac_word=$2
3915 echo "$as_me:3915: checking for $ac_word" >&5
3916 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3917 if test "${ac_cv_prog_AR+set}" = set; then
3918   echo $ECHO_N "(cached) $ECHO_C" >&6
3919 else
3920   if test -n "$AR"; then
3921   ac_cv_prog_AR="$AR" # Let the user override the test.
3922 else
3923   ac_save_IFS=$IFS; IFS=$ac_path_separator
3924 ac_dummy="$PATH"
3925 for ac_dir in $ac_dummy; do
3926   IFS=$ac_save_IFS
3927   test -z "$ac_dir" && ac_dir=.
3928   $as_executable_p "$ac_dir/$ac_word" || continue
3929 ac_cv_prog_AR="${ac_tool_prefix}ar"
3930 echo "$as_me:3930: found $ac_dir/$ac_word" >&5
3931 break
3932 done
3933
3934 fi
3935 fi
3936 AR=$ac_cv_prog_AR
3937 if test -n "$AR"; then
3938   echo "$as_me:3938: result: $AR" >&5
3939 echo "${ECHO_T}$AR" >&6
3940 else
3941   echo "$as_me:3941: result: no" >&5
3942 echo "${ECHO_T}no" >&6
3943 fi
3944
3945 fi
3946 if test -z "$ac_cv_prog_AR"; then
3947   ac_ct_AR=$AR
3948   # Extract the first word of "ar", so it can be a program name with args.
3949 set dummy ar; ac_word=$2
3950 echo "$as_me:3950: checking for $ac_word" >&5
3951 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3952 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3953   echo $ECHO_N "(cached) $ECHO_C" >&6
3954 else
3955   if test -n "$ac_ct_AR"; then
3956   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3957 else
3958   ac_save_IFS=$IFS; IFS=$ac_path_separator
3959 ac_dummy="$PATH"
3960 for ac_dir in $ac_dummy; do
3961   IFS=$ac_save_IFS
3962   test -z "$ac_dir" && ac_dir=.
3963   $as_executable_p "$ac_dir/$ac_word" || continue
3964 ac_cv_prog_ac_ct_AR="ar"
3965 echo "$as_me:3965: found $ac_dir/$ac_word" >&5
3966 break
3967 done
3968
3969   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3970 fi
3971 fi
3972 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3973 if test -n "$ac_ct_AR"; then
3974   echo "$as_me:3974: result: $ac_ct_AR" >&5
3975 echo "${ECHO_T}$ac_ct_AR" >&6
3976 else
3977   echo "$as_me:3977: result: no" >&5
3978 echo "${ECHO_T}no" >&6
3979 fi
3980
3981   AR=$ac_ct_AR
3982 else
3983   AR="$ac_cv_prog_AR"
3984 fi
3985
3986 if test -n "$ac_tool_prefix"; then
3987   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3988 set dummy ${ac_tool_prefix}ar; ac_word=$2
3989 echo "$as_me:3989: checking for $ac_word" >&5
3990 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3991 if test "${ac_cv_prog_AR+set}" = set; then
3992   echo $ECHO_N "(cached) $ECHO_C" >&6
3993 else
3994   if test -n "$AR"; then
3995   ac_cv_prog_AR="$AR" # Let the user override the test.
3996 else
3997   ac_save_IFS=$IFS; IFS=$ac_path_separator
3998 ac_dummy="$PATH"
3999 for ac_dir in $ac_dummy; do
4000   IFS=$ac_save_IFS
4001   test -z "$ac_dir" && ac_dir=.
4002   $as_executable_p "$ac_dir/$ac_word" || continue
4003 ac_cv_prog_AR="${ac_tool_prefix}ar"
4004 echo "$as_me:4004: found $ac_dir/$ac_word" >&5
4005 break
4006 done
4007
4008 fi
4009 fi
4010 AR=$ac_cv_prog_AR
4011 if test -n "$AR"; then
4012   echo "$as_me:4012: result: $AR" >&5
4013 echo "${ECHO_T}$AR" >&6
4014 else
4015   echo "$as_me:4015: result: no" >&5
4016 echo "${ECHO_T}no" >&6
4017 fi
4018
4019 fi
4020 if test -z "$ac_cv_prog_AR"; then
4021   ac_ct_AR=$AR
4022   # Extract the first word of "ar", so it can be a program name with args.
4023 set dummy ar; ac_word=$2
4024 echo "$as_me:4024: checking for $ac_word" >&5
4025 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4026 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4027   echo $ECHO_N "(cached) $ECHO_C" >&6
4028 else
4029   if test -n "$ac_ct_AR"; then
4030   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4031 else
4032   ac_save_IFS=$IFS; IFS=$ac_path_separator
4033 ac_dummy="$PATH"
4034 for ac_dir in $ac_dummy; do
4035   IFS=$ac_save_IFS
4036   test -z "$ac_dir" && ac_dir=.
4037   $as_executable_p "$ac_dir/$ac_word" || continue
4038 ac_cv_prog_ac_ct_AR="ar"
4039 echo "$as_me:4039: found $ac_dir/$ac_word" >&5
4040 break
4041 done
4042
4043   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4044 fi
4045 fi
4046 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4047 if test -n "$ac_ct_AR"; then
4048   echo "$as_me:4048: result: $ac_ct_AR" >&5
4049 echo "${ECHO_T}$ac_ct_AR" >&6
4050 else
4051   echo "$as_me:4051: result: no" >&5
4052 echo "${ECHO_T}no" >&6
4053 fi
4054
4055   AR=$ac_ct_AR
4056 else
4057   AR="$ac_cv_prog_AR"
4058 fi
4059
4060 echo "$as_me:4060: checking for options to update archives" >&5
4061 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4062 if test "${cf_cv_ar_flags+set}" = set; then
4063   echo $ECHO_N "(cached) $ECHO_C" >&6
4064 else
4065
4066         case "$cf_cv_system_name" in
4067         (*-msvc*)
4068                 cf_cv_ar_flags=''
4069                 cat >mk_static_lib.sh <<-EOF
4070                 #!$SHELL
4071                 MSVC_BIN="$AR"
4072                 out="\$1"
4073                 shift
4074                 exec \$MSVC_BIN -out:"\$out" \$@
4075                 EOF
4076                 chmod +x mk_static_lib.sh
4077                 AR=`pwd`/mk_static_lib.sh
4078                 ;;
4079         (*)
4080                 cf_cv_ar_flags=unknown
4081                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4082                 do
4083
4084                         # check if $ARFLAGS already contains this choice
4085                         if test "x$ARFLAGS" != "x" ; then
4086                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4087                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4088                                         cf_cv_ar_flags=
4089                                         break
4090                                 fi
4091                         fi
4092
4093                         rm -f "conftest.$ac_cv_objext"
4094                         rm -f conftest.a
4095
4096                         cat >"conftest.$ac_ext" <<EOF
4097 #line 4097 "configure"
4098 int     testdata[3] = { 123, 456, 789 };
4099 EOF
4100                         if { (eval echo "$as_me:4100: \"$ac_compile\"") >&5
4101   (eval $ac_compile) 2>&5
4102   ac_status=$?
4103   echo "$as_me:4103: \$? = $ac_status" >&5
4104   (exit "$ac_status"); } ; then
4105                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4106                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4107                                 if test -f conftest.a ; then
4108                                         cf_cv_ar_flags="$cf_ar_flags"
4109                                         break
4110                                 fi
4111                         else
4112                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4113
4114 echo "${as_me:-configure}:4114: testing cannot compile test-program ..." 1>&5
4115
4116                                 break
4117                         fi
4118                 done
4119                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4120                 ;;
4121         esac
4122
4123 fi
4124 echo "$as_me:4124: result: $cf_cv_ar_flags" >&5
4125 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4126
4127 if test -n "$ARFLAGS" ; then
4128         if test -n "$cf_cv_ar_flags" ; then
4129                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4130         fi
4131 else
4132         ARFLAGS=$cf_cv_ar_flags
4133 fi
4134
4135         echo "$as_me:4135: checking for PATH separator" >&5
4136 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4137         case "$cf_cv_system_name" in
4138         (os2*)  PATH_SEPARATOR=';'  ;;
4139         (*)     ${PATH_SEPARATOR:=':'}  ;;
4140         esac
4141
4142         echo "$as_me:4142: result: $PATH_SEPARATOR" >&5
4143 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4144
4145 echo "$as_me:4145: checking if you have specified an install-prefix" >&5
4146 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4147
4148 # Check whether --with-install-prefix or --without-install-prefix was given.
4149 if test "${with_install_prefix+set}" = set; then
4150   withval="$with_install_prefix"
4151   case "$withval" in
4152         (yes|no)
4153                 ;;
4154         (*)     DESTDIR="$withval"
4155                 ;;
4156         esac
4157 fi;
4158 echo "$as_me:4158: result: $DESTDIR" >&5
4159 echo "${ECHO_T}$DESTDIR" >&6
4160
4161 ###############################################################################
4162
4163 # If we're cross-compiling, allow the user to override the tools and their
4164 # options.  The configure script is oriented toward identifying the host
4165 # compiler, etc., but we need a build compiler to generate parts of the source.
4166
4167 if test "$cross_compiling" = yes ; then
4168
4169         # defaults that we might want to override
4170         : ${BUILD_CFLAGS:=''}
4171         : ${BUILD_CPPFLAGS:=''}
4172         : ${BUILD_LDFLAGS:=''}
4173         : ${BUILD_LIBS:=''}
4174         : ${BUILD_EXEEXT:='$x'}
4175         : ${BUILD_OBJEXT:='o'}
4176
4177 # Check whether --with-build-cc or --without-build-cc was given.
4178 if test "${with_build_cc+set}" = set; then
4179   withval="$with_build_cc"
4180   BUILD_CC="$withval"
4181 else
4182   for ac_prog in gcc clang c99 c89 cc cl
4183 do
4184   # Extract the first word of "$ac_prog", so it can be a program name with args.
4185 set dummy $ac_prog; ac_word=$2
4186 echo "$as_me:4186: checking for $ac_word" >&5
4187 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4188 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4189   echo $ECHO_N "(cached) $ECHO_C" >&6
4190 else
4191   if test -n "$BUILD_CC"; then
4192   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4193 else
4194   ac_save_IFS=$IFS; IFS=$ac_path_separator
4195 ac_dummy="$PATH"
4196 for ac_dir in $ac_dummy; do
4197   IFS=$ac_save_IFS
4198   test -z "$ac_dir" && ac_dir=.
4199   $as_executable_p "$ac_dir/$ac_word" || continue
4200 ac_cv_prog_BUILD_CC="$ac_prog"
4201 echo "$as_me:4201: found $ac_dir/$ac_word" >&5
4202 break
4203 done
4204
4205 fi
4206 fi
4207 BUILD_CC=$ac_cv_prog_BUILD_CC
4208 if test -n "$BUILD_CC"; then
4209   echo "$as_me:4209: result: $BUILD_CC" >&5
4210 echo "${ECHO_T}$BUILD_CC" >&6
4211 else
4212   echo "$as_me:4212: result: no" >&5
4213 echo "${ECHO_T}no" >&6
4214 fi
4215
4216   test -n "$BUILD_CC" && break
4217 done
4218 test -n "$BUILD_CC" || BUILD_CC="none"
4219
4220 fi;
4221         echo "$as_me:4221: checking for native build C compiler" >&5
4222 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4223         echo "$as_me:4223: result: $BUILD_CC" >&5
4224 echo "${ECHO_T}$BUILD_CC" >&6
4225
4226         echo "$as_me:4226: checking for native build C preprocessor" >&5
4227 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4228
4229 # Check whether --with-build-cpp or --without-build-cpp was given.
4230 if test "${with_build_cpp+set}" = set; then
4231   withval="$with_build_cpp"
4232   BUILD_CPP="$withval"
4233 else
4234   BUILD_CPP='${BUILD_CC} -E'
4235 fi;
4236         echo "$as_me:4236: result: $BUILD_CPP" >&5
4237 echo "${ECHO_T}$BUILD_CPP" >&6
4238
4239         echo "$as_me:4239: checking for native build C flags" >&5
4240 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4241
4242 # Check whether --with-build-cflags or --without-build-cflags was given.
4243 if test "${with_build_cflags+set}" = set; then
4244   withval="$with_build_cflags"
4245   BUILD_CFLAGS="$withval"
4246 fi;
4247         echo "$as_me:4247: result: $BUILD_CFLAGS" >&5
4248 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4249
4250         echo "$as_me:4250: checking for native build C preprocessor-flags" >&5
4251 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4252
4253 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4254 if test "${with_build_cppflags+set}" = set; then
4255   withval="$with_build_cppflags"
4256   BUILD_CPPFLAGS="$withval"
4257 fi;
4258         echo "$as_me:4258: result: $BUILD_CPPFLAGS" >&5
4259 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4260
4261         echo "$as_me:4261: checking for native build linker-flags" >&5
4262 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4263
4264 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4265 if test "${with_build_ldflags+set}" = set; then
4266   withval="$with_build_ldflags"
4267   BUILD_LDFLAGS="$withval"
4268 fi;
4269         echo "$as_me:4269: result: $BUILD_LDFLAGS" >&5
4270 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4271
4272         echo "$as_me:4272: checking for native build linker-libraries" >&5
4273 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4274
4275 # Check whether --with-build-libs or --without-build-libs was given.
4276 if test "${with_build_libs+set}" = set; then
4277   withval="$with_build_libs"
4278   BUILD_LIBS="$withval"
4279 fi;
4280         echo "$as_me:4280: result: $BUILD_LIBS" >&5
4281 echo "${ECHO_T}$BUILD_LIBS" >&6
4282
4283         # this assumes we're on Unix.
4284         BUILD_EXEEXT=
4285         BUILD_OBJEXT=o
4286
4287         : ${BUILD_CC:='${CC}'}
4288
4289         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4290                 { { echo "$as_me:4290: error: Cross-build requires two compilers.
4291 Use --with-build-cc to specify the native compiler." >&5
4292 echo "$as_me: error: Cross-build requires two compilers.
4293 Use --with-build-cc to specify the native compiler." >&2;}
4294    { (exit 1); exit 1; }; }
4295         fi
4296
4297 else
4298         : ${BUILD_CC:='${CC}'}
4299         : ${BUILD_CPP:='${CPP}'}
4300         : ${BUILD_CFLAGS:='${CFLAGS}'}
4301         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4302         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4303         : ${BUILD_LIBS:='${LIBS}'}
4304         : ${BUILD_EXEEXT:='$x'}
4305         : ${BUILD_OBJEXT:='o'}
4306 fi
4307
4308 ###############################################################################
4309
4310 ### Options to allow the user to specify the set of libraries which are used.
4311 ### Use "--without-normal --with-shared" to allow the default model to be
4312 ### shared, for example.
4313 cf_list_models=""
4314
4315 echo "$as_me:4315: checking if you want to build shared C-objects" >&5
4316 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4317
4318 # Check whether --with-shared or --without-shared was given.
4319 if test "${with_shared+set}" = set; then
4320   withval="$with_shared"
4321   with_shared=$withval
4322 else
4323   with_shared=no
4324 fi;
4325 echo "$as_me:4325: result: $with_shared" >&5
4326 echo "${ECHO_T}$with_shared" >&6
4327 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4328
4329 echo "$as_me:4329: checking for specified models" >&5
4330 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4331 test -z "$cf_list_models" && cf_list_models=normal
4332 echo "$as_me:4332: result: $cf_list_models" >&5
4333 echo "${ECHO_T}$cf_list_models" >&6
4334
4335 ### Use the first model as the default, and save its suffix for use in building
4336 ### up test-applications.
4337 echo "$as_me:4337: checking for default model" >&5
4338 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4339 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4340 echo "$as_me:4340: result: $DFT_LWR_MODEL" >&5
4341 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4342
4343 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4344
4345 echo "$as_me:4345: checking for specific curses-directory" >&5
4346 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4347
4348 # Check whether --with-curses-dir or --without-curses-dir was given.
4349 if test "${with_curses_dir+set}" = set; then
4350   withval="$with_curses_dir"
4351   cf_cv_curses_dir=$withval
4352 else
4353   cf_cv_curses_dir=no
4354 fi;
4355 echo "$as_me:4355: result: $cf_cv_curses_dir" >&5
4356 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4357
4358 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4359 then
4360
4361 if test "x$prefix" != xNONE; then
4362         cf_path_syntax="$prefix"
4363 else
4364         cf_path_syntax="$ac_default_prefix"
4365 fi
4366
4367 case ".$withval" in
4368 (.\$\(*\)*|.\'*\'*)
4369         ;;
4370 (..|./*|.\\*)
4371         ;;
4372 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4373         ;;
4374 (.\$\{*prefix\}*|.\$\{*dir\}*)
4375         eval withval="$withval"
4376         case ".$withval" in
4377         (.NONE/*)
4378                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4379                 ;;
4380         esac
4381         ;;
4382 (.no|.NONE/*)
4383         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4384         ;;
4385 (*)
4386         { { echo "$as_me:4386: error: expected a pathname, not \"$withval\"" >&5
4387 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4388    { (exit 1); exit 1; }; }
4389         ;;
4390 esac
4391
4392         if test -d "$cf_cv_curses_dir"
4393         then
4394
4395 if test -n "$cf_cv_curses_dir/include" ; then
4396   for cf_add_incdir in $cf_cv_curses_dir/include
4397   do
4398         while test "$cf_add_incdir" != /usr/include
4399         do
4400           if test -d "$cf_add_incdir"
4401           then
4402                 cf_have_incdir=no
4403                 if test -n "$CFLAGS$CPPFLAGS" ; then
4404                   # a loop is needed to ensure we can add subdirs of existing dirs
4405                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4406                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4407                           cf_have_incdir=yes; break
4408                         fi
4409                   done
4410                 fi
4411
4412                 if test "$cf_have_incdir" = no ; then
4413                   if test "$cf_add_incdir" = /usr/local/include ; then
4414                         if test "$GCC" = yes
4415                         then
4416                           cf_save_CPPFLAGS=$CPPFLAGS
4417
4418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4419         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4420
4421                           cat >"conftest.$ac_ext" <<_ACEOF
4422 #line 4422 "configure"
4423 #include "confdefs.h"
4424 #include <stdio.h>
4425 int
4426 main (void)
4427 {
4428 printf("Hello")
4429   ;
4430   return 0;
4431 }
4432 _ACEOF
4433 rm -f "conftest.$ac_objext"
4434 if { (eval echo "$as_me:4434: \"$ac_compile\"") >&5
4435   (eval $ac_compile) 2>&5
4436   ac_status=$?
4437   echo "$as_me:4437: \$? = $ac_status" >&5
4438   (exit "$ac_status"); } &&
4439          { ac_try='test -s "conftest.$ac_objext"'
4440   { (eval echo "$as_me:4440: \"$ac_try\"") >&5
4441   (eval $ac_try) 2>&5
4442   ac_status=$?
4443   echo "$as_me:4443: \$? = $ac_status" >&5
4444   (exit "$ac_status"); }; }; then
4445   :
4446 else
4447   echo "$as_me: failed program was:" >&5
4448 cat "conftest.$ac_ext" >&5
4449 cf_have_incdir=yes
4450 fi
4451 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4452                           CPPFLAGS=$cf_save_CPPFLAGS
4453                         fi
4454                   fi
4455                 fi
4456
4457                 if test "$cf_have_incdir" = no ; then
4458                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4459
4460 echo "${as_me:-configure}:4460: testing adding $cf_add_incdir to include-path ..." 1>&5
4461
4462                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4463
4464                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4465                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4466                   cf_add_incdir="$cf_top_incdir"
4467                 else
4468                   break
4469                 fi
4470           else
4471                 break
4472           fi
4473         done
4474   done
4475 fi
4476
4477 if test -n "$cf_cv_curses_dir/lib" ; then
4478         for cf_add_libdir in $cf_cv_curses_dir/lib
4479         do
4480                 if test "$cf_add_libdir" = /usr/lib ; then
4481                         :
4482                 elif test -d "$cf_add_libdir"
4483                 then
4484                         cf_have_libdir=no
4485                         if test -n "$LDFLAGS$LIBS" ; then
4486                                 # a loop is needed to ensure we can add subdirs of existing dirs
4487                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4488                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4489                                                 cf_have_libdir=yes; break
4490                                         fi
4491                                 done
4492                         fi
4493                         if test "$cf_have_libdir" = no ; then
4494                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4495
4496 echo "${as_me:-configure}:4496: testing adding $cf_add_libdir to library-path ..." 1>&5
4497
4498                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4499                         fi
4500                 fi
4501         done
4502 fi
4503
4504         fi
4505 fi
4506
4507 cf_ncuconfig_root=ncurses
4508 cf_have_ncuconfig=no
4509
4510 if test "x${PKG_CONFIG:=none}" != xnone; then
4511         echo "$as_me:4511: checking pkg-config for $cf_ncuconfig_root" >&5
4512 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4513         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4514                 echo "$as_me:4514: result: yes" >&5
4515 echo "${ECHO_T}yes" >&6
4516
4517                 echo "$as_me:4517: checking if the $cf_ncuconfig_root package files work" >&5
4518 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4519                 cf_have_ncuconfig=unknown
4520
4521                 cf_save_CFLAGS="$CFLAGS"
4522                 cf_save_CPPFLAGS="$CPPFLAGS"
4523                 cf_save_LIBS="$LIBS"
4524
4525                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4526                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4527
4528                 # while -W for passing linker flags is prevalent, it is not "standard".
4529                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4530                 # incompatible _and_ non-standard -W option which gives an error.  Work
4531                 # around that pitfall.
4532                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4533                 (x*c[89]9@@*-W*)
4534
4535 cf_fix_cppflags=no
4536 cf_new_cflags=
4537 cf_new_cppflags=
4538 cf_new_extra_cppflags=
4539
4540 for cf_add_cflags in $cf_pkg_cflags
4541 do
4542 case "$cf_fix_cppflags" in
4543 (no)
4544         case "$cf_add_cflags" in
4545         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4546                 case "$cf_add_cflags" in
4547                 (-D*)
4548                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4549
4550                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4551                                 && test -z "${cf_tst_cflags}" \
4552                                 && cf_fix_cppflags=yes
4553
4554                         if test "$cf_fix_cppflags" = yes ; then
4555
4556         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4557         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4558
4559                                 continue
4560                         elif test "${cf_tst_cflags}" = "\"'" ; then
4561
4562         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4563         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4564
4565                                 continue
4566                         fi
4567                         ;;
4568                 esac
4569                 case "$CPPFLAGS" in
4570                 (*$cf_add_cflags)
4571                         ;;
4572                 (*)
4573                         case "$cf_add_cflags" in
4574                         (-D*)
4575                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4576
4577 CPPFLAGS=`echo "$CPPFLAGS" | \
4578         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4579                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4580
4581                                 ;;
4582                         esac
4583
4584         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4585         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4586
4587                         ;;
4588                 esac
4589                 ;;
4590         (*)
4591
4592         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4593         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4594
4595                 ;;
4596         esac
4597         ;;
4598 (yes)
4599
4600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4602
4603         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4604
4605         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4606                 && test -z "${cf_tst_cflags}" \
4607                 && cf_fix_cppflags=no
4608         ;;
4609 esac
4610 done
4611
4612 if test -n "$cf_new_cflags" ; then
4613
4614         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4615         CFLAGS="${CFLAGS}$cf_new_cflags"
4616
4617 fi
4618
4619 if test -n "$cf_new_cppflags" ; then
4620
4621         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4622         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4623
4624 fi
4625
4626 if test -n "$cf_new_extra_cppflags" ; then
4627
4628         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4629         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4630
4631 fi
4632
4633 cf_add_libs="$LIBS"
4634 # reverse order
4635 cf_add_0lib=
4636 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4637 # filter duplicates
4638 for cf_add_1lib in $cf_add_0lib; do
4639         for cf_add_2lib in $cf_add_libs; do
4640                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4641                         cf_add_1lib=
4642                         break
4643                 fi
4644         done
4645         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4646 done
4647 LIBS="$cf_add_libs"
4648
4649                         cat >"conftest.$ac_ext" <<_ACEOF
4650 #line 4650 "configure"
4651 #include "confdefs.h"
4652 #include <${cf_cv_ncurses_header:-curses.h}>
4653 int
4654 main (void)
4655 {
4656 initscr(); mousemask(0,0); tigetstr((char *)0);
4657   ;
4658   return 0;
4659 }
4660 _ACEOF
4661 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4662 if { (eval echo "$as_me:4662: \"$ac_link\"") >&5
4663   (eval $ac_link) 2>&5
4664   ac_status=$?
4665   echo "$as_me:4665: \$? = $ac_status" >&5
4666   (exit "$ac_status"); } &&
4667          { ac_try='test -s "conftest$ac_exeext"'
4668   { (eval echo "$as_me:4668: \"$ac_try\"") >&5
4669   (eval $ac_try) 2>&5
4670   ac_status=$?
4671   echo "$as_me:4671: \$? = $ac_status" >&5
4672   (exit "$ac_status"); }; }; then
4673   if test "$cross_compiling" = yes; then
4674   cf_test_ncuconfig=maybe
4675 else
4676   cat >"conftest.$ac_ext" <<_ACEOF
4677 #line 4677 "configure"
4678 #include "confdefs.h"
4679 #include <${cf_cv_ncurses_header:-curses.h}>
4680                                         int main(void)
4681                                         { const char *xx = curses_version(); return (xx == 0); }
4682 _ACEOF
4683 rm -f "conftest$ac_exeext"
4684 if { (eval echo "$as_me:4684: \"$ac_link\"") >&5
4685   (eval $ac_link) 2>&5
4686   ac_status=$?
4687   echo "$as_me:4687: \$? = $ac_status" >&5
4688   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4689   { (eval echo "$as_me:4689: \"$ac_try\"") >&5
4690   (eval $ac_try) 2>&5
4691   ac_status=$?
4692   echo "$as_me:4692: \$? = $ac_status" >&5
4693   (exit "$ac_status"); }; }; then
4694   cf_test_ncuconfig=yes
4695 else
4696   echo "$as_me: program exited with status $ac_status" >&5
4697 echo "$as_me: failed program was:" >&5
4698 cat "conftest.$ac_ext" >&5
4699 cf_test_ncuconfig=no
4700 fi
4701 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4702 fi
4703 else
4704   echo "$as_me: failed program was:" >&5
4705 cat "conftest.$ac_ext" >&5
4706 cf_test_ncuconfig=no
4707 fi
4708 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4709
4710                         CFLAGS="$cf_save_CFLAGS"
4711                         CPPFLAGS="$cf_save_CPPFLAGS"
4712                         LIBS="$cf_save_LIBS"
4713
4714                         if test "x$cf_test_ncuconfig" != xyes; then
4715                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4716                                 cf_pkg_cflags="$cf_temp"
4717                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4718                                 cf_pkg_libs="$cf_temp"
4719                         fi
4720                         ;;
4721                 esac
4722
4723 for cf_add_cflags in $cf_pkg_cflags
4724 do
4725         case "x$cf_add_cflags" in
4726         (x-[DU]*)
4727
4728 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4729 while true
4730 do
4731         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4732         test "$CFLAGS" != "$cf_old_cflag" || break
4733
4734         CFLAGS="$cf_old_cflag"
4735 done
4736
4737 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4738 while true
4739 do
4740         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4741         test "$CPPFLAGS" != "$cf_old_cflag" || break
4742
4743         CPPFLAGS="$cf_old_cflag"
4744 done
4745
4746                 ;;
4747         esac
4748
4749 cf_fix_cppflags=no
4750 cf_new_cflags=
4751 cf_new_cppflags=
4752 cf_new_extra_cppflags=
4753
4754 for cf_add_cflags in $cf_add_cflags
4755 do
4756 case "$cf_fix_cppflags" in
4757 (no)
4758         case "$cf_add_cflags" in
4759         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4760                 case "$cf_add_cflags" in
4761                 (-D*)
4762                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4763
4764                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4765                                 && test -z "${cf_tst_cflags}" \
4766                                 && cf_fix_cppflags=yes
4767
4768                         if test "$cf_fix_cppflags" = yes ; then
4769
4770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4772
4773                                 continue
4774                         elif test "${cf_tst_cflags}" = "\"'" ; then
4775
4776         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4777         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4778
4779                                 continue
4780                         fi
4781                         ;;
4782                 esac
4783                 case "$CPPFLAGS" in
4784                 (*$cf_add_cflags)
4785                         ;;
4786                 (*)
4787                         case "$cf_add_cflags" in
4788                         (-D*)
4789                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4790
4791 CPPFLAGS=`echo "$CPPFLAGS" | \
4792         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4793                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4794
4795                                 ;;
4796                         esac
4797
4798         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4799         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4800
4801                         ;;
4802                 esac
4803                 ;;
4804         (*)
4805
4806         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4807         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4808
4809                 ;;
4810         esac
4811         ;;
4812 (yes)
4813
4814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4816
4817         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4818
4819         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4820                 && test -z "${cf_tst_cflags}" \
4821                 && cf_fix_cppflags=no
4822         ;;
4823 esac
4824 done
4825
4826 if test -n "$cf_new_cflags" ; then
4827
4828         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4829         CFLAGS="${CFLAGS}$cf_new_cflags"
4830
4831 fi
4832
4833 if test -n "$cf_new_cppflags" ; then
4834
4835         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4836         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4837
4838 fi
4839
4840 if test -n "$cf_new_extra_cppflags" ; then
4841
4842         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4843         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4844
4845 fi
4846
4847 done
4848
4849 cf_add_libs="$LIBS"
4850 # reverse order
4851 cf_add_0lib=
4852 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4853 # filter duplicates
4854 for cf_add_1lib in $cf_add_0lib; do
4855         for cf_add_2lib in $cf_add_libs; do
4856                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4857                         cf_add_1lib=
4858                         break
4859                 fi
4860         done
4861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4862 done
4863 LIBS="$cf_add_libs"
4864
4865                 cat >"conftest.$ac_ext" <<_ACEOF
4866 #line 4866 "configure"
4867 #include "confdefs.h"
4868 #include <${cf_cv_ncurses_header:-curses.h}>
4869 int
4870 main (void)
4871 {
4872 initscr(); mousemask(0,0); tigetstr((char *)0);
4873   ;
4874   return 0;
4875 }
4876 _ACEOF
4877 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4878 if { (eval echo "$as_me:4878: \"$ac_link\"") >&5
4879   (eval $ac_link) 2>&5
4880   ac_status=$?
4881   echo "$as_me:4881: \$? = $ac_status" >&5
4882   (exit "$ac_status"); } &&
4883          { ac_try='test -s "conftest$ac_exeext"'
4884   { (eval echo "$as_me:4884: \"$ac_try\"") >&5
4885   (eval $ac_try) 2>&5
4886   ac_status=$?
4887   echo "$as_me:4887: \$? = $ac_status" >&5
4888   (exit "$ac_status"); }; }; then
4889   if test "$cross_compiling" = yes; then
4890   cf_have_ncuconfig=maybe
4891 else
4892   cat >"conftest.$ac_ext" <<_ACEOF
4893 #line 4893 "configure"
4894 #include "confdefs.h"
4895 #include <${cf_cv_ncurses_header:-curses.h}>
4896                                 int main(void)
4897                                 { const char *xx = curses_version(); return (xx == 0); }
4898 _ACEOF
4899 rm -f "conftest$ac_exeext"
4900 if { (eval echo "$as_me:4900: \"$ac_link\"") >&5
4901   (eval $ac_link) 2>&5
4902   ac_status=$?
4903   echo "$as_me:4903: \$? = $ac_status" >&5
4904   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4905   { (eval echo "$as_me:4905: \"$ac_try\"") >&5
4906   (eval $ac_try) 2>&5
4907   ac_status=$?
4908   echo "$as_me:4908: \$? = $ac_status" >&5
4909   (exit "$ac_status"); }; }; then
4910   cf_have_ncuconfig=yes
4911 else
4912   echo "$as_me: program exited with status $ac_status" >&5
4913 echo "$as_me: failed program was:" >&5
4914 cat "conftest.$ac_ext" >&5
4915 cf_have_ncuconfig=no
4916 fi
4917 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4918 fi
4919 else
4920   echo "$as_me: failed program was:" >&5
4921 cat "conftest.$ac_ext" >&5
4922 cf_have_ncuconfig=no
4923 fi
4924 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4925                 echo "$as_me:4925: result: $cf_have_ncuconfig" >&5
4926 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4927                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4928                 if test "$cf_have_ncuconfig" != "yes"
4929                 then
4930                         CPPFLAGS="$cf_save_CPPFLAGS"
4931                         LIBS="$cf_save_LIBS"
4932                         NCURSES_CONFIG_PKG=none
4933                 else
4934
4935 cat >>confdefs.h <<\EOF
4936 #define NCURSES 1
4937 EOF
4938
4939                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4940
4941 echo "$as_me:4941: checking for terminfo header" >&5
4942 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4943 if test "${cf_cv_term_header+set}" = set; then
4944   echo $ECHO_N "(cached) $ECHO_C" >&6
4945 else
4946
4947 case "${cf_cv_ncurses_header}" in
4948 (*/ncurses.h|*/ncursesw.h)
4949         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4950         ;;
4951 (*)
4952         cf_term_header=term.h
4953         ;;
4954 esac
4955
4956 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4957 do
4958 cat >"conftest.$ac_ext" <<_ACEOF
4959 #line 4959 "configure"
4960 #include "confdefs.h"
4961 #include <stdio.h>
4962 #include <${cf_cv_ncurses_header:-curses.h}>
4963 #include <$cf_test>
4964
4965 int
4966 main (void)
4967 {
4968 int x = auto_left_margin; (void)x
4969   ;
4970   return 0;
4971 }
4972 _ACEOF
4973 rm -f "conftest.$ac_objext"
4974 if { (eval echo "$as_me:4974: \"$ac_compile\"") >&5
4975   (eval $ac_compile) 2>&5
4976   ac_status=$?
4977   echo "$as_me:4977: \$? = $ac_status" >&5
4978   (exit "$ac_status"); } &&
4979          { ac_try='test -s "conftest.$ac_objext"'
4980   { (eval echo "$as_me:4980: \"$ac_try\"") >&5
4981   (eval $ac_try) 2>&5
4982   ac_status=$?
4983   echo "$as_me:4983: \$? = $ac_status" >&5
4984   (exit "$ac_status"); }; }; then
4985
4986         cf_cv_term_header="$cf_test"
4987 else
4988   echo "$as_me: failed program was:" >&5
4989 cat "conftest.$ac_ext" >&5
4990
4991         cf_cv_term_header=unknown
4992
4993 fi
4994 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4995         test "$cf_cv_term_header" != unknown && break
4996 done
4997
4998 fi
4999 echo "$as_me:4999: result: $cf_cv_term_header" >&5
5000 echo "${ECHO_T}$cf_cv_term_header" >&6
5001
5002 # Set definitions to allow ifdef'ing to accommodate subdirectories
5003
5004 case "$cf_cv_term_header" in
5005 (*term.h)
5006
5007 cat >>confdefs.h <<\EOF
5008 #define HAVE_TERM_H 1
5009 EOF
5010
5011         ;;
5012 esac
5013
5014 case "$cf_cv_term_header" in
5015 (ncurses/term.h)
5016
5017 cat >>confdefs.h <<\EOF
5018 #define HAVE_NCURSES_TERM_H 1
5019 EOF
5020
5021         ;;
5022 (ncursesw/term.h)
5023
5024 cat >>confdefs.h <<\EOF
5025 #define HAVE_NCURSESW_TERM_H 1
5026 EOF
5027
5028         ;;
5029 esac
5030
5031                 fi
5032
5033         else
5034                 echo "$as_me:5034: result: no" >&5
5035 echo "${ECHO_T}no" >&6
5036                 NCURSES_CONFIG_PKG=none
5037         fi
5038 else
5039         NCURSES_CONFIG_PKG=none
5040 fi
5041
5042 if test "x$cf_have_ncuconfig" = "xno"; then
5043         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5044
5045 if test -n "$ac_tool_prefix"; then
5046   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5047   do
5048     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5049 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5050 echo "$as_me:5050: checking for $ac_word" >&5
5051 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5052 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5053   echo $ECHO_N "(cached) $ECHO_C" >&6
5054 else
5055   if test -n "$NCURSES_CONFIG"; then
5056   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5057 else
5058   ac_save_IFS=$IFS; IFS=$ac_path_separator
5059 ac_dummy="$PATH"
5060 for ac_dir in $ac_dummy; do
5061   IFS=$ac_save_IFS
5062   test -z "$ac_dir" && ac_dir=.
5063   $as_executable_p "$ac_dir/$ac_word" || continue
5064 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5065 echo "$as_me:5065: found $ac_dir/$ac_word" >&5
5066 break
5067 done
5068
5069 fi
5070 fi
5071 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5072 if test -n "$NCURSES_CONFIG"; then
5073   echo "$as_me:5073: result: $NCURSES_CONFIG" >&5
5074 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5075 else
5076   echo "$as_me:5076: result: no" >&5
5077 echo "${ECHO_T}no" >&6
5078 fi
5079
5080     test -n "$NCURSES_CONFIG" && break
5081   done
5082 fi
5083 if test -z "$NCURSES_CONFIG"; then
5084   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5085   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5086 do
5087   # Extract the first word of "$ac_prog", so it can be a program name with args.
5088 set dummy $ac_prog; ac_word=$2
5089 echo "$as_me:5089: checking for $ac_word" >&5
5090 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5091 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5092   echo $ECHO_N "(cached) $ECHO_C" >&6
5093 else
5094   if test -n "$ac_ct_NCURSES_CONFIG"; then
5095   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5096 else
5097   ac_save_IFS=$IFS; IFS=$ac_path_separator
5098 ac_dummy="$PATH"
5099 for ac_dir in $ac_dummy; do
5100   IFS=$ac_save_IFS
5101   test -z "$ac_dir" && ac_dir=.
5102   $as_executable_p "$ac_dir/$ac_word" || continue
5103 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5104 echo "$as_me:5104: found $ac_dir/$ac_word" >&5
5105 break
5106 done
5107
5108 fi
5109 fi
5110 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5111 if test -n "$ac_ct_NCURSES_CONFIG"; then
5112   echo "$as_me:5112: result: $ac_ct_NCURSES_CONFIG" >&5
5113 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5114 else
5115   echo "$as_me:5115: result: no" >&5
5116 echo "${ECHO_T}no" >&6
5117 fi
5118
5119   test -n "$ac_ct_NCURSES_CONFIG" && break
5120 done
5121 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5122
5123   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5124 fi
5125
5126         if test "$NCURSES_CONFIG" != none ; then
5127
5128 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5129 do
5130         case "x$cf_add_cflags" in
5131         (x-[DU]*)
5132
5133 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5134 while true
5135 do
5136         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5137         test "$CFLAGS" != "$cf_old_cflag" || break
5138
5139         CFLAGS="$cf_old_cflag"
5140 done
5141
5142 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5143 while true
5144 do
5145         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5146         test "$CPPFLAGS" != "$cf_old_cflag" || break
5147
5148         CPPFLAGS="$cf_old_cflag"
5149 done
5150
5151                 ;;
5152         esac
5153
5154 cf_fix_cppflags=no
5155 cf_new_cflags=
5156 cf_new_cppflags=
5157 cf_new_extra_cppflags=
5158
5159 for cf_add_cflags in $cf_add_cflags
5160 do
5161 case "$cf_fix_cppflags" in
5162 (no)
5163         case "$cf_add_cflags" in
5164         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5165                 case "$cf_add_cflags" in
5166                 (-D*)
5167                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5168
5169                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5170                                 && test -z "${cf_tst_cflags}" \
5171                                 && cf_fix_cppflags=yes
5172
5173                         if test "$cf_fix_cppflags" = yes ; then
5174
5175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5177
5178                                 continue
5179                         elif test "${cf_tst_cflags}" = "\"'" ; then
5180
5181         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5182         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5183
5184                                 continue
5185                         fi
5186                         ;;
5187                 esac
5188                 case "$CPPFLAGS" in
5189                 (*$cf_add_cflags)
5190                         ;;
5191                 (*)
5192                         case "$cf_add_cflags" in
5193                         (-D*)
5194                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5195
5196 CPPFLAGS=`echo "$CPPFLAGS" | \
5197         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5198                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5199
5200                                 ;;
5201                         esac
5202
5203         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5204         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5205
5206                         ;;
5207                 esac
5208                 ;;
5209         (*)
5210
5211         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5212         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5213
5214                 ;;
5215         esac
5216         ;;
5217 (yes)
5218
5219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5221
5222         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5223
5224         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5225                 && test -z "${cf_tst_cflags}" \
5226                 && cf_fix_cppflags=no
5227         ;;
5228 esac
5229 done
5230
5231 if test -n "$cf_new_cflags" ; then
5232
5233         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5234         CFLAGS="${CFLAGS}$cf_new_cflags"
5235
5236 fi
5237
5238 if test -n "$cf_new_cppflags" ; then
5239
5240         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5241         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5242
5243 fi
5244
5245 if test -n "$cf_new_extra_cppflags" ; then
5246
5247         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5248         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5249
5250 fi
5251
5252 done
5253
5254 cf_add_libs="$LIBS"
5255 # reverse order
5256 cf_add_0lib=
5257 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5258 # filter duplicates
5259 for cf_add_1lib in $cf_add_0lib; do
5260         for cf_add_2lib in $cf_add_libs; do
5261                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5262                         cf_add_1lib=
5263                         break
5264                 fi
5265         done
5266         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5267 done
5268 LIBS="$cf_add_libs"
5269
5270                 # even with config script, some packages use no-override for curses.h
5271
5272 echo "$as_me:5272: checking if we have identified curses headers" >&5
5273 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5274 if test "${cf_cv_ncurses_header+set}" = set; then
5275   echo $ECHO_N "(cached) $ECHO_C" >&6
5276 else
5277
5278 cf_cv_ncurses_header=none
5279 for cf_header in \
5280         ncurses.h ncurses/ncurses.h \
5281         curses.h ncurses/curses.h
5282 do
5283 cat >"conftest.$ac_ext" <<_ACEOF
5284 #line 5284 "configure"
5285 #include "confdefs.h"
5286 #include <${cf_header}>
5287 int
5288 main (void)
5289 {
5290 initscr(); tgoto("?", 0,0)
5291   ;
5292   return 0;
5293 }
5294 _ACEOF
5295 rm -f "conftest.$ac_objext"
5296 if { (eval echo "$as_me:5296: \"$ac_compile\"") >&5
5297   (eval $ac_compile) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit "$ac_status"); } &&
5301          { ac_try='test -s "conftest.$ac_objext"'
5302   { (eval echo "$as_me:5302: \"$ac_try\"") >&5
5303   (eval $ac_try) 2>&5
5304   ac_status=$?
5305   echo "$as_me:5305: \$? = $ac_status" >&5
5306   (exit "$ac_status"); }; }; then
5307   cf_cv_ncurses_header=$cf_header; break
5308 else
5309   echo "$as_me: failed program was:" >&5
5310 cat "conftest.$ac_ext" >&5
5311 fi
5312 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5313 done
5314
5315 fi
5316 echo "$as_me:5316: result: $cf_cv_ncurses_header" >&5
5317 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5318
5319 if test "$cf_cv_ncurses_header" = none ; then
5320         { { echo "$as_me:5320: error: No curses header-files found" >&5
5321 echo "$as_me: error: No curses header-files found" >&2;}
5322    { (exit 1); exit 1; }; }
5323 fi
5324
5325 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5326
5327 for ac_header in $cf_cv_ncurses_header
5328 do
5329 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5330 echo "$as_me:5330: checking for $ac_header" >&5
5331 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5332 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5333   echo $ECHO_N "(cached) $ECHO_C" >&6
5334 else
5335   cat >"conftest.$ac_ext" <<_ACEOF
5336 #line 5336 "configure"
5337 #include "confdefs.h"
5338 #include <$ac_header>
5339 _ACEOF
5340 if { (eval echo "$as_me:5340: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5341   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5342   ac_status=$?
5343   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5344   rm -f conftest.er1
5345   cat conftest.err >&5
5346   echo "$as_me:5346: \$? = $ac_status" >&5
5347   (exit "$ac_status"); } >/dev/null; then
5348   if test -s conftest.err; then
5349     ac_cpp_err=$ac_c_preproc_warn_flag
5350   else
5351     ac_cpp_err=
5352   fi
5353 else
5354   ac_cpp_err=yes
5355 fi
5356 if test -z "$ac_cpp_err"; then
5357   eval "$as_ac_Header=yes"
5358 else
5359   echo "$as_me: failed program was:" >&5
5360   cat "conftest.$ac_ext" >&5
5361   eval "$as_ac_Header=no"
5362 fi
5363 rm -f conftest.err "conftest.$ac_ext"
5364 fi
5365 echo "$as_me:5365: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5366 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5367 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5368   cat >>confdefs.h <<EOF
5369 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5370 EOF
5371
5372 fi
5373 done
5374
5375 cat >>confdefs.h <<\EOF
5376 #define NCURSES 1
5377 EOF
5378
5379 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5380
5381                 cat >>confdefs.h <<EOF
5382 #define $cf_nculib_ROOT 1
5383 EOF
5384
5385                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5386
5387         else
5388
5389 cf_ncuhdr_root=ncurses
5390
5391 test -n "$cf_cv_curses_dir" && \
5392 test "$cf_cv_curses_dir" != "no" && { \
5393
5394 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5395   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5396   do
5397         while test "$cf_add_incdir" != /usr/include
5398         do
5399           if test -d "$cf_add_incdir"
5400           then
5401                 cf_have_incdir=no
5402                 if test -n "$CFLAGS$CPPFLAGS" ; then
5403                   # a loop is needed to ensure we can add subdirs of existing dirs
5404                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5405                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5406                           cf_have_incdir=yes; break
5407                         fi
5408                   done
5409                 fi
5410
5411                 if test "$cf_have_incdir" = no ; then
5412                   if test "$cf_add_incdir" = /usr/local/include ; then
5413                         if test "$GCC" = yes
5414                         then
5415                           cf_save_CPPFLAGS=$CPPFLAGS
5416
5417         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5418         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5419
5420                           cat >"conftest.$ac_ext" <<_ACEOF
5421 #line 5421 "configure"
5422 #include "confdefs.h"
5423 #include <stdio.h>
5424 int
5425 main (void)
5426 {
5427 printf("Hello")
5428   ;
5429   return 0;
5430 }
5431 _ACEOF
5432 rm -f "conftest.$ac_objext"
5433 if { (eval echo "$as_me:5433: \"$ac_compile\"") >&5
5434   (eval $ac_compile) 2>&5
5435   ac_status=$?
5436   echo "$as_me:5436: \$? = $ac_status" >&5
5437   (exit "$ac_status"); } &&
5438          { ac_try='test -s "conftest.$ac_objext"'
5439   { (eval echo "$as_me:5439: \"$ac_try\"") >&5
5440   (eval $ac_try) 2>&5
5441   ac_status=$?
5442   echo "$as_me:5442: \$? = $ac_status" >&5
5443   (exit "$ac_status"); }; }; then
5444   :
5445 else
5446   echo "$as_me: failed program was:" >&5
5447 cat "conftest.$ac_ext" >&5
5448 cf_have_incdir=yes
5449 fi
5450 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5451                           CPPFLAGS=$cf_save_CPPFLAGS
5452                         fi
5453                   fi
5454                 fi
5455
5456                 if test "$cf_have_incdir" = no ; then
5457                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5458
5459 echo "${as_me:-configure}:5459: testing adding $cf_add_incdir to include-path ..." 1>&5
5460
5461                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5462
5463                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5464                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5465                   cf_add_incdir="$cf_top_incdir"
5466                 else
5467                   break
5468                 fi
5469           else
5470                 break
5471           fi
5472         done
5473   done
5474 fi
5475
5476 }
5477
5478 echo "$as_me:5478: checking for $cf_ncuhdr_root header in include-path" >&5
5479 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5480 if test "${cf_cv_ncurses_h+set}" = set; then
5481   echo $ECHO_N "(cached) $ECHO_C" >&6
5482 else
5483
5484         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5485         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5486         for cf_header in $cf_header_list
5487         do
5488
5489         cat >"conftest.$ac_ext" <<_ACEOF
5490 #line 5490 "configure"
5491 #include "confdefs.h"
5492
5493 #include <$cf_header>
5494 int
5495 main (void)
5496 {
5497
5498 #ifdef NCURSES_VERSION
5499
5500 printf("%s\\n", NCURSES_VERSION);
5501 #else
5502 #ifdef __NCURSES_H
5503 printf("old\\n");
5504 #else
5505         make an error
5506 #endif
5507 #endif
5508
5509   ;
5510   return 0;
5511 }
5512 _ACEOF
5513 rm -f "conftest.$ac_objext"
5514 if { (eval echo "$as_me:5514: \"$ac_compile\"") >&5
5515   (eval $ac_compile) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit "$ac_status"); } &&
5519          { ac_try='test -s "conftest.$ac_objext"'
5520   { (eval echo "$as_me:5520: \"$ac_try\"") >&5
5521   (eval $ac_try) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit "$ac_status"); }; }; then
5525   cf_cv_ncurses_h=$cf_header
5526
5527 else
5528   echo "$as_me: failed program was:" >&5
5529 cat "conftest.$ac_ext" >&5
5530 cf_cv_ncurses_h=no
5531 fi
5532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5533
5534                 test "$cf_cv_ncurses_h" != no && break
5535         done
5536
5537 fi
5538 echo "$as_me:5538: result: $cf_cv_ncurses_h" >&5
5539 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5540
5541 if test "$cf_cv_ncurses_h" != no ; then
5542         cf_cv_ncurses_header=$cf_cv_ncurses_h
5543 else
5544
5545 echo "$as_me:5545: checking for $cf_ncuhdr_root include-path" >&5
5546 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5547 if test "${cf_cv_ncurses_h2+set}" = set; then
5548   echo $ECHO_N "(cached) $ECHO_C" >&6
5549 else
5550
5551         test -n "$verbose" && echo
5552
5553 cf_search=
5554
5555 # collect the current set of include-directories from compiler flags
5556 cf_header_path_list=""
5557 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5558         for cf_header_path in $CPPFLAGS $CFLAGS
5559         do
5560                 case "$cf_header_path" in
5561                 (-I*)
5562                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5563
5564 test "x$cf_header_path" != "xNONE" && \
5565 test -d "$cf_header_path" && \
5566  {
5567         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5568         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5569         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5570         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5571         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5572         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"
5573 }
5574
5575                         cf_header_path_list="$cf_header_path_list $cf_search"
5576                         ;;
5577                 esac
5578         done
5579 fi
5580
5581 # add the variations for the package we are looking for
5582
5583 cf_search=
5584
5585 test "x$prefix" != "xNONE" && \
5586 test -d "$prefix" && \
5587  {
5588         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5589         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5590         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5591         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5592         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5593         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5594 }
5595
5596 for cf_subdir_prefix in \
5597         /usr \
5598         /usr/local \
5599         /usr/pkg \
5600         /opt \
5601         /opt/local \
5602         $HOME
5603 do
5604
5605 test "x$cf_subdir_prefix" != "x$prefix" && \
5606 test -d "$cf_subdir_prefix" && \
5607 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5608         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5609         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5610         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5611         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5612         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5613         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"
5614 }
5615
5616 done
5617
5618 test "$includedir" != NONE && \
5619 test "$includedir" != "/usr/include" && \
5620 test -d "$includedir" && {
5621         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5622         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5623 }
5624
5625 test "$oldincludedir" != NONE && \
5626 test "$oldincludedir" != "/usr/include" && \
5627 test -d "$oldincludedir" && {
5628         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5629         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5630 }
5631
5632 cf_search="$cf_search $cf_header_path_list"
5633
5634         test -n "$verbose" && echo "search path $cf_search"
5635         cf_save2_CPPFLAGS="$CPPFLAGS"
5636         for cf_incdir in $cf_search
5637         do
5638
5639 if test -n "$cf_incdir" ; then
5640   for cf_add_incdir in $cf_incdir
5641   do
5642         while test "$cf_add_incdir" != /usr/include
5643         do
5644           if test -d "$cf_add_incdir"
5645           then
5646                 cf_have_incdir=no
5647                 if test -n "$CFLAGS$CPPFLAGS" ; then
5648                   # a loop is needed to ensure we can add subdirs of existing dirs
5649                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5650                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5651                           cf_have_incdir=yes; break
5652                         fi
5653                   done
5654                 fi
5655
5656                 if test "$cf_have_incdir" = no ; then
5657                   if test "$cf_add_incdir" = /usr/local/include ; then
5658                         if test "$GCC" = yes
5659                         then
5660                           cf_save_CPPFLAGS=$CPPFLAGS
5661
5662         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5663         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5664
5665                           cat >"conftest.$ac_ext" <<_ACEOF
5666 #line 5666 "configure"
5667 #include "confdefs.h"
5668 #include <stdio.h>
5669 int
5670 main (void)
5671 {
5672 printf("Hello")
5673   ;
5674   return 0;
5675 }
5676 _ACEOF
5677 rm -f "conftest.$ac_objext"
5678 if { (eval echo "$as_me:5678: \"$ac_compile\"") >&5
5679   (eval $ac_compile) 2>&5
5680   ac_status=$?
5681   echo "$as_me:5681: \$? = $ac_status" >&5
5682   (exit "$ac_status"); } &&
5683          { ac_try='test -s "conftest.$ac_objext"'
5684   { (eval echo "$as_me:5684: \"$ac_try\"") >&5
5685   (eval $ac_try) 2>&5
5686   ac_status=$?
5687   echo "$as_me:5687: \$? = $ac_status" >&5
5688   (exit "$ac_status"); }; }; then
5689   :
5690 else
5691   echo "$as_me: failed program was:" >&5
5692 cat "conftest.$ac_ext" >&5
5693 cf_have_incdir=yes
5694 fi
5695 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5696                           CPPFLAGS=$cf_save_CPPFLAGS
5697                         fi
5698                   fi
5699                 fi
5700
5701                 if test "$cf_have_incdir" = no ; then
5702                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5703
5704 echo "${as_me:-configure}:5704: testing adding $cf_add_incdir to include-path ..." 1>&5
5705
5706                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5707
5708                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5709                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5710                   cf_add_incdir="$cf_top_incdir"
5711                 else
5712                   break
5713                 fi
5714           else
5715                 break
5716           fi
5717         done
5718   done
5719 fi
5720
5721                 for cf_header in \
5722                         ncurses.h \
5723                         curses.h
5724                 do
5725
5726         cat >"conftest.$ac_ext" <<_ACEOF
5727 #line 5727 "configure"
5728 #include "confdefs.h"
5729
5730 #include <$cf_header>
5731 int
5732 main (void)
5733 {
5734
5735 #ifdef NCURSES_VERSION
5736
5737 printf("%s\\n", NCURSES_VERSION);
5738 #else
5739 #ifdef __NCURSES_H
5740 printf("old\\n");
5741 #else
5742         make an error
5743 #endif
5744 #endif
5745
5746   ;
5747   return 0;
5748 }
5749 _ACEOF
5750 rm -f "conftest.$ac_objext"
5751 if { (eval echo "$as_me:5751: \"$ac_compile\"") >&5
5752   (eval $ac_compile) 2>&5
5753   ac_status=$?
5754   echo "$as_me:5754: \$? = $ac_status" >&5
5755   (exit "$ac_status"); } &&
5756          { ac_try='test -s "conftest.$ac_objext"'
5757   { (eval echo "$as_me:5757: \"$ac_try\"") >&5
5758   (eval $ac_try) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit "$ac_status"); }; }; then
5762   cf_cv_ncurses_h2=$cf_header
5763
5764 else
5765   echo "$as_me: failed program was:" >&5
5766 cat "conftest.$ac_ext" >&5
5767 cf_cv_ncurses_h2=no
5768 fi
5769 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5770
5771                         if test "$cf_cv_ncurses_h2" != no ; then
5772                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5773                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5774                                 break
5775                         fi
5776                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5777                 done
5778                 CPPFLAGS="$cf_save2_CPPFLAGS"
5779                 test "$cf_cv_ncurses_h2" != no && break
5780         done
5781         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5781: error: not found" >&5
5782 echo "$as_me: error: not found" >&2;}
5783    { (exit 1); exit 1; }; }
5784
5785 fi
5786 echo "$as_me:5786: result: $cf_cv_ncurses_h2" >&5
5787 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5788
5789         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5790         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5791         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5792                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5793         fi
5794
5795 if test -n "$cf_1st_incdir" ; then
5796   for cf_add_incdir in $cf_1st_incdir
5797   do
5798         while test "$cf_add_incdir" != /usr/include
5799         do
5800           if test -d "$cf_add_incdir"
5801           then
5802                 cf_have_incdir=no
5803                 if test -n "$CFLAGS$CPPFLAGS" ; then
5804                   # a loop is needed to ensure we can add subdirs of existing dirs
5805                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5806                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5807                           cf_have_incdir=yes; break
5808                         fi
5809                   done
5810                 fi
5811
5812                 if test "$cf_have_incdir" = no ; then
5813                   if test "$cf_add_incdir" = /usr/local/include ; then
5814                         if test "$GCC" = yes
5815                         then
5816                           cf_save_CPPFLAGS=$CPPFLAGS
5817
5818         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5819         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5820
5821                           cat >"conftest.$ac_ext" <<_ACEOF
5822 #line 5822 "configure"
5823 #include "confdefs.h"
5824 #include <stdio.h>
5825 int
5826 main (void)
5827 {
5828 printf("Hello")
5829   ;
5830   return 0;
5831 }
5832 _ACEOF
5833 rm -f "conftest.$ac_objext"
5834 if { (eval echo "$as_me:5834: \"$ac_compile\"") >&5
5835   (eval $ac_compile) 2>&5
5836   ac_status=$?
5837   echo "$as_me:5837: \$? = $ac_status" >&5
5838   (exit "$ac_status"); } &&
5839          { ac_try='test -s "conftest.$ac_objext"'
5840   { (eval echo "$as_me:5840: \"$ac_try\"") >&5
5841   (eval $ac_try) 2>&5
5842   ac_status=$?
5843   echo "$as_me:5843: \$? = $ac_status" >&5
5844   (exit "$ac_status"); }; }; then
5845   :
5846 else
5847   echo "$as_me: failed program was:" >&5
5848 cat "conftest.$ac_ext" >&5
5849 cf_have_incdir=yes
5850 fi
5851 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5852                           CPPFLAGS=$cf_save_CPPFLAGS
5853                         fi
5854                   fi
5855                 fi
5856
5857                 if test "$cf_have_incdir" = no ; then
5858                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5859
5860 echo "${as_me:-configure}:5860: testing adding $cf_add_incdir to include-path ..." 1>&5
5861
5862                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5863
5864                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5865                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5866                   cf_add_incdir="$cf_top_incdir"
5867                 else
5868                   break
5869                 fi
5870           else
5871                 break
5872           fi
5873         done
5874   done
5875 fi
5876
5877 fi
5878
5879 # Set definitions to allow ifdef'ing for ncurses.h
5880
5881 case "$cf_cv_ncurses_header" in
5882 (*ncurses.h)
5883
5884 cat >>confdefs.h <<\EOF
5885 #define HAVE_NCURSES_H 1
5886 EOF
5887
5888         ;;
5889 esac
5890
5891 case "$cf_cv_ncurses_header" in
5892 (ncurses/curses.h|ncurses/ncurses.h)
5893
5894 cat >>confdefs.h <<\EOF
5895 #define HAVE_NCURSES_NCURSES_H 1
5896 EOF
5897
5898         ;;
5899 (ncursesw/curses.h|ncursesw/ncurses.h)
5900
5901 cat >>confdefs.h <<\EOF
5902 #define HAVE_NCURSESW_NCURSES_H 1
5903 EOF
5904
5905         ;;
5906 esac
5907
5908 echo "$as_me:5908: checking for terminfo header" >&5
5909 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5910 if test "${cf_cv_term_header+set}" = set; then
5911   echo $ECHO_N "(cached) $ECHO_C" >&6
5912 else
5913
5914 case "${cf_cv_ncurses_header}" in
5915 (*/ncurses.h|*/ncursesw.h)
5916         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5917         ;;
5918 (*)
5919         cf_term_header=term.h
5920         ;;
5921 esac
5922
5923 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5924 do
5925 cat >"conftest.$ac_ext" <<_ACEOF
5926 #line 5926 "configure"
5927 #include "confdefs.h"
5928 #include <stdio.h>
5929 #include <${cf_cv_ncurses_header:-curses.h}>
5930 #include <$cf_test>
5931
5932 int
5933 main (void)
5934 {
5935 int x = auto_left_margin; (void)x
5936   ;
5937   return 0;
5938 }
5939 _ACEOF
5940 rm -f "conftest.$ac_objext"
5941 if { (eval echo "$as_me:5941: \"$ac_compile\"") >&5
5942   (eval $ac_compile) 2>&5
5943   ac_status=$?
5944   echo "$as_me:5944: \$? = $ac_status" >&5
5945   (exit "$ac_status"); } &&
5946          { ac_try='test -s "conftest.$ac_objext"'
5947   { (eval echo "$as_me:5947: \"$ac_try\"") >&5
5948   (eval $ac_try) 2>&5
5949   ac_status=$?
5950   echo "$as_me:5950: \$? = $ac_status" >&5
5951   (exit "$ac_status"); }; }; then
5952
5953         cf_cv_term_header="$cf_test"
5954 else
5955   echo "$as_me: failed program was:" >&5
5956 cat "conftest.$ac_ext" >&5
5957
5958         cf_cv_term_header=unknown
5959
5960 fi
5961 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5962         test "$cf_cv_term_header" != unknown && break
5963 done
5964
5965 fi
5966 echo "$as_me:5966: result: $cf_cv_term_header" >&5
5967 echo "${ECHO_T}$cf_cv_term_header" >&6
5968
5969 # Set definitions to allow ifdef'ing to accommodate subdirectories
5970
5971 case "$cf_cv_term_header" in
5972 (*term.h)
5973
5974 cat >>confdefs.h <<\EOF
5975 #define HAVE_TERM_H 1
5976 EOF
5977
5978         ;;
5979 esac
5980
5981 case "$cf_cv_term_header" in
5982 (ncurses/term.h)
5983
5984 cat >>confdefs.h <<\EOF
5985 #define HAVE_NCURSES_TERM_H 1
5986 EOF
5987
5988         ;;
5989 (ncursesw/term.h)
5990
5991 cat >>confdefs.h <<\EOF
5992 #define HAVE_NCURSESW_TERM_H 1
5993 EOF
5994
5995         ;;
5996 esac
5997
5998 # some applications need this, but should check for NCURSES_VERSION
5999
6000 cat >>confdefs.h <<\EOF
6001 #define NCURSES 1
6002 EOF
6003
6004 echo "$as_me:6004: checking for ncurses version" >&5
6005 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6006 if test "${cf_cv_ncurses_version+set}" = set; then
6007   echo $ECHO_N "(cached) $ECHO_C" >&6
6008 else
6009
6010         cf_cv_ncurses_version=no
6011         cf_tempfile=out$$
6012         rm -f "$cf_tempfile"
6013         if test "$cross_compiling" = yes; then
6014
6015         # This will not work if the preprocessor splits the line after the
6016         # Autoconf token.  The 'unproto' program does that.
6017         cat > "conftest.$ac_ext" <<EOF
6018 #include <${cf_cv_ncurses_header:-curses.h}>
6019 #undef Autoconf
6020 #ifdef NCURSES_VERSION
6021 Autoconf NCURSES_VERSION
6022 #else
6023 #ifdef __NCURSES_H
6024 Autoconf "old"
6025 #endif
6026 ;
6027 #endif
6028 EOF
6029         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6030         { (eval echo "$as_me:6030: \"$cf_try\"") >&5
6031   (eval $cf_try) 2>&5
6032   ac_status=$?
6033   echo "$as_me:6033: \$? = $ac_status" >&5
6034   (exit "$ac_status"); }
6035         if test -f conftest.out ; then
6036                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6037                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6038                 rm -f conftest.out
6039         fi
6040
6041 else
6042   cat >"conftest.$ac_ext" <<_ACEOF
6043 #line 6043 "configure"
6044 #include "confdefs.h"
6045
6046 #include <${cf_cv_ncurses_header:-curses.h}>
6047 #include <stdio.h>
6048 int main(void)
6049 {
6050         FILE *fp = fopen("$cf_tempfile", "w");
6051 #ifdef NCURSES_VERSION
6052 # ifdef NCURSES_VERSION_PATCH
6053         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6054 # else
6055         fprintf(fp, "%s\\n", NCURSES_VERSION);
6056 # endif
6057 #else
6058 # ifdef __NCURSES_H
6059         fprintf(fp, "old\\n");
6060 # else
6061         make an error
6062 # endif
6063 #endif
6064         ${cf_cv_main_return:-return}(0);
6065 }
6066 _ACEOF
6067 rm -f "conftest$ac_exeext"
6068 if { (eval echo "$as_me:6068: \"$ac_link\"") >&5
6069   (eval $ac_link) 2>&5
6070   ac_status=$?
6071   echo "$as_me:6071: \$? = $ac_status" >&5
6072   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6073   { (eval echo "$as_me:6073: \"$ac_try\"") >&5
6074   (eval $ac_try) 2>&5
6075   ac_status=$?
6076   echo "$as_me:6076: \$? = $ac_status" >&5
6077   (exit "$ac_status"); }; }; then
6078
6079         cf_cv_ncurses_version=`cat $cf_tempfile`
6080 else
6081   echo "$as_me: program exited with status $ac_status" >&5
6082 echo "$as_me: failed program was:" >&5
6083 cat "conftest.$ac_ext" >&5
6084 fi
6085 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6086 fi
6087         rm -f "$cf_tempfile"
6088
6089 fi
6090 echo "$as_me:6090: result: $cf_cv_ncurses_version" >&5
6091 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6092 test "$cf_cv_ncurses_version" = no ||
6093 cat >>confdefs.h <<\EOF
6094 #define NCURSES 1
6095 EOF
6096
6097 cf_nculib_root=ncurses
6098         # This works, except for the special case where we find gpm, but
6099         # ncurses is in a nonstandard location via $LIBS, and we really want
6100         # to link gpm.
6101 cf_ncurses_LIBS=""
6102 cf_ncurses_SAVE="$LIBS"
6103 echo "$as_me:6103: checking for Gpm_Open in -lgpm" >&5
6104 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6105 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6106   echo $ECHO_N "(cached) $ECHO_C" >&6
6107 else
6108   ac_check_lib_save_LIBS=$LIBS
6109 LIBS="-lgpm  $LIBS"
6110 cat >"conftest.$ac_ext" <<_ACEOF
6111 #line 6111 "configure"
6112 #include "confdefs.h"
6113
6114 /* Override any gcc2 internal prototype to avoid an error.  */
6115 #ifdef __cplusplus
6116 extern "C"
6117 #endif
6118 /* We use char because int might match the return type of a gcc2
6119    builtin and then its argument prototype would still apply.  */
6120 char Gpm_Open ();
6121 int
6122 main (void)
6123 {
6124 Gpm_Open ();
6125   ;
6126   return 0;
6127 }
6128 _ACEOF
6129 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6130 if { (eval echo "$as_me:6130: \"$ac_link\"") >&5
6131   (eval $ac_link) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit "$ac_status"); } &&
6135          { ac_try='test -s "conftest$ac_exeext"'
6136   { (eval echo "$as_me:6136: \"$ac_try\"") >&5
6137   (eval $ac_try) 2>&5
6138   ac_status=$?
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit "$ac_status"); }; }; then
6141   ac_cv_lib_gpm_Gpm_Open=yes
6142 else
6143   echo "$as_me: failed program was:" >&5
6144 cat "conftest.$ac_ext" >&5
6145 ac_cv_lib_gpm_Gpm_Open=no
6146 fi
6147 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6148 LIBS=$ac_check_lib_save_LIBS
6149 fi
6150 echo "$as_me:6150: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6151 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6152 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6153   echo "$as_me:6153: checking for initscr in -lgpm" >&5
6154 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6155 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6156   echo $ECHO_N "(cached) $ECHO_C" >&6
6157 else
6158   ac_check_lib_save_LIBS=$LIBS
6159 LIBS="-lgpm  $LIBS"
6160 cat >"conftest.$ac_ext" <<_ACEOF
6161 #line 6161 "configure"
6162 #include "confdefs.h"
6163
6164 /* Override any gcc2 internal prototype to avoid an error.  */
6165 #ifdef __cplusplus
6166 extern "C"
6167 #endif
6168 /* We use char because int might match the return type of a gcc2
6169    builtin and then its argument prototype would still apply.  */
6170 char initscr ();
6171 int
6172 main (void)
6173 {
6174 initscr ();
6175   ;
6176   return 0;
6177 }
6178 _ACEOF
6179 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6180 if { (eval echo "$as_me:6180: \"$ac_link\"") >&5
6181   (eval $ac_link) 2>&5
6182   ac_status=$?
6183   echo "$as_me:6183: \$? = $ac_status" >&5
6184   (exit "$ac_status"); } &&
6185          { ac_try='test -s "conftest$ac_exeext"'
6186   { (eval echo "$as_me:6186: \"$ac_try\"") >&5
6187   (eval $ac_try) 2>&5
6188   ac_status=$?
6189   echo "$as_me:6189: \$? = $ac_status" >&5
6190   (exit "$ac_status"); }; }; then
6191   ac_cv_lib_gpm_initscr=yes
6192 else
6193   echo "$as_me: failed program was:" >&5
6194 cat "conftest.$ac_ext" >&5
6195 ac_cv_lib_gpm_initscr=no
6196 fi
6197 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6198 LIBS=$ac_check_lib_save_LIBS
6199 fi
6200 echo "$as_me:6200: result: $ac_cv_lib_gpm_initscr" >&5
6201 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6202 if test "$ac_cv_lib_gpm_initscr" = yes; then
6203   LIBS="$cf_ncurses_SAVE"
6204 else
6205   cf_ncurses_LIBS="-lgpm"
6206 fi
6207
6208 fi
6209
6210 case "$host_os" in
6211 (freebsd*)
6212         # This is only necessary if you are linking against an obsolete
6213         # version of ncurses (but it should do no harm, since it is static).
6214         if test "$cf_nculib_root" = ncurses ; then
6215                 echo "$as_me:6215: checking for tgoto in -lmytinfo" >&5
6216 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6217 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6218   echo $ECHO_N "(cached) $ECHO_C" >&6
6219 else
6220   ac_check_lib_save_LIBS=$LIBS
6221 LIBS="-lmytinfo  $LIBS"
6222 cat >"conftest.$ac_ext" <<_ACEOF
6223 #line 6223 "configure"
6224 #include "confdefs.h"
6225
6226 /* Override any gcc2 internal prototype to avoid an error.  */
6227 #ifdef __cplusplus
6228 extern "C"
6229 #endif
6230 /* We use char because int might match the return type of a gcc2
6231    builtin and then its argument prototype would still apply.  */
6232 char tgoto ();
6233 int
6234 main (void)
6235 {
6236 tgoto ();
6237   ;
6238   return 0;
6239 }
6240 _ACEOF
6241 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6242 if { (eval echo "$as_me:6242: \"$ac_link\"") >&5
6243   (eval $ac_link) 2>&5
6244   ac_status=$?
6245   echo "$as_me:6245: \$? = $ac_status" >&5
6246   (exit "$ac_status"); } &&
6247          { ac_try='test -s "conftest$ac_exeext"'
6248   { (eval echo "$as_me:6248: \"$ac_try\"") >&5
6249   (eval $ac_try) 2>&5
6250   ac_status=$?
6251   echo "$as_me:6251: \$? = $ac_status" >&5
6252   (exit "$ac_status"); }; }; then
6253   ac_cv_lib_mytinfo_tgoto=yes
6254 else
6255   echo "$as_me: failed program was:" >&5
6256 cat "conftest.$ac_ext" >&5
6257 ac_cv_lib_mytinfo_tgoto=no
6258 fi
6259 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6260 LIBS=$ac_check_lib_save_LIBS
6261 fi
6262 echo "$as_me:6262: result: $ac_cv_lib_mytinfo_tgoto" >&5
6263 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6264 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6265   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6266 fi
6267
6268         fi
6269         ;;
6270 esac
6271
6272 cf_add_libs="$LIBS"
6273 # reverse order
6274 cf_add_0lib=
6275 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6276 # filter duplicates
6277 for cf_add_1lib in $cf_add_0lib; do
6278         for cf_add_2lib in $cf_add_libs; do
6279                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6280                         cf_add_1lib=
6281                         break
6282                 fi
6283         done
6284         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6285 done
6286 LIBS="$cf_add_libs"
6287
6288 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6289 then
6290
6291 cf_add_libs="$LIBS"
6292 # reverse order
6293 cf_add_0lib=
6294 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6295 # filter duplicates
6296 for cf_add_1lib in $cf_add_0lib; do
6297         for cf_add_2lib in $cf_add_libs; do
6298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6299                         cf_add_1lib=
6300                         break
6301                 fi
6302         done
6303         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6304 done
6305 LIBS="$cf_add_libs"
6306
6307 else
6308
6309         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6310         cf_libdir=""
6311         echo "$as_me:6311: checking for initscr" >&5
6312 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6313 if test "${ac_cv_func_initscr+set}" = set; then
6314   echo $ECHO_N "(cached) $ECHO_C" >&6
6315 else
6316   cat >"conftest.$ac_ext" <<_ACEOF
6317 #line 6317 "configure"
6318 #include "confdefs.h"
6319 #define initscr autoconf_temporary
6320 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6321 #undef initscr
6322
6323 #ifdef __cplusplus
6324 extern "C"
6325 #endif
6326
6327 /* We use char because int might match the return type of a gcc2
6328    builtin and then its argument prototype would still apply.  */
6329 char initscr (void);
6330
6331 int
6332 main (void)
6333 {
6334
6335 /* The GNU C library defines stubs for functions which it implements
6336     to always fail with ENOSYS.  Some functions are actually named
6337     something starting with __ and the normal name is an alias.  */
6338 #if defined (__stub_initscr) || defined (__stub___initscr)
6339 #error found stub for initscr
6340 #endif
6341
6342         return initscr ();
6343   ;
6344   return 0;
6345 }
6346 _ACEOF
6347 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6348 if { (eval echo "$as_me:6348: \"$ac_link\"") >&5
6349   (eval $ac_link) 2>&5
6350   ac_status=$?
6351   echo "$as_me:6351: \$? = $ac_status" >&5
6352   (exit "$ac_status"); } &&
6353          { ac_try='test -s "conftest$ac_exeext"'
6354   { (eval echo "$as_me:6354: \"$ac_try\"") >&5
6355   (eval $ac_try) 2>&5
6356   ac_status=$?
6357   echo "$as_me:6357: \$? = $ac_status" >&5
6358   (exit "$ac_status"); }; }; then
6359   ac_cv_func_initscr=yes
6360 else
6361   echo "$as_me: failed program was:" >&5
6362 cat "conftest.$ac_ext" >&5
6363 ac_cv_func_initscr=no
6364 fi
6365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6366 fi
6367 echo "$as_me:6367: result: $ac_cv_func_initscr" >&5
6368 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6369 if test "$ac_cv_func_initscr" = yes; then
6370   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6371 else
6372
6373                 cf_save_LIBS="$LIBS"
6374                 echo "$as_me:6374: checking for initscr in -l$cf_nculib_root" >&5
6375 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6376                 LIBS="-l$cf_nculib_root $LIBS"
6377                 cat >"conftest.$ac_ext" <<_ACEOF
6378 #line 6378 "configure"
6379 #include "confdefs.h"
6380 #include <${cf_cv_ncurses_header:-curses.h}>
6381 int
6382 main (void)
6383 {
6384 initscr()
6385   ;
6386   return 0;
6387 }
6388 _ACEOF
6389 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6390 if { (eval echo "$as_me:6390: \"$ac_link\"") >&5
6391   (eval $ac_link) 2>&5
6392   ac_status=$?
6393   echo "$as_me:6393: \$? = $ac_status" >&5
6394   (exit "$ac_status"); } &&
6395          { ac_try='test -s "conftest$ac_exeext"'
6396   { (eval echo "$as_me:6396: \"$ac_try\"") >&5
6397   (eval $ac_try) 2>&5
6398   ac_status=$?
6399   echo "$as_me:6399: \$? = $ac_status" >&5
6400   (exit "$ac_status"); }; }; then
6401   echo "$as_me:6401: result: yes" >&5
6402 echo "${ECHO_T}yes" >&6
6403                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6404
6405 else
6406   echo "$as_me: failed program was:" >&5
6407 cat "conftest.$ac_ext" >&5
6408 echo "$as_me:6408: result: no" >&5
6409 echo "${ECHO_T}no" >&6
6410
6411 cf_search=
6412 cf_library_path_list=""
6413 if test -n "${LDFLAGS}${LIBS}" ; then
6414         for cf_library_path in $LDFLAGS $LIBS
6415         do
6416                 case "$cf_library_path" in
6417                 (-L*)
6418                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6419
6420 test "x$cf_library_path" != "xNONE" && \
6421 test -d "$cf_library_path" && \
6422  {
6423         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6424         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6425         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6426         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6427         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6428         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"
6429 }
6430
6431                         cf_library_path_list="$cf_library_path_list $cf_search"
6432                         ;;
6433                 esac
6434         done
6435 fi
6436
6437 cf_search=
6438
6439 test "x$prefix" != "xNONE" && \
6440 test -d "$prefix" && \
6441  {
6442         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6443         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6444         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6445         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6446         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6447         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6448 }
6449
6450 for cf_subdir_prefix in \
6451         /usr \
6452         /usr/local \
6453         /usr/pkg \
6454         /opt \
6455         /opt/local \
6456         $HOME
6457 do
6458
6459 test "x$cf_subdir_prefix" != "x$prefix" && \
6460 test -d "$cf_subdir_prefix" && \
6461 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6462         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6463         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6464         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6465         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6466         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6467         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"
6468 }
6469
6470 done
6471
6472 cf_search="$cf_library_path_list $cf_search"
6473
6474                         for cf_libdir in $cf_search
6475                         do
6476                                 echo "$as_me:6476: checking for -l$cf_nculib_root in $cf_libdir" >&5
6477 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6478                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6479                                 cat >"conftest.$ac_ext" <<_ACEOF
6480 #line 6480 "configure"
6481 #include "confdefs.h"
6482 #include <${cf_cv_ncurses_header:-curses.h}>
6483 int
6484 main (void)
6485 {
6486 initscr()
6487   ;
6488   return 0;
6489 }
6490 _ACEOF
6491 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6492 if { (eval echo "$as_me:6492: \"$ac_link\"") >&5
6493   (eval $ac_link) 2>&5
6494   ac_status=$?
6495   echo "$as_me:6495: \$? = $ac_status" >&5
6496   (exit "$ac_status"); } &&
6497          { ac_try='test -s "conftest$ac_exeext"'
6498   { (eval echo "$as_me:6498: \"$ac_try\"") >&5
6499   (eval $ac_try) 2>&5
6500   ac_status=$?
6501   echo "$as_me:6501: \$? = $ac_status" >&5
6502   (exit "$ac_status"); }; }; then
6503   echo "$as_me:6503: result: yes" >&5
6504 echo "${ECHO_T}yes" >&6
6505                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6506                                          break
6507 else
6508   echo "$as_me: failed program was:" >&5
6509 cat "conftest.$ac_ext" >&5
6510 echo "$as_me:6510: result: no" >&5
6511 echo "${ECHO_T}no" >&6
6512                                          LIBS="$cf_save_LIBS"
6513 fi
6514 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6515                         done
6516
6517 fi
6518 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6519
6520 fi
6521
6522 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6523
6524 if test "$cf_found_library" = no ; then
6525         { { echo "$as_me:6525: error: Cannot link $cf_nculib_root library" >&5
6526 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6527    { (exit 1); exit 1; }; }
6528 fi
6529
6530 fi
6531
6532 if test -n "$cf_ncurses_LIBS" ; then
6533         echo "$as_me:6533: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6534 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6535         cf_ncurses_SAVE="$LIBS"
6536         for p in $cf_ncurses_LIBS ; do
6537                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6538                 if test "$q" != "$LIBS" ; then
6539                         LIBS="$q"
6540                 fi
6541         done
6542         cat >"conftest.$ac_ext" <<_ACEOF
6543 #line 6543 "configure"
6544 #include "confdefs.h"
6545 #include <${cf_cv_ncurses_header:-curses.h}>
6546 int
6547 main (void)
6548 {
6549 initscr(); mousemask(0,0); tigetstr((char *)0);
6550   ;
6551   return 0;
6552 }
6553 _ACEOF
6554 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6555 if { (eval echo "$as_me:6555: \"$ac_link\"") >&5
6556   (eval $ac_link) 2>&5
6557   ac_status=$?
6558   echo "$as_me:6558: \$? = $ac_status" >&5
6559   (exit "$ac_status"); } &&
6560          { ac_try='test -s "conftest$ac_exeext"'
6561   { (eval echo "$as_me:6561: \"$ac_try\"") >&5
6562   (eval $ac_try) 2>&5
6563   ac_status=$?
6564   echo "$as_me:6564: \$? = $ac_status" >&5
6565   (exit "$ac_status"); }; }; then
6566   echo "$as_me:6566: result: yes" >&5
6567 echo "${ECHO_T}yes" >&6
6568 else
6569   echo "$as_me: failed program was:" >&5
6570 cat "conftest.$ac_ext" >&5
6571 echo "$as_me:6571: result: no" >&5
6572 echo "${ECHO_T}no" >&6
6573                  LIBS="$cf_ncurses_SAVE"
6574 fi
6575 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6576 fi
6577
6578 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6579
6580 cat >>confdefs.h <<EOF
6581 #define $cf_nculib_ROOT 1
6582 EOF
6583
6584         fi
6585 else
6586         NCURSES_CONFIG=none
6587 fi
6588
6589 echo "$as_me:6589: checking if you want wide-character code" >&5
6590 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6591
6592 # Check whether --enable-widec or --disable-widec was given.
6593 if test "${enable_widec+set}" = set; then
6594   enableval="$enable_widec"
6595   with_widec=$enableval
6596 else
6597   with_widec=no
6598 fi;
6599 echo "$as_me:6599: result: $with_widec" >&5
6600 echo "${ECHO_T}$with_widec" >&6
6601 if test "$with_widec" = yes ; then
6602
6603 for ac_header in wchar.h
6604 do
6605 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6606 echo "$as_me:6606: checking for $ac_header" >&5
6607 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6608 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6609   echo $ECHO_N "(cached) $ECHO_C" >&6
6610 else
6611   cat >"conftest.$ac_ext" <<_ACEOF
6612 #line 6612 "configure"
6613 #include "confdefs.h"
6614 #include <$ac_header>
6615 _ACEOF
6616 if { (eval echo "$as_me:6616: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6617   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6618   ac_status=$?
6619   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6620   rm -f conftest.er1
6621   cat conftest.err >&5
6622   echo "$as_me:6622: \$? = $ac_status" >&5
6623   (exit "$ac_status"); } >/dev/null; then
6624   if test -s conftest.err; then
6625     ac_cpp_err=$ac_c_preproc_warn_flag
6626   else
6627     ac_cpp_err=
6628   fi
6629 else
6630   ac_cpp_err=yes
6631 fi
6632 if test -z "$ac_cpp_err"; then
6633   eval "$as_ac_Header=yes"
6634 else
6635   echo "$as_me: failed program was:" >&5
6636   cat "conftest.$ac_ext" >&5
6637   eval "$as_ac_Header=no"
6638 fi
6639 rm -f conftest.err "conftest.$ac_ext"
6640 fi
6641 echo "$as_me:6641: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6642 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6643 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6644   cat >>confdefs.h <<EOF
6645 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6646 EOF
6647
6648 fi
6649 done
6650
6651 echo "$as_me:6651: checking for multibyte character support" >&5
6652 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6653 if test "${cf_cv_utf8_lib+set}" = set; then
6654   echo $ECHO_N "(cached) $ECHO_C" >&6
6655 else
6656
6657         cf_save_LIBS="$LIBS"
6658         cat >"conftest.$ac_ext" <<_ACEOF
6659 #line 6659 "configure"
6660 #include "confdefs.h"
6661
6662 #include <stdlib.h>
6663 #include <stdio.h>
6664 #ifdef HAVE_WCHAR_H
6665 #include <wchar.h>
6666 #endif
6667
6668 int
6669 main (void)
6670 {
6671 putwc(0,0);
6672   ;
6673   return 0;
6674 }
6675 _ACEOF
6676 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6677 if { (eval echo "$as_me:6677: \"$ac_link\"") >&5
6678   (eval $ac_link) 2>&5
6679   ac_status=$?
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit "$ac_status"); } &&
6682          { ac_try='test -s "conftest$ac_exeext"'
6683   { (eval echo "$as_me:6683: \"$ac_try\"") >&5
6684   (eval $ac_try) 2>&5
6685   ac_status=$?
6686   echo "$as_me:6686: \$? = $ac_status" >&5
6687   (exit "$ac_status"); }; }; then
6688   cf_cv_utf8_lib=yes
6689 else
6690   echo "$as_me: failed program was:" >&5
6691 cat "conftest.$ac_ext" >&5
6692
6693 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6694 # will be set on completion of the AC_TRY_LINK below.
6695 cf_cv_header_path_utf8=
6696 cf_cv_library_path_utf8=
6697
6698 echo "${as_me:-configure}:6698: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6699
6700 cf_save_LIBS="$LIBS"
6701
6702 cat >"conftest.$ac_ext" <<_ACEOF
6703 #line 6703 "configure"
6704 #include "confdefs.h"
6705
6706 #include <libutf8.h>
6707 int
6708 main (void)
6709 {
6710 putwc(0,0);
6711   ;
6712   return 0;
6713 }
6714 _ACEOF
6715 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6716 if { (eval echo "$as_me:6716: \"$ac_link\"") >&5
6717   (eval $ac_link) 2>&5
6718   ac_status=$?
6719   echo "$as_me:6719: \$? = $ac_status" >&5
6720   (exit "$ac_status"); } &&
6721          { ac_try='test -s "conftest$ac_exeext"'
6722   { (eval echo "$as_me:6722: \"$ac_try\"") >&5
6723   (eval $ac_try) 2>&5
6724   ac_status=$?
6725   echo "$as_me:6725: \$? = $ac_status" >&5
6726   (exit "$ac_status"); }; }; then
6727
6728         cf_cv_find_linkage_utf8=yes
6729         cf_cv_header_path_utf8=/usr/include
6730         cf_cv_library_path_utf8=/usr/lib
6731
6732 else
6733   echo "$as_me: failed program was:" >&5
6734 cat "conftest.$ac_ext" >&5
6735
6736 LIBS="-lutf8  $cf_save_LIBS"
6737
6738 cat >"conftest.$ac_ext" <<_ACEOF
6739 #line 6739 "configure"
6740 #include "confdefs.h"
6741
6742 #include <libutf8.h>
6743 int
6744 main (void)
6745 {
6746 putwc(0,0);
6747   ;
6748   return 0;
6749 }
6750 _ACEOF
6751 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6752 if { (eval echo "$as_me:6752: \"$ac_link\"") >&5
6753   (eval $ac_link) 2>&5
6754   ac_status=$?
6755   echo "$as_me:6755: \$? = $ac_status" >&5
6756   (exit "$ac_status"); } &&
6757          { ac_try='test -s "conftest$ac_exeext"'
6758   { (eval echo "$as_me:6758: \"$ac_try\"") >&5
6759   (eval $ac_try) 2>&5
6760   ac_status=$?
6761   echo "$as_me:6761: \$? = $ac_status" >&5
6762   (exit "$ac_status"); }; }; then
6763
6764         cf_cv_find_linkage_utf8=yes
6765         cf_cv_header_path_utf8=/usr/include
6766         cf_cv_library_path_utf8=/usr/lib
6767         cf_cv_library_file_utf8="-lutf8"
6768
6769 else
6770   echo "$as_me: failed program was:" >&5
6771 cat "conftest.$ac_ext" >&5
6772
6773         cf_cv_find_linkage_utf8=no
6774         LIBS="$cf_save_LIBS"
6775
6776         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6777
6778 echo "${as_me:-configure}:6778: testing find linkage for utf8 library ..." 1>&5
6779
6780 echo "${as_me:-configure}:6780: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6781
6782         cf_save_CPPFLAGS="$CPPFLAGS"
6783         cf_test_CPPFLAGS="$CPPFLAGS"
6784
6785 cf_search=
6786
6787 # collect the current set of include-directories from compiler flags
6788 cf_header_path_list=""
6789 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6790         for cf_header_path in $CPPFLAGS $CFLAGS
6791         do
6792                 case "$cf_header_path" in
6793                 (-I*)
6794                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6795
6796 test "x$cf_header_path" != "xNONE" && \
6797 test -d "$cf_header_path" && \
6798  {
6799         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6800         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6801         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6802         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6803         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6804         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6805 }
6806
6807                         cf_header_path_list="$cf_header_path_list $cf_search"
6808                         ;;
6809                 esac
6810         done
6811 fi
6812
6813 # add the variations for the package we are looking for
6814
6815 cf_search=
6816
6817 test "x$prefix" != "xNONE" && \
6818 test -d "$prefix" && \
6819  {
6820         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6821         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6822         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6823         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6824         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6825         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6826 }
6827
6828 for cf_subdir_prefix in \
6829         /usr \
6830         /usr/local \
6831         /usr/pkg \
6832         /opt \
6833         /opt/local \
6834         $HOME
6835 do
6836
6837 test "x$cf_subdir_prefix" != "x$prefix" && \
6838 test -d "$cf_subdir_prefix" && \
6839 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6840         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6841         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6842         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6843         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6844         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6845         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6846 }
6847
6848 done
6849
6850 test "$includedir" != NONE && \
6851 test "$includedir" != "/usr/include" && \
6852 test -d "$includedir" && {
6853         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6854         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6855 }
6856
6857 test "$oldincludedir" != NONE && \
6858 test "$oldincludedir" != "/usr/include" && \
6859 test -d "$oldincludedir" && {
6860         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6861         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6862 }
6863
6864 cf_search="$cf_search $cf_header_path_list"
6865
6866         for cf_cv_header_path_utf8 in $cf_search
6867         do
6868                 if test -d "$cf_cv_header_path_utf8" ; then
6869                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6870
6871 echo "${as_me:-configure}:6871: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6872
6873                         CPPFLAGS="$cf_save_CPPFLAGS"
6874
6875         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6876         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6877
6878                         cat >"conftest.$ac_ext" <<_ACEOF
6879 #line 6879 "configure"
6880 #include "confdefs.h"
6881
6882 #include <libutf8.h>
6883 int
6884 main (void)
6885 {
6886 putwc(0,0);
6887   ;
6888   return 0;
6889 }
6890 _ACEOF
6891 rm -f "conftest.$ac_objext"
6892 if { (eval echo "$as_me:6892: \"$ac_compile\"") >&5
6893   (eval $ac_compile) 2>&5
6894   ac_status=$?
6895   echo "$as_me:6895: \$? = $ac_status" >&5
6896   (exit "$ac_status"); } &&
6897          { ac_try='test -s "conftest.$ac_objext"'
6898   { (eval echo "$as_me:6898: \"$ac_try\"") >&5
6899   (eval $ac_try) 2>&5
6900   ac_status=$?
6901   echo "$as_me:6901: \$? = $ac_status" >&5
6902   (exit "$ac_status"); }; }; then
6903
6904                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6905
6906 echo "${as_me:-configure}:6906: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6907
6908                                 cf_cv_find_linkage_utf8=maybe
6909                                 cf_test_CPPFLAGS="$CPPFLAGS"
6910                                 break
6911 else
6912   echo "$as_me: failed program was:" >&5
6913 cat "conftest.$ac_ext" >&5
6914
6915                                 CPPFLAGS="$cf_save_CPPFLAGS"
6916
6917 fi
6918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6919                 fi
6920         done
6921
6922         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6923
6924 echo "${as_me:-configure}:6924: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6925
6926                 cf_save_LIBS="$LIBS"
6927                 cf_save_LDFLAGS="$LDFLAGS"
6928
6929                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6930
6931 cf_search=
6932 cf_library_path_list=""
6933 if test -n "${LDFLAGS}${LIBS}" ; then
6934         for cf_library_path in $LDFLAGS $LIBS
6935         do
6936                 case "$cf_library_path" in
6937                 (-L*)
6938                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6939
6940 test "x$cf_library_path" != "xNONE" && \
6941 test -d "$cf_library_path" && \
6942  {
6943         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6944         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6945         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6946         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6947         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6948         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6949 }
6950
6951                         cf_library_path_list="$cf_library_path_list $cf_search"
6952                         ;;
6953                 esac
6954         done
6955 fi
6956
6957 cf_search=
6958
6959 test "x$prefix" != "xNONE" && \
6960 test -d "$prefix" && \
6961  {
6962         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6963         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6964         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6965         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6966         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6967         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6968 }
6969
6970 for cf_subdir_prefix in \
6971         /usr \
6972         /usr/local \
6973         /usr/pkg \
6974         /opt \
6975         /opt/local \
6976         $HOME
6977 do
6978
6979 test "x$cf_subdir_prefix" != "x$prefix" && \
6980 test -d "$cf_subdir_prefix" && \
6981 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6982         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6983         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6984         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6985         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6986         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6987         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6988 }
6989
6990 done
6991
6992 cf_search="$cf_library_path_list $cf_search"
6993
6994                         for cf_cv_library_path_utf8 in $cf_search
6995                         do
6996                                 if test -d "$cf_cv_library_path_utf8" ; then
6997                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6998
6999 echo "${as_me:-configure}:6999: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7000
7001                                         CPPFLAGS="$cf_test_CPPFLAGS"
7002                                         LIBS="-lutf8  $cf_save_LIBS"
7003                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7004                                         cat >"conftest.$ac_ext" <<_ACEOF
7005 #line 7005 "configure"
7006 #include "confdefs.h"
7007
7008 #include <libutf8.h>
7009 int
7010 main (void)
7011 {
7012 putwc(0,0);
7013   ;
7014   return 0;
7015 }
7016 _ACEOF
7017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7018 if { (eval echo "$as_me:7018: \"$ac_link\"") >&5
7019   (eval $ac_link) 2>&5
7020   ac_status=$?
7021   echo "$as_me:7021: \$? = $ac_status" >&5
7022   (exit "$ac_status"); } &&
7023          { ac_try='test -s "conftest$ac_exeext"'
7024   { (eval echo "$as_me:7024: \"$ac_try\"") >&5
7025   (eval $ac_try) 2>&5
7026   ac_status=$?
7027   echo "$as_me:7027: \$? = $ac_status" >&5
7028   (exit "$ac_status"); }; }; then
7029
7030                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7031
7032 echo "${as_me:-configure}:7032: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7033
7034                                         cf_cv_find_linkage_utf8=yes
7035                                         cf_cv_library_file_utf8="-lutf8"
7036                                         break
7037 else
7038   echo "$as_me: failed program was:" >&5
7039 cat "conftest.$ac_ext" >&5
7040
7041                                         CPPFLAGS="$cf_save_CPPFLAGS"
7042                                         LIBS="$cf_save_LIBS"
7043                                         LDFLAGS="$cf_save_LDFLAGS"
7044
7045 fi
7046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7047                                 fi
7048                         done
7049                         CPPFLAGS="$cf_save_CPPFLAGS"
7050                         LDFLAGS="$cf_save_LDFLAGS"
7051                 fi
7052
7053         else
7054                 cf_cv_find_linkage_utf8=no
7055         fi
7056
7057 fi
7058 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7059
7060 fi
7061 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7062
7063 LIBS="$cf_save_LIBS"
7064
7065 if test "$cf_cv_find_linkage_utf8" = yes ; then
7066 cf_cv_utf8_lib=add-on
7067 else
7068 cf_cv_utf8_lib=no
7069 fi
7070
7071 fi
7072 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7073 fi
7074 echo "$as_me:7074: result: $cf_cv_utf8_lib" >&5
7075 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7076
7077 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7078 # ncurses/ncursesw:
7079 if test "$cf_cv_utf8_lib" = "add-on" ; then
7080
7081 cat >>confdefs.h <<\EOF
7082 #define HAVE_LIBUTF8_H 1
7083 EOF
7084
7085 if test -n "$cf_cv_header_path_utf8" ; then
7086   for cf_add_incdir in $cf_cv_header_path_utf8
7087   do
7088         while test "$cf_add_incdir" != /usr/include
7089         do
7090           if test -d "$cf_add_incdir"
7091           then
7092                 cf_have_incdir=no
7093                 if test -n "$CFLAGS$CPPFLAGS" ; then
7094                   # a loop is needed to ensure we can add subdirs of existing dirs
7095                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7096                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7097                           cf_have_incdir=yes; break
7098                         fi
7099                   done
7100                 fi
7101
7102                 if test "$cf_have_incdir" = no ; then
7103                   if test "$cf_add_incdir" = /usr/local/include ; then
7104                         if test "$GCC" = yes
7105                         then
7106                           cf_save_CPPFLAGS=$CPPFLAGS
7107
7108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7109         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7110
7111                           cat >"conftest.$ac_ext" <<_ACEOF
7112 #line 7112 "configure"
7113 #include "confdefs.h"
7114 #include <stdio.h>
7115 int
7116 main (void)
7117 {
7118 printf("Hello")
7119   ;
7120   return 0;
7121 }
7122 _ACEOF
7123 rm -f "conftest.$ac_objext"
7124 if { (eval echo "$as_me:7124: \"$ac_compile\"") >&5
7125   (eval $ac_compile) 2>&5
7126   ac_status=$?
7127   echo "$as_me:7127: \$? = $ac_status" >&5
7128   (exit "$ac_status"); } &&
7129          { ac_try='test -s "conftest.$ac_objext"'
7130   { (eval echo "$as_me:7130: \"$ac_try\"") >&5
7131   (eval $ac_try) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit "$ac_status"); }; }; then
7135   :
7136 else
7137   echo "$as_me: failed program was:" >&5
7138 cat "conftest.$ac_ext" >&5
7139 cf_have_incdir=yes
7140 fi
7141 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7142                           CPPFLAGS=$cf_save_CPPFLAGS
7143                         fi
7144                   fi
7145                 fi
7146
7147                 if test "$cf_have_incdir" = no ; then
7148                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7149
7150 echo "${as_me:-configure}:7150: testing adding $cf_add_incdir to include-path ..." 1>&5
7151
7152                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7153
7154                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7155                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7156                   cf_add_incdir="$cf_top_incdir"
7157                 else
7158                   break
7159                 fi
7160           else
7161                 break
7162           fi
7163         done
7164   done
7165 fi
7166
7167 if test -n "$cf_cv_library_path_utf8" ; then
7168         for cf_add_libdir in $cf_cv_library_path_utf8
7169         do
7170                 if test "$cf_add_libdir" = /usr/lib ; then
7171                         :
7172                 elif test -d "$cf_add_libdir"
7173                 then
7174                         cf_have_libdir=no
7175                         if test -n "$LDFLAGS$LIBS" ; then
7176                                 # a loop is needed to ensure we can add subdirs of existing dirs
7177                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7178                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7179                                                 cf_have_libdir=yes; break
7180                                         fi
7181                                 done
7182                         fi
7183                         if test "$cf_have_libdir" = no ; then
7184                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7185
7186 echo "${as_me:-configure}:7186: testing adding $cf_add_libdir to library-path ..." 1>&5
7187
7188                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7189                         fi
7190                 fi
7191         done
7192 fi
7193
7194 cf_add_libs="$LIBS"
7195 # reverse order
7196 cf_add_0lib=
7197 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7198 # filter duplicates
7199 for cf_add_1lib in $cf_add_0lib; do
7200         for cf_add_2lib in $cf_add_libs; do
7201                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7202                         cf_add_1lib=
7203                         break
7204                 fi
7205         done
7206         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7207 done
7208 LIBS="$cf_add_libs"
7209
7210 fi
7211
7212 cf_ncuconfig_root=ncursesw
7213 cf_have_ncuconfig=no
7214
7215 if test "x${PKG_CONFIG:=none}" != xnone; then
7216         echo "$as_me:7216: checking pkg-config for $cf_ncuconfig_root" >&5
7217 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7218         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7219                 echo "$as_me:7219: result: yes" >&5
7220 echo "${ECHO_T}yes" >&6
7221
7222                 echo "$as_me:7222: checking if the $cf_ncuconfig_root package files work" >&5
7223 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7224                 cf_have_ncuconfig=unknown
7225
7226                 cf_save_CFLAGS="$CFLAGS"
7227                 cf_save_CPPFLAGS="$CPPFLAGS"
7228                 cf_save_LIBS="$LIBS"
7229
7230                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7231                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7232
7233                 # while -W for passing linker flags is prevalent, it is not "standard".
7234                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7235                 # incompatible _and_ non-standard -W option which gives an error.  Work
7236                 # around that pitfall.
7237                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7238                 (x*c[89]9@@*-W*)
7239
7240 cf_fix_cppflags=no
7241 cf_new_cflags=
7242 cf_new_cppflags=
7243 cf_new_extra_cppflags=
7244
7245 for cf_add_cflags in $cf_pkg_cflags
7246 do
7247 case "$cf_fix_cppflags" in
7248 (no)
7249         case "$cf_add_cflags" in
7250         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7251                 case "$cf_add_cflags" in
7252                 (-D*)
7253                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7254
7255                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7256                                 && test -z "${cf_tst_cflags}" \
7257                                 && cf_fix_cppflags=yes
7258
7259                         if test "$cf_fix_cppflags" = yes ; then
7260
7261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7263
7264                                 continue
7265                         elif test "${cf_tst_cflags}" = "\"'" ; then
7266
7267         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7268         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7269
7270                                 continue
7271                         fi
7272                         ;;
7273                 esac
7274                 case "$CPPFLAGS" in
7275                 (*$cf_add_cflags)
7276                         ;;
7277                 (*)
7278                         case "$cf_add_cflags" in
7279                         (-D*)
7280                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7281
7282 CPPFLAGS=`echo "$CPPFLAGS" | \
7283         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7284                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7285
7286                                 ;;
7287                         esac
7288
7289         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7290         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7291
7292                         ;;
7293                 esac
7294                 ;;
7295         (*)
7296
7297         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7298         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7299
7300                 ;;
7301         esac
7302         ;;
7303 (yes)
7304
7305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7307
7308         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7309
7310         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7311                 && test -z "${cf_tst_cflags}" \
7312                 && cf_fix_cppflags=no
7313         ;;
7314 esac
7315 done
7316
7317 if test -n "$cf_new_cflags" ; then
7318
7319         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7320         CFLAGS="${CFLAGS}$cf_new_cflags"
7321
7322 fi
7323
7324 if test -n "$cf_new_cppflags" ; then
7325
7326         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7327         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7328
7329 fi
7330
7331 if test -n "$cf_new_extra_cppflags" ; then
7332
7333         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7334         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7335
7336 fi
7337
7338 cf_add_libs="$LIBS"
7339 # reverse order
7340 cf_add_0lib=
7341 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7342 # filter duplicates
7343 for cf_add_1lib in $cf_add_0lib; do
7344         for cf_add_2lib in $cf_add_libs; do
7345                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7346                         cf_add_1lib=
7347                         break
7348                 fi
7349         done
7350         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7351 done
7352 LIBS="$cf_add_libs"
7353
7354                         cat >"conftest.$ac_ext" <<_ACEOF
7355 #line 7355 "configure"
7356 #include "confdefs.h"
7357 #include <${cf_cv_ncurses_header:-curses.h}>
7358 int
7359 main (void)
7360 {
7361 initscr(); mousemask(0,0); tigetstr((char *)0);
7362   ;
7363   return 0;
7364 }
7365 _ACEOF
7366 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7367 if { (eval echo "$as_me:7367: \"$ac_link\"") >&5
7368   (eval $ac_link) 2>&5
7369   ac_status=$?
7370   echo "$as_me:7370: \$? = $ac_status" >&5
7371   (exit "$ac_status"); } &&
7372          { ac_try='test -s "conftest$ac_exeext"'
7373   { (eval echo "$as_me:7373: \"$ac_try\"") >&5
7374   (eval $ac_try) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit "$ac_status"); }; }; then
7378   if test "$cross_compiling" = yes; then
7379   cf_test_ncuconfig=maybe
7380 else
7381   cat >"conftest.$ac_ext" <<_ACEOF
7382 #line 7382 "configure"
7383 #include "confdefs.h"
7384 #include <${cf_cv_ncurses_header:-curses.h}>
7385                                         int main(void)
7386                                         { const char *xx = curses_version(); return (xx == 0); }
7387 _ACEOF
7388 rm -f "conftest$ac_exeext"
7389 if { (eval echo "$as_me:7389: \"$ac_link\"") >&5
7390   (eval $ac_link) 2>&5
7391   ac_status=$?
7392   echo "$as_me:7392: \$? = $ac_status" >&5
7393   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7394   { (eval echo "$as_me:7394: \"$ac_try\"") >&5
7395   (eval $ac_try) 2>&5
7396   ac_status=$?
7397   echo "$as_me:7397: \$? = $ac_status" >&5
7398   (exit "$ac_status"); }; }; then
7399   cf_test_ncuconfig=yes
7400 else
7401   echo "$as_me: program exited with status $ac_status" >&5
7402 echo "$as_me: failed program was:" >&5
7403 cat "conftest.$ac_ext" >&5
7404 cf_test_ncuconfig=no
7405 fi
7406 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7407 fi
7408 else
7409   echo "$as_me: failed program was:" >&5
7410 cat "conftest.$ac_ext" >&5
7411 cf_test_ncuconfig=no
7412 fi
7413 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7414
7415                         CFLAGS="$cf_save_CFLAGS"
7416                         CPPFLAGS="$cf_save_CPPFLAGS"
7417                         LIBS="$cf_save_LIBS"
7418
7419                         if test "x$cf_test_ncuconfig" != xyes; then
7420                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7421                                 cf_pkg_cflags="$cf_temp"
7422                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7423                                 cf_pkg_libs="$cf_temp"
7424                         fi
7425                         ;;
7426                 esac
7427
7428 for cf_add_cflags in $cf_pkg_cflags
7429 do
7430         case "x$cf_add_cflags" in
7431         (x-[DU]*)
7432
7433 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7434 while true
7435 do
7436         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7437         test "$CFLAGS" != "$cf_old_cflag" || break
7438
7439         CFLAGS="$cf_old_cflag"
7440 done
7441
7442 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7443 while true
7444 do
7445         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7446         test "$CPPFLAGS" != "$cf_old_cflag" || break
7447
7448         CPPFLAGS="$cf_old_cflag"
7449 done
7450
7451                 ;;
7452         esac
7453
7454 cf_fix_cppflags=no
7455 cf_new_cflags=
7456 cf_new_cppflags=
7457 cf_new_extra_cppflags=
7458
7459 for cf_add_cflags in $cf_add_cflags
7460 do
7461 case "$cf_fix_cppflags" in
7462 (no)
7463         case "$cf_add_cflags" in
7464         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7465                 case "$cf_add_cflags" in
7466                 (-D*)
7467                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7468
7469                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7470                                 && test -z "${cf_tst_cflags}" \
7471                                 && cf_fix_cppflags=yes
7472
7473                         if test "$cf_fix_cppflags" = yes ; then
7474
7475         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7476         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7477
7478                                 continue
7479                         elif test "${cf_tst_cflags}" = "\"'" ; then
7480
7481         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7482         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7483
7484                                 continue
7485                         fi
7486                         ;;
7487                 esac
7488                 case "$CPPFLAGS" in
7489                 (*$cf_add_cflags)
7490                         ;;
7491                 (*)
7492                         case "$cf_add_cflags" in
7493                         (-D*)
7494                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7495
7496 CPPFLAGS=`echo "$CPPFLAGS" | \
7497         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7498                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7499
7500                                 ;;
7501                         esac
7502
7503         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7504         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7505
7506                         ;;
7507                 esac
7508                 ;;
7509         (*)
7510
7511         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7512         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7513
7514                 ;;
7515         esac
7516         ;;
7517 (yes)
7518
7519         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7520         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7521
7522         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7523
7524         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7525                 && test -z "${cf_tst_cflags}" \
7526                 && cf_fix_cppflags=no
7527         ;;
7528 esac
7529 done
7530
7531 if test -n "$cf_new_cflags" ; then
7532
7533         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7534         CFLAGS="${CFLAGS}$cf_new_cflags"
7535
7536 fi
7537
7538 if test -n "$cf_new_cppflags" ; then
7539
7540         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7541         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7542
7543 fi
7544
7545 if test -n "$cf_new_extra_cppflags" ; then
7546
7547         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7548         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7549
7550 fi
7551
7552 done
7553
7554 cf_add_libs="$LIBS"
7555 # reverse order
7556 cf_add_0lib=
7557 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7558 # filter duplicates
7559 for cf_add_1lib in $cf_add_0lib; do
7560         for cf_add_2lib in $cf_add_libs; do
7561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7562                         cf_add_1lib=
7563                         break
7564                 fi
7565         done
7566         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7567 done
7568 LIBS="$cf_add_libs"
7569
7570                 cat >"conftest.$ac_ext" <<_ACEOF
7571 #line 7571 "configure"
7572 #include "confdefs.h"
7573 #include <${cf_cv_ncurses_header:-curses.h}>
7574 int
7575 main (void)
7576 {
7577 initscr(); mousemask(0,0); tigetstr((char *)0);
7578   ;
7579   return 0;
7580 }
7581 _ACEOF
7582 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7583 if { (eval echo "$as_me:7583: \"$ac_link\"") >&5
7584   (eval $ac_link) 2>&5
7585   ac_status=$?
7586   echo "$as_me:7586: \$? = $ac_status" >&5
7587   (exit "$ac_status"); } &&
7588          { ac_try='test -s "conftest$ac_exeext"'
7589   { (eval echo "$as_me:7589: \"$ac_try\"") >&5
7590   (eval $ac_try) 2>&5
7591   ac_status=$?
7592   echo "$as_me:7592: \$? = $ac_status" >&5
7593   (exit "$ac_status"); }; }; then
7594   if test "$cross_compiling" = yes; then
7595   cf_have_ncuconfig=maybe
7596 else
7597   cat >"conftest.$ac_ext" <<_ACEOF
7598 #line 7598 "configure"
7599 #include "confdefs.h"
7600 #include <${cf_cv_ncurses_header:-curses.h}>
7601                                 int main(void)
7602                                 { const char *xx = curses_version(); return (xx == 0); }
7603 _ACEOF
7604 rm -f "conftest$ac_exeext"
7605 if { (eval echo "$as_me:7605: \"$ac_link\"") >&5
7606   (eval $ac_link) 2>&5
7607   ac_status=$?
7608   echo "$as_me:7608: \$? = $ac_status" >&5
7609   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7610   { (eval echo "$as_me:7610: \"$ac_try\"") >&5
7611   (eval $ac_try) 2>&5
7612   ac_status=$?
7613   echo "$as_me:7613: \$? = $ac_status" >&5
7614   (exit "$ac_status"); }; }; then
7615   cf_have_ncuconfig=yes
7616 else
7617   echo "$as_me: program exited with status $ac_status" >&5
7618 echo "$as_me: failed program was:" >&5
7619 cat "conftest.$ac_ext" >&5
7620 cf_have_ncuconfig=no
7621 fi
7622 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7623 fi
7624 else
7625   echo "$as_me: failed program was:" >&5
7626 cat "conftest.$ac_ext" >&5
7627 cf_have_ncuconfig=no
7628 fi
7629 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7630                 echo "$as_me:7630: result: $cf_have_ncuconfig" >&5
7631 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7632                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7633                 if test "$cf_have_ncuconfig" != "yes"
7634                 then
7635                         CPPFLAGS="$cf_save_CPPFLAGS"
7636                         LIBS="$cf_save_LIBS"
7637                         NCURSES_CONFIG_PKG=none
7638                 else
7639
7640 cat >>confdefs.h <<\EOF
7641 #define NCURSES 1
7642 EOF
7643
7644                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7645
7646 echo "$as_me:7646: checking for terminfo header" >&5
7647 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7648 if test "${cf_cv_term_header+set}" = set; then
7649   echo $ECHO_N "(cached) $ECHO_C" >&6
7650 else
7651
7652 case "${cf_cv_ncurses_header}" in
7653 (*/ncurses.h|*/ncursesw.h)
7654         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7655         ;;
7656 (*)
7657         cf_term_header=term.h
7658         ;;
7659 esac
7660
7661 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7662 do
7663 cat >"conftest.$ac_ext" <<_ACEOF
7664 #line 7664 "configure"
7665 #include "confdefs.h"
7666 #include <stdio.h>
7667 #include <${cf_cv_ncurses_header:-curses.h}>
7668 #include <$cf_test>
7669
7670 int
7671 main (void)
7672 {
7673 int x = auto_left_margin; (void)x
7674   ;
7675   return 0;
7676 }
7677 _ACEOF
7678 rm -f "conftest.$ac_objext"
7679 if { (eval echo "$as_me:7679: \"$ac_compile\"") >&5
7680   (eval $ac_compile) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit "$ac_status"); } &&
7684          { ac_try='test -s "conftest.$ac_objext"'
7685   { (eval echo "$as_me:7685: \"$ac_try\"") >&5
7686   (eval $ac_try) 2>&5
7687   ac_status=$?
7688   echo "$as_me:7688: \$? = $ac_status" >&5
7689   (exit "$ac_status"); }; }; then
7690
7691         cf_cv_term_header="$cf_test"
7692 else
7693   echo "$as_me: failed program was:" >&5
7694 cat "conftest.$ac_ext" >&5
7695
7696         cf_cv_term_header=unknown
7697
7698 fi
7699 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7700         test "$cf_cv_term_header" != unknown && break
7701 done
7702
7703 fi
7704 echo "$as_me:7704: result: $cf_cv_term_header" >&5
7705 echo "${ECHO_T}$cf_cv_term_header" >&6
7706
7707 # Set definitions to allow ifdef'ing to accommodate subdirectories
7708
7709 case "$cf_cv_term_header" in
7710 (*term.h)
7711
7712 cat >>confdefs.h <<\EOF
7713 #define HAVE_TERM_H 1
7714 EOF
7715
7716         ;;
7717 esac
7718
7719 case "$cf_cv_term_header" in
7720 (ncurses/term.h)
7721
7722 cat >>confdefs.h <<\EOF
7723 #define HAVE_NCURSES_TERM_H 1
7724 EOF
7725
7726         ;;
7727 (ncursesw/term.h)
7728
7729 cat >>confdefs.h <<\EOF
7730 #define HAVE_NCURSESW_TERM_H 1
7731 EOF
7732
7733         ;;
7734 esac
7735
7736                 fi
7737
7738         else
7739                 echo "$as_me:7739: result: no" >&5
7740 echo "${ECHO_T}no" >&6
7741                 NCURSES_CONFIG_PKG=none
7742         fi
7743 else
7744         NCURSES_CONFIG_PKG=none
7745 fi
7746
7747 if test "x$cf_have_ncuconfig" = "xno"; then
7748         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7749
7750 if test -n "$ac_tool_prefix"; then
7751   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7752   do
7753     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7754 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7755 echo "$as_me:7755: checking for $ac_word" >&5
7756 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7757 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7758   echo $ECHO_N "(cached) $ECHO_C" >&6
7759 else
7760   if test -n "$NCURSES_CONFIG"; then
7761   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7762 else
7763   ac_save_IFS=$IFS; IFS=$ac_path_separator
7764 ac_dummy="$PATH"
7765 for ac_dir in $ac_dummy; do
7766   IFS=$ac_save_IFS
7767   test -z "$ac_dir" && ac_dir=.
7768   $as_executable_p "$ac_dir/$ac_word" || continue
7769 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7770 echo "$as_me:7770: found $ac_dir/$ac_word" >&5
7771 break
7772 done
7773
7774 fi
7775 fi
7776 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7777 if test -n "$NCURSES_CONFIG"; then
7778   echo "$as_me:7778: result: $NCURSES_CONFIG" >&5
7779 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7780 else
7781   echo "$as_me:7781: result: no" >&5
7782 echo "${ECHO_T}no" >&6
7783 fi
7784
7785     test -n "$NCURSES_CONFIG" && break
7786   done
7787 fi
7788 if test -z "$NCURSES_CONFIG"; then
7789   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7790   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7791 do
7792   # Extract the first word of "$ac_prog", so it can be a program name with args.
7793 set dummy $ac_prog; ac_word=$2
7794 echo "$as_me:7794: checking for $ac_word" >&5
7795 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7796 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7797   echo $ECHO_N "(cached) $ECHO_C" >&6
7798 else
7799   if test -n "$ac_ct_NCURSES_CONFIG"; then
7800   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7801 else
7802   ac_save_IFS=$IFS; IFS=$ac_path_separator
7803 ac_dummy="$PATH"
7804 for ac_dir in $ac_dummy; do
7805   IFS=$ac_save_IFS
7806   test -z "$ac_dir" && ac_dir=.
7807   $as_executable_p "$ac_dir/$ac_word" || continue
7808 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7809 echo "$as_me:7809: found $ac_dir/$ac_word" >&5
7810 break
7811 done
7812
7813 fi
7814 fi
7815 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7816 if test -n "$ac_ct_NCURSES_CONFIG"; then
7817   echo "$as_me:7817: result: $ac_ct_NCURSES_CONFIG" >&5
7818 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7819 else
7820   echo "$as_me:7820: result: no" >&5
7821 echo "${ECHO_T}no" >&6
7822 fi
7823
7824   test -n "$ac_ct_NCURSES_CONFIG" && break
7825 done
7826 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7827
7828   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7829 fi
7830
7831         if test "$NCURSES_CONFIG" != none ; then
7832
7833 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7834 do
7835         case "x$cf_add_cflags" in
7836         (x-[DU]*)
7837
7838 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7839 while true
7840 do
7841         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7842         test "$CFLAGS" != "$cf_old_cflag" || break
7843
7844         CFLAGS="$cf_old_cflag"
7845 done
7846
7847 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7848 while true
7849 do
7850         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7851         test "$CPPFLAGS" != "$cf_old_cflag" || break
7852
7853         CPPFLAGS="$cf_old_cflag"
7854 done
7855
7856                 ;;
7857         esac
7858
7859 cf_fix_cppflags=no
7860 cf_new_cflags=
7861 cf_new_cppflags=
7862 cf_new_extra_cppflags=
7863
7864 for cf_add_cflags in $cf_add_cflags
7865 do
7866 case "$cf_fix_cppflags" in
7867 (no)
7868         case "$cf_add_cflags" in
7869         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7870                 case "$cf_add_cflags" in
7871                 (-D*)
7872                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7873
7874                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7875                                 && test -z "${cf_tst_cflags}" \
7876                                 && cf_fix_cppflags=yes
7877
7878                         if test "$cf_fix_cppflags" = yes ; then
7879
7880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7882
7883                                 continue
7884                         elif test "${cf_tst_cflags}" = "\"'" ; then
7885
7886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7888
7889                                 continue
7890                         fi
7891                         ;;
7892                 esac
7893                 case "$CPPFLAGS" in
7894                 (*$cf_add_cflags)
7895                         ;;
7896                 (*)
7897                         case "$cf_add_cflags" in
7898                         (-D*)
7899                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7900
7901 CPPFLAGS=`echo "$CPPFLAGS" | \
7902         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7903                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7904
7905                                 ;;
7906                         esac
7907
7908         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7909         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7910
7911                         ;;
7912                 esac
7913                 ;;
7914         (*)
7915
7916         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7917         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7918
7919                 ;;
7920         esac
7921         ;;
7922 (yes)
7923
7924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7926
7927         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7928
7929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7930                 && test -z "${cf_tst_cflags}" \
7931                 && cf_fix_cppflags=no
7932         ;;
7933 esac
7934 done
7935
7936 if test -n "$cf_new_cflags" ; then
7937
7938         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7939         CFLAGS="${CFLAGS}$cf_new_cflags"
7940
7941 fi
7942
7943 if test -n "$cf_new_cppflags" ; then
7944
7945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7946         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7947
7948 fi
7949
7950 if test -n "$cf_new_extra_cppflags" ; then
7951
7952         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7953         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7954
7955 fi
7956
7957 done
7958
7959 cf_add_libs="$LIBS"
7960 # reverse order
7961 cf_add_0lib=
7962 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7963 # filter duplicates
7964 for cf_add_1lib in $cf_add_0lib; do
7965         for cf_add_2lib in $cf_add_libs; do
7966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7967                         cf_add_1lib=
7968                         break
7969                 fi
7970         done
7971         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7972 done
7973 LIBS="$cf_add_libs"
7974
7975                 # even with config script, some packages use no-override for curses.h
7976
7977 echo "$as_me:7977: checking if we have identified curses headers" >&5
7978 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7979 if test "${cf_cv_ncurses_header+set}" = set; then
7980   echo $ECHO_N "(cached) $ECHO_C" >&6
7981 else
7982
7983 cf_cv_ncurses_header=none
7984 for cf_header in \
7985         ncurses.h ncursesw/ncurses.h \
7986         curses.h ncursesw/curses.h
7987 do
7988 cat >"conftest.$ac_ext" <<_ACEOF
7989 #line 7989 "configure"
7990 #include "confdefs.h"
7991 #include <${cf_header}>
7992 int
7993 main (void)
7994 {
7995 initscr(); tgoto("?", 0,0)
7996   ;
7997   return 0;
7998 }
7999 _ACEOF
8000 rm -f "conftest.$ac_objext"
8001 if { (eval echo "$as_me:8001: \"$ac_compile\"") >&5
8002   (eval $ac_compile) 2>&5
8003   ac_status=$?
8004   echo "$as_me:8004: \$? = $ac_status" >&5
8005   (exit "$ac_status"); } &&
8006          { ac_try='test -s "conftest.$ac_objext"'
8007   { (eval echo "$as_me:8007: \"$ac_try\"") >&5
8008   (eval $ac_try) 2>&5
8009   ac_status=$?
8010   echo "$as_me:8010: \$? = $ac_status" >&5
8011   (exit "$ac_status"); }; }; then
8012   cf_cv_ncurses_header=$cf_header; break
8013 else
8014   echo "$as_me: failed program was:" >&5
8015 cat "conftest.$ac_ext" >&5
8016 fi
8017 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8018 done
8019
8020 fi
8021 echo "$as_me:8021: result: $cf_cv_ncurses_header" >&5
8022 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8023
8024 if test "$cf_cv_ncurses_header" = none ; then
8025         { { echo "$as_me:8025: error: No curses header-files found" >&5
8026 echo "$as_me: error: No curses header-files found" >&2;}
8027    { (exit 1); exit 1; }; }
8028 fi
8029
8030 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8031
8032 for ac_header in $cf_cv_ncurses_header
8033 do
8034 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8035 echo "$as_me:8035: checking for $ac_header" >&5
8036 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8037 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8038   echo $ECHO_N "(cached) $ECHO_C" >&6
8039 else
8040   cat >"conftest.$ac_ext" <<_ACEOF
8041 #line 8041 "configure"
8042 #include "confdefs.h"
8043 #include <$ac_header>
8044 _ACEOF
8045 if { (eval echo "$as_me:8045: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8046   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8047   ac_status=$?
8048   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8049   rm -f conftest.er1
8050   cat conftest.err >&5
8051   echo "$as_me:8051: \$? = $ac_status" >&5
8052   (exit "$ac_status"); } >/dev/null; then
8053   if test -s conftest.err; then
8054     ac_cpp_err=$ac_c_preproc_warn_flag
8055   else
8056     ac_cpp_err=
8057   fi
8058 else
8059   ac_cpp_err=yes
8060 fi
8061 if test -z "$ac_cpp_err"; then
8062   eval "$as_ac_Header=yes"
8063 else
8064   echo "$as_me: failed program was:" >&5
8065   cat "conftest.$ac_ext" >&5
8066   eval "$as_ac_Header=no"
8067 fi
8068 rm -f conftest.err "conftest.$ac_ext"
8069 fi
8070 echo "$as_me:8070: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8071 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8072 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8073   cat >>confdefs.h <<EOF
8074 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8075 EOF
8076
8077 fi
8078 done
8079
8080 cat >>confdefs.h <<\EOF
8081 #define NCURSES 1
8082 EOF
8083
8084 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8085
8086                 cat >>confdefs.h <<EOF
8087 #define $cf_nculib_ROOT 1
8088 EOF
8089
8090                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8091
8092         else
8093
8094 cf_ncuhdr_root=ncursesw
8095
8096 test -n "$cf_cv_curses_dir" && \
8097 test "$cf_cv_curses_dir" != "no" && { \
8098
8099 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8100   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8101   do
8102         while test "$cf_add_incdir" != /usr/include
8103         do
8104           if test -d "$cf_add_incdir"
8105           then
8106                 cf_have_incdir=no
8107                 if test -n "$CFLAGS$CPPFLAGS" ; then
8108                   # a loop is needed to ensure we can add subdirs of existing dirs
8109                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8110                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8111                           cf_have_incdir=yes; break
8112                         fi
8113                   done
8114                 fi
8115
8116                 if test "$cf_have_incdir" = no ; then
8117                   if test "$cf_add_incdir" = /usr/local/include ; then
8118                         if test "$GCC" = yes
8119                         then
8120                           cf_save_CPPFLAGS=$CPPFLAGS
8121
8122         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8123         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8124
8125                           cat >"conftest.$ac_ext" <<_ACEOF
8126 #line 8126 "configure"
8127 #include "confdefs.h"
8128 #include <stdio.h>
8129 int
8130 main (void)
8131 {
8132 printf("Hello")
8133   ;
8134   return 0;
8135 }
8136 _ACEOF
8137 rm -f "conftest.$ac_objext"
8138 if { (eval echo "$as_me:8138: \"$ac_compile\"") >&5
8139   (eval $ac_compile) 2>&5
8140   ac_status=$?
8141   echo "$as_me:8141: \$? = $ac_status" >&5
8142   (exit "$ac_status"); } &&
8143          { ac_try='test -s "conftest.$ac_objext"'
8144   { (eval echo "$as_me:8144: \"$ac_try\"") >&5
8145   (eval $ac_try) 2>&5
8146   ac_status=$?
8147   echo "$as_me:8147: \$? = $ac_status" >&5
8148   (exit "$ac_status"); }; }; then
8149   :
8150 else
8151   echo "$as_me: failed program was:" >&5
8152 cat "conftest.$ac_ext" >&5
8153 cf_have_incdir=yes
8154 fi
8155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8156                           CPPFLAGS=$cf_save_CPPFLAGS
8157                         fi
8158                   fi
8159                 fi
8160
8161                 if test "$cf_have_incdir" = no ; then
8162                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8163
8164 echo "${as_me:-configure}:8164: testing adding $cf_add_incdir to include-path ..." 1>&5
8165
8166                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8167
8168                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8169                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8170                   cf_add_incdir="$cf_top_incdir"
8171                 else
8172                   break
8173                 fi
8174           else
8175                 break
8176           fi
8177         done
8178   done
8179 fi
8180
8181 }
8182
8183 echo "$as_me:8183: checking for $cf_ncuhdr_root header in include-path" >&5
8184 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8185 if test "${cf_cv_ncurses_h+set}" = set; then
8186   echo $ECHO_N "(cached) $ECHO_C" >&6
8187 else
8188
8189         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8190         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8191         for cf_header in $cf_header_list
8192         do
8193
8194         cat >"conftest.$ac_ext" <<_ACEOF
8195 #line 8195 "configure"
8196 #include "confdefs.h"
8197
8198 #define _XOPEN_SOURCE_EXTENDED
8199 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8200 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8201
8202 #include <$cf_header>
8203 int
8204 main (void)
8205 {
8206
8207 #ifdef NCURSES_VERSION
8208
8209 #ifndef WACS_BSSB
8210         make an error
8211 #endif
8212
8213 printf("%s\\n", NCURSES_VERSION);
8214 #else
8215 #ifdef __NCURSES_H
8216 printf("old\\n");
8217 #else
8218         make an error
8219 #endif
8220 #endif
8221
8222   ;
8223   return 0;
8224 }
8225 _ACEOF
8226 rm -f "conftest.$ac_objext"
8227 if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5
8228   (eval $ac_compile) 2>&5
8229   ac_status=$?
8230   echo "$as_me:8230: \$? = $ac_status" >&5
8231   (exit "$ac_status"); } &&
8232          { ac_try='test -s "conftest.$ac_objext"'
8233   { (eval echo "$as_me:8233: \"$ac_try\"") >&5
8234   (eval $ac_try) 2>&5
8235   ac_status=$?
8236   echo "$as_me:8236: \$? = $ac_status" >&5
8237   (exit "$ac_status"); }; }; then
8238   cf_cv_ncurses_h=$cf_header
8239
8240 else
8241   echo "$as_me: failed program was:" >&5
8242 cat "conftest.$ac_ext" >&5
8243 cf_cv_ncurses_h=no
8244 fi
8245 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8246
8247                 test "$cf_cv_ncurses_h" != no && break
8248         done
8249
8250 fi
8251 echo "$as_me:8251: result: $cf_cv_ncurses_h" >&5
8252 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8253
8254 if test "$cf_cv_ncurses_h" != no ; then
8255         cf_cv_ncurses_header=$cf_cv_ncurses_h
8256 else
8257
8258 echo "$as_me:8258: checking for $cf_ncuhdr_root include-path" >&5
8259 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8260 if test "${cf_cv_ncurses_h2+set}" = set; then
8261   echo $ECHO_N "(cached) $ECHO_C" >&6
8262 else
8263
8264         test -n "$verbose" && echo
8265
8266 cf_search=
8267
8268 # collect the current set of include-directories from compiler flags
8269 cf_header_path_list=""
8270 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8271         for cf_header_path in $CPPFLAGS $CFLAGS
8272         do
8273                 case "$cf_header_path" in
8274                 (-I*)
8275                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8276
8277 test "x$cf_header_path" != "xNONE" && \
8278 test -d "$cf_header_path" && \
8279  {
8280         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8281         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8282         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8283         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8284         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8285         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"
8286 }
8287
8288                         cf_header_path_list="$cf_header_path_list $cf_search"
8289                         ;;
8290                 esac
8291         done
8292 fi
8293
8294 # add the variations for the package we are looking for
8295
8296 cf_search=
8297
8298 test "x$prefix" != "xNONE" && \
8299 test -d "$prefix" && \
8300  {
8301         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8302         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8303         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8304         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8305         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8306         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8307 }
8308
8309 for cf_subdir_prefix in \
8310         /usr \
8311         /usr/local \
8312         /usr/pkg \
8313         /opt \
8314         /opt/local \
8315         $HOME
8316 do
8317
8318 test "x$cf_subdir_prefix" != "x$prefix" && \
8319 test -d "$cf_subdir_prefix" && \
8320 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8321         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8322         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8323         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8324         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8325         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8326         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"
8327 }
8328
8329 done
8330
8331 test "$includedir" != NONE && \
8332 test "$includedir" != "/usr/include" && \
8333 test -d "$includedir" && {
8334         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8335         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8336 }
8337
8338 test "$oldincludedir" != NONE && \
8339 test "$oldincludedir" != "/usr/include" && \
8340 test -d "$oldincludedir" && {
8341         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8342         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8343 }
8344
8345 cf_search="$cf_search $cf_header_path_list"
8346
8347         test -n "$verbose" && echo "search path $cf_search"
8348         cf_save2_CPPFLAGS="$CPPFLAGS"
8349         for cf_incdir in $cf_search
8350         do
8351
8352 if test -n "$cf_incdir" ; then
8353   for cf_add_incdir in $cf_incdir
8354   do
8355         while test "$cf_add_incdir" != /usr/include
8356         do
8357           if test -d "$cf_add_incdir"
8358           then
8359                 cf_have_incdir=no
8360                 if test -n "$CFLAGS$CPPFLAGS" ; then
8361                   # a loop is needed to ensure we can add subdirs of existing dirs
8362                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8363                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8364                           cf_have_incdir=yes; break
8365                         fi
8366                   done
8367                 fi
8368
8369                 if test "$cf_have_incdir" = no ; then
8370                   if test "$cf_add_incdir" = /usr/local/include ; then
8371                         if test "$GCC" = yes
8372                         then
8373                           cf_save_CPPFLAGS=$CPPFLAGS
8374
8375         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8376         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8377
8378                           cat >"conftest.$ac_ext" <<_ACEOF
8379 #line 8379 "configure"
8380 #include "confdefs.h"
8381 #include <stdio.h>
8382 int
8383 main (void)
8384 {
8385 printf("Hello")
8386   ;
8387   return 0;
8388 }
8389 _ACEOF
8390 rm -f "conftest.$ac_objext"
8391 if { (eval echo "$as_me:8391: \"$ac_compile\"") >&5
8392   (eval $ac_compile) 2>&5
8393   ac_status=$?
8394   echo "$as_me:8394: \$? = $ac_status" >&5
8395   (exit "$ac_status"); } &&
8396          { ac_try='test -s "conftest.$ac_objext"'
8397   { (eval echo "$as_me:8397: \"$ac_try\"") >&5
8398   (eval $ac_try) 2>&5
8399   ac_status=$?
8400   echo "$as_me:8400: \$? = $ac_status" >&5
8401   (exit "$ac_status"); }; }; then
8402   :
8403 else
8404   echo "$as_me: failed program was:" >&5
8405 cat "conftest.$ac_ext" >&5
8406 cf_have_incdir=yes
8407 fi
8408 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8409                           CPPFLAGS=$cf_save_CPPFLAGS
8410                         fi
8411                   fi
8412                 fi
8413
8414                 if test "$cf_have_incdir" = no ; then
8415                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8416
8417 echo "${as_me:-configure}:8417: testing adding $cf_add_incdir to include-path ..." 1>&5
8418
8419                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8420
8421                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8422                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8423                   cf_add_incdir="$cf_top_incdir"
8424                 else
8425                   break
8426                 fi
8427           else
8428                 break
8429           fi
8430         done
8431   done
8432 fi
8433
8434                 for cf_header in \
8435                         ncurses.h \
8436                         curses.h
8437                 do
8438
8439         cat >"conftest.$ac_ext" <<_ACEOF
8440 #line 8440 "configure"
8441 #include "confdefs.h"
8442
8443 #include <$cf_header>
8444 int
8445 main (void)
8446 {
8447
8448 #ifdef NCURSES_VERSION
8449
8450 printf("%s\\n", NCURSES_VERSION);
8451 #else
8452 #ifdef __NCURSES_H
8453 printf("old\\n");
8454 #else
8455         make an error
8456 #endif
8457 #endif
8458
8459   ;
8460   return 0;
8461 }
8462 _ACEOF
8463 rm -f "conftest.$ac_objext"
8464 if { (eval echo "$as_me:8464: \"$ac_compile\"") >&5
8465   (eval $ac_compile) 2>&5
8466   ac_status=$?
8467   echo "$as_me:8467: \$? = $ac_status" >&5
8468   (exit "$ac_status"); } &&
8469          { ac_try='test -s "conftest.$ac_objext"'
8470   { (eval echo "$as_me:8470: \"$ac_try\"") >&5
8471   (eval $ac_try) 2>&5
8472   ac_status=$?
8473   echo "$as_me:8473: \$? = $ac_status" >&5
8474   (exit "$ac_status"); }; }; then
8475   cf_cv_ncurses_h2=$cf_header
8476
8477 else
8478   echo "$as_me: failed program was:" >&5
8479 cat "conftest.$ac_ext" >&5
8480 cf_cv_ncurses_h2=no
8481 fi
8482 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8483
8484                         if test "$cf_cv_ncurses_h2" != no ; then
8485                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8486                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8487                                 break
8488                         fi
8489                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8490                 done
8491                 CPPFLAGS="$cf_save2_CPPFLAGS"
8492                 test "$cf_cv_ncurses_h2" != no && break
8493         done
8494         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8494: error: not found" >&5
8495 echo "$as_me: error: not found" >&2;}
8496    { (exit 1); exit 1; }; }
8497
8498 fi
8499 echo "$as_me:8499: result: $cf_cv_ncurses_h2" >&5
8500 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8501
8502         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8503         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8504         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8505                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8506         fi
8507
8508 if test -n "$cf_1st_incdir" ; then
8509   for cf_add_incdir in $cf_1st_incdir
8510   do
8511         while test "$cf_add_incdir" != /usr/include
8512         do
8513           if test -d "$cf_add_incdir"
8514           then
8515                 cf_have_incdir=no
8516                 if test -n "$CFLAGS$CPPFLAGS" ; then
8517                   # a loop is needed to ensure we can add subdirs of existing dirs
8518                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8519                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8520                           cf_have_incdir=yes; break
8521                         fi
8522                   done
8523                 fi
8524
8525                 if test "$cf_have_incdir" = no ; then
8526                   if test "$cf_add_incdir" = /usr/local/include ; then
8527                         if test "$GCC" = yes
8528                         then
8529                           cf_save_CPPFLAGS=$CPPFLAGS
8530
8531         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8532         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8533
8534                           cat >"conftest.$ac_ext" <<_ACEOF
8535 #line 8535 "configure"
8536 #include "confdefs.h"
8537 #include <stdio.h>
8538 int
8539 main (void)
8540 {
8541 printf("Hello")
8542   ;
8543   return 0;
8544 }
8545 _ACEOF
8546 rm -f "conftest.$ac_objext"
8547 if { (eval echo "$as_me:8547: \"$ac_compile\"") >&5
8548   (eval $ac_compile) 2>&5
8549   ac_status=$?
8550   echo "$as_me:8550: \$? = $ac_status" >&5
8551   (exit "$ac_status"); } &&
8552          { ac_try='test -s "conftest.$ac_objext"'
8553   { (eval echo "$as_me:8553: \"$ac_try\"") >&5
8554   (eval $ac_try) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit "$ac_status"); }; }; then
8558   :
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat "conftest.$ac_ext" >&5
8562 cf_have_incdir=yes
8563 fi
8564 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8565                           CPPFLAGS=$cf_save_CPPFLAGS
8566                         fi
8567                   fi
8568                 fi
8569
8570                 if test "$cf_have_incdir" = no ; then
8571                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8572
8573 echo "${as_me:-configure}:8573: testing adding $cf_add_incdir to include-path ..." 1>&5
8574
8575                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8576
8577                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8578                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8579                   cf_add_incdir="$cf_top_incdir"
8580                 else
8581                   break
8582                 fi
8583           else
8584                 break
8585           fi
8586         done
8587   done
8588 fi
8589
8590 fi
8591
8592 # Set definitions to allow ifdef'ing for ncurses.h
8593
8594 case "$cf_cv_ncurses_header" in
8595 (*ncurses.h)
8596
8597 cat >>confdefs.h <<\EOF
8598 #define HAVE_NCURSES_H 1
8599 EOF
8600
8601         ;;
8602 esac
8603
8604 case "$cf_cv_ncurses_header" in
8605 (ncurses/curses.h|ncurses/ncurses.h)
8606
8607 cat >>confdefs.h <<\EOF
8608 #define HAVE_NCURSES_NCURSES_H 1
8609 EOF
8610
8611         ;;
8612 (ncursesw/curses.h|ncursesw/ncurses.h)
8613
8614 cat >>confdefs.h <<\EOF
8615 #define HAVE_NCURSESW_NCURSES_H 1
8616 EOF
8617
8618         ;;
8619 esac
8620
8621 echo "$as_me:8621: checking for terminfo header" >&5
8622 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8623 if test "${cf_cv_term_header+set}" = set; then
8624   echo $ECHO_N "(cached) $ECHO_C" >&6
8625 else
8626
8627 case "${cf_cv_ncurses_header}" in
8628 (*/ncurses.h|*/ncursesw.h)
8629         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8630         ;;
8631 (*)
8632         cf_term_header=term.h
8633         ;;
8634 esac
8635
8636 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8637 do
8638 cat >"conftest.$ac_ext" <<_ACEOF
8639 #line 8639 "configure"
8640 #include "confdefs.h"
8641 #include <stdio.h>
8642 #include <${cf_cv_ncurses_header:-curses.h}>
8643 #include <$cf_test>
8644
8645 int
8646 main (void)
8647 {
8648 int x = auto_left_margin; (void)x
8649   ;
8650   return 0;
8651 }
8652 _ACEOF
8653 rm -f "conftest.$ac_objext"
8654 if { (eval echo "$as_me:8654: \"$ac_compile\"") >&5
8655   (eval $ac_compile) 2>&5
8656   ac_status=$?
8657   echo "$as_me:8657: \$? = $ac_status" >&5
8658   (exit "$ac_status"); } &&
8659          { ac_try='test -s "conftest.$ac_objext"'
8660   { (eval echo "$as_me:8660: \"$ac_try\"") >&5
8661   (eval $ac_try) 2>&5
8662   ac_status=$?
8663   echo "$as_me:8663: \$? = $ac_status" >&5
8664   (exit "$ac_status"); }; }; then
8665
8666         cf_cv_term_header="$cf_test"
8667 else
8668   echo "$as_me: failed program was:" >&5
8669 cat "conftest.$ac_ext" >&5
8670
8671         cf_cv_term_header=unknown
8672
8673 fi
8674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8675         test "$cf_cv_term_header" != unknown && break
8676 done
8677
8678 fi
8679 echo "$as_me:8679: result: $cf_cv_term_header" >&5
8680 echo "${ECHO_T}$cf_cv_term_header" >&6
8681
8682 # Set definitions to allow ifdef'ing to accommodate subdirectories
8683
8684 case "$cf_cv_term_header" in
8685 (*term.h)
8686
8687 cat >>confdefs.h <<\EOF
8688 #define HAVE_TERM_H 1
8689 EOF
8690
8691         ;;
8692 esac
8693
8694 case "$cf_cv_term_header" in
8695 (ncurses/term.h)
8696
8697 cat >>confdefs.h <<\EOF
8698 #define HAVE_NCURSES_TERM_H 1
8699 EOF
8700
8701         ;;
8702 (ncursesw/term.h)
8703
8704 cat >>confdefs.h <<\EOF
8705 #define HAVE_NCURSESW_TERM_H 1
8706 EOF
8707
8708         ;;
8709 esac
8710
8711 # some applications need this, but should check for NCURSES_VERSION
8712
8713 cat >>confdefs.h <<\EOF
8714 #define NCURSES 1
8715 EOF
8716
8717 echo "$as_me:8717: checking for ncurses version" >&5
8718 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8719 if test "${cf_cv_ncurses_version+set}" = set; then
8720   echo $ECHO_N "(cached) $ECHO_C" >&6
8721 else
8722
8723         cf_cv_ncurses_version=no
8724         cf_tempfile=out$$
8725         rm -f "$cf_tempfile"
8726         if test "$cross_compiling" = yes; then
8727
8728         # This will not work if the preprocessor splits the line after the
8729         # Autoconf token.  The 'unproto' program does that.
8730         cat > "conftest.$ac_ext" <<EOF
8731 #include <${cf_cv_ncurses_header:-curses.h}>
8732 #undef Autoconf
8733 #ifdef NCURSES_VERSION
8734 Autoconf NCURSES_VERSION
8735 #else
8736 #ifdef __NCURSES_H
8737 Autoconf "old"
8738 #endif
8739 ;
8740 #endif
8741 EOF
8742         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8743         { (eval echo "$as_me:8743: \"$cf_try\"") >&5
8744   (eval $cf_try) 2>&5
8745   ac_status=$?
8746   echo "$as_me:8746: \$? = $ac_status" >&5
8747   (exit "$ac_status"); }
8748         if test -f conftest.out ; then
8749                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8750                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8751                 rm -f conftest.out
8752         fi
8753
8754 else
8755   cat >"conftest.$ac_ext" <<_ACEOF
8756 #line 8756 "configure"
8757 #include "confdefs.h"
8758
8759 #include <${cf_cv_ncurses_header:-curses.h}>
8760 #include <stdio.h>
8761 int main(void)
8762 {
8763         FILE *fp = fopen("$cf_tempfile", "w");
8764 #ifdef NCURSES_VERSION
8765 # ifdef NCURSES_VERSION_PATCH
8766         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8767 # else
8768         fprintf(fp, "%s\\n", NCURSES_VERSION);
8769 # endif
8770 #else
8771 # ifdef __NCURSES_H
8772         fprintf(fp, "old\\n");
8773 # else
8774         make an error
8775 # endif
8776 #endif
8777         ${cf_cv_main_return:-return}(0);
8778 }
8779 _ACEOF
8780 rm -f "conftest$ac_exeext"
8781 if { (eval echo "$as_me:8781: \"$ac_link\"") >&5
8782   (eval $ac_link) 2>&5
8783   ac_status=$?
8784   echo "$as_me:8784: \$? = $ac_status" >&5
8785   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8786   { (eval echo "$as_me:8786: \"$ac_try\"") >&5
8787   (eval $ac_try) 2>&5
8788   ac_status=$?
8789   echo "$as_me:8789: \$? = $ac_status" >&5
8790   (exit "$ac_status"); }; }; then
8791
8792         cf_cv_ncurses_version=`cat $cf_tempfile`
8793 else
8794   echo "$as_me: program exited with status $ac_status" >&5
8795 echo "$as_me: failed program was:" >&5
8796 cat "conftest.$ac_ext" >&5
8797 fi
8798 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8799 fi
8800         rm -f "$cf_tempfile"
8801
8802 fi
8803 echo "$as_me:8803: result: $cf_cv_ncurses_version" >&5
8804 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8805 test "$cf_cv_ncurses_version" = no ||
8806 cat >>confdefs.h <<\EOF
8807 #define NCURSES 1
8808 EOF
8809
8810 cf_nculib_root=ncursesw
8811         # This works, except for the special case where we find gpm, but
8812         # ncurses is in a nonstandard location via $LIBS, and we really want
8813         # to link gpm.
8814 cf_ncurses_LIBS=""
8815 cf_ncurses_SAVE="$LIBS"
8816 echo "$as_me:8816: checking for Gpm_Open in -lgpm" >&5
8817 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8818 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8819   echo $ECHO_N "(cached) $ECHO_C" >&6
8820 else
8821   ac_check_lib_save_LIBS=$LIBS
8822 LIBS="-lgpm  $LIBS"
8823 cat >"conftest.$ac_ext" <<_ACEOF
8824 #line 8824 "configure"
8825 #include "confdefs.h"
8826
8827 /* Override any gcc2 internal prototype to avoid an error.  */
8828 #ifdef __cplusplus
8829 extern "C"
8830 #endif
8831 /* We use char because int might match the return type of a gcc2
8832    builtin and then its argument prototype would still apply.  */
8833 char Gpm_Open ();
8834 int
8835 main (void)
8836 {
8837 Gpm_Open ();
8838   ;
8839   return 0;
8840 }
8841 _ACEOF
8842 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8843 if { (eval echo "$as_me:8843: \"$ac_link\"") >&5
8844   (eval $ac_link) 2>&5
8845   ac_status=$?
8846   echo "$as_me:8846: \$? = $ac_status" >&5
8847   (exit "$ac_status"); } &&
8848          { ac_try='test -s "conftest$ac_exeext"'
8849   { (eval echo "$as_me:8849: \"$ac_try\"") >&5
8850   (eval $ac_try) 2>&5
8851   ac_status=$?
8852   echo "$as_me:8852: \$? = $ac_status" >&5
8853   (exit "$ac_status"); }; }; then
8854   ac_cv_lib_gpm_Gpm_Open=yes
8855 else
8856   echo "$as_me: failed program was:" >&5
8857 cat "conftest.$ac_ext" >&5
8858 ac_cv_lib_gpm_Gpm_Open=no
8859 fi
8860 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8861 LIBS=$ac_check_lib_save_LIBS
8862 fi
8863 echo "$as_me:8863: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8864 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8865 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8866   echo "$as_me:8866: checking for initscr in -lgpm" >&5
8867 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8868 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8869   echo $ECHO_N "(cached) $ECHO_C" >&6
8870 else
8871   ac_check_lib_save_LIBS=$LIBS
8872 LIBS="-lgpm  $LIBS"
8873 cat >"conftest.$ac_ext" <<_ACEOF
8874 #line 8874 "configure"
8875 #include "confdefs.h"
8876
8877 /* Override any gcc2 internal prototype to avoid an error.  */
8878 #ifdef __cplusplus
8879 extern "C"
8880 #endif
8881 /* We use char because int might match the return type of a gcc2
8882    builtin and then its argument prototype would still apply.  */
8883 char initscr ();
8884 int
8885 main (void)
8886 {
8887 initscr ();
8888   ;
8889   return 0;
8890 }
8891 _ACEOF
8892 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8893 if { (eval echo "$as_me:8893: \"$ac_link\"") >&5
8894   (eval $ac_link) 2>&5
8895   ac_status=$?
8896   echo "$as_me:8896: \$? = $ac_status" >&5
8897   (exit "$ac_status"); } &&
8898          { ac_try='test -s "conftest$ac_exeext"'
8899   { (eval echo "$as_me:8899: \"$ac_try\"") >&5
8900   (eval $ac_try) 2>&5
8901   ac_status=$?
8902   echo "$as_me:8902: \$? = $ac_status" >&5
8903   (exit "$ac_status"); }; }; then
8904   ac_cv_lib_gpm_initscr=yes
8905 else
8906   echo "$as_me: failed program was:" >&5
8907 cat "conftest.$ac_ext" >&5
8908 ac_cv_lib_gpm_initscr=no
8909 fi
8910 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8911 LIBS=$ac_check_lib_save_LIBS
8912 fi
8913 echo "$as_me:8913: result: $ac_cv_lib_gpm_initscr" >&5
8914 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8915 if test "$ac_cv_lib_gpm_initscr" = yes; then
8916   LIBS="$cf_ncurses_SAVE"
8917 else
8918   cf_ncurses_LIBS="-lgpm"
8919 fi
8920
8921 fi
8922
8923 case "$host_os" in
8924 (freebsd*)
8925         # This is only necessary if you are linking against an obsolete
8926         # version of ncurses (but it should do no harm, since it is static).
8927         if test "$cf_nculib_root" = ncurses ; then
8928                 echo "$as_me:8928: checking for tgoto in -lmytinfo" >&5
8929 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8930 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8931   echo $ECHO_N "(cached) $ECHO_C" >&6
8932 else
8933   ac_check_lib_save_LIBS=$LIBS
8934 LIBS="-lmytinfo  $LIBS"
8935 cat >"conftest.$ac_ext" <<_ACEOF
8936 #line 8936 "configure"
8937 #include "confdefs.h"
8938
8939 /* Override any gcc2 internal prototype to avoid an error.  */
8940 #ifdef __cplusplus
8941 extern "C"
8942 #endif
8943 /* We use char because int might match the return type of a gcc2
8944    builtin and then its argument prototype would still apply.  */
8945 char tgoto ();
8946 int
8947 main (void)
8948 {
8949 tgoto ();
8950   ;
8951   return 0;
8952 }
8953 _ACEOF
8954 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8955 if { (eval echo "$as_me:8955: \"$ac_link\"") >&5
8956   (eval $ac_link) 2>&5
8957   ac_status=$?
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit "$ac_status"); } &&
8960          { ac_try='test -s "conftest$ac_exeext"'
8961   { (eval echo "$as_me:8961: \"$ac_try\"") >&5
8962   (eval $ac_try) 2>&5
8963   ac_status=$?
8964   echo "$as_me:8964: \$? = $ac_status" >&5
8965   (exit "$ac_status"); }; }; then
8966   ac_cv_lib_mytinfo_tgoto=yes
8967 else
8968   echo "$as_me: failed program was:" >&5
8969 cat "conftest.$ac_ext" >&5
8970 ac_cv_lib_mytinfo_tgoto=no
8971 fi
8972 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8973 LIBS=$ac_check_lib_save_LIBS
8974 fi
8975 echo "$as_me:8975: result: $ac_cv_lib_mytinfo_tgoto" >&5
8976 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8977 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8978   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8979 fi
8980
8981         fi
8982         ;;
8983 esac
8984
8985 cf_add_libs="$LIBS"
8986 # reverse order
8987 cf_add_0lib=
8988 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8989 # filter duplicates
8990 for cf_add_1lib in $cf_add_0lib; do
8991         for cf_add_2lib in $cf_add_libs; do
8992                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8993                         cf_add_1lib=
8994                         break
8995                 fi
8996         done
8997         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8998 done
8999 LIBS="$cf_add_libs"
9000
9001 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9002 then
9003
9004 cf_add_libs="$LIBS"
9005 # reverse order
9006 cf_add_0lib=
9007 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9008 # filter duplicates
9009 for cf_add_1lib in $cf_add_0lib; do
9010         for cf_add_2lib in $cf_add_libs; do
9011                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9012                         cf_add_1lib=
9013                         break
9014                 fi
9015         done
9016         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9017 done
9018 LIBS="$cf_add_libs"
9019
9020 else
9021
9022         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9023         cf_libdir=""
9024         echo "$as_me:9024: checking for initscr" >&5
9025 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9026 if test "${ac_cv_func_initscr+set}" = set; then
9027   echo $ECHO_N "(cached) $ECHO_C" >&6
9028 else
9029   cat >"conftest.$ac_ext" <<_ACEOF
9030 #line 9030 "configure"
9031 #include "confdefs.h"
9032 #define initscr autoconf_temporary
9033 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9034 #undef initscr
9035
9036 #ifdef __cplusplus
9037 extern "C"
9038 #endif
9039
9040 /* We use char because int might match the return type of a gcc2
9041    builtin and then its argument prototype would still apply.  */
9042 char initscr (void);
9043
9044 int
9045 main (void)
9046 {
9047
9048 /* The GNU C library defines stubs for functions which it implements
9049     to always fail with ENOSYS.  Some functions are actually named
9050     something starting with __ and the normal name is an alias.  */
9051 #if defined (__stub_initscr) || defined (__stub___initscr)
9052 #error found stub for initscr
9053 #endif
9054
9055         return initscr ();
9056   ;
9057   return 0;
9058 }
9059 _ACEOF
9060 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9061 if { (eval echo "$as_me:9061: \"$ac_link\"") >&5
9062   (eval $ac_link) 2>&5
9063   ac_status=$?
9064   echo "$as_me:9064: \$? = $ac_status" >&5
9065   (exit "$ac_status"); } &&
9066          { ac_try='test -s "conftest$ac_exeext"'
9067   { (eval echo "$as_me:9067: \"$ac_try\"") >&5
9068   (eval $ac_try) 2>&5
9069   ac_status=$?
9070   echo "$as_me:9070: \$? = $ac_status" >&5
9071   (exit "$ac_status"); }; }; then
9072   ac_cv_func_initscr=yes
9073 else
9074   echo "$as_me: failed program was:" >&5
9075 cat "conftest.$ac_ext" >&5
9076 ac_cv_func_initscr=no
9077 fi
9078 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9079 fi
9080 echo "$as_me:9080: result: $ac_cv_func_initscr" >&5
9081 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9082 if test "$ac_cv_func_initscr" = yes; then
9083   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9084 else
9085
9086                 cf_save_LIBS="$LIBS"
9087                 echo "$as_me:9087: checking for initscr in -l$cf_nculib_root" >&5
9088 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9089                 LIBS="-l$cf_nculib_root $LIBS"
9090                 cat >"conftest.$ac_ext" <<_ACEOF
9091 #line 9091 "configure"
9092 #include "confdefs.h"
9093 #include <${cf_cv_ncurses_header:-curses.h}>
9094 int
9095 main (void)
9096 {
9097 initscr()
9098   ;
9099   return 0;
9100 }
9101 _ACEOF
9102 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9103 if { (eval echo "$as_me:9103: \"$ac_link\"") >&5
9104   (eval $ac_link) 2>&5
9105   ac_status=$?
9106   echo "$as_me:9106: \$? = $ac_status" >&5
9107   (exit "$ac_status"); } &&
9108          { ac_try='test -s "conftest$ac_exeext"'
9109   { (eval echo "$as_me:9109: \"$ac_try\"") >&5
9110   (eval $ac_try) 2>&5
9111   ac_status=$?
9112   echo "$as_me:9112: \$? = $ac_status" >&5
9113   (exit "$ac_status"); }; }; then
9114   echo "$as_me:9114: result: yes" >&5
9115 echo "${ECHO_T}yes" >&6
9116                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9117
9118 else
9119   echo "$as_me: failed program was:" >&5
9120 cat "conftest.$ac_ext" >&5
9121 echo "$as_me:9121: result: no" >&5
9122 echo "${ECHO_T}no" >&6
9123
9124 cf_search=
9125 cf_library_path_list=""
9126 if test -n "${LDFLAGS}${LIBS}" ; then
9127         for cf_library_path in $LDFLAGS $LIBS
9128         do
9129                 case "$cf_library_path" in
9130                 (-L*)
9131                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9132
9133 test "x$cf_library_path" != "xNONE" && \
9134 test -d "$cf_library_path" && \
9135  {
9136         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9137         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9138         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9139         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9140         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9141         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"
9142 }
9143
9144                         cf_library_path_list="$cf_library_path_list $cf_search"
9145                         ;;
9146                 esac
9147         done
9148 fi
9149
9150 cf_search=
9151
9152 test "x$prefix" != "xNONE" && \
9153 test -d "$prefix" && \
9154  {
9155         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9156         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9157         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9158         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9159         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9160         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9161 }
9162
9163 for cf_subdir_prefix in \
9164         /usr \
9165         /usr/local \
9166         /usr/pkg \
9167         /opt \
9168         /opt/local \
9169         $HOME
9170 do
9171
9172 test "x$cf_subdir_prefix" != "x$prefix" && \
9173 test -d "$cf_subdir_prefix" && \
9174 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9175         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9176         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9177         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9178         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9179         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9180         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"
9181 }
9182
9183 done
9184
9185 cf_search="$cf_library_path_list $cf_search"
9186
9187                         for cf_libdir in $cf_search
9188                         do
9189                                 echo "$as_me:9189: checking for -l$cf_nculib_root in $cf_libdir" >&5
9190 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9191                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9192                                 cat >"conftest.$ac_ext" <<_ACEOF
9193 #line 9193 "configure"
9194 #include "confdefs.h"
9195 #include <${cf_cv_ncurses_header:-curses.h}>
9196 int
9197 main (void)
9198 {
9199 initscr()
9200   ;
9201   return 0;
9202 }
9203 _ACEOF
9204 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9205 if { (eval echo "$as_me:9205: \"$ac_link\"") >&5
9206   (eval $ac_link) 2>&5
9207   ac_status=$?
9208   echo "$as_me:9208: \$? = $ac_status" >&5
9209   (exit "$ac_status"); } &&
9210          { ac_try='test -s "conftest$ac_exeext"'
9211   { (eval echo "$as_me:9211: \"$ac_try\"") >&5
9212   (eval $ac_try) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit "$ac_status"); }; }; then
9216   echo "$as_me:9216: result: yes" >&5
9217 echo "${ECHO_T}yes" >&6
9218                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9219                                          break
9220 else
9221   echo "$as_me: failed program was:" >&5
9222 cat "conftest.$ac_ext" >&5
9223 echo "$as_me:9223: result: no" >&5
9224 echo "${ECHO_T}no" >&6
9225                                          LIBS="$cf_save_LIBS"
9226 fi
9227 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9228                         done
9229
9230 fi
9231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9232
9233 fi
9234
9235 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9236
9237 if test "$cf_found_library" = no ; then
9238         { { echo "$as_me:9238: error: Cannot link $cf_nculib_root library" >&5
9239 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9240    { (exit 1); exit 1; }; }
9241 fi
9242
9243 fi
9244
9245 if test -n "$cf_ncurses_LIBS" ; then
9246         echo "$as_me:9246: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9247 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9248         cf_ncurses_SAVE="$LIBS"
9249         for p in $cf_ncurses_LIBS ; do
9250                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9251                 if test "$q" != "$LIBS" ; then
9252                         LIBS="$q"
9253                 fi
9254         done
9255         cat >"conftest.$ac_ext" <<_ACEOF
9256 #line 9256 "configure"
9257 #include "confdefs.h"
9258 #include <${cf_cv_ncurses_header:-curses.h}>
9259 int
9260 main (void)
9261 {
9262 initscr(); mousemask(0,0); tigetstr((char *)0);
9263   ;
9264   return 0;
9265 }
9266 _ACEOF
9267 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9268 if { (eval echo "$as_me:9268: \"$ac_link\"") >&5
9269   (eval $ac_link) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit "$ac_status"); } &&
9273          { ac_try='test -s "conftest$ac_exeext"'
9274   { (eval echo "$as_me:9274: \"$ac_try\"") >&5
9275   (eval $ac_try) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit "$ac_status"); }; }; then
9279   echo "$as_me:9279: result: yes" >&5
9280 echo "${ECHO_T}yes" >&6
9281 else
9282   echo "$as_me: failed program was:" >&5
9283 cat "conftest.$ac_ext" >&5
9284 echo "$as_me:9284: result: no" >&5
9285 echo "${ECHO_T}no" >&6
9286                  LIBS="$cf_ncurses_SAVE"
9287 fi
9288 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9289 fi
9290
9291 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9292
9293 cat >>confdefs.h <<EOF
9294 #define $cf_nculib_ROOT 1
9295 EOF
9296
9297         fi
9298 else
9299         NCURSES_CONFIG=none
9300 fi
9301
9302 else
9303
9304 cf_ncuconfig_root=ncurses
9305 cf_have_ncuconfig=no
9306
9307 if test "x${PKG_CONFIG:=none}" != xnone; then
9308         echo "$as_me:9308: checking pkg-config for $cf_ncuconfig_root" >&5
9309 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9310         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9311                 echo "$as_me:9311: result: yes" >&5
9312 echo "${ECHO_T}yes" >&6
9313
9314                 echo "$as_me:9314: checking if the $cf_ncuconfig_root package files work" >&5
9315 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9316                 cf_have_ncuconfig=unknown
9317
9318                 cf_save_CFLAGS="$CFLAGS"
9319                 cf_save_CPPFLAGS="$CPPFLAGS"
9320                 cf_save_LIBS="$LIBS"
9321
9322                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9323                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9324
9325                 # while -W for passing linker flags is prevalent, it is not "standard".
9326                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9327                 # incompatible _and_ non-standard -W option which gives an error.  Work
9328                 # around that pitfall.
9329                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9330                 (x*c[89]9@@*-W*)
9331
9332 cf_fix_cppflags=no
9333 cf_new_cflags=
9334 cf_new_cppflags=
9335 cf_new_extra_cppflags=
9336
9337 for cf_add_cflags in $cf_pkg_cflags
9338 do
9339 case "$cf_fix_cppflags" in
9340 (no)
9341         case "$cf_add_cflags" in
9342         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9343                 case "$cf_add_cflags" in
9344                 (-D*)
9345                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9346
9347                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9348                                 && test -z "${cf_tst_cflags}" \
9349                                 && cf_fix_cppflags=yes
9350
9351                         if test "$cf_fix_cppflags" = yes ; then
9352
9353         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9354         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9355
9356                                 continue
9357                         elif test "${cf_tst_cflags}" = "\"'" ; then
9358
9359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9361
9362                                 continue
9363                         fi
9364                         ;;
9365                 esac
9366                 case "$CPPFLAGS" in
9367                 (*$cf_add_cflags)
9368                         ;;
9369                 (*)
9370                         case "$cf_add_cflags" in
9371                         (-D*)
9372                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9373
9374 CPPFLAGS=`echo "$CPPFLAGS" | \
9375         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9376                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9377
9378                                 ;;
9379                         esac
9380
9381         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9382         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9383
9384                         ;;
9385                 esac
9386                 ;;
9387         (*)
9388
9389         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9390         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9391
9392                 ;;
9393         esac
9394         ;;
9395 (yes)
9396
9397         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9398         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9399
9400         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9401
9402         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9403                 && test -z "${cf_tst_cflags}" \
9404                 && cf_fix_cppflags=no
9405         ;;
9406 esac
9407 done
9408
9409 if test -n "$cf_new_cflags" ; then
9410
9411         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9412         CFLAGS="${CFLAGS}$cf_new_cflags"
9413
9414 fi
9415
9416 if test -n "$cf_new_cppflags" ; then
9417
9418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9419         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9420
9421 fi
9422
9423 if test -n "$cf_new_extra_cppflags" ; then
9424
9425         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9426         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9427
9428 fi
9429
9430 cf_add_libs="$LIBS"
9431 # reverse order
9432 cf_add_0lib=
9433 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9434 # filter duplicates
9435 for cf_add_1lib in $cf_add_0lib; do
9436         for cf_add_2lib in $cf_add_libs; do
9437                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9438                         cf_add_1lib=
9439                         break
9440                 fi
9441         done
9442         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9443 done
9444 LIBS="$cf_add_libs"
9445
9446                         cat >"conftest.$ac_ext" <<_ACEOF
9447 #line 9447 "configure"
9448 #include "confdefs.h"
9449 #include <${cf_cv_ncurses_header:-curses.h}>
9450 int
9451 main (void)
9452 {
9453 initscr(); mousemask(0,0); tigetstr((char *)0);
9454   ;
9455   return 0;
9456 }
9457 _ACEOF
9458 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9459 if { (eval echo "$as_me:9459: \"$ac_link\"") >&5
9460   (eval $ac_link) 2>&5
9461   ac_status=$?
9462   echo "$as_me:9462: \$? = $ac_status" >&5
9463   (exit "$ac_status"); } &&
9464          { ac_try='test -s "conftest$ac_exeext"'
9465   { (eval echo "$as_me:9465: \"$ac_try\"") >&5
9466   (eval $ac_try) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit "$ac_status"); }; }; then
9470   if test "$cross_compiling" = yes; then
9471   cf_test_ncuconfig=maybe
9472 else
9473   cat >"conftest.$ac_ext" <<_ACEOF
9474 #line 9474 "configure"
9475 #include "confdefs.h"
9476 #include <${cf_cv_ncurses_header:-curses.h}>
9477                                         int main(void)
9478                                         { const char *xx = curses_version(); return (xx == 0); }
9479 _ACEOF
9480 rm -f "conftest$ac_exeext"
9481 if { (eval echo "$as_me:9481: \"$ac_link\"") >&5
9482   (eval $ac_link) 2>&5
9483   ac_status=$?
9484   echo "$as_me:9484: \$? = $ac_status" >&5
9485   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9486   { (eval echo "$as_me:9486: \"$ac_try\"") >&5
9487   (eval $ac_try) 2>&5
9488   ac_status=$?
9489   echo "$as_me:9489: \$? = $ac_status" >&5
9490   (exit "$ac_status"); }; }; then
9491   cf_test_ncuconfig=yes
9492 else
9493   echo "$as_me: program exited with status $ac_status" >&5
9494 echo "$as_me: failed program was:" >&5
9495 cat "conftest.$ac_ext" >&5
9496 cf_test_ncuconfig=no
9497 fi
9498 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9499 fi
9500 else
9501   echo "$as_me: failed program was:" >&5
9502 cat "conftest.$ac_ext" >&5
9503 cf_test_ncuconfig=no
9504 fi
9505 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9506
9507                         CFLAGS="$cf_save_CFLAGS"
9508                         CPPFLAGS="$cf_save_CPPFLAGS"
9509                         LIBS="$cf_save_LIBS"
9510
9511                         if test "x$cf_test_ncuconfig" != xyes; then
9512                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9513                                 cf_pkg_cflags="$cf_temp"
9514                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9515                                 cf_pkg_libs="$cf_temp"
9516                         fi
9517                         ;;
9518                 esac
9519
9520 for cf_add_cflags in $cf_pkg_cflags
9521 do
9522         case "x$cf_add_cflags" in
9523         (x-[DU]*)
9524
9525 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9526 while true
9527 do
9528         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9529         test "$CFLAGS" != "$cf_old_cflag" || break
9530
9531         CFLAGS="$cf_old_cflag"
9532 done
9533
9534 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9535 while true
9536 do
9537         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9538         test "$CPPFLAGS" != "$cf_old_cflag" || break
9539
9540         CPPFLAGS="$cf_old_cflag"
9541 done
9542
9543                 ;;
9544         esac
9545
9546 cf_fix_cppflags=no
9547 cf_new_cflags=
9548 cf_new_cppflags=
9549 cf_new_extra_cppflags=
9550
9551 for cf_add_cflags in $cf_add_cflags
9552 do
9553 case "$cf_fix_cppflags" in
9554 (no)
9555         case "$cf_add_cflags" in
9556         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9557                 case "$cf_add_cflags" in
9558                 (-D*)
9559                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9560
9561                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9562                                 && test -z "${cf_tst_cflags}" \
9563                                 && cf_fix_cppflags=yes
9564
9565                         if test "$cf_fix_cppflags" = yes ; then
9566
9567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9569
9570                                 continue
9571                         elif test "${cf_tst_cflags}" = "\"'" ; then
9572
9573         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9574         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9575
9576                                 continue
9577                         fi
9578                         ;;
9579                 esac
9580                 case "$CPPFLAGS" in
9581                 (*$cf_add_cflags)
9582                         ;;
9583                 (*)
9584                         case "$cf_add_cflags" in
9585                         (-D*)
9586                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9587
9588 CPPFLAGS=`echo "$CPPFLAGS" | \
9589         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9590                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9591
9592                                 ;;
9593                         esac
9594
9595         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9596         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9597
9598                         ;;
9599                 esac
9600                 ;;
9601         (*)
9602
9603         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9604         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9605
9606                 ;;
9607         esac
9608         ;;
9609 (yes)
9610
9611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9613
9614         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9615
9616         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9617                 && test -z "${cf_tst_cflags}" \
9618                 && cf_fix_cppflags=no
9619         ;;
9620 esac
9621 done
9622
9623 if test -n "$cf_new_cflags" ; then
9624
9625         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9626         CFLAGS="${CFLAGS}$cf_new_cflags"
9627
9628 fi
9629
9630 if test -n "$cf_new_cppflags" ; then
9631
9632         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9633         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9634
9635 fi
9636
9637 if test -n "$cf_new_extra_cppflags" ; then
9638
9639         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9640         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9641
9642 fi
9643
9644 done
9645
9646 cf_add_libs="$LIBS"
9647 # reverse order
9648 cf_add_0lib=
9649 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9650 # filter duplicates
9651 for cf_add_1lib in $cf_add_0lib; do
9652         for cf_add_2lib in $cf_add_libs; do
9653                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9654                         cf_add_1lib=
9655                         break
9656                 fi
9657         done
9658         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9659 done
9660 LIBS="$cf_add_libs"
9661
9662                 cat >"conftest.$ac_ext" <<_ACEOF
9663 #line 9663 "configure"
9664 #include "confdefs.h"
9665 #include <${cf_cv_ncurses_header:-curses.h}>
9666 int
9667 main (void)
9668 {
9669 initscr(); mousemask(0,0); tigetstr((char *)0);
9670   ;
9671   return 0;
9672 }
9673 _ACEOF
9674 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9675 if { (eval echo "$as_me:9675: \"$ac_link\"") >&5
9676   (eval $ac_link) 2>&5
9677   ac_status=$?
9678   echo "$as_me:9678: \$? = $ac_status" >&5
9679   (exit "$ac_status"); } &&
9680          { ac_try='test -s "conftest$ac_exeext"'
9681   { (eval echo "$as_me:9681: \"$ac_try\"") >&5
9682   (eval $ac_try) 2>&5
9683   ac_status=$?
9684   echo "$as_me:9684: \$? = $ac_status" >&5
9685   (exit "$ac_status"); }; }; then
9686   if test "$cross_compiling" = yes; then
9687   cf_have_ncuconfig=maybe
9688 else
9689   cat >"conftest.$ac_ext" <<_ACEOF
9690 #line 9690 "configure"
9691 #include "confdefs.h"
9692 #include <${cf_cv_ncurses_header:-curses.h}>
9693                                 int main(void)
9694                                 { const char *xx = curses_version(); return (xx == 0); }
9695 _ACEOF
9696 rm -f "conftest$ac_exeext"
9697 if { (eval echo "$as_me:9697: \"$ac_link\"") >&5
9698   (eval $ac_link) 2>&5
9699   ac_status=$?
9700   echo "$as_me:9700: \$? = $ac_status" >&5
9701   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9702   { (eval echo "$as_me:9702: \"$ac_try\"") >&5
9703   (eval $ac_try) 2>&5
9704   ac_status=$?
9705   echo "$as_me:9705: \$? = $ac_status" >&5
9706   (exit "$ac_status"); }; }; then
9707   cf_have_ncuconfig=yes
9708 else
9709   echo "$as_me: program exited with status $ac_status" >&5
9710 echo "$as_me: failed program was:" >&5
9711 cat "conftest.$ac_ext" >&5
9712 cf_have_ncuconfig=no
9713 fi
9714 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9715 fi
9716 else
9717   echo "$as_me: failed program was:" >&5
9718 cat "conftest.$ac_ext" >&5
9719 cf_have_ncuconfig=no
9720 fi
9721 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9722                 echo "$as_me:9722: result: $cf_have_ncuconfig" >&5
9723 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9724                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9725                 if test "$cf_have_ncuconfig" != "yes"
9726                 then
9727                         CPPFLAGS="$cf_save_CPPFLAGS"
9728                         LIBS="$cf_save_LIBS"
9729                         NCURSES_CONFIG_PKG=none
9730                 else
9731
9732 cat >>confdefs.h <<\EOF
9733 #define NCURSES 1
9734 EOF
9735
9736                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9737
9738 echo "$as_me:9738: checking for terminfo header" >&5
9739 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9740 if test "${cf_cv_term_header+set}" = set; then
9741   echo $ECHO_N "(cached) $ECHO_C" >&6
9742 else
9743
9744 case "${cf_cv_ncurses_header}" in
9745 (*/ncurses.h|*/ncursesw.h)
9746         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9747         ;;
9748 (*)
9749         cf_term_header=term.h
9750         ;;
9751 esac
9752
9753 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9754 do
9755 cat >"conftest.$ac_ext" <<_ACEOF
9756 #line 9756 "configure"
9757 #include "confdefs.h"
9758 #include <stdio.h>
9759 #include <${cf_cv_ncurses_header:-curses.h}>
9760 #include <$cf_test>
9761
9762 int
9763 main (void)
9764 {
9765 int x = auto_left_margin; (void)x
9766   ;
9767   return 0;
9768 }
9769 _ACEOF
9770 rm -f "conftest.$ac_objext"
9771 if { (eval echo "$as_me:9771: \"$ac_compile\"") >&5
9772   (eval $ac_compile) 2>&5
9773   ac_status=$?
9774   echo "$as_me:9774: \$? = $ac_status" >&5
9775   (exit "$ac_status"); } &&
9776          { ac_try='test -s "conftest.$ac_objext"'
9777   { (eval echo "$as_me:9777: \"$ac_try\"") >&5
9778   (eval $ac_try) 2>&5
9779   ac_status=$?
9780   echo "$as_me:9780: \$? = $ac_status" >&5
9781   (exit "$ac_status"); }; }; then
9782
9783         cf_cv_term_header="$cf_test"
9784 else
9785   echo "$as_me: failed program was:" >&5
9786 cat "conftest.$ac_ext" >&5
9787
9788         cf_cv_term_header=unknown
9789
9790 fi
9791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9792         test "$cf_cv_term_header" != unknown && break
9793 done
9794
9795 fi
9796 echo "$as_me:9796: result: $cf_cv_term_header" >&5
9797 echo "${ECHO_T}$cf_cv_term_header" >&6
9798
9799 # Set definitions to allow ifdef'ing to accommodate subdirectories
9800
9801 case "$cf_cv_term_header" in
9802 (*term.h)
9803
9804 cat >>confdefs.h <<\EOF
9805 #define HAVE_TERM_H 1
9806 EOF
9807
9808         ;;
9809 esac
9810
9811 case "$cf_cv_term_header" in
9812 (ncurses/term.h)
9813
9814 cat >>confdefs.h <<\EOF
9815 #define HAVE_NCURSES_TERM_H 1
9816 EOF
9817
9818         ;;
9819 (ncursesw/term.h)
9820
9821 cat >>confdefs.h <<\EOF
9822 #define HAVE_NCURSESW_TERM_H 1
9823 EOF
9824
9825         ;;
9826 esac
9827
9828                 fi
9829
9830         else
9831                 echo "$as_me:9831: result: no" >&5
9832 echo "${ECHO_T}no" >&6
9833                 NCURSES_CONFIG_PKG=none
9834         fi
9835 else
9836         NCURSES_CONFIG_PKG=none
9837 fi
9838
9839 if test "x$cf_have_ncuconfig" = "xno"; then
9840         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9841
9842 if test -n "$ac_tool_prefix"; then
9843   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9844   do
9845     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9846 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9847 echo "$as_me:9847: checking for $ac_word" >&5
9848 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9849 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9850   echo $ECHO_N "(cached) $ECHO_C" >&6
9851 else
9852   if test -n "$NCURSES_CONFIG"; then
9853   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9854 else
9855   ac_save_IFS=$IFS; IFS=$ac_path_separator
9856 ac_dummy="$PATH"
9857 for ac_dir in $ac_dummy; do
9858   IFS=$ac_save_IFS
9859   test -z "$ac_dir" && ac_dir=.
9860   $as_executable_p "$ac_dir/$ac_word" || continue
9861 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9862 echo "$as_me:9862: found $ac_dir/$ac_word" >&5
9863 break
9864 done
9865
9866 fi
9867 fi
9868 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9869 if test -n "$NCURSES_CONFIG"; then
9870   echo "$as_me:9870: result: $NCURSES_CONFIG" >&5
9871 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9872 else
9873   echo "$as_me:9873: result: no" >&5
9874 echo "${ECHO_T}no" >&6
9875 fi
9876
9877     test -n "$NCURSES_CONFIG" && break
9878   done
9879 fi
9880 if test -z "$NCURSES_CONFIG"; then
9881   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9882   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9883 do
9884   # Extract the first word of "$ac_prog", so it can be a program name with args.
9885 set dummy $ac_prog; ac_word=$2
9886 echo "$as_me:9886: checking for $ac_word" >&5
9887 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9888 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9889   echo $ECHO_N "(cached) $ECHO_C" >&6
9890 else
9891   if test -n "$ac_ct_NCURSES_CONFIG"; then
9892   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9893 else
9894   ac_save_IFS=$IFS; IFS=$ac_path_separator
9895 ac_dummy="$PATH"
9896 for ac_dir in $ac_dummy; do
9897   IFS=$ac_save_IFS
9898   test -z "$ac_dir" && ac_dir=.
9899   $as_executable_p "$ac_dir/$ac_word" || continue
9900 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9901 echo "$as_me:9901: found $ac_dir/$ac_word" >&5
9902 break
9903 done
9904
9905 fi
9906 fi
9907 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9908 if test -n "$ac_ct_NCURSES_CONFIG"; then
9909   echo "$as_me:9909: result: $ac_ct_NCURSES_CONFIG" >&5
9910 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9911 else
9912   echo "$as_me:9912: result: no" >&5
9913 echo "${ECHO_T}no" >&6
9914 fi
9915
9916   test -n "$ac_ct_NCURSES_CONFIG" && break
9917 done
9918 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9919
9920   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9921 fi
9922
9923         if test "$NCURSES_CONFIG" != none ; then
9924
9925 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9926 do
9927         case "x$cf_add_cflags" in
9928         (x-[DU]*)
9929
9930 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9931 while true
9932 do
9933         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9934         test "$CFLAGS" != "$cf_old_cflag" || break
9935
9936         CFLAGS="$cf_old_cflag"
9937 done
9938
9939 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9940 while true
9941 do
9942         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9943         test "$CPPFLAGS" != "$cf_old_cflag" || break
9944
9945         CPPFLAGS="$cf_old_cflag"
9946 done
9947
9948                 ;;
9949         esac
9950
9951 cf_fix_cppflags=no
9952 cf_new_cflags=
9953 cf_new_cppflags=
9954 cf_new_extra_cppflags=
9955
9956 for cf_add_cflags in $cf_add_cflags
9957 do
9958 case "$cf_fix_cppflags" in
9959 (no)
9960         case "$cf_add_cflags" in
9961         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9962                 case "$cf_add_cflags" in
9963                 (-D*)
9964                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9965
9966                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9967                                 && test -z "${cf_tst_cflags}" \
9968                                 && cf_fix_cppflags=yes
9969
9970                         if test "$cf_fix_cppflags" = yes ; then
9971
9972         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9973         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9974
9975                                 continue
9976                         elif test "${cf_tst_cflags}" = "\"'" ; then
9977
9978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9980
9981                                 continue
9982                         fi
9983                         ;;
9984                 esac
9985                 case "$CPPFLAGS" in
9986                 (*$cf_add_cflags)
9987                         ;;
9988                 (*)
9989                         case "$cf_add_cflags" in
9990                         (-D*)
9991                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9992
9993 CPPFLAGS=`echo "$CPPFLAGS" | \
9994         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9995                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9996
9997                                 ;;
9998                         esac
9999
10000         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10001         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10002
10003                         ;;
10004                 esac
10005                 ;;
10006         (*)
10007
10008         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10009         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10010
10011                 ;;
10012         esac
10013         ;;
10014 (yes)
10015
10016         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10017         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10018
10019         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10020
10021         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10022                 && test -z "${cf_tst_cflags}" \
10023                 && cf_fix_cppflags=no
10024         ;;
10025 esac
10026 done
10027
10028 if test -n "$cf_new_cflags" ; then
10029
10030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10031         CFLAGS="${CFLAGS}$cf_new_cflags"
10032
10033 fi
10034
10035 if test -n "$cf_new_cppflags" ; then
10036
10037         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10038         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10039
10040 fi
10041
10042 if test -n "$cf_new_extra_cppflags" ; then
10043
10044         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10045         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10046
10047 fi
10048
10049 done
10050
10051 cf_add_libs="$LIBS"
10052 # reverse order
10053 cf_add_0lib=
10054 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10055 # filter duplicates
10056 for cf_add_1lib in $cf_add_0lib; do
10057         for cf_add_2lib in $cf_add_libs; do
10058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10059                         cf_add_1lib=
10060                         break
10061                 fi
10062         done
10063         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10064 done
10065 LIBS="$cf_add_libs"
10066
10067                 # even with config script, some packages use no-override for curses.h
10068
10069 echo "$as_me:10069: checking if we have identified curses headers" >&5
10070 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10071 if test "${cf_cv_ncurses_header+set}" = set; then
10072   echo $ECHO_N "(cached) $ECHO_C" >&6
10073 else
10074
10075 cf_cv_ncurses_header=none
10076 for cf_header in \
10077         ncurses.h ncurses/ncurses.h \
10078         curses.h ncurses/curses.h
10079 do
10080 cat >"conftest.$ac_ext" <<_ACEOF
10081 #line 10081 "configure"
10082 #include "confdefs.h"
10083 #include <${cf_header}>
10084 int
10085 main (void)
10086 {
10087 initscr(); tgoto("?", 0,0)
10088   ;
10089   return 0;
10090 }
10091 _ACEOF
10092 rm -f "conftest.$ac_objext"
10093 if { (eval echo "$as_me:10093: \"$ac_compile\"") >&5
10094   (eval $ac_compile) 2>&5
10095   ac_status=$?
10096   echo "$as_me:10096: \$? = $ac_status" >&5
10097   (exit "$ac_status"); } &&
10098          { ac_try='test -s "conftest.$ac_objext"'
10099   { (eval echo "$as_me:10099: \"$ac_try\"") >&5
10100   (eval $ac_try) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit "$ac_status"); }; }; then
10104   cf_cv_ncurses_header=$cf_header; break
10105 else
10106   echo "$as_me: failed program was:" >&5
10107 cat "conftest.$ac_ext" >&5
10108 fi
10109 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10110 done
10111
10112 fi
10113 echo "$as_me:10113: result: $cf_cv_ncurses_header" >&5
10114 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10115
10116 if test "$cf_cv_ncurses_header" = none ; then
10117         { { echo "$as_me:10117: error: No curses header-files found" >&5
10118 echo "$as_me: error: No curses header-files found" >&2;}
10119    { (exit 1); exit 1; }; }
10120 fi
10121
10122 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10123
10124 for ac_header in $cf_cv_ncurses_header
10125 do
10126 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10127 echo "$as_me:10127: checking for $ac_header" >&5
10128 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10129 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10130   echo $ECHO_N "(cached) $ECHO_C" >&6
10131 else
10132   cat >"conftest.$ac_ext" <<_ACEOF
10133 #line 10133 "configure"
10134 #include "confdefs.h"
10135 #include <$ac_header>
10136 _ACEOF
10137 if { (eval echo "$as_me:10137: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10138   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10139   ac_status=$?
10140   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10141   rm -f conftest.er1
10142   cat conftest.err >&5
10143   echo "$as_me:10143: \$? = $ac_status" >&5
10144   (exit "$ac_status"); } >/dev/null; then
10145   if test -s conftest.err; then
10146     ac_cpp_err=$ac_c_preproc_warn_flag
10147   else
10148     ac_cpp_err=
10149   fi
10150 else
10151   ac_cpp_err=yes
10152 fi
10153 if test -z "$ac_cpp_err"; then
10154   eval "$as_ac_Header=yes"
10155 else
10156   echo "$as_me: failed program was:" >&5
10157   cat "conftest.$ac_ext" >&5
10158   eval "$as_ac_Header=no"
10159 fi
10160 rm -f conftest.err "conftest.$ac_ext"
10161 fi
10162 echo "$as_me:10162: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10163 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10164 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10165   cat >>confdefs.h <<EOF
10166 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10167 EOF
10168
10169 fi
10170 done
10171
10172 cat >>confdefs.h <<\EOF
10173 #define NCURSES 1
10174 EOF
10175
10176 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10177
10178                 cat >>confdefs.h <<EOF
10179 #define $cf_nculib_ROOT 1
10180 EOF
10181
10182                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10183
10184         else
10185
10186 cf_ncuhdr_root=ncurses
10187
10188 test -n "$cf_cv_curses_dir" && \
10189 test "$cf_cv_curses_dir" != "no" && { \
10190
10191 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10192   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10193   do
10194         while test "$cf_add_incdir" != /usr/include
10195         do
10196           if test -d "$cf_add_incdir"
10197           then
10198                 cf_have_incdir=no
10199                 if test -n "$CFLAGS$CPPFLAGS" ; then
10200                   # a loop is needed to ensure we can add subdirs of existing dirs
10201                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10202                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10203                           cf_have_incdir=yes; break
10204                         fi
10205                   done
10206                 fi
10207
10208                 if test "$cf_have_incdir" = no ; then
10209                   if test "$cf_add_incdir" = /usr/local/include ; then
10210                         if test "$GCC" = yes
10211                         then
10212                           cf_save_CPPFLAGS=$CPPFLAGS
10213
10214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10215         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10216
10217                           cat >"conftest.$ac_ext" <<_ACEOF
10218 #line 10218 "configure"
10219 #include "confdefs.h"
10220 #include <stdio.h>
10221 int
10222 main (void)
10223 {
10224 printf("Hello")
10225   ;
10226   return 0;
10227 }
10228 _ACEOF
10229 rm -f "conftest.$ac_objext"
10230 if { (eval echo "$as_me:10230: \"$ac_compile\"") >&5
10231   (eval $ac_compile) 2>&5
10232   ac_status=$?
10233   echo "$as_me:10233: \$? = $ac_status" >&5
10234   (exit "$ac_status"); } &&
10235          { ac_try='test -s "conftest.$ac_objext"'
10236   { (eval echo "$as_me:10236: \"$ac_try\"") >&5
10237   (eval $ac_try) 2>&5
10238   ac_status=$?
10239   echo "$as_me:10239: \$? = $ac_status" >&5
10240   (exit "$ac_status"); }; }; then
10241   :
10242 else
10243   echo "$as_me: failed program was:" >&5
10244 cat "conftest.$ac_ext" >&5
10245 cf_have_incdir=yes
10246 fi
10247 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10248                           CPPFLAGS=$cf_save_CPPFLAGS
10249                         fi
10250                   fi
10251                 fi
10252
10253                 if test "$cf_have_incdir" = no ; then
10254                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10255
10256 echo "${as_me:-configure}:10256: testing adding $cf_add_incdir to include-path ..." 1>&5
10257
10258                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10259
10260                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10261                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10262                   cf_add_incdir="$cf_top_incdir"
10263                 else
10264                   break
10265                 fi
10266           else
10267                 break
10268           fi
10269         done
10270   done
10271 fi
10272
10273 }
10274
10275 echo "$as_me:10275: checking for $cf_ncuhdr_root header in include-path" >&5
10276 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10277 if test "${cf_cv_ncurses_h+set}" = set; then
10278   echo $ECHO_N "(cached) $ECHO_C" >&6
10279 else
10280
10281         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10282         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10283         for cf_header in $cf_header_list
10284         do
10285
10286         cat >"conftest.$ac_ext" <<_ACEOF
10287 #line 10287 "configure"
10288 #include "confdefs.h"
10289
10290 #include <$cf_header>
10291 int
10292 main (void)
10293 {
10294
10295 #ifdef NCURSES_VERSION
10296
10297 printf("%s\\n", NCURSES_VERSION);
10298 #else
10299 #ifdef __NCURSES_H
10300 printf("old\\n");
10301 #else
10302         make an error
10303 #endif
10304 #endif
10305
10306   ;
10307   return 0;
10308 }
10309 _ACEOF
10310 rm -f "conftest.$ac_objext"
10311 if { (eval echo "$as_me:10311: \"$ac_compile\"") >&5
10312   (eval $ac_compile) 2>&5
10313   ac_status=$?
10314   echo "$as_me:10314: \$? = $ac_status" >&5
10315   (exit "$ac_status"); } &&
10316          { ac_try='test -s "conftest.$ac_objext"'
10317   { (eval echo "$as_me:10317: \"$ac_try\"") >&5
10318   (eval $ac_try) 2>&5
10319   ac_status=$?
10320   echo "$as_me:10320: \$? = $ac_status" >&5
10321   (exit "$ac_status"); }; }; then
10322   cf_cv_ncurses_h=$cf_header
10323
10324 else
10325   echo "$as_me: failed program was:" >&5
10326 cat "conftest.$ac_ext" >&5
10327 cf_cv_ncurses_h=no
10328 fi
10329 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10330
10331                 test "$cf_cv_ncurses_h" != no && break
10332         done
10333
10334 fi
10335 echo "$as_me:10335: result: $cf_cv_ncurses_h" >&5
10336 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10337
10338 if test "$cf_cv_ncurses_h" != no ; then
10339         cf_cv_ncurses_header=$cf_cv_ncurses_h
10340 else
10341
10342 echo "$as_me:10342: checking for $cf_ncuhdr_root include-path" >&5
10343 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10344 if test "${cf_cv_ncurses_h2+set}" = set; then
10345   echo $ECHO_N "(cached) $ECHO_C" >&6
10346 else
10347
10348         test -n "$verbose" && echo
10349
10350 cf_search=
10351
10352 # collect the current set of include-directories from compiler flags
10353 cf_header_path_list=""
10354 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10355         for cf_header_path in $CPPFLAGS $CFLAGS
10356         do
10357                 case "$cf_header_path" in
10358                 (-I*)
10359                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10360
10361 test "x$cf_header_path" != "xNONE" && \
10362 test -d "$cf_header_path" && \
10363  {
10364         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10365         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10366         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10367         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10368         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10369         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"
10370 }
10371
10372                         cf_header_path_list="$cf_header_path_list $cf_search"
10373                         ;;
10374                 esac
10375         done
10376 fi
10377
10378 # add the variations for the package we are looking for
10379
10380 cf_search=
10381
10382 test "x$prefix" != "xNONE" && \
10383 test -d "$prefix" && \
10384  {
10385         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10386         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10387         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10388         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10389         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10390         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10391 }
10392
10393 for cf_subdir_prefix in \
10394         /usr \
10395         /usr/local \
10396         /usr/pkg \
10397         /opt \
10398         /opt/local \
10399         $HOME
10400 do
10401
10402 test "x$cf_subdir_prefix" != "x$prefix" && \
10403 test -d "$cf_subdir_prefix" && \
10404 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10405         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10406         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10407         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10408         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10409         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10410         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"
10411 }
10412
10413 done
10414
10415 test "$includedir" != NONE && \
10416 test "$includedir" != "/usr/include" && \
10417 test -d "$includedir" && {
10418         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10419         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10420 }
10421
10422 test "$oldincludedir" != NONE && \
10423 test "$oldincludedir" != "/usr/include" && \
10424 test -d "$oldincludedir" && {
10425         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10426         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10427 }
10428
10429 cf_search="$cf_search $cf_header_path_list"
10430
10431         test -n "$verbose" && echo "search path $cf_search"
10432         cf_save2_CPPFLAGS="$CPPFLAGS"
10433         for cf_incdir in $cf_search
10434         do
10435
10436 if test -n "$cf_incdir" ; then
10437   for cf_add_incdir in $cf_incdir
10438   do
10439         while test "$cf_add_incdir" != /usr/include
10440         do
10441           if test -d "$cf_add_incdir"
10442           then
10443                 cf_have_incdir=no
10444                 if test -n "$CFLAGS$CPPFLAGS" ; then
10445                   # a loop is needed to ensure we can add subdirs of existing dirs
10446                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10447                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10448                           cf_have_incdir=yes; break
10449                         fi
10450                   done
10451                 fi
10452
10453                 if test "$cf_have_incdir" = no ; then
10454                   if test "$cf_add_incdir" = /usr/local/include ; then
10455                         if test "$GCC" = yes
10456                         then
10457                           cf_save_CPPFLAGS=$CPPFLAGS
10458
10459         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10460         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10461
10462                           cat >"conftest.$ac_ext" <<_ACEOF
10463 #line 10463 "configure"
10464 #include "confdefs.h"
10465 #include <stdio.h>
10466 int
10467 main (void)
10468 {
10469 printf("Hello")
10470   ;
10471   return 0;
10472 }
10473 _ACEOF
10474 rm -f "conftest.$ac_objext"
10475 if { (eval echo "$as_me:10475: \"$ac_compile\"") >&5
10476   (eval $ac_compile) 2>&5
10477   ac_status=$?
10478   echo "$as_me:10478: \$? = $ac_status" >&5
10479   (exit "$ac_status"); } &&
10480          { ac_try='test -s "conftest.$ac_objext"'
10481   { (eval echo "$as_me:10481: \"$ac_try\"") >&5
10482   (eval $ac_try) 2>&5
10483   ac_status=$?
10484   echo "$as_me:10484: \$? = $ac_status" >&5
10485   (exit "$ac_status"); }; }; then
10486   :
10487 else
10488   echo "$as_me: failed program was:" >&5
10489 cat "conftest.$ac_ext" >&5
10490 cf_have_incdir=yes
10491 fi
10492 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10493                           CPPFLAGS=$cf_save_CPPFLAGS
10494                         fi
10495                   fi
10496                 fi
10497
10498                 if test "$cf_have_incdir" = no ; then
10499                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10500
10501 echo "${as_me:-configure}:10501: testing adding $cf_add_incdir to include-path ..." 1>&5
10502
10503                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10504
10505                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10506                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10507                   cf_add_incdir="$cf_top_incdir"
10508                 else
10509                   break
10510                 fi
10511           else
10512                 break
10513           fi
10514         done
10515   done
10516 fi
10517
10518                 for cf_header in \
10519                         ncurses.h \
10520                         curses.h
10521                 do
10522
10523         cat >"conftest.$ac_ext" <<_ACEOF
10524 #line 10524 "configure"
10525 #include "confdefs.h"
10526
10527 #include <$cf_header>
10528 int
10529 main (void)
10530 {
10531
10532 #ifdef NCURSES_VERSION
10533
10534 printf("%s\\n", NCURSES_VERSION);
10535 #else
10536 #ifdef __NCURSES_H
10537 printf("old\\n");
10538 #else
10539         make an error
10540 #endif
10541 #endif
10542
10543   ;
10544   return 0;
10545 }
10546 _ACEOF
10547 rm -f "conftest.$ac_objext"
10548 if { (eval echo "$as_me:10548: \"$ac_compile\"") >&5
10549   (eval $ac_compile) 2>&5
10550   ac_status=$?
10551   echo "$as_me:10551: \$? = $ac_status" >&5
10552   (exit "$ac_status"); } &&
10553          { ac_try='test -s "conftest.$ac_objext"'
10554   { (eval echo "$as_me:10554: \"$ac_try\"") >&5
10555   (eval $ac_try) 2>&5
10556   ac_status=$?
10557   echo "$as_me:10557: \$? = $ac_status" >&5
10558   (exit "$ac_status"); }; }; then
10559   cf_cv_ncurses_h2=$cf_header
10560
10561 else
10562   echo "$as_me: failed program was:" >&5
10563 cat "conftest.$ac_ext" >&5
10564 cf_cv_ncurses_h2=no
10565 fi
10566 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10567
10568                         if test "$cf_cv_ncurses_h2" != no ; then
10569                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10570                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10571                                 break
10572                         fi
10573                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10574                 done
10575                 CPPFLAGS="$cf_save2_CPPFLAGS"
10576                 test "$cf_cv_ncurses_h2" != no && break
10577         done
10578         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10578: error: not found" >&5
10579 echo "$as_me: error: not found" >&2;}
10580    { (exit 1); exit 1; }; }
10581
10582 fi
10583 echo "$as_me:10583: result: $cf_cv_ncurses_h2" >&5
10584 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10585
10586         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10587         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10588         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10589                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10590         fi
10591
10592 if test -n "$cf_1st_incdir" ; then
10593   for cf_add_incdir in $cf_1st_incdir
10594   do
10595         while test "$cf_add_incdir" != /usr/include
10596         do
10597           if test -d "$cf_add_incdir"
10598           then
10599                 cf_have_incdir=no
10600                 if test -n "$CFLAGS$CPPFLAGS" ; then
10601                   # a loop is needed to ensure we can add subdirs of existing dirs
10602                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10603                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10604                           cf_have_incdir=yes; break
10605                         fi
10606                   done
10607                 fi
10608
10609                 if test "$cf_have_incdir" = no ; then
10610                   if test "$cf_add_incdir" = /usr/local/include ; then
10611                         if test "$GCC" = yes
10612                         then
10613                           cf_save_CPPFLAGS=$CPPFLAGS
10614
10615         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10616         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10617
10618                           cat >"conftest.$ac_ext" <<_ACEOF
10619 #line 10619 "configure"
10620 #include "confdefs.h"
10621 #include <stdio.h>
10622 int
10623 main (void)
10624 {
10625 printf("Hello")
10626   ;
10627   return 0;
10628 }
10629 _ACEOF
10630 rm -f "conftest.$ac_objext"
10631 if { (eval echo "$as_me:10631: \"$ac_compile\"") >&5
10632   (eval $ac_compile) 2>&5
10633   ac_status=$?
10634   echo "$as_me:10634: \$? = $ac_status" >&5
10635   (exit "$ac_status"); } &&
10636          { ac_try='test -s "conftest.$ac_objext"'
10637   { (eval echo "$as_me:10637: \"$ac_try\"") >&5
10638   (eval $ac_try) 2>&5
10639   ac_status=$?
10640   echo "$as_me:10640: \$? = $ac_status" >&5
10641   (exit "$ac_status"); }; }; then
10642   :
10643 else
10644   echo "$as_me: failed program was:" >&5
10645 cat "conftest.$ac_ext" >&5
10646 cf_have_incdir=yes
10647 fi
10648 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10649                           CPPFLAGS=$cf_save_CPPFLAGS
10650                         fi
10651                   fi
10652                 fi
10653
10654                 if test "$cf_have_incdir" = no ; then
10655                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10656
10657 echo "${as_me:-configure}:10657: testing adding $cf_add_incdir to include-path ..." 1>&5
10658
10659                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10660
10661                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10662                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10663                   cf_add_incdir="$cf_top_incdir"
10664                 else
10665                   break
10666                 fi
10667           else
10668                 break
10669           fi
10670         done
10671   done
10672 fi
10673
10674 fi
10675
10676 # Set definitions to allow ifdef'ing for ncurses.h
10677
10678 case "$cf_cv_ncurses_header" in
10679 (*ncurses.h)
10680
10681 cat >>confdefs.h <<\EOF
10682 #define HAVE_NCURSES_H 1
10683 EOF
10684
10685         ;;
10686 esac
10687
10688 case "$cf_cv_ncurses_header" in
10689 (ncurses/curses.h|ncurses/ncurses.h)
10690
10691 cat >>confdefs.h <<\EOF
10692 #define HAVE_NCURSES_NCURSES_H 1
10693 EOF
10694
10695         ;;
10696 (ncursesw/curses.h|ncursesw/ncurses.h)
10697
10698 cat >>confdefs.h <<\EOF
10699 #define HAVE_NCURSESW_NCURSES_H 1
10700 EOF
10701
10702         ;;
10703 esac
10704
10705 echo "$as_me:10705: checking for terminfo header" >&5
10706 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10707 if test "${cf_cv_term_header+set}" = set; then
10708   echo $ECHO_N "(cached) $ECHO_C" >&6
10709 else
10710
10711 case "${cf_cv_ncurses_header}" in
10712 (*/ncurses.h|*/ncursesw.h)
10713         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10714         ;;
10715 (*)
10716         cf_term_header=term.h
10717         ;;
10718 esac
10719
10720 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10721 do
10722 cat >"conftest.$ac_ext" <<_ACEOF
10723 #line 10723 "configure"
10724 #include "confdefs.h"
10725 #include <stdio.h>
10726 #include <${cf_cv_ncurses_header:-curses.h}>
10727 #include <$cf_test>
10728
10729 int
10730 main (void)
10731 {
10732 int x = auto_left_margin; (void)x
10733   ;
10734   return 0;
10735 }
10736 _ACEOF
10737 rm -f "conftest.$ac_objext"
10738 if { (eval echo "$as_me:10738: \"$ac_compile\"") >&5
10739   (eval $ac_compile) 2>&5
10740   ac_status=$?
10741   echo "$as_me:10741: \$? = $ac_status" >&5
10742   (exit "$ac_status"); } &&
10743          { ac_try='test -s "conftest.$ac_objext"'
10744   { (eval echo "$as_me:10744: \"$ac_try\"") >&5
10745   (eval $ac_try) 2>&5
10746   ac_status=$?
10747   echo "$as_me:10747: \$? = $ac_status" >&5
10748   (exit "$ac_status"); }; }; then
10749
10750         cf_cv_term_header="$cf_test"
10751 else
10752   echo "$as_me: failed program was:" >&5
10753 cat "conftest.$ac_ext" >&5
10754
10755         cf_cv_term_header=unknown
10756
10757 fi
10758 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10759         test "$cf_cv_term_header" != unknown && break
10760 done
10761
10762 fi
10763 echo "$as_me:10763: result: $cf_cv_term_header" >&5
10764 echo "${ECHO_T}$cf_cv_term_header" >&6
10765
10766 # Set definitions to allow ifdef'ing to accommodate subdirectories
10767
10768 case "$cf_cv_term_header" in
10769 (*term.h)
10770
10771 cat >>confdefs.h <<\EOF
10772 #define HAVE_TERM_H 1
10773 EOF
10774
10775         ;;
10776 esac
10777
10778 case "$cf_cv_term_header" in
10779 (ncurses/term.h)
10780
10781 cat >>confdefs.h <<\EOF
10782 #define HAVE_NCURSES_TERM_H 1
10783 EOF
10784
10785         ;;
10786 (ncursesw/term.h)
10787
10788 cat >>confdefs.h <<\EOF
10789 #define HAVE_NCURSESW_TERM_H 1
10790 EOF
10791
10792         ;;
10793 esac
10794
10795 # some applications need this, but should check for NCURSES_VERSION
10796
10797 cat >>confdefs.h <<\EOF
10798 #define NCURSES 1
10799 EOF
10800
10801 echo "$as_me:10801: checking for ncurses version" >&5
10802 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10803 if test "${cf_cv_ncurses_version+set}" = set; then
10804   echo $ECHO_N "(cached) $ECHO_C" >&6
10805 else
10806
10807         cf_cv_ncurses_version=no
10808         cf_tempfile=out$$
10809         rm -f "$cf_tempfile"
10810         if test "$cross_compiling" = yes; then
10811
10812         # This will not work if the preprocessor splits the line after the
10813         # Autoconf token.  The 'unproto' program does that.
10814         cat > "conftest.$ac_ext" <<EOF
10815 #include <${cf_cv_ncurses_header:-curses.h}>
10816 #undef Autoconf
10817 #ifdef NCURSES_VERSION
10818 Autoconf NCURSES_VERSION
10819 #else
10820 #ifdef __NCURSES_H
10821 Autoconf "old"
10822 #endif
10823 ;
10824 #endif
10825 EOF
10826         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10827         { (eval echo "$as_me:10827: \"$cf_try\"") >&5
10828   (eval $cf_try) 2>&5
10829   ac_status=$?
10830   echo "$as_me:10830: \$? = $ac_status" >&5
10831   (exit "$ac_status"); }
10832         if test -f conftest.out ; then
10833                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10834                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10835                 rm -f conftest.out
10836         fi
10837
10838 else
10839   cat >"conftest.$ac_ext" <<_ACEOF
10840 #line 10840 "configure"
10841 #include "confdefs.h"
10842
10843 #include <${cf_cv_ncurses_header:-curses.h}>
10844 #include <stdio.h>
10845 int main(void)
10846 {
10847         FILE *fp = fopen("$cf_tempfile", "w");
10848 #ifdef NCURSES_VERSION
10849 # ifdef NCURSES_VERSION_PATCH
10850         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10851 # else
10852         fprintf(fp, "%s\\n", NCURSES_VERSION);
10853 # endif
10854 #else
10855 # ifdef __NCURSES_H
10856         fprintf(fp, "old\\n");
10857 # else
10858         make an error
10859 # endif
10860 #endif
10861         ${cf_cv_main_return:-return}(0);
10862 }
10863 _ACEOF
10864 rm -f "conftest$ac_exeext"
10865 if { (eval echo "$as_me:10865: \"$ac_link\"") >&5
10866   (eval $ac_link) 2>&5
10867   ac_status=$?
10868   echo "$as_me:10868: \$? = $ac_status" >&5
10869   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10870   { (eval echo "$as_me:10870: \"$ac_try\"") >&5
10871   (eval $ac_try) 2>&5
10872   ac_status=$?
10873   echo "$as_me:10873: \$? = $ac_status" >&5
10874   (exit "$ac_status"); }; }; then
10875
10876         cf_cv_ncurses_version=`cat $cf_tempfile`
10877 else
10878   echo "$as_me: program exited with status $ac_status" >&5
10879 echo "$as_me: failed program was:" >&5
10880 cat "conftest.$ac_ext" >&5
10881 fi
10882 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10883 fi
10884         rm -f "$cf_tempfile"
10885
10886 fi
10887 echo "$as_me:10887: result: $cf_cv_ncurses_version" >&5
10888 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10889 test "$cf_cv_ncurses_version" = no ||
10890 cat >>confdefs.h <<\EOF
10891 #define NCURSES 1
10892 EOF
10893
10894 cf_nculib_root=ncurses
10895         # This works, except for the special case where we find gpm, but
10896         # ncurses is in a nonstandard location via $LIBS, and we really want
10897         # to link gpm.
10898 cf_ncurses_LIBS=""
10899 cf_ncurses_SAVE="$LIBS"
10900 echo "$as_me:10900: checking for Gpm_Open in -lgpm" >&5
10901 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10902 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10903   echo $ECHO_N "(cached) $ECHO_C" >&6
10904 else
10905   ac_check_lib_save_LIBS=$LIBS
10906 LIBS="-lgpm  $LIBS"
10907 cat >"conftest.$ac_ext" <<_ACEOF
10908 #line 10908 "configure"
10909 #include "confdefs.h"
10910
10911 /* Override any gcc2 internal prototype to avoid an error.  */
10912 #ifdef __cplusplus
10913 extern "C"
10914 #endif
10915 /* We use char because int might match the return type of a gcc2
10916    builtin and then its argument prototype would still apply.  */
10917 char Gpm_Open ();
10918 int
10919 main (void)
10920 {
10921 Gpm_Open ();
10922   ;
10923   return 0;
10924 }
10925 _ACEOF
10926 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10927 if { (eval echo "$as_me:10927: \"$ac_link\"") >&5
10928   (eval $ac_link) 2>&5
10929   ac_status=$?
10930   echo "$as_me:10930: \$? = $ac_status" >&5
10931   (exit "$ac_status"); } &&
10932          { ac_try='test -s "conftest$ac_exeext"'
10933   { (eval echo "$as_me:10933: \"$ac_try\"") >&5
10934   (eval $ac_try) 2>&5
10935   ac_status=$?
10936   echo "$as_me:10936: \$? = $ac_status" >&5
10937   (exit "$ac_status"); }; }; then
10938   ac_cv_lib_gpm_Gpm_Open=yes
10939 else
10940   echo "$as_me: failed program was:" >&5
10941 cat "conftest.$ac_ext" >&5
10942 ac_cv_lib_gpm_Gpm_Open=no
10943 fi
10944 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10945 LIBS=$ac_check_lib_save_LIBS
10946 fi
10947 echo "$as_me:10947: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10948 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10949 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10950   echo "$as_me:10950: checking for initscr in -lgpm" >&5
10951 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10952 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10953   echo $ECHO_N "(cached) $ECHO_C" >&6
10954 else
10955   ac_check_lib_save_LIBS=$LIBS
10956 LIBS="-lgpm  $LIBS"
10957 cat >"conftest.$ac_ext" <<_ACEOF
10958 #line 10958 "configure"
10959 #include "confdefs.h"
10960
10961 /* Override any gcc2 internal prototype to avoid an error.  */
10962 #ifdef __cplusplus
10963 extern "C"
10964 #endif
10965 /* We use char because int might match the return type of a gcc2
10966    builtin and then its argument prototype would still apply.  */
10967 char initscr ();
10968 int
10969 main (void)
10970 {
10971 initscr ();
10972   ;
10973   return 0;
10974 }
10975 _ACEOF
10976 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10977 if { (eval echo "$as_me:10977: \"$ac_link\"") >&5
10978   (eval $ac_link) 2>&5
10979   ac_status=$?
10980   echo "$as_me:10980: \$? = $ac_status" >&5
10981   (exit "$ac_status"); } &&
10982          { ac_try='test -s "conftest$ac_exeext"'
10983   { (eval echo "$as_me:10983: \"$ac_try\"") >&5
10984   (eval $ac_try) 2>&5
10985   ac_status=$?
10986   echo "$as_me:10986: \$? = $ac_status" >&5
10987   (exit "$ac_status"); }; }; then
10988   ac_cv_lib_gpm_initscr=yes
10989 else
10990   echo "$as_me: failed program was:" >&5
10991 cat "conftest.$ac_ext" >&5
10992 ac_cv_lib_gpm_initscr=no
10993 fi
10994 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10995 LIBS=$ac_check_lib_save_LIBS
10996 fi
10997 echo "$as_me:10997: result: $ac_cv_lib_gpm_initscr" >&5
10998 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10999 if test "$ac_cv_lib_gpm_initscr" = yes; then
11000   LIBS="$cf_ncurses_SAVE"
11001 else
11002   cf_ncurses_LIBS="-lgpm"
11003 fi
11004
11005 fi
11006
11007 case "$host_os" in
11008 (freebsd*)
11009         # This is only necessary if you are linking against an obsolete
11010         # version of ncurses (but it should do no harm, since it is static).
11011         if test "$cf_nculib_root" = ncurses ; then
11012                 echo "$as_me:11012: checking for tgoto in -lmytinfo" >&5
11013 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11014 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11015   echo $ECHO_N "(cached) $ECHO_C" >&6
11016 else
11017   ac_check_lib_save_LIBS=$LIBS
11018 LIBS="-lmytinfo  $LIBS"
11019 cat >"conftest.$ac_ext" <<_ACEOF
11020 #line 11020 "configure"
11021 #include "confdefs.h"
11022
11023 /* Override any gcc2 internal prototype to avoid an error.  */
11024 #ifdef __cplusplus
11025 extern "C"
11026 #endif
11027 /* We use char because int might match the return type of a gcc2
11028    builtin and then its argument prototype would still apply.  */
11029 char tgoto ();
11030 int
11031 main (void)
11032 {
11033 tgoto ();
11034   ;
11035   return 0;
11036 }
11037 _ACEOF
11038 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11039 if { (eval echo "$as_me:11039: \"$ac_link\"") >&5
11040   (eval $ac_link) 2>&5
11041   ac_status=$?
11042   echo "$as_me:11042: \$? = $ac_status" >&5
11043   (exit "$ac_status"); } &&
11044          { ac_try='test -s "conftest$ac_exeext"'
11045   { (eval echo "$as_me:11045: \"$ac_try\"") >&5
11046   (eval $ac_try) 2>&5
11047   ac_status=$?
11048   echo "$as_me:11048: \$? = $ac_status" >&5
11049   (exit "$ac_status"); }; }; then
11050   ac_cv_lib_mytinfo_tgoto=yes
11051 else
11052   echo "$as_me: failed program was:" >&5
11053 cat "conftest.$ac_ext" >&5
11054 ac_cv_lib_mytinfo_tgoto=no
11055 fi
11056 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11057 LIBS=$ac_check_lib_save_LIBS
11058 fi
11059 echo "$as_me:11059: result: $ac_cv_lib_mytinfo_tgoto" >&5
11060 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11061 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11062   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11063 fi
11064
11065         fi
11066         ;;
11067 esac
11068
11069 cf_add_libs="$LIBS"
11070 # reverse order
11071 cf_add_0lib=
11072 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11073 # filter duplicates
11074 for cf_add_1lib in $cf_add_0lib; do
11075         for cf_add_2lib in $cf_add_libs; do
11076                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11077                         cf_add_1lib=
11078                         break
11079                 fi
11080         done
11081         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11082 done
11083 LIBS="$cf_add_libs"
11084
11085 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11086 then
11087
11088 cf_add_libs="$LIBS"
11089 # reverse order
11090 cf_add_0lib=
11091 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11092 # filter duplicates
11093 for cf_add_1lib in $cf_add_0lib; do
11094         for cf_add_2lib in $cf_add_libs; do
11095                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11096                         cf_add_1lib=
11097                         break
11098                 fi
11099         done
11100         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11101 done
11102 LIBS="$cf_add_libs"
11103
11104 else
11105
11106         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11107         cf_libdir=""
11108         echo "$as_me:11108: checking for initscr" >&5
11109 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11110 if test "${ac_cv_func_initscr+set}" = set; then
11111   echo $ECHO_N "(cached) $ECHO_C" >&6
11112 else
11113   cat >"conftest.$ac_ext" <<_ACEOF
11114 #line 11114 "configure"
11115 #include "confdefs.h"
11116 #define initscr autoconf_temporary
11117 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11118 #undef initscr
11119
11120 #ifdef __cplusplus
11121 extern "C"
11122 #endif
11123
11124 /* We use char because int might match the return type of a gcc2
11125    builtin and then its argument prototype would still apply.  */
11126 char initscr (void);
11127
11128 int
11129 main (void)
11130 {
11131
11132 /* The GNU C library defines stubs for functions which it implements
11133     to always fail with ENOSYS.  Some functions are actually named
11134     something starting with __ and the normal name is an alias.  */
11135 #if defined (__stub_initscr) || defined (__stub___initscr)
11136 #error found stub for initscr
11137 #endif
11138
11139         return initscr ();
11140   ;
11141   return 0;
11142 }
11143 _ACEOF
11144 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11145 if { (eval echo "$as_me:11145: \"$ac_link\"") >&5
11146   (eval $ac_link) 2>&5
11147   ac_status=$?
11148   echo "$as_me:11148: \$? = $ac_status" >&5
11149   (exit "$ac_status"); } &&
11150          { ac_try='test -s "conftest$ac_exeext"'
11151   { (eval echo "$as_me:11151: \"$ac_try\"") >&5
11152   (eval $ac_try) 2>&5
11153   ac_status=$?
11154   echo "$as_me:11154: \$? = $ac_status" >&5
11155   (exit "$ac_status"); }; }; then
11156   ac_cv_func_initscr=yes
11157 else
11158   echo "$as_me: failed program was:" >&5
11159 cat "conftest.$ac_ext" >&5
11160 ac_cv_func_initscr=no
11161 fi
11162 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11163 fi
11164 echo "$as_me:11164: result: $ac_cv_func_initscr" >&5
11165 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11166 if test "$ac_cv_func_initscr" = yes; then
11167   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11168 else
11169
11170                 cf_save_LIBS="$LIBS"
11171                 echo "$as_me:11171: checking for initscr in -l$cf_nculib_root" >&5
11172 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11173                 LIBS="-l$cf_nculib_root $LIBS"
11174                 cat >"conftest.$ac_ext" <<_ACEOF
11175 #line 11175 "configure"
11176 #include "confdefs.h"
11177 #include <${cf_cv_ncurses_header:-curses.h}>
11178 int
11179 main (void)
11180 {
11181 initscr()
11182   ;
11183   return 0;
11184 }
11185 _ACEOF
11186 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11187 if { (eval echo "$as_me:11187: \"$ac_link\"") >&5
11188   (eval $ac_link) 2>&5
11189   ac_status=$?
11190   echo "$as_me:11190: \$? = $ac_status" >&5
11191   (exit "$ac_status"); } &&
11192          { ac_try='test -s "conftest$ac_exeext"'
11193   { (eval echo "$as_me:11193: \"$ac_try\"") >&5
11194   (eval $ac_try) 2>&5
11195   ac_status=$?
11196   echo "$as_me:11196: \$? = $ac_status" >&5
11197   (exit "$ac_status"); }; }; then
11198   echo "$as_me:11198: result: yes" >&5
11199 echo "${ECHO_T}yes" >&6
11200                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11201
11202 else
11203   echo "$as_me: failed program was:" >&5
11204 cat "conftest.$ac_ext" >&5
11205 echo "$as_me:11205: result: no" >&5
11206 echo "${ECHO_T}no" >&6
11207
11208 cf_search=
11209 cf_library_path_list=""
11210 if test -n "${LDFLAGS}${LIBS}" ; then
11211         for cf_library_path in $LDFLAGS $LIBS
11212         do
11213                 case "$cf_library_path" in
11214                 (-L*)
11215                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11216
11217 test "x$cf_library_path" != "xNONE" && \
11218 test -d "$cf_library_path" && \
11219  {
11220         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11221         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11222         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11223         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11224         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11225         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"
11226 }
11227
11228                         cf_library_path_list="$cf_library_path_list $cf_search"
11229                         ;;
11230                 esac
11231         done
11232 fi
11233
11234 cf_search=
11235
11236 test "x$prefix" != "xNONE" && \
11237 test -d "$prefix" && \
11238  {
11239         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11240         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11241         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11242         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11243         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11244         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11245 }
11246
11247 for cf_subdir_prefix in \
11248         /usr \
11249         /usr/local \
11250         /usr/pkg \
11251         /opt \
11252         /opt/local \
11253         $HOME
11254 do
11255
11256 test "x$cf_subdir_prefix" != "x$prefix" && \
11257 test -d "$cf_subdir_prefix" && \
11258 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11259         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11260         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11261         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11262         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11263         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11264         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"
11265 }
11266
11267 done
11268
11269 cf_search="$cf_library_path_list $cf_search"
11270
11271                         for cf_libdir in $cf_search
11272                         do
11273                                 echo "$as_me:11273: checking for -l$cf_nculib_root in $cf_libdir" >&5
11274 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11275                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11276                                 cat >"conftest.$ac_ext" <<_ACEOF
11277 #line 11277 "configure"
11278 #include "confdefs.h"
11279 #include <${cf_cv_ncurses_header:-curses.h}>
11280 int
11281 main (void)
11282 {
11283 initscr()
11284   ;
11285   return 0;
11286 }
11287 _ACEOF
11288 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11289 if { (eval echo "$as_me:11289: \"$ac_link\"") >&5
11290   (eval $ac_link) 2>&5
11291   ac_status=$?
11292   echo "$as_me:11292: \$? = $ac_status" >&5
11293   (exit "$ac_status"); } &&
11294          { ac_try='test -s "conftest$ac_exeext"'
11295   { (eval echo "$as_me:11295: \"$ac_try\"") >&5
11296   (eval $ac_try) 2>&5
11297   ac_status=$?
11298   echo "$as_me:11298: \$? = $ac_status" >&5
11299   (exit "$ac_status"); }; }; then
11300   echo "$as_me:11300: result: yes" >&5
11301 echo "${ECHO_T}yes" >&6
11302                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11303                                          break
11304 else
11305   echo "$as_me: failed program was:" >&5
11306 cat "conftest.$ac_ext" >&5
11307 echo "$as_me:11307: result: no" >&5
11308 echo "${ECHO_T}no" >&6
11309                                          LIBS="$cf_save_LIBS"
11310 fi
11311 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11312                         done
11313
11314 fi
11315 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11316
11317 fi
11318
11319 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11320
11321 if test "$cf_found_library" = no ; then
11322         { { echo "$as_me:11322: error: Cannot link $cf_nculib_root library" >&5
11323 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11324    { (exit 1); exit 1; }; }
11325 fi
11326
11327 fi
11328
11329 if test -n "$cf_ncurses_LIBS" ; then
11330         echo "$as_me:11330: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11331 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11332         cf_ncurses_SAVE="$LIBS"
11333         for p in $cf_ncurses_LIBS ; do
11334                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11335                 if test "$q" != "$LIBS" ; then
11336                         LIBS="$q"
11337                 fi
11338         done
11339         cat >"conftest.$ac_ext" <<_ACEOF
11340 #line 11340 "configure"
11341 #include "confdefs.h"
11342 #include <${cf_cv_ncurses_header:-curses.h}>
11343 int
11344 main (void)
11345 {
11346 initscr(); mousemask(0,0); tigetstr((char *)0);
11347   ;
11348   return 0;
11349 }
11350 _ACEOF
11351 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11352 if { (eval echo "$as_me:11352: \"$ac_link\"") >&5
11353   (eval $ac_link) 2>&5
11354   ac_status=$?
11355   echo "$as_me:11355: \$? = $ac_status" >&5
11356   (exit "$ac_status"); } &&
11357          { ac_try='test -s "conftest$ac_exeext"'
11358   { (eval echo "$as_me:11358: \"$ac_try\"") >&5
11359   (eval $ac_try) 2>&5
11360   ac_status=$?
11361   echo "$as_me:11361: \$? = $ac_status" >&5
11362   (exit "$ac_status"); }; }; then
11363   echo "$as_me:11363: result: yes" >&5
11364 echo "${ECHO_T}yes" >&6
11365 else
11366   echo "$as_me: failed program was:" >&5
11367 cat "conftest.$ac_ext" >&5
11368 echo "$as_me:11368: result: no" >&5
11369 echo "${ECHO_T}no" >&6
11370                  LIBS="$cf_ncurses_SAVE"
11371 fi
11372 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11373 fi
11374
11375 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11376
11377 cat >>confdefs.h <<EOF
11378 #define $cf_nculib_ROOT 1
11379 EOF
11380
11381         fi
11382 else
11383         NCURSES_CONFIG=none
11384 fi
11385
11386 fi
11387
11388 if test "$NCURSES_CONFIG_PKG" != none ; then
11389         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11390
11391         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11392         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11393         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11394
11395         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11396         if test -z "$cf_cv_abi_version"
11397         then
11398                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11399         fi
11400
11401 elif test "$NCURSES_CONFIG" != none ; then
11402
11403         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11404
11405         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11406         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11407         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11408
11409         # ABI version is not available from headers
11410         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11411
11412 else
11413
11414         for cf_name in MAJOR MINOR PATCH
11415         do
11416         cat >conftest.$ac_ext <<CF_EOF
11417         #include <${cf_cv_ncurses_header:-curses.h}>
11418         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11419 CF_EOF
11420                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11421                 { (eval echo "$as_me:11421: \"$cf_try\"") >&5
11422   (eval $cf_try) 2>&5
11423   ac_status=$?
11424   echo "$as_me:11424: \$? = $ac_status" >&5
11425   (exit "$ac_status"); }
11426                 if test -f conftest.out ; then
11427                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11428                         eval NCURSES_$cf_name=\"$cf_result\"
11429                         # cat conftest.$ac_ext
11430                         # cat conftest.out
11431                 fi
11432         done
11433
11434         cf_cv_abi_version=${NCURSES_MAJOR}
11435
11436 fi
11437
11438 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11439
11440 cf_cv_timestamp=`date`
11441
11442 echo "$as_me:11442: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11443 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11444
11445 echo "$as_me:11445: checking if you want to have a library-prefix" >&5
11446 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11447
11448 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11449 if test "${with_lib_prefix+set}" = set; then
11450   withval="$with_lib_prefix"
11451   with_lib_prefix=$withval
11452 else
11453   with_lib_prefix=auto
11454 fi;
11455 echo "$as_me:11455: result: $with_lib_prefix" >&5
11456 echo "${ECHO_T}$with_lib_prefix" >&6
11457
11458 if test "$with_lib_prefix" = auto
11459 then
11460
11461         case "$cf_cv_system_name" in
11462         (OS/2*|os2*)
11463                 if test "$DFT_LWR_MODEL" = libtool; then
11464                         LIB_PREFIX='lib'
11465                 else
11466                         LIB_PREFIX=''
11467                 fi
11468                 ;;
11469         (*-msvc*)
11470                 LIB_PREFIX=''
11471                 ;;
11472         (*)     LIB_PREFIX='lib'
11473                 ;;
11474         esac
11475 cf_prefix=$LIB_PREFIX
11476
11477 elif test "$with_lib_prefix" = no
11478 then
11479         LIB_PREFIX=
11480 else
11481         LIB_PREFIX=$with_lib_prefix
11482 fi
11483
11484 LIB_SUFFIX=
11485
11486 ###############################################################################
11487
11488 if test X"$CC_G_OPT" = X"" ; then
11489         CC_G_OPT='-g'
11490         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11491 fi
11492
11493 echo "$as_me:11493: checking for default loader flags" >&5
11494 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11495 case $DFT_LWR_MODEL in
11496 (normal)  LD_MODEL=''   ;;
11497 (debug)   LD_MODEL=$CC_G_OPT ;;
11498 (profile) LD_MODEL='-pg';;
11499 (shared)  LD_MODEL=''   ;;
11500 esac
11501 echo "$as_me:11501: result: $LD_MODEL" >&5
11502 echo "${ECHO_T}$LD_MODEL" >&6
11503
11504 LD_RPATH_OPT=
11505 if test "x$cf_cv_enable_rpath" != xno
11506 then
11507         echo "$as_me:11507: checking for an rpath option" >&5
11508 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11509         case "$cf_cv_system_name" in
11510         (irix*)
11511                 if test "$GCC" = yes; then
11512                         LD_RPATH_OPT="-Wl,-rpath,"
11513                 else
11514                         LD_RPATH_OPT="-rpath "
11515                 fi
11516                 ;;
11517         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11518                 LD_RPATH_OPT="-Wl,-rpath,"
11519                 ;;
11520         (openbsd[2-9].*|mirbsd*)
11521                 LD_RPATH_OPT="-Wl,-rpath,"
11522                 ;;
11523         (dragonfly*)
11524                 LD_RPATH_OPT="-rpath "
11525                 ;;
11526         (netbsd*)
11527                 LD_RPATH_OPT="-Wl,-rpath,"
11528                 ;;
11529         (osf*|mls+*)
11530                 LD_RPATH_OPT="-rpath "
11531                 ;;
11532         (solaris2*)
11533                 LD_RPATH_OPT="-R"
11534                 ;;
11535         (*)
11536                 ;;
11537         esac
11538         echo "$as_me:11538: result: $LD_RPATH_OPT" >&5
11539 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11540
11541         case "x$LD_RPATH_OPT" in
11542         (x-R*)
11543                 echo "$as_me:11543: checking if we need a space after rpath option" >&5
11544 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11545                 cf_save_LIBS="$LIBS"
11546
11547 cf_add_libs="$LIBS"
11548 # reverse order
11549 cf_add_0lib=
11550 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11551 # filter duplicates
11552 for cf_add_1lib in $cf_add_0lib; do
11553         for cf_add_2lib in $cf_add_libs; do
11554                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11555                         cf_add_1lib=
11556                         break
11557                 fi
11558         done
11559         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11560 done
11561 LIBS="$cf_add_libs"
11562
11563                 cat >"conftest.$ac_ext" <<_ACEOF
11564 #line 11564 "configure"
11565 #include "confdefs.h"
11566
11567 int
11568 main (void)
11569 {
11570
11571   ;
11572   return 0;
11573 }
11574 _ACEOF
11575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11576 if { (eval echo "$as_me:11576: \"$ac_link\"") >&5
11577   (eval $ac_link) 2>&5
11578   ac_status=$?
11579   echo "$as_me:11579: \$? = $ac_status" >&5
11580   (exit "$ac_status"); } &&
11581          { ac_try='test -s "conftest$ac_exeext"'
11582   { (eval echo "$as_me:11582: \"$ac_try\"") >&5
11583   (eval $ac_try) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit "$ac_status"); }; }; then
11587   cf_rpath_space=no
11588 else
11589   echo "$as_me: failed program was:" >&5
11590 cat "conftest.$ac_ext" >&5
11591 cf_rpath_space=yes
11592 fi
11593 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11594                 LIBS="$cf_save_LIBS"
11595                 echo "$as_me:11595: result: $cf_rpath_space" >&5
11596 echo "${ECHO_T}$cf_rpath_space" >&6
11597                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11598                 ;;
11599         esac
11600 fi
11601
11602         RM_SHARED_OPTS=
11603         LOCAL_LDFLAGS=
11604         LOCAL_LDFLAGS2=
11605         LD_SHARED_OPTS=
11606         INSTALL_LIB="-m 644"
11607         : ${rel_builddir:=.}
11608
11609         shlibdir=$libdir
11610
11611         MAKE_DLLS="#"
11612
11613         cf_cv_do_symlinks=no
11614         cf_ld_rpath_opt=
11615         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11616
11617         echo "$as_me:11617: checking if release/abi version should be used for shared libs" >&5
11618 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11619
11620 # Check whether --with-shlib-version or --without-shlib-version was given.
11621 if test "${with_shlib_version+set}" = set; then
11622   withval="$with_shlib_version"
11623   test -z "$withval" && withval=auto
11624         case "$withval" in
11625         (yes)
11626                 cf_cv_shlib_version=auto
11627                 ;;
11628         (rel|abi|auto)
11629                 cf_cv_shlib_version=$withval
11630                 ;;
11631         (*)
11632                 echo "$as_me:11632: result: $withval" >&5
11633 echo "${ECHO_T}$withval" >&6
11634                 { { echo "$as_me:11634: error: option value must be one of: rel, abi, or auto" >&5
11635 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11636    { (exit 1); exit 1; }; }
11637                 ;;
11638         esac
11639
11640 else
11641   cf_cv_shlib_version=auto
11642 fi;
11643         echo "$as_me:11643: result: $cf_cv_shlib_version" >&5
11644 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11645
11646         cf_cv_rm_so_locs=no
11647         cf_try_cflags=
11648
11649         # Some less-capable ports of gcc support only -fpic
11650         CC_SHARED_OPTS=
11651
11652         cf_try_fPIC=no
11653         if test "$GCC" = yes
11654         then
11655                 cf_try_fPIC=yes
11656         else
11657                 case "$cf_cv_system_name" in
11658                 (*linux*)       # e.g., PGI compiler
11659                         cf_try_fPIC=yes
11660                         ;;
11661                 esac
11662         fi
11663
11664         if test "$cf_try_fPIC" = yes
11665         then
11666                 echo "$as_me:11666: checking which $CC option to use" >&5
11667 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11668                 cf_save_CFLAGS="$CFLAGS"
11669                 for CC_SHARED_OPTS in -fPIC -fpic ''
11670                 do
11671                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11672                         cat >"conftest.$ac_ext" <<_ACEOF
11673 #line 11673 "configure"
11674 #include "confdefs.h"
11675 #include <stdio.h>
11676 int
11677 main (void)
11678 {
11679 int x = 1
11680   ;
11681   return 0;
11682 }
11683 _ACEOF
11684 rm -f "conftest.$ac_objext"
11685 if { (eval echo "$as_me:11685: \"$ac_compile\"") >&5
11686   (eval $ac_compile) 2>&5
11687   ac_status=$?
11688   echo "$as_me:11688: \$? = $ac_status" >&5
11689   (exit "$ac_status"); } &&
11690          { ac_try='test -s "conftest.$ac_objext"'
11691   { (eval echo "$as_me:11691: \"$ac_try\"") >&5
11692   (eval $ac_try) 2>&5
11693   ac_status=$?
11694   echo "$as_me:11694: \$? = $ac_status" >&5
11695   (exit "$ac_status"); }; }; then
11696   break
11697 else
11698   echo "$as_me: failed program was:" >&5
11699 cat "conftest.$ac_ext" >&5
11700 fi
11701 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11702                 done
11703                 echo "$as_me:11703: result: $CC_SHARED_OPTS" >&5
11704 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11705                 CFLAGS="$cf_save_CFLAGS"
11706         fi
11707
11708         cf_cv_shlib_version_infix=no
11709
11710         case "$cf_cv_system_name" in
11711         (aix4.3-9*|aix[5-7]*)
11712                 if test "$GCC" = yes; then
11713                         CC_SHARED_OPTS='-Wl,-brtl'
11714                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11715                 else
11716                         CC_SHARED_OPTS='-brtl'
11717                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11718                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11719                 fi
11720                 ;;
11721         (beos*)
11722                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11723                 ;;
11724         (cygwin*)
11725                 CC_SHARED_OPTS=
11726                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11727                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11728                 cf_cv_shlib_version=cygdll
11729                 cf_cv_shlib_version_infix=cygdll
11730                 shlibdir=$bindir
11731                 MAKE_DLLS=
11732                 cat >mk_shared_lib.sh <<-CF_EOF
11733                 #!$SHELL
11734                 SHARED_LIB=\$1
11735                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11736                 shift
11737                 cat <<-EOF
11738                 Linking shared library
11739                 ** SHARED_LIB \$SHARED_LIB
11740                 ** IMPORT_LIB \$IMPORT_LIB
11741 EOF
11742                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11743 CF_EOF
11744                 chmod +x mk_shared_lib.sh
11745                 ;;
11746         (msys*)
11747                 CC_SHARED_OPTS=
11748                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11749                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11750                 cf_cv_shlib_version=msysdll
11751                 cf_cv_shlib_version_infix=msysdll
11752                 shlibdir=$bindir
11753                 MAKE_DLLS=
11754                 cat >mk_shared_lib.sh <<-CF_EOF
11755                 #!$SHELL
11756                 SHARED_LIB=\$1
11757                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11758                 shift
11759                 cat <<-EOF
11760                 Linking shared library
11761                 ** SHARED_LIB \$SHARED_LIB
11762                 ** IMPORT_LIB \$IMPORT_LIB
11763 EOF
11764                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11765 CF_EOF
11766                 chmod +x mk_shared_lib.sh
11767                 ;;
11768         (darwin*)
11769                 cf_try_cflags="no-cpp-precomp"
11770                 CC_SHARED_OPTS="-dynamic"
11771                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11772                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11773                 cf_cv_shlib_version_infix=yes
11774                 echo "$as_me:11774: checking if ld -search_paths_first works" >&5
11775 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11776 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11777   echo $ECHO_N "(cached) $ECHO_C" >&6
11778 else
11779
11780                         cf_save_LDFLAGS=$LDFLAGS
11781                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11782                         cat >"conftest.$ac_ext" <<_ACEOF
11783 #line 11783 "configure"
11784 #include "confdefs.h"
11785
11786 int
11787 main (void)
11788 {
11789 int i;
11790   ;
11791   return 0;
11792 }
11793 _ACEOF
11794 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11795 if { (eval echo "$as_me:11795: \"$ac_link\"") >&5
11796   (eval $ac_link) 2>&5
11797   ac_status=$?
11798   echo "$as_me:11798: \$? = $ac_status" >&5
11799   (exit "$ac_status"); } &&
11800          { ac_try='test -s "conftest$ac_exeext"'
11801   { (eval echo "$as_me:11801: \"$ac_try\"") >&5
11802   (eval $ac_try) 2>&5
11803   ac_status=$?
11804   echo "$as_me:11804: \$? = $ac_status" >&5
11805   (exit "$ac_status"); }; }; then
11806   cf_cv_ldflags_search_paths_first=yes
11807 else
11808   echo "$as_me: failed program was:" >&5
11809 cat "conftest.$ac_ext" >&5
11810 cf_cv_ldflags_search_paths_first=no
11811 fi
11812 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11813                                 LDFLAGS=$cf_save_LDFLAGS
11814 fi
11815 echo "$as_me:11815: result: $cf_cv_ldflags_search_paths_first" >&5
11816 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11817                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11818                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11819                 fi
11820                 ;;
11821         (haiku*)
11822
11823         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11824         if test "$cf_cv_shlib_version" = rel; then
11825                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11826         else
11827                 cf_cv_shared_soname='`basename $@`'
11828         fi
11829
11830                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11831                 ;;
11832         (hpux[7-8]*)
11833                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11834                 if test "$GCC" != yes; then
11835                         CC_SHARED_OPTS='+Z'
11836                 fi
11837                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11838                 INSTALL_LIB="-m 555"
11839                 ;;
11840         (hpux*)
11841                 # (tested with gcc 2.7.2 -- I don't have c89)
11842                 if test "$GCC" = yes; then
11843                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11844                 else
11845                         CC_SHARED_OPTS='+Z'
11846                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11847                 fi
11848                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11849                 # HP-UX shared libraries must be executable, and should be
11850                 # readonly to exploit a quirk in the memory manager.
11851                 INSTALL_LIB="-m 555"
11852                 ;;
11853         (interix*)
11854                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11855                 if test "$cf_cv_shlib_version" = rel; then
11856                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11857                 else
11858                         cf_shared_soname='`basename $@`'
11859                 fi
11860                 CC_SHARED_OPTS=
11861                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11862                 ;;
11863         (irix*)
11864                 if test "$cf_cv_enable_rpath" = yes ; then
11865                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11866                 fi
11867                 # tested with IRIX 5.2 and 'cc'.
11868                 if test "$GCC" != yes; then
11869                         CC_SHARED_OPTS='-KPIC'
11870                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11871                 else
11872                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11873                 fi
11874                 cf_cv_rm_so_locs=yes
11875                 ;;
11876         (linux*|gnu*|k*bsd*-gnu)
11877                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11878                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11879                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11880                 fi
11881                 if test "$cf_cv_enable_rpath" = yes ; then
11882                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11883                 fi
11884
11885         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11886         if test "$cf_cv_shlib_version" = rel; then
11887                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11888         else
11889                 cf_cv_shared_soname='`basename $@`'
11890         fi
11891
11892                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11893                 ;;
11894         (mingw*msvc*)
11895                 cf_cv_shlib_version=msvcdll
11896                 cf_cv_shlib_version_infix=msvcdll
11897                 shlibdir=$bindir
11898                 MAKE_DLLS=
11899                 if test "$DFT_LWR_MODEL" = "shared" ; then
11900                         LOCAL_LDFLAGS="-link -dll"
11901                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11902                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11903                 fi
11904                 CC_SHARED_OPTS=
11905                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11906                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11907                 cat >mk_shared_lib.sh <<-CF_EOF
11908                 #!$SHELL
11909                 SHARED_LIB=\$1
11910                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11911                 shift
11912                 my_ld=\$1
11913                 shift
11914                 cat <<-EOF
11915                 Linking shared library
11916                 ** SHARED LIB \$SHARED_LIB
11917                 ** IMPORT_LIB \$IMPORT_LIB
11918 EOF
11919                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11920                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11921                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11922 CF_EOF
11923                 chmod +x mk_shared_lib.sh
11924                 cat >mk_prog.sh <<-CF_EOF
11925                 #!$SHELL
11926                 shift
11927                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11928                 LD="$LD"
11929                 clopts=()
11930                 ldopts=("/subsystem:console")
11931                 libs=()
11932                 isdll=0
11933                 while test \$# -gt 0; do
11934                         case "\$1" in
11935                                 -link)
11936                                         # ignore -link argument
11937                                         ;;
11938                                 -M[TD] | -M[TD]d)
11939                                         # ignore runtime-library option
11940                                         ;;
11941                                 -dll)
11942                                         isdll=1
11943                                         ;;
11944                                 -W* | -w*)
11945                                         # ignore warnings
11946                                         ;;
11947                                 -D*)
11948                                         clopts+=("\$1")
11949                                         ;;
11950                                 -I*)
11951                                         clopts+=("\$1")
11952                                         ;;
11953                                 -l*)
11954                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11955                                         ;;
11956                                 -L*)
11957                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11958                                         ;;
11959                                 *.obj | *.o)
11960                                         ldopts+=("\$1")
11961                                         ;;
11962                                 -Wl,*)
11963                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11964                                                 ldopts+=("\${linkarg}")
11965                                         done
11966                                         ;;
11967                                 *.lib)
11968                                         ldopts+=("\$1")
11969                                         ;;
11970                                 -o)
11971                                         shift
11972                                         ldopts+=("-out:\$1")
11973                                         ;;
11974                                 *)
11975                                         clopts+=("\$1")
11976                                         ldopts+=("\$1")
11977                                         ;;
11978                         esac
11979                         shift
11980                 done
11981                 if [ "\$isdll" -ne 0 ]; then
11982                         for lib in \${libs[*]}; do
11983                                 ldopts+=("\$lib.dll.lib")
11984                         done
11985                 else
11986                         for lib in \${libs[*]}; do
11987                                 ldopts+=("\$lib.lib")
11988                         done
11989                 fi
11990                 cat <<-EOF
11991                 Creating program
11992                 ** ld options:   "\${ldopts[@]}"
11993 EOF
11994                 exec \$LD \${ldopts[@]}
11995 CF_EOF
11996                 chmod +x mk_prog.sh
11997                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11998                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11999                 ;;
12000         (mingw*)
12001                 cf_cv_shlib_version=mingw
12002                 cf_cv_shlib_version_infix=mingw
12003                 shlibdir=$bindir
12004                 MAKE_DLLS=
12005                 if test "$DFT_LWR_MODEL" = "shared" ; then
12006                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12007                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12008                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12009                 fi
12010                 CC_SHARED_OPTS=
12011                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12012                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12013                 cat >mk_shared_lib.sh <<-CF_EOF
12014                 #!$SHELL
12015                 SHARED_LIB=\$1
12016                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12017                 shift
12018                 cat <<-EOF
12019                 Linking shared library
12020                 ** SHARED_LIB \$SHARED_LIB
12021                 ** IMPORT_LIB \$IMPORT_LIB
12022 EOF
12023                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12024 CF_EOF
12025                 chmod +x mk_shared_lib.sh
12026                 ;;
12027         (openbsd[2-9].*|mirbsd*)
12028                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12029                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12030                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12031                 fi
12032                 if test "$cf_cv_enable_rpath" = yes ; then
12033                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12034                 fi
12035                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12036
12037         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12038         if test "$cf_cv_shlib_version" = rel; then
12039                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12040         else
12041                 cf_cv_shared_soname='`basename $@`'
12042         fi
12043
12044                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12045                 ;;
12046         (nskJ*)
12047                 CC_SHARED_OPTS=
12048                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12049                 ;;
12050         (nskL*)
12051                 CC_SHARED_OPTS=
12052                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12053                 ;;
12054         (nto-qnx*|openbsd*|freebsd[12].*)
12055                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12056                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12057                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12058                 ;;
12059         (dragonfly*|freebsd*)
12060                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12061                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12062                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12063                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12064                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12065                 fi
12066
12067         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12068         if test "$cf_cv_shlib_version" = rel; then
12069                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12070         else
12071                 cf_cv_shared_soname='`basename $@`'
12072         fi
12073
12074                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12075                 ;;
12076         (netbsd*)
12077                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12078                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12079                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12080                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12081                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12082                         if test "$cf_cv_shlib_version" = auto; then
12083                         if test -f /usr/libexec/ld.elf_so; then
12084                                 cf_cv_shlib_version=abi
12085                         else
12086                                 cf_cv_shlib_version=rel
12087                         fi
12088                         fi
12089
12090         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12091         if test "$cf_cv_shlib_version" = rel; then
12092                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12093         else
12094                 cf_cv_shared_soname='`basename $@`'
12095         fi
12096
12097                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12098                 else
12099                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12100                 fi
12101                 ;;
12102         (osf*|mls+*)
12103                 # tested with OSF/1 V3.2 and 'cc'
12104                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12105                 # link with shared libs).
12106                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12107                 case "$host_os" in
12108                 (osf4*)
12109                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12110                         ;;
12111                 esac
12112                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12113                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12114                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12115                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12116                 fi
12117                 cf_cv_rm_so_locs=yes
12118                 ;;
12119         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12120                 # tested with osr5.0.5
12121                 if test "$GCC" != yes; then
12122                         CC_SHARED_OPTS='-belf -KPIC'
12123                 fi
12124                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12125                 if test "$cf_cv_enable_rpath" = yes ; then
12126                         # only way is to set LD_RUN_PATH but no switch for it
12127                         RUN_PATH=$libdir
12128                 fi
12129                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12130                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12131                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12132                 ;;
12133         (sunos4*)
12134                 # tested with SunOS 4.1.1 and gcc 2.7.0
12135                 if test "$GCC" != yes; then
12136                         CC_SHARED_OPTS='-KPIC'
12137                 fi
12138                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12139                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12140                 ;;
12141         (solaris2*)
12142                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12143                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12144                 if test "$DFT_LWR_MODEL" = "shared" ; then
12145                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12146                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12147                 fi
12148                 if test "$cf_cv_enable_rpath" = yes ; then
12149                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12150                 fi
12151
12152         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12153         if test "$cf_cv_shlib_version" = rel; then
12154                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12155         else
12156                 cf_cv_shared_soname='`basename $@`'
12157         fi
12158
12159                 if test "$GCC" != yes; then
12160                         cf_save_CFLAGS="$CFLAGS"
12161                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12162                         do
12163                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12164                                 cat >"conftest.$ac_ext" <<_ACEOF
12165 #line 12165 "configure"
12166 #include "confdefs.h"
12167 #include <stdio.h>
12168 int
12169 main (void)
12170 {
12171 printf("Hello\\n");
12172   ;
12173   return 0;
12174 }
12175 _ACEOF
12176 rm -f "conftest.$ac_objext"
12177 if { (eval echo "$as_me:12177: \"$ac_compile\"") >&5
12178   (eval $ac_compile) 2>&5
12179   ac_status=$?
12180   echo "$as_me:12180: \$? = $ac_status" >&5
12181   (exit "$ac_status"); } &&
12182          { ac_try='test -s "conftest.$ac_objext"'
12183   { (eval echo "$as_me:12183: \"$ac_try\"") >&5
12184   (eval $ac_try) 2>&5
12185   ac_status=$?
12186   echo "$as_me:12186: \$? = $ac_status" >&5
12187   (exit "$ac_status"); }; }; then
12188   break
12189 else
12190   echo "$as_me: failed program was:" >&5
12191 cat "conftest.$ac_ext" >&5
12192 fi
12193 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12194                         done
12195                         CFLAGS="$cf_save_CFLAGS"
12196                         CC_SHARED_OPTS=$cf_shared_opts
12197                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12198                 else
12199                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12200                 fi
12201                 ;;
12202         (sysv5uw7*|unix_sv*)
12203                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12204                 if test "$GCC" != yes; then
12205                         CC_SHARED_OPTS='-KPIC'
12206                 fi
12207                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12208                 ;;
12209         (*)
12210                 CC_SHARED_OPTS='unknown'
12211                 MK_SHARED_LIB='echo unknown'
12212                 ;;
12213         esac
12214
12215         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12216         case "$cf_cv_shlib_version" in
12217         (rel|abi)
12218                 case "$MK_SHARED_LIB" in
12219                 (*'-o $@')
12220                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12221                         ;;
12222                 (*)
12223                         { echo "$as_me:12223: WARNING: ignored --with-shlib-version" >&5
12224 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12225                         ;;
12226                 esac
12227                 ;;
12228         esac
12229
12230         if test -n "$cf_try_cflags"
12231         then
12232 cat > conftest.$ac_ext <<EOF
12233 #line 12233 "${as_me:-configure}"
12234 #include <stdio.h>
12235 int main(int argc, char *argv[])
12236 {
12237         printf("hello\\n");
12238         return (argv[argc-1] == 0) ;
12239 }
12240 EOF
12241                 cf_save_CFLAGS="$CFLAGS"
12242                 for cf_opt in $cf_try_cflags
12243                 do
12244                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12245                         echo "$as_me:12245: checking if CFLAGS option -$cf_opt works" >&5
12246 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12247                         if { (eval echo "$as_me:12247: \"$ac_compile\"") >&5
12248   (eval $ac_compile) 2>&5
12249   ac_status=$?
12250   echo "$as_me:12250: \$? = $ac_status" >&5
12251   (exit "$ac_status"); }; then
12252                                 echo "$as_me:12252: result: yes" >&5
12253 echo "${ECHO_T}yes" >&6
12254                                 cf_save_CFLAGS="$CFLAGS"
12255                         else
12256                                 echo "$as_me:12256: result: no" >&5
12257 echo "${ECHO_T}no" >&6
12258                         fi
12259                 done
12260                 CFLAGS="$cf_save_CFLAGS"
12261         fi
12262
12263         # RPATH_LIST is a colon-separated list of directories
12264         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12265         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12266
12267         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12268
12269         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12270
12271 echo "${as_me:-configure}:12271: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12272
12273         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12274
12275 echo "${as_me:-configure}:12275: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12276
12277 # The test/sample programs in the original tree link using rpath option.
12278 # Make it optional for packagers.
12279 if test -n "$LOCAL_LDFLAGS"
12280 then
12281         echo "$as_me:12281: checking if you want to link sample programs with rpath option" >&5
12282 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12283
12284 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12285 if test "${enable_rpath_link+set}" = set; then
12286   enableval="$enable_rpath_link"
12287   with_rpath_link=$enableval
12288 else
12289   with_rpath_link=yes
12290 fi;
12291         echo "$as_me:12291: result: $with_rpath_link" >&5
12292 echo "${ECHO_T}$with_rpath_link" >&6
12293         if test "$with_rpath_link" = no
12294         then
12295                 LOCAL_LDFLAGS=
12296                 LOCAL_LDFLAGS2=
12297         fi
12298 fi
12299
12300 ###############################################################################
12301
12302 ###   use option --enable-broken-linker to force on use of broken-linker support
12303
12304 echo "$as_me:12304: checking if you want broken-linker support code" >&5
12305 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12306
12307 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12308 if test "${enable_broken_linker+set}" = set; then
12309   enableval="$enable_broken_linker"
12310   with_broken_linker=$enableval
12311 else
12312   with_broken_linker=no
12313 fi;
12314 echo "$as_me:12314: result: $with_broken_linker" >&5
12315 echo "${ECHO_T}$with_broken_linker" >&6
12316
12317 : "${BROKEN_LINKER:=0}"
12318 if test "x$with_broken_linker" = xyes ; then
12319
12320 cat >>confdefs.h <<\EOF
12321 #define BROKEN_LINKER 1
12322 EOF
12323
12324         BROKEN_LINKER=1
12325 fi
12326
12327 # Check to define _XOPEN_SOURCE "automatically"
12328
12329 echo "$as_me:12329: checking if the POSIX test-macros are already defined" >&5
12330 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12331 if test "${cf_cv_posix_visible+set}" = set; then
12332   echo $ECHO_N "(cached) $ECHO_C" >&6
12333 else
12334
12335 cat >"conftest.$ac_ext" <<_ACEOF
12336 #line 12336 "configure"
12337 #include "confdefs.h"
12338 #include <stdio.h>
12339 int
12340 main (void)
12341 {
12342
12343 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12344         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12345         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12346         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12347 #error conflicting symbols found
12348 #endif
12349
12350   ;
12351   return 0;
12352 }
12353 _ACEOF
12354 rm -f "conftest.$ac_objext"
12355 if { (eval echo "$as_me:12355: \"$ac_compile\"") >&5
12356   (eval $ac_compile) 2>&5
12357   ac_status=$?
12358   echo "$as_me:12358: \$? = $ac_status" >&5
12359   (exit "$ac_status"); } &&
12360          { ac_try='test -s "conftest.$ac_objext"'
12361   { (eval echo "$as_me:12361: \"$ac_try\"") >&5
12362   (eval $ac_try) 2>&5
12363   ac_status=$?
12364   echo "$as_me:12364: \$? = $ac_status" >&5
12365   (exit "$ac_status"); }; }; then
12366   cf_cv_posix_visible=no
12367 else
12368   echo "$as_me: failed program was:" >&5
12369 cat "conftest.$ac_ext" >&5
12370 cf_cv_posix_visible=yes
12371 fi
12372 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12373
12374 fi
12375 echo "$as_me:12375: result: $cf_cv_posix_visible" >&5
12376 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12377
12378 if test "$cf_cv_posix_visible" = no; then
12379
12380 cf_XOPEN_SOURCE=600
12381 cf_POSIX_C_SOURCE=199506L
12382 cf_xopen_source=
12383
12384 case "$host_os" in
12385 (aix[4-7]*)
12386         cf_xopen_source="-D_ALL_SOURCE"
12387         ;;
12388 (msys)
12389         cf_XOPEN_SOURCE=600
12390         ;;
12391 (darwin[0-8].*)
12392         cf_xopen_source="-D_APPLE_C_SOURCE"
12393         ;;
12394 (darwin*)
12395         cf_xopen_source="-D_DARWIN_C_SOURCE"
12396         cf_XOPEN_SOURCE=
12397         ;;
12398 (freebsd*|dragonfly*|midnightbsd*)
12399         # 5.x headers associate
12400         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12401         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12402         cf_POSIX_C_SOURCE=200112L
12403         cf_XOPEN_SOURCE=600
12404         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12405         ;;
12406 (hpux11*)
12407         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12408         ;;
12409 (hpux*)
12410         cf_xopen_source="-D_HPUX_SOURCE"
12411         ;;
12412 (irix[56].*)
12413         cf_xopen_source="-D_SGI_SOURCE"
12414         cf_XOPEN_SOURCE=
12415         ;;
12416 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12417
12418 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12419
12420 echo "$as_me:12420: checking if this is the GNU C library" >&5
12421 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12422 if test "${cf_cv_gnu_library+set}" = set; then
12423   echo $ECHO_N "(cached) $ECHO_C" >&6
12424 else
12425
12426 cat >"conftest.$ac_ext" <<_ACEOF
12427 #line 12427 "configure"
12428 #include "confdefs.h"
12429 #include <sys/types.h>
12430 int
12431 main (void)
12432 {
12433
12434         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12435                 return 0;
12436         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12437                 return 0;
12438         #else
12439         #       error not GNU C library
12440         #endif
12441   ;
12442   return 0;
12443 }
12444 _ACEOF
12445 rm -f "conftest.$ac_objext"
12446 if { (eval echo "$as_me:12446: \"$ac_compile\"") >&5
12447   (eval $ac_compile) 2>&5
12448   ac_status=$?
12449   echo "$as_me:12449: \$? = $ac_status" >&5
12450   (exit "$ac_status"); } &&
12451          { ac_try='test -s "conftest.$ac_objext"'
12452   { (eval echo "$as_me:12452: \"$ac_try\"") >&5
12453   (eval $ac_try) 2>&5
12454   ac_status=$?
12455   echo "$as_me:12455: \$? = $ac_status" >&5
12456   (exit "$ac_status"); }; }; then
12457   cf_cv_gnu_library=yes
12458 else
12459   echo "$as_me: failed program was:" >&5
12460 cat "conftest.$ac_ext" >&5
12461 cf_cv_gnu_library=no
12462 fi
12463 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12464
12465 fi
12466 echo "$as_me:12466: result: $cf_cv_gnu_library" >&5
12467 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12468
12469 if test x$cf_cv_gnu_library = xyes; then
12470
12471         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12472         # was changed to help a little.  newlib incorporated the change about 4
12473         # years later.
12474         echo "$as_me:12474: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12475 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12476 if test "${cf_cv_gnu_library_219+set}" = set; then
12477   echo $ECHO_N "(cached) $ECHO_C" >&6
12478 else
12479
12480                 cf_save="$CPPFLAGS"
12481
12482         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12483         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12484
12485                 cat >"conftest.$ac_ext" <<_ACEOF
12486 #line 12486 "configure"
12487 #include "confdefs.h"
12488 #include <sys/types.h>
12489 int
12490 main (void)
12491 {
12492
12493                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12494                                 return 0;
12495                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12496                                 return 0;
12497                         #else
12498                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12499                         #endif
12500   ;
12501   return 0;
12502 }
12503 _ACEOF
12504 rm -f "conftest.$ac_objext"
12505 if { (eval echo "$as_me:12505: \"$ac_compile\"") >&5
12506   (eval $ac_compile) 2>&5
12507   ac_status=$?
12508   echo "$as_me:12508: \$? = $ac_status" >&5
12509   (exit "$ac_status"); } &&
12510          { ac_try='test -s "conftest.$ac_objext"'
12511   { (eval echo "$as_me:12511: \"$ac_try\"") >&5
12512   (eval $ac_try) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit "$ac_status"); }; }; then
12516   cf_cv_gnu_library_219=yes
12517 else
12518   echo "$as_me: failed program was:" >&5
12519 cat "conftest.$ac_ext" >&5
12520 cf_cv_gnu_library_219=no
12521 fi
12522 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12523                 CPPFLAGS="$cf_save"
12524
12525 fi
12526 echo "$as_me:12526: result: $cf_cv_gnu_library_219" >&5
12527 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12528
12529         if test "x$cf_cv_gnu_library_219" = xyes; then
12530                 cf_save="$CPPFLAGS"
12531                 echo "$as_me:12531: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12532 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12533 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12534   echo $ECHO_N "(cached) $ECHO_C" >&6
12535 else
12536
12537 cf_fix_cppflags=no
12538 cf_new_cflags=
12539 cf_new_cppflags=
12540 cf_new_extra_cppflags=
12541
12542 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12543 do
12544 case "$cf_fix_cppflags" in
12545 (no)
12546         case "$cf_add_cflags" in
12547         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12548                 case "$cf_add_cflags" in
12549                 (-D*)
12550                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12551
12552                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12553                                 && test -z "${cf_tst_cflags}" \
12554                                 && cf_fix_cppflags=yes
12555
12556                         if test "$cf_fix_cppflags" = yes ; then
12557
12558         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12559         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12560
12561                                 continue
12562                         elif test "${cf_tst_cflags}" = "\"'" ; then
12563
12564         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12565         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12566
12567                                 continue
12568                         fi
12569                         ;;
12570                 esac
12571                 case "$CPPFLAGS" in
12572                 (*$cf_add_cflags)
12573                         ;;
12574                 (*)
12575                         case "$cf_add_cflags" in
12576                         (-D*)
12577                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12578
12579 CPPFLAGS=`echo "$CPPFLAGS" | \
12580         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12581                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12582
12583                                 ;;
12584                         esac
12585
12586         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12587         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12588
12589                         ;;
12590                 esac
12591                 ;;
12592         (*)
12593
12594         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12595         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12596
12597                 ;;
12598         esac
12599         ;;
12600 (yes)
12601
12602         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12603         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12604
12605         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12606
12607         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12608                 && test -z "${cf_tst_cflags}" \
12609                 && cf_fix_cppflags=no
12610         ;;
12611 esac
12612 done
12613
12614 if test -n "$cf_new_cflags" ; then
12615
12616         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12617         CFLAGS="${CFLAGS}$cf_new_cflags"
12618
12619 fi
12620
12621 if test -n "$cf_new_cppflags" ; then
12622
12623         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12624         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12625
12626 fi
12627
12628 if test -n "$cf_new_extra_cppflags" ; then
12629
12630         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12631         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12632
12633 fi
12634
12635                         cat >"conftest.$ac_ext" <<_ACEOF
12636 #line 12636 "configure"
12637 #include "confdefs.h"
12638
12639                                 #include <limits.h>
12640                                 #include <sys/types.h>
12641
12642 int
12643 main (void)
12644 {
12645
12646                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12647                                         return 0;
12648                                 #else
12649                                 #       error GNU C library is too old
12650                                 #endif
12651   ;
12652   return 0;
12653 }
12654 _ACEOF
12655 rm -f "conftest.$ac_objext"
12656 if { (eval echo "$as_me:12656: \"$ac_compile\"") >&5
12657   (eval $ac_compile) 2>&5
12658   ac_status=$?
12659   echo "$as_me:12659: \$? = $ac_status" >&5
12660   (exit "$ac_status"); } &&
12661          { ac_try='test -s "conftest.$ac_objext"'
12662   { (eval echo "$as_me:12662: \"$ac_try\"") >&5
12663   (eval $ac_try) 2>&5
12664   ac_status=$?
12665   echo "$as_me:12665: \$? = $ac_status" >&5
12666   (exit "$ac_status"); }; }; then
12667   cf_cv_gnu_dftsrc_219=yes
12668 else
12669   echo "$as_me: failed program was:" >&5
12670 cat "conftest.$ac_ext" >&5
12671 cf_cv_gnu_dftsrc_219=no
12672 fi
12673 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12674
12675 fi
12676 echo "$as_me:12676: result: $cf_cv_gnu_dftsrc_219" >&5
12677 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12678                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12679         else
12680                 cf_cv_gnu_dftsrc_219=maybe
12681         fi
12682
12683         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12684
12685                 echo "$as_me:12685: checking if we must define _GNU_SOURCE" >&5
12686 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12687 if test "${cf_cv_gnu_source+set}" = set; then
12688   echo $ECHO_N "(cached) $ECHO_C" >&6
12689 else
12690
12691                 cat >"conftest.$ac_ext" <<_ACEOF
12692 #line 12692 "configure"
12693 #include "confdefs.h"
12694 #include <sys/types.h>
12695 int
12696 main (void)
12697 {
12698
12699                         #ifndef _XOPEN_SOURCE
12700                         #error  expected _XOPEN_SOURCE to be defined
12701                         #endif
12702   ;
12703   return 0;
12704 }
12705 _ACEOF
12706 rm -f "conftest.$ac_objext"
12707 if { (eval echo "$as_me:12707: \"$ac_compile\"") >&5
12708   (eval $ac_compile) 2>&5
12709   ac_status=$?
12710   echo "$as_me:12710: \$? = $ac_status" >&5
12711   (exit "$ac_status"); } &&
12712          { ac_try='test -s "conftest.$ac_objext"'
12713   { (eval echo "$as_me:12713: \"$ac_try\"") >&5
12714   (eval $ac_try) 2>&5
12715   ac_status=$?
12716   echo "$as_me:12716: \$? = $ac_status" >&5
12717   (exit "$ac_status"); }; }; then
12718   cf_cv_gnu_source=no
12719 else
12720   echo "$as_me: failed program was:" >&5
12721 cat "conftest.$ac_ext" >&5
12722 cf_save="$CPPFLAGS"
12723
12724 cf_fix_cppflags=no
12725 cf_new_cflags=
12726 cf_new_cppflags=
12727 cf_new_extra_cppflags=
12728
12729 for cf_add_cflags in -D_GNU_SOURCE
12730 do
12731 case "$cf_fix_cppflags" in
12732 (no)
12733         case "$cf_add_cflags" in
12734         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12735                 case "$cf_add_cflags" in
12736                 (-D*)
12737                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12738
12739                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12740                                 && test -z "${cf_tst_cflags}" \
12741                                 && cf_fix_cppflags=yes
12742
12743                         if test "$cf_fix_cppflags" = yes ; then
12744
12745         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12746         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12747
12748                                 continue
12749                         elif test "${cf_tst_cflags}" = "\"'" ; then
12750
12751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12753
12754                                 continue
12755                         fi
12756                         ;;
12757                 esac
12758                 case "$CPPFLAGS" in
12759                 (*$cf_add_cflags)
12760                         ;;
12761                 (*)
12762                         case "$cf_add_cflags" in
12763                         (-D*)
12764                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12765
12766 CPPFLAGS=`echo "$CPPFLAGS" | \
12767         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12768                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12769
12770                                 ;;
12771                         esac
12772
12773         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12774         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12775
12776                         ;;
12777                 esac
12778                 ;;
12779         (*)
12780
12781         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12782         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12783
12784                 ;;
12785         esac
12786         ;;
12787 (yes)
12788
12789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12791
12792         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12793
12794         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12795                 && test -z "${cf_tst_cflags}" \
12796                 && cf_fix_cppflags=no
12797         ;;
12798 esac
12799 done
12800
12801 if test -n "$cf_new_cflags" ; then
12802
12803         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12804         CFLAGS="${CFLAGS}$cf_new_cflags"
12805
12806 fi
12807
12808 if test -n "$cf_new_cppflags" ; then
12809
12810         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12811         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12812
12813 fi
12814
12815 if test -n "$cf_new_extra_cppflags" ; then
12816
12817         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12818         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12819
12820 fi
12821
12822                          cat >"conftest.$ac_ext" <<_ACEOF
12823 #line 12823 "configure"
12824 #include "confdefs.h"
12825 #include <sys/types.h>
12826 int
12827 main (void)
12828 {
12829
12830                                 #ifdef _XOPEN_SOURCE
12831                                 #error  expected _XOPEN_SOURCE to be undefined
12832                                 #endif
12833   ;
12834   return 0;
12835 }
12836 _ACEOF
12837 rm -f "conftest.$ac_objext"
12838 if { (eval echo "$as_me:12838: \"$ac_compile\"") >&5
12839   (eval $ac_compile) 2>&5
12840   ac_status=$?
12841   echo "$as_me:12841: \$? = $ac_status" >&5
12842   (exit "$ac_status"); } &&
12843          { ac_try='test -s "conftest.$ac_objext"'
12844   { (eval echo "$as_me:12844: \"$ac_try\"") >&5
12845   (eval $ac_try) 2>&5
12846   ac_status=$?
12847   echo "$as_me:12847: \$? = $ac_status" >&5
12848   (exit "$ac_status"); }; }; then
12849   cf_cv_gnu_source=no
12850 else
12851   echo "$as_me: failed program was:" >&5
12852 cat "conftest.$ac_ext" >&5
12853 cf_cv_gnu_source=yes
12854 fi
12855 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12856                         CPPFLAGS="$cf_save"
12857
12858 fi
12859 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12860
12861 fi
12862 echo "$as_me:12862: result: $cf_cv_gnu_source" >&5
12863 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12864
12865                 if test "$cf_cv_gnu_source" = yes
12866                 then
12867                 echo "$as_me:12867: checking if we should also define _DEFAULT_SOURCE" >&5
12868 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12869 if test "${cf_cv_default_source+set}" = set; then
12870   echo $ECHO_N "(cached) $ECHO_C" >&6
12871 else
12872
12873         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12874         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12875
12876                         cat >"conftest.$ac_ext" <<_ACEOF
12877 #line 12877 "configure"
12878 #include "confdefs.h"
12879 #include <sys/types.h>
12880 int
12881 main (void)
12882 {
12883
12884                                 #ifdef _DEFAULT_SOURCE
12885                                 #error  expected _DEFAULT_SOURCE to be undefined
12886                                 #endif
12887   ;
12888   return 0;
12889 }
12890 _ACEOF
12891 rm -f "conftest.$ac_objext"
12892 if { (eval echo "$as_me:12892: \"$ac_compile\"") >&5
12893   (eval $ac_compile) 2>&5
12894   ac_status=$?
12895   echo "$as_me:12895: \$? = $ac_status" >&5
12896   (exit "$ac_status"); } &&
12897          { ac_try='test -s "conftest.$ac_objext"'
12898   { (eval echo "$as_me:12898: \"$ac_try\"") >&5
12899   (eval $ac_try) 2>&5
12900   ac_status=$?
12901   echo "$as_me:12901: \$? = $ac_status" >&5
12902   (exit "$ac_status"); }; }; then
12903   cf_cv_default_source=no
12904 else
12905   echo "$as_me: failed program was:" >&5
12906 cat "conftest.$ac_ext" >&5
12907 cf_cv_default_source=yes
12908 fi
12909 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12910
12911 fi
12912 echo "$as_me:12912: result: $cf_cv_default_source" >&5
12913 echo "${ECHO_T}$cf_cv_default_source" >&6
12914                         if test "$cf_cv_default_source" = yes
12915                         then
12916
12917         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12918         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12919
12920                         fi
12921                 fi
12922         fi
12923
12924 fi
12925
12926         ;;
12927 (minix*)
12928         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12929         ;;
12930 (mirbsd*)
12931         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12932         cf_XOPEN_SOURCE=
12933
12934 if test "$cf_cv_posix_visible" = no; then
12935
12936 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12937
12938 cf_save_CFLAGS="$CFLAGS"
12939 cf_save_CPPFLAGS="$CPPFLAGS"
12940
12941 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12942         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12943                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12944
12945 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12946         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12947                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12948
12949 echo "$as_me:12949: checking if we should define _POSIX_C_SOURCE" >&5
12950 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12951 if test "${cf_cv_posix_c_source+set}" = set; then
12952   echo $ECHO_N "(cached) $ECHO_C" >&6
12953 else
12954
12955 echo "${as_me:-configure}:12955: testing if the symbol is already defined go no further ..." 1>&5
12956
12957         cat >"conftest.$ac_ext" <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960 #include <sys/types.h>
12961 int
12962 main (void)
12963 {
12964
12965 #ifndef _POSIX_C_SOURCE
12966 make an error
12967 #endif
12968   ;
12969   return 0;
12970 }
12971 _ACEOF
12972 rm -f "conftest.$ac_objext"
12973 if { (eval echo "$as_me:12973: \"$ac_compile\"") >&5
12974   (eval $ac_compile) 2>&5
12975   ac_status=$?
12976   echo "$as_me:12976: \$? = $ac_status" >&5
12977   (exit "$ac_status"); } &&
12978          { ac_try='test -s "conftest.$ac_objext"'
12979   { (eval echo "$as_me:12979: \"$ac_try\"") >&5
12980   (eval $ac_try) 2>&5
12981   ac_status=$?
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit "$ac_status"); }; }; then
12984   cf_cv_posix_c_source=no
12985 else
12986   echo "$as_me: failed program was:" >&5
12987 cat "conftest.$ac_ext" >&5
12988 cf_want_posix_source=no
12989          case .$cf_POSIX_C_SOURCE in
12990          (.[12]??*)
12991                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12992                 ;;
12993          (.2)
12994                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12995                 cf_want_posix_source=yes
12996                 ;;
12997          (.*)
12998                 cf_want_posix_source=yes
12999                 ;;
13000          esac
13001          if test "$cf_want_posix_source" = yes ; then
13002                 cat >"conftest.$ac_ext" <<_ACEOF
13003 #line 13003 "configure"
13004 #include "confdefs.h"
13005 #include <sys/types.h>
13006 int
13007 main (void)
13008 {
13009
13010 #ifdef _POSIX_SOURCE
13011 make an error
13012 #endif
13013   ;
13014   return 0;
13015 }
13016 _ACEOF
13017 rm -f "conftest.$ac_objext"
13018 if { (eval echo "$as_me:13018: \"$ac_compile\"") >&5
13019   (eval $ac_compile) 2>&5
13020   ac_status=$?
13021   echo "$as_me:13021: \$? = $ac_status" >&5
13022   (exit "$ac_status"); } &&
13023          { ac_try='test -s "conftest.$ac_objext"'
13024   { (eval echo "$as_me:13024: \"$ac_try\"") >&5
13025   (eval $ac_try) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit "$ac_status"); }; }; then
13029   :
13030 else
13031   echo "$as_me: failed program was:" >&5
13032 cat "conftest.$ac_ext" >&5
13033 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13034 fi
13035 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13036          fi
13037
13038 echo "${as_me:-configure}:13038: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13039
13040          CFLAGS="$cf_trim_CFLAGS"
13041          CPPFLAGS="$cf_trim_CPPFLAGS"
13042
13043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13044         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13045
13046 echo "${as_me:-configure}:13046: testing if the second compile does not leave our definition intact error ..." 1>&5
13047
13048          cat >"conftest.$ac_ext" <<_ACEOF
13049 #line 13049 "configure"
13050 #include "confdefs.h"
13051 #include <sys/types.h>
13052 int
13053 main (void)
13054 {
13055
13056 #ifndef _POSIX_C_SOURCE
13057 make an error
13058 #endif
13059   ;
13060   return 0;
13061 }
13062 _ACEOF
13063 rm -f "conftest.$ac_objext"
13064 if { (eval echo "$as_me:13064: \"$ac_compile\"") >&5
13065   (eval $ac_compile) 2>&5
13066   ac_status=$?
13067   echo "$as_me:13067: \$? = $ac_status" >&5
13068   (exit "$ac_status"); } &&
13069          { ac_try='test -s "conftest.$ac_objext"'
13070   { (eval echo "$as_me:13070: \"$ac_try\"") >&5
13071   (eval $ac_try) 2>&5
13072   ac_status=$?
13073   echo "$as_me:13073: \$? = $ac_status" >&5
13074   (exit "$ac_status"); }; }; then
13075   :
13076 else
13077   echo "$as_me: failed program was:" >&5
13078 cat "conftest.$ac_ext" >&5
13079 cf_cv_posix_c_source=no
13080 fi
13081 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13082          CFLAGS="$cf_save_CFLAGS"
13083          CPPFLAGS="$cf_save_CPPFLAGS"
13084
13085 fi
13086 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13087
13088 fi
13089 echo "$as_me:13089: result: $cf_cv_posix_c_source" >&5
13090 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13091
13092 if test "$cf_cv_posix_c_source" != no ; then
13093         CFLAGS="$cf_trim_CFLAGS"
13094         CPPFLAGS="$cf_trim_CPPFLAGS"
13095
13096 cf_fix_cppflags=no
13097 cf_new_cflags=
13098 cf_new_cppflags=
13099 cf_new_extra_cppflags=
13100
13101 for cf_add_cflags in $cf_cv_posix_c_source
13102 do
13103 case "$cf_fix_cppflags" in
13104 (no)
13105         case "$cf_add_cflags" in
13106         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13107                 case "$cf_add_cflags" in
13108                 (-D*)
13109                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13110
13111                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13112                                 && test -z "${cf_tst_cflags}" \
13113                                 && cf_fix_cppflags=yes
13114
13115                         if test "$cf_fix_cppflags" = yes ; then
13116
13117         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13118         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13119
13120                                 continue
13121                         elif test "${cf_tst_cflags}" = "\"'" ; then
13122
13123         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13124         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13125
13126                                 continue
13127                         fi
13128                         ;;
13129                 esac
13130                 case "$CPPFLAGS" in
13131                 (*$cf_add_cflags)
13132                         ;;
13133                 (*)
13134                         case "$cf_add_cflags" in
13135                         (-D*)
13136                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13137
13138 CPPFLAGS=`echo "$CPPFLAGS" | \
13139         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13140                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13141
13142                                 ;;
13143                         esac
13144
13145         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13146         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13147
13148                         ;;
13149                 esac
13150                 ;;
13151         (*)
13152
13153         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13154         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13155
13156                 ;;
13157         esac
13158         ;;
13159 (yes)
13160
13161         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13162         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13163
13164         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13165
13166         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13167                 && test -z "${cf_tst_cflags}" \
13168                 && cf_fix_cppflags=no
13169         ;;
13170 esac
13171 done
13172
13173 if test -n "$cf_new_cflags" ; then
13174
13175         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13176         CFLAGS="${CFLAGS}$cf_new_cflags"
13177
13178 fi
13179
13180 if test -n "$cf_new_cppflags" ; then
13181
13182         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13183         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13184
13185 fi
13186
13187 if test -n "$cf_new_extra_cppflags" ; then
13188
13189         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13190         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13191
13192 fi
13193
13194 fi
13195
13196 fi # cf_cv_posix_visible
13197
13198         ;;
13199 (netbsd*)
13200         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13201         ;;
13202 (openbsd[6-9]*)
13203         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13204         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13205         # Abusing the conformance level is a workaround.
13206         { echo "$as_me:13206: WARNING: this system does not provide usable locale support" >&5
13207 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13208         cf_xopen_source="-D_BSD_SOURCE"
13209         cf_XOPEN_SOURCE=700
13210         ;;
13211 (openbsd[4-5]*)
13212         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13213         cf_xopen_source="-D_BSD_SOURCE"
13214         cf_XOPEN_SOURCE=600
13215         ;;
13216 (openbsd*)
13217         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13218         ;;
13219 (osf[45]*)
13220         cf_xopen_source="-D_OSF_SOURCE"
13221         ;;
13222 (nto-qnx*)
13223         cf_xopen_source="-D_QNX_SOURCE"
13224         ;;
13225 (sco*)
13226         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13227         ;;
13228 (solaris2.*)
13229         cf_xopen_source="-D__EXTENSIONS__"
13230         cf_cv_xopen_source=broken
13231         ;;
13232 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13233         cf_XOPEN_SOURCE=
13234         cf_POSIX_C_SOURCE=
13235         ;;
13236 (*)
13237
13238 echo "$as_me:13238: checking if we should define _XOPEN_SOURCE" >&5
13239 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13240 if test "${cf_cv_xopen_source+set}" = set; then
13241   echo $ECHO_N "(cached) $ECHO_C" >&6
13242 else
13243
13244         cat >"conftest.$ac_ext" <<_ACEOF
13245 #line 13245 "configure"
13246 #include "confdefs.h"
13247
13248 #include <stdlib.h>
13249 #include <string.h>
13250 #include <sys/types.h>
13251
13252 int
13253 main (void)
13254 {
13255
13256 #ifndef _XOPEN_SOURCE
13257 make an error
13258 #endif
13259   ;
13260   return 0;
13261 }
13262 _ACEOF
13263 rm -f "conftest.$ac_objext"
13264 if { (eval echo "$as_me:13264: \"$ac_compile\"") >&5
13265   (eval $ac_compile) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit "$ac_status"); } &&
13269          { ac_try='test -s "conftest.$ac_objext"'
13270   { (eval echo "$as_me:13270: \"$ac_try\"") >&5
13271   (eval $ac_try) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit "$ac_status"); }; }; then
13275   cf_cv_xopen_source=no
13276 else
13277   echo "$as_me: failed program was:" >&5
13278 cat "conftest.$ac_ext" >&5
13279 cf_save="$CPPFLAGS"
13280
13281         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13282         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13283
13284          cat >"conftest.$ac_ext" <<_ACEOF
13285 #line 13285 "configure"
13286 #include "confdefs.h"
13287
13288 #include <stdlib.h>
13289 #include <string.h>
13290 #include <sys/types.h>
13291
13292 int
13293 main (void)
13294 {
13295
13296 #ifdef _XOPEN_SOURCE
13297 make an error
13298 #endif
13299   ;
13300   return 0;
13301 }
13302 _ACEOF
13303 rm -f "conftest.$ac_objext"
13304 if { (eval echo "$as_me:13304: \"$ac_compile\"") >&5
13305   (eval $ac_compile) 2>&5
13306   ac_status=$?
13307   echo "$as_me:13307: \$? = $ac_status" >&5
13308   (exit "$ac_status"); } &&
13309          { ac_try='test -s "conftest.$ac_objext"'
13310   { (eval echo "$as_me:13310: \"$ac_try\"") >&5
13311   (eval $ac_try) 2>&5
13312   ac_status=$?
13313   echo "$as_me:13313: \$? = $ac_status" >&5
13314   (exit "$ac_status"); }; }; then
13315   cf_cv_xopen_source=no
13316 else
13317   echo "$as_me: failed program was:" >&5
13318 cat "conftest.$ac_ext" >&5
13319 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13320 fi
13321 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13322         CPPFLAGS="$cf_save"
13323
13324 fi
13325 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13326
13327 fi
13328 echo "$as_me:13328: result: $cf_cv_xopen_source" >&5
13329 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13330
13331 if test "$cf_cv_xopen_source" != no ; then
13332
13333 CFLAGS=`echo "$CFLAGS" | \
13334         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13335                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13336
13337 CPPFLAGS=`echo "$CPPFLAGS" | \
13338         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13339                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13340
13341         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13342
13343 for cf_add_cflags in $cf_temp_xopen_source
13344 do
13345         case "x$cf_add_cflags" in
13346         (x-[DU]*)
13347
13348 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13349 while true
13350 do
13351         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13352         test "$CFLAGS" != "$cf_old_cflag" || break
13353
13354         CFLAGS="$cf_old_cflag"
13355 done
13356
13357 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13358 while true
13359 do
13360         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13361         test "$CPPFLAGS" != "$cf_old_cflag" || break
13362
13363         CPPFLAGS="$cf_old_cflag"
13364 done
13365
13366                 ;;
13367         esac
13368
13369 cf_fix_cppflags=no
13370 cf_new_cflags=
13371 cf_new_cppflags=
13372 cf_new_extra_cppflags=
13373
13374 for cf_add_cflags in $cf_add_cflags
13375 do
13376 case "$cf_fix_cppflags" in
13377 (no)
13378         case "$cf_add_cflags" in
13379         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13380                 case "$cf_add_cflags" in
13381                 (-D*)
13382                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13383
13384                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13385                                 && test -z "${cf_tst_cflags}" \
13386                                 && cf_fix_cppflags=yes
13387
13388                         if test "$cf_fix_cppflags" = yes ; then
13389
13390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13392
13393                                 continue
13394                         elif test "${cf_tst_cflags}" = "\"'" ; then
13395
13396         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13397         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13398
13399                                 continue
13400                         fi
13401                         ;;
13402                 esac
13403                 case "$CPPFLAGS" in
13404                 (*$cf_add_cflags)
13405                         ;;
13406                 (*)
13407                         case "$cf_add_cflags" in
13408                         (-D*)
13409                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13410
13411 CPPFLAGS=`echo "$CPPFLAGS" | \
13412         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13413                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13414
13415                                 ;;
13416                         esac
13417
13418         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13419         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13420
13421                         ;;
13422                 esac
13423                 ;;
13424         (*)
13425
13426         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13427         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13428
13429                 ;;
13430         esac
13431         ;;
13432 (yes)
13433
13434         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13435         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13436
13437         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13438
13439         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13440                 && test -z "${cf_tst_cflags}" \
13441                 && cf_fix_cppflags=no
13442         ;;
13443 esac
13444 done
13445
13446 if test -n "$cf_new_cflags" ; then
13447
13448         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13449         CFLAGS="${CFLAGS}$cf_new_cflags"
13450
13451 fi
13452
13453 if test -n "$cf_new_cppflags" ; then
13454
13455         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13456         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13457
13458 fi
13459
13460 if test -n "$cf_new_extra_cppflags" ; then
13461
13462         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13463         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13464
13465 fi
13466
13467 done
13468
13469 fi
13470
13471 if test "$cf_cv_posix_visible" = no; then
13472
13473 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13474
13475 cf_save_CFLAGS="$CFLAGS"
13476 cf_save_CPPFLAGS="$CPPFLAGS"
13477
13478 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13479         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13480                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13481
13482 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13483         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13484                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13485
13486 echo "$as_me:13486: checking if we should define _POSIX_C_SOURCE" >&5
13487 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13488 if test "${cf_cv_posix_c_source+set}" = set; then
13489   echo $ECHO_N "(cached) $ECHO_C" >&6
13490 else
13491
13492 echo "${as_me:-configure}:13492: testing if the symbol is already defined go no further ..." 1>&5
13493
13494         cat >"conftest.$ac_ext" <<_ACEOF
13495 #line 13495 "configure"
13496 #include "confdefs.h"
13497 #include <sys/types.h>
13498 int
13499 main (void)
13500 {
13501
13502 #ifndef _POSIX_C_SOURCE
13503 make an error
13504 #endif
13505   ;
13506   return 0;
13507 }
13508 _ACEOF
13509 rm -f "conftest.$ac_objext"
13510 if { (eval echo "$as_me:13510: \"$ac_compile\"") >&5
13511   (eval $ac_compile) 2>&5
13512   ac_status=$?
13513   echo "$as_me:13513: \$? = $ac_status" >&5
13514   (exit "$ac_status"); } &&
13515          { ac_try='test -s "conftest.$ac_objext"'
13516   { (eval echo "$as_me:13516: \"$ac_try\"") >&5
13517   (eval $ac_try) 2>&5
13518   ac_status=$?
13519   echo "$as_me:13519: \$? = $ac_status" >&5
13520   (exit "$ac_status"); }; }; then
13521   cf_cv_posix_c_source=no
13522 else
13523   echo "$as_me: failed program was:" >&5
13524 cat "conftest.$ac_ext" >&5
13525 cf_want_posix_source=no
13526          case .$cf_POSIX_C_SOURCE in
13527          (.[12]??*)
13528                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13529                 ;;
13530          (.2)
13531                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13532                 cf_want_posix_source=yes
13533                 ;;
13534          (.*)
13535                 cf_want_posix_source=yes
13536                 ;;
13537          esac
13538          if test "$cf_want_posix_source" = yes ; then
13539                 cat >"conftest.$ac_ext" <<_ACEOF
13540 #line 13540 "configure"
13541 #include "confdefs.h"
13542 #include <sys/types.h>
13543 int
13544 main (void)
13545 {
13546
13547 #ifdef _POSIX_SOURCE
13548 make an error
13549 #endif
13550   ;
13551   return 0;
13552 }
13553 _ACEOF
13554 rm -f "conftest.$ac_objext"
13555 if { (eval echo "$as_me:13555: \"$ac_compile\"") >&5
13556   (eval $ac_compile) 2>&5
13557   ac_status=$?
13558   echo "$as_me:13558: \$? = $ac_status" >&5
13559   (exit "$ac_status"); } &&
13560          { ac_try='test -s "conftest.$ac_objext"'
13561   { (eval echo "$as_me:13561: \"$ac_try\"") >&5
13562   (eval $ac_try) 2>&5
13563   ac_status=$?
13564   echo "$as_me:13564: \$? = $ac_status" >&5
13565   (exit "$ac_status"); }; }; then
13566   :
13567 else
13568   echo "$as_me: failed program was:" >&5
13569 cat "conftest.$ac_ext" >&5
13570 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13571 fi
13572 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13573          fi
13574
13575 echo "${as_me:-configure}:13575: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13576
13577          CFLAGS="$cf_trim_CFLAGS"
13578          CPPFLAGS="$cf_trim_CPPFLAGS"
13579
13580         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13581         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13582
13583 echo "${as_me:-configure}:13583: testing if the second compile does not leave our definition intact error ..." 1>&5
13584
13585          cat >"conftest.$ac_ext" <<_ACEOF
13586 #line 13586 "configure"
13587 #include "confdefs.h"
13588 #include <sys/types.h>
13589 int
13590 main (void)
13591 {
13592
13593 #ifndef _POSIX_C_SOURCE
13594 make an error
13595 #endif
13596   ;
13597   return 0;
13598 }
13599 _ACEOF
13600 rm -f "conftest.$ac_objext"
13601 if { (eval echo "$as_me:13601: \"$ac_compile\"") >&5
13602   (eval $ac_compile) 2>&5
13603   ac_status=$?
13604   echo "$as_me:13604: \$? = $ac_status" >&5
13605   (exit "$ac_status"); } &&
13606          { ac_try='test -s "conftest.$ac_objext"'
13607   { (eval echo "$as_me:13607: \"$ac_try\"") >&5
13608   (eval $ac_try) 2>&5
13609   ac_status=$?
13610   echo "$as_me:13610: \$? = $ac_status" >&5
13611   (exit "$ac_status"); }; }; then
13612   :
13613 else
13614   echo "$as_me: failed program was:" >&5
13615 cat "conftest.$ac_ext" >&5
13616 cf_cv_posix_c_source=no
13617 fi
13618 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13619          CFLAGS="$cf_save_CFLAGS"
13620          CPPFLAGS="$cf_save_CPPFLAGS"
13621
13622 fi
13623 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13624
13625 fi
13626 echo "$as_me:13626: result: $cf_cv_posix_c_source" >&5
13627 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13628
13629 if test "$cf_cv_posix_c_source" != no ; then
13630         CFLAGS="$cf_trim_CFLAGS"
13631         CPPFLAGS="$cf_trim_CPPFLAGS"
13632
13633 cf_fix_cppflags=no
13634 cf_new_cflags=
13635 cf_new_cppflags=
13636 cf_new_extra_cppflags=
13637
13638 for cf_add_cflags in $cf_cv_posix_c_source
13639 do
13640 case "$cf_fix_cppflags" in
13641 (no)
13642         case "$cf_add_cflags" in
13643         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13644                 case "$cf_add_cflags" in
13645                 (-D*)
13646                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13647
13648                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13649                                 && test -z "${cf_tst_cflags}" \
13650                                 && cf_fix_cppflags=yes
13651
13652                         if test "$cf_fix_cppflags" = yes ; then
13653
13654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13656
13657                                 continue
13658                         elif test "${cf_tst_cflags}" = "\"'" ; then
13659
13660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13662
13663                                 continue
13664                         fi
13665                         ;;
13666                 esac
13667                 case "$CPPFLAGS" in
13668                 (*$cf_add_cflags)
13669                         ;;
13670                 (*)
13671                         case "$cf_add_cflags" in
13672                         (-D*)
13673                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13674
13675 CPPFLAGS=`echo "$CPPFLAGS" | \
13676         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13677                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13678
13679                                 ;;
13680                         esac
13681
13682         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13683         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13684
13685                         ;;
13686                 esac
13687                 ;;
13688         (*)
13689
13690         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13691         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13692
13693                 ;;
13694         esac
13695         ;;
13696 (yes)
13697
13698         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13699         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13700
13701         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13702
13703         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13704                 && test -z "${cf_tst_cflags}" \
13705                 && cf_fix_cppflags=no
13706         ;;
13707 esac
13708 done
13709
13710 if test -n "$cf_new_cflags" ; then
13711
13712         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13713         CFLAGS="${CFLAGS}$cf_new_cflags"
13714
13715 fi
13716
13717 if test -n "$cf_new_cppflags" ; then
13718
13719         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13720         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13721
13722 fi
13723
13724 if test -n "$cf_new_extra_cppflags" ; then
13725
13726         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13727         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13728
13729 fi
13730
13731 fi
13732
13733 fi # cf_cv_posix_visible
13734
13735         ;;
13736 esac
13737
13738 if test -n "$cf_xopen_source" ; then
13739
13740 for cf_add_cflags in $cf_xopen_source
13741 do
13742         case "x$cf_add_cflags" in
13743         (x-[DU]*)
13744
13745 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13746 while true
13747 do
13748         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13749         test "$CFLAGS" != "$cf_old_cflag" || break
13750         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13751
13752 echo "${as_me:-configure}:13752: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13753
13754         CFLAGS="$cf_old_cflag"
13755 done
13756
13757 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13758 while true
13759 do
13760         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13761         test "$CPPFLAGS" != "$cf_old_cflag" || break
13762         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13763
13764 echo "${as_me:-configure}:13764: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13765
13766         CPPFLAGS="$cf_old_cflag"
13767 done
13768
13769                 ;;
13770         esac
13771
13772 cf_fix_cppflags=no
13773 cf_new_cflags=
13774 cf_new_cppflags=
13775 cf_new_extra_cppflags=
13776
13777 for cf_add_cflags in $cf_add_cflags
13778 do
13779 case "$cf_fix_cppflags" in
13780 (no)
13781         case "$cf_add_cflags" in
13782         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13783                 case "$cf_add_cflags" in
13784                 (-D*)
13785                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13786
13787                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13788                                 && test -z "${cf_tst_cflags}" \
13789                                 && cf_fix_cppflags=yes
13790
13791                         if test "$cf_fix_cppflags" = yes ; then
13792
13793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13795
13796                                 continue
13797                         elif test "${cf_tst_cflags}" = "\"'" ; then
13798
13799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13801
13802                                 continue
13803                         fi
13804                         ;;
13805                 esac
13806                 case "$CPPFLAGS" in
13807                 (*$cf_add_cflags)
13808                         ;;
13809                 (*)
13810                         case "$cf_add_cflags" in
13811                         (-D*)
13812                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13813
13814 CPPFLAGS=`echo "$CPPFLAGS" | \
13815         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13816                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13817
13818                                 ;;
13819                         esac
13820
13821         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13822         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13823
13824                         ;;
13825                 esac
13826                 ;;
13827         (*)
13828
13829         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13830         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13831
13832                 ;;
13833         esac
13834         ;;
13835 (yes)
13836
13837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13839
13840         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13841
13842         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13843                 && test -z "${cf_tst_cflags}" \
13844                 && cf_fix_cppflags=no
13845         ;;
13846 esac
13847 done
13848
13849 if test -n "$cf_new_cflags" ; then
13850         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13851
13852 echo "${as_me:-configure}:13852: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13853
13854         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13855         CFLAGS="${CFLAGS}$cf_new_cflags"
13856
13857 fi
13858
13859 if test -n "$cf_new_cppflags" ; then
13860         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13861
13862 echo "${as_me:-configure}:13862: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13863
13864         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13865         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13866
13867 fi
13868
13869 if test -n "$cf_new_extra_cppflags" ; then
13870         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13871
13872 echo "${as_me:-configure}:13872: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13873
13874         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13875         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13876
13877 fi
13878
13879 done
13880
13881 fi
13882
13883 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13884         echo "$as_me:13884: checking if _XOPEN_SOURCE really is set" >&5
13885 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13886         cat >"conftest.$ac_ext" <<_ACEOF
13887 #line 13887 "configure"
13888 #include "confdefs.h"
13889 #include <stdlib.h>
13890 int
13891 main (void)
13892 {
13893
13894 #ifndef _XOPEN_SOURCE
13895 make an error
13896 #endif
13897   ;
13898   return 0;
13899 }
13900 _ACEOF
13901 rm -f "conftest.$ac_objext"
13902 if { (eval echo "$as_me:13902: \"$ac_compile\"") >&5
13903   (eval $ac_compile) 2>&5
13904   ac_status=$?
13905   echo "$as_me:13905: \$? = $ac_status" >&5
13906   (exit "$ac_status"); } &&
13907          { ac_try='test -s "conftest.$ac_objext"'
13908   { (eval echo "$as_me:13908: \"$ac_try\"") >&5
13909   (eval $ac_try) 2>&5
13910   ac_status=$?
13911   echo "$as_me:13911: \$? = $ac_status" >&5
13912   (exit "$ac_status"); }; }; then
13913   cf_XOPEN_SOURCE_set=yes
13914 else
13915   echo "$as_me: failed program was:" >&5
13916 cat "conftest.$ac_ext" >&5
13917 cf_XOPEN_SOURCE_set=no
13918 fi
13919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13920         echo "$as_me:13920: result: $cf_XOPEN_SOURCE_set" >&5
13921 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13922         if test "$cf_XOPEN_SOURCE_set" = yes
13923         then
13924                 cat >"conftest.$ac_ext" <<_ACEOF
13925 #line 13925 "configure"
13926 #include "confdefs.h"
13927 #include <stdlib.h>
13928 int
13929 main (void)
13930 {
13931
13932 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13933 make an error
13934 #endif
13935   ;
13936   return 0;
13937 }
13938 _ACEOF
13939 rm -f "conftest.$ac_objext"
13940 if { (eval echo "$as_me:13940: \"$ac_compile\"") >&5
13941   (eval $ac_compile) 2>&5
13942   ac_status=$?
13943   echo "$as_me:13943: \$? = $ac_status" >&5
13944   (exit "$ac_status"); } &&
13945          { ac_try='test -s "conftest.$ac_objext"'
13946   { (eval echo "$as_me:13946: \"$ac_try\"") >&5
13947   (eval $ac_try) 2>&5
13948   ac_status=$?
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit "$ac_status"); }; }; then
13951   cf_XOPEN_SOURCE_set_ok=yes
13952 else
13953   echo "$as_me: failed program was:" >&5
13954 cat "conftest.$ac_ext" >&5
13955 cf_XOPEN_SOURCE_set_ok=no
13956 fi
13957 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13958                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13959                 then
13960                         { echo "$as_me:13960: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13961 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13962                 fi
13963         else
13964
13965 echo "$as_me:13965: checking if we should define _XOPEN_SOURCE" >&5
13966 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13967 if test "${cf_cv_xopen_source+set}" = set; then
13968   echo $ECHO_N "(cached) $ECHO_C" >&6
13969 else
13970
13971         cat >"conftest.$ac_ext" <<_ACEOF
13972 #line 13972 "configure"
13973 #include "confdefs.h"
13974
13975 #include <stdlib.h>
13976 #include <string.h>
13977 #include <sys/types.h>
13978
13979 int
13980 main (void)
13981 {
13982
13983 #ifndef _XOPEN_SOURCE
13984 make an error
13985 #endif
13986   ;
13987   return 0;
13988 }
13989 _ACEOF
13990 rm -f "conftest.$ac_objext"
13991 if { (eval echo "$as_me:13991: \"$ac_compile\"") >&5
13992   (eval $ac_compile) 2>&5
13993   ac_status=$?
13994   echo "$as_me:13994: \$? = $ac_status" >&5
13995   (exit "$ac_status"); } &&
13996          { ac_try='test -s "conftest.$ac_objext"'
13997   { (eval echo "$as_me:13997: \"$ac_try\"") >&5
13998   (eval $ac_try) 2>&5
13999   ac_status=$?
14000   echo "$as_me:14000: \$? = $ac_status" >&5
14001   (exit "$ac_status"); }; }; then
14002   cf_cv_xopen_source=no
14003 else
14004   echo "$as_me: failed program was:" >&5
14005 cat "conftest.$ac_ext" >&5
14006 cf_save="$CPPFLAGS"
14007
14008         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14009         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14010
14011          cat >"conftest.$ac_ext" <<_ACEOF
14012 #line 14012 "configure"
14013 #include "confdefs.h"
14014
14015 #include <stdlib.h>
14016 #include <string.h>
14017 #include <sys/types.h>
14018
14019 int
14020 main (void)
14021 {
14022
14023 #ifdef _XOPEN_SOURCE
14024 make an error
14025 #endif
14026   ;
14027   return 0;
14028 }
14029 _ACEOF
14030 rm -f "conftest.$ac_objext"
14031 if { (eval echo "$as_me:14031: \"$ac_compile\"") >&5
14032   (eval $ac_compile) 2>&5
14033   ac_status=$?
14034   echo "$as_me:14034: \$? = $ac_status" >&5
14035   (exit "$ac_status"); } &&
14036          { ac_try='test -s "conftest.$ac_objext"'
14037   { (eval echo "$as_me:14037: \"$ac_try\"") >&5
14038   (eval $ac_try) 2>&5
14039   ac_status=$?
14040   echo "$as_me:14040: \$? = $ac_status" >&5
14041   (exit "$ac_status"); }; }; then
14042   cf_cv_xopen_source=no
14043 else
14044   echo "$as_me: failed program was:" >&5
14045 cat "conftest.$ac_ext" >&5
14046 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14047 fi
14048 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14049         CPPFLAGS="$cf_save"
14050
14051 fi
14052 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14053
14054 fi
14055 echo "$as_me:14055: result: $cf_cv_xopen_source" >&5
14056 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14057
14058 if test "$cf_cv_xopen_source" != no ; then
14059
14060 CFLAGS=`echo "$CFLAGS" | \
14061         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14062                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14063
14064 CPPFLAGS=`echo "$CPPFLAGS" | \
14065         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14066                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14067
14068         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14069
14070 for cf_add_cflags in $cf_temp_xopen_source
14071 do
14072         case "x$cf_add_cflags" in
14073         (x-[DU]*)
14074
14075 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14076 while true
14077 do
14078         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14079         test "$CFLAGS" != "$cf_old_cflag" || break
14080
14081         CFLAGS="$cf_old_cflag"
14082 done
14083
14084 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14085 while true
14086 do
14087         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14088         test "$CPPFLAGS" != "$cf_old_cflag" || break
14089
14090         CPPFLAGS="$cf_old_cflag"
14091 done
14092
14093                 ;;
14094         esac
14095
14096 cf_fix_cppflags=no
14097 cf_new_cflags=
14098 cf_new_cppflags=
14099 cf_new_extra_cppflags=
14100
14101 for cf_add_cflags in $cf_add_cflags
14102 do
14103 case "$cf_fix_cppflags" in
14104 (no)
14105         case "$cf_add_cflags" in
14106         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14107                 case "$cf_add_cflags" in
14108                 (-D*)
14109                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14110
14111                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14112                                 && test -z "${cf_tst_cflags}" \
14113                                 && cf_fix_cppflags=yes
14114
14115                         if test "$cf_fix_cppflags" = yes ; then
14116
14117         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14118         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14119
14120                                 continue
14121                         elif test "${cf_tst_cflags}" = "\"'" ; then
14122
14123         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14124         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14125
14126                                 continue
14127                         fi
14128                         ;;
14129                 esac
14130                 case "$CPPFLAGS" in
14131                 (*$cf_add_cflags)
14132                         ;;
14133                 (*)
14134                         case "$cf_add_cflags" in
14135                         (-D*)
14136                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14137
14138 CPPFLAGS=`echo "$CPPFLAGS" | \
14139         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14140                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14141
14142                                 ;;
14143                         esac
14144
14145         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14146         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14147
14148                         ;;
14149                 esac
14150                 ;;
14151         (*)
14152
14153         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14154         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14155
14156                 ;;
14157         esac
14158         ;;
14159 (yes)
14160
14161         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14162         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14163
14164         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14165
14166         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14167                 && test -z "${cf_tst_cflags}" \
14168                 && cf_fix_cppflags=no
14169         ;;
14170 esac
14171 done
14172
14173 if test -n "$cf_new_cflags" ; then
14174
14175         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14176         CFLAGS="${CFLAGS}$cf_new_cflags"
14177
14178 fi
14179
14180 if test -n "$cf_new_cppflags" ; then
14181
14182         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14183         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14184
14185 fi
14186
14187 if test -n "$cf_new_extra_cppflags" ; then
14188
14189         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14190         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14191
14192 fi
14193
14194 done
14195
14196 fi
14197
14198         fi
14199 fi
14200 fi # cf_cv_posix_visible
14201
14202 # Check whether --enable-largefile or --disable-largefile was given.
14203 if test "${enable_largefile+set}" = set; then
14204   enableval="$enable_largefile"
14205
14206 fi;
14207 if test "$enable_largefile" != no; then
14208
14209   echo "$as_me:14209: checking for special C compiler options needed for large files" >&5
14210 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14211 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14212   echo $ECHO_N "(cached) $ECHO_C" >&6
14213 else
14214   ac_cv_sys_largefile_CC=no
14215      if test "$GCC" != yes; then
14216        ac_save_CC=$CC
14217        while :; do
14218          # IRIX 6.2 and later do not support large files by default,
14219          # so use the C compiler's -n32 option if that helps.
14220          cat >"conftest.$ac_ext" <<_ACEOF
14221 #line 14221 "configure"
14222 #include "confdefs.h"
14223 #include <sys/types.h>
14224  /* Check that off_t can represent 2**63 - 1 correctly.
14225     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14226     since some C++ compilers masquerading as C compilers
14227     incorrectly reject 9223372036854775807.  */
14228 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14229   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14230                        && LARGE_OFF_T % 2147483647 == 1)
14231                       ? 1 : -1];
14232 int
14233 main (void)
14234 {
14235
14236   ;
14237   return 0;
14238 }
14239 _ACEOF
14240          rm -f "conftest.$ac_objext"
14241 if { (eval echo "$as_me:14241: \"$ac_compile\"") >&5
14242   (eval $ac_compile) 2>&5
14243   ac_status=$?
14244   echo "$as_me:14244: \$? = $ac_status" >&5
14245   (exit "$ac_status"); } &&
14246          { ac_try='test -s "conftest.$ac_objext"'
14247   { (eval echo "$as_me:14247: \"$ac_try\"") >&5
14248   (eval $ac_try) 2>&5
14249   ac_status=$?
14250   echo "$as_me:14250: \$? = $ac_status" >&5
14251   (exit "$ac_status"); }; }; then
14252   break
14253 else
14254   echo "$as_me: failed program was:" >&5
14255 cat "conftest.$ac_ext" >&5
14256 fi
14257 rm -f "conftest.$ac_objext"
14258          CC="$CC -n32"
14259          rm -f "conftest.$ac_objext"
14260 if { (eval echo "$as_me:14260: \"$ac_compile\"") >&5
14261   (eval $ac_compile) 2>&5
14262   ac_status=$?
14263   echo "$as_me:14263: \$? = $ac_status" >&5
14264   (exit "$ac_status"); } &&
14265          { ac_try='test -s "conftest.$ac_objext"'
14266   { (eval echo "$as_me:14266: \"$ac_try\"") >&5
14267   (eval $ac_try) 2>&5
14268   ac_status=$?
14269   echo "$as_me:14269: \$? = $ac_status" >&5
14270   (exit "$ac_status"); }; }; then
14271   ac_cv_sys_largefile_CC=' -n32'; break
14272 else
14273   echo "$as_me: failed program was:" >&5
14274 cat "conftest.$ac_ext" >&5
14275 fi
14276 rm -f "conftest.$ac_objext"
14277          break
14278        done
14279        CC=$ac_save_CC
14280        rm -f "conftest.$ac_ext"
14281     fi
14282 fi
14283 echo "$as_me:14283: result: $ac_cv_sys_largefile_CC" >&5
14284 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14285   if test "$ac_cv_sys_largefile_CC" != no; then
14286     CC=$CC$ac_cv_sys_largefile_CC
14287   fi
14288
14289   echo "$as_me:14289: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14290 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14291 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14292   echo $ECHO_N "(cached) $ECHO_C" >&6
14293 else
14294   while :; do
14295   ac_cv_sys_file_offset_bits=no
14296   cat >"conftest.$ac_ext" <<_ACEOF
14297 #line 14297 "configure"
14298 #include "confdefs.h"
14299 #include <sys/types.h>
14300  /* Check that off_t can represent 2**63 - 1 correctly.
14301     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14302     since some C++ compilers masquerading as C compilers
14303     incorrectly reject 9223372036854775807.  */
14304 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14305   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14306                        && LARGE_OFF_T % 2147483647 == 1)
14307                       ? 1 : -1];
14308 int
14309 main (void)
14310 {
14311
14312   ;
14313   return 0;
14314 }
14315 _ACEOF
14316 rm -f "conftest.$ac_objext"
14317 if { (eval echo "$as_me:14317: \"$ac_compile\"") >&5
14318   (eval $ac_compile) 2>&5
14319   ac_status=$?
14320   echo "$as_me:14320: \$? = $ac_status" >&5
14321   (exit "$ac_status"); } &&
14322          { ac_try='test -s "conftest.$ac_objext"'
14323   { (eval echo "$as_me:14323: \"$ac_try\"") >&5
14324   (eval $ac_try) 2>&5
14325   ac_status=$?
14326   echo "$as_me:14326: \$? = $ac_status" >&5
14327   (exit "$ac_status"); }; }; then
14328   break
14329 else
14330   echo "$as_me: failed program was:" >&5
14331 cat "conftest.$ac_ext" >&5
14332 fi
14333 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14334   cat >"conftest.$ac_ext" <<_ACEOF
14335 #line 14335 "configure"
14336 #include "confdefs.h"
14337 #define _FILE_OFFSET_BITS 64
14338 #include <sys/types.h>
14339  /* Check that off_t can represent 2**63 - 1 correctly.
14340     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14341     since some C++ compilers masquerading as C compilers
14342     incorrectly reject 9223372036854775807.  */
14343 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14344   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14345                        && LARGE_OFF_T % 2147483647 == 1)
14346                       ? 1 : -1];
14347 int
14348 main (void)
14349 {
14350
14351   ;
14352   return 0;
14353 }
14354 _ACEOF
14355 rm -f "conftest.$ac_objext"
14356 if { (eval echo "$as_me:14356: \"$ac_compile\"") >&5
14357   (eval $ac_compile) 2>&5
14358   ac_status=$?
14359   echo "$as_me:14359: \$? = $ac_status" >&5
14360   (exit "$ac_status"); } &&
14361          { ac_try='test -s "conftest.$ac_objext"'
14362   { (eval echo "$as_me:14362: \"$ac_try\"") >&5
14363   (eval $ac_try) 2>&5
14364   ac_status=$?
14365   echo "$as_me:14365: \$? = $ac_status" >&5
14366   (exit "$ac_status"); }; }; then
14367   ac_cv_sys_file_offset_bits=64; break
14368 else
14369   echo "$as_me: failed program was:" >&5
14370 cat "conftest.$ac_ext" >&5
14371 fi
14372 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14373   break
14374 done
14375 fi
14376 echo "$as_me:14376: result: $ac_cv_sys_file_offset_bits" >&5
14377 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14378 if test "$ac_cv_sys_file_offset_bits" != no; then
14379
14380 cat >>confdefs.h <<EOF
14381 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14382 EOF
14383
14384 fi
14385 rm -rf conftest*
14386   echo "$as_me:14386: checking for _LARGE_FILES value needed for large files" >&5
14387 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14388 if test "${ac_cv_sys_large_files+set}" = set; then
14389   echo $ECHO_N "(cached) $ECHO_C" >&6
14390 else
14391   while :; do
14392   ac_cv_sys_large_files=no
14393   cat >"conftest.$ac_ext" <<_ACEOF
14394 #line 14394 "configure"
14395 #include "confdefs.h"
14396 #include <sys/types.h>
14397  /* Check that off_t can represent 2**63 - 1 correctly.
14398     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14399     since some C++ compilers masquerading as C compilers
14400     incorrectly reject 9223372036854775807.  */
14401 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14402   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14403                        && LARGE_OFF_T % 2147483647 == 1)
14404                       ? 1 : -1];
14405 int
14406 main (void)
14407 {
14408
14409   ;
14410   return 0;
14411 }
14412 _ACEOF
14413 rm -f "conftest.$ac_objext"
14414 if { (eval echo "$as_me:14414: \"$ac_compile\"") >&5
14415   (eval $ac_compile) 2>&5
14416   ac_status=$?
14417   echo "$as_me:14417: \$? = $ac_status" >&5
14418   (exit "$ac_status"); } &&
14419          { ac_try='test -s "conftest.$ac_objext"'
14420   { (eval echo "$as_me:14420: \"$ac_try\"") >&5
14421   (eval $ac_try) 2>&5
14422   ac_status=$?
14423   echo "$as_me:14423: \$? = $ac_status" >&5
14424   (exit "$ac_status"); }; }; then
14425   break
14426 else
14427   echo "$as_me: failed program was:" >&5
14428 cat "conftest.$ac_ext" >&5
14429 fi
14430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14431   cat >"conftest.$ac_ext" <<_ACEOF
14432 #line 14432 "configure"
14433 #include "confdefs.h"
14434 #define _LARGE_FILES 1
14435 #include <sys/types.h>
14436  /* Check that off_t can represent 2**63 - 1 correctly.
14437     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14438     since some C++ compilers masquerading as C compilers
14439     incorrectly reject 9223372036854775807.  */
14440 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14441   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14442                        && LARGE_OFF_T % 2147483647 == 1)
14443                       ? 1 : -1];
14444 int
14445 main (void)
14446 {
14447
14448   ;
14449   return 0;
14450 }
14451 _ACEOF
14452 rm -f "conftest.$ac_objext"
14453 if { (eval echo "$as_me:14453: \"$ac_compile\"") >&5
14454   (eval $ac_compile) 2>&5
14455   ac_status=$?
14456   echo "$as_me:14456: \$? = $ac_status" >&5
14457   (exit "$ac_status"); } &&
14458          { ac_try='test -s "conftest.$ac_objext"'
14459   { (eval echo "$as_me:14459: \"$ac_try\"") >&5
14460   (eval $ac_try) 2>&5
14461   ac_status=$?
14462   echo "$as_me:14462: \$? = $ac_status" >&5
14463   (exit "$ac_status"); }; }; then
14464   ac_cv_sys_large_files=1; break
14465 else
14466   echo "$as_me: failed program was:" >&5
14467 cat "conftest.$ac_ext" >&5
14468 fi
14469 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14470   break
14471 done
14472 fi
14473 echo "$as_me:14473: result: $ac_cv_sys_large_files" >&5
14474 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14475 if test "$ac_cv_sys_large_files" != no; then
14476
14477 cat >>confdefs.h <<EOF
14478 #define _LARGE_FILES $ac_cv_sys_large_files
14479 EOF
14480
14481 fi
14482 rm -rf conftest*
14483 fi
14484
14485         if test "$enable_largefile" != no ; then
14486         echo "$as_me:14486: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14487 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14488 if test "${ac_cv_sys_largefile_source+set}" = set; then
14489   echo $ECHO_N "(cached) $ECHO_C" >&6
14490 else
14491   while :; do
14492   ac_cv_sys_largefile_source=no
14493   cat >"conftest.$ac_ext" <<_ACEOF
14494 #line 14494 "configure"
14495 #include "confdefs.h"
14496 #include <stdio.h>
14497 int
14498 main (void)
14499 {
14500 return !fseeko;
14501   ;
14502   return 0;
14503 }
14504 _ACEOF
14505 rm -f "conftest.$ac_objext"
14506 if { (eval echo "$as_me:14506: \"$ac_compile\"") >&5
14507   (eval $ac_compile) 2>&5
14508   ac_status=$?
14509   echo "$as_me:14509: \$? = $ac_status" >&5
14510   (exit "$ac_status"); } &&
14511          { ac_try='test -s "conftest.$ac_objext"'
14512   { (eval echo "$as_me:14512: \"$ac_try\"") >&5
14513   (eval $ac_try) 2>&5
14514   ac_status=$?
14515   echo "$as_me:14515: \$? = $ac_status" >&5
14516   (exit "$ac_status"); }; }; then
14517   break
14518 else
14519   echo "$as_me: failed program was:" >&5
14520 cat "conftest.$ac_ext" >&5
14521 fi
14522 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14523   cat >"conftest.$ac_ext" <<_ACEOF
14524 #line 14524 "configure"
14525 #include "confdefs.h"
14526 #define _LARGEFILE_SOURCE 1
14527 #include <stdio.h>
14528 int
14529 main (void)
14530 {
14531 return !fseeko;
14532   ;
14533   return 0;
14534 }
14535 _ACEOF
14536 rm -f "conftest.$ac_objext"
14537 if { (eval echo "$as_me:14537: \"$ac_compile\"") >&5
14538   (eval $ac_compile) 2>&5
14539   ac_status=$?
14540   echo "$as_me:14540: \$? = $ac_status" >&5
14541   (exit "$ac_status"); } &&
14542          { ac_try='test -s "conftest.$ac_objext"'
14543   { (eval echo "$as_me:14543: \"$ac_try\"") >&5
14544   (eval $ac_try) 2>&5
14545   ac_status=$?
14546   echo "$as_me:14546: \$? = $ac_status" >&5
14547   (exit "$ac_status"); }; }; then
14548   ac_cv_sys_largefile_source=1; break
14549 else
14550   echo "$as_me: failed program was:" >&5
14551 cat "conftest.$ac_ext" >&5
14552 fi
14553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14554   break
14555 done
14556 fi
14557 echo "$as_me:14557: result: $ac_cv_sys_largefile_source" >&5
14558 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14559 if test "$ac_cv_sys_largefile_source" != no; then
14560
14561 cat >>confdefs.h <<EOF
14562 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14563 EOF
14564
14565 fi
14566 rm -rf conftest*
14567
14568 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14569 # in glibc 2.1.3, but that breaks too many other things.
14570 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14571 echo "$as_me:14571: checking for fseeko" >&5
14572 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14573 if test "${ac_cv_func_fseeko+set}" = set; then
14574   echo $ECHO_N "(cached) $ECHO_C" >&6
14575 else
14576   cat >"conftest.$ac_ext" <<_ACEOF
14577 #line 14577 "configure"
14578 #include "confdefs.h"
14579 #include <stdio.h>
14580 int
14581 main (void)
14582 {
14583 return fseeko && fseeko (stdin, 0, 0);
14584   ;
14585   return 0;
14586 }
14587 _ACEOF
14588 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14589 if { (eval echo "$as_me:14589: \"$ac_link\"") >&5
14590   (eval $ac_link) 2>&5
14591   ac_status=$?
14592   echo "$as_me:14592: \$? = $ac_status" >&5
14593   (exit "$ac_status"); } &&
14594          { ac_try='test -s "conftest$ac_exeext"'
14595   { (eval echo "$as_me:14595: \"$ac_try\"") >&5
14596   (eval $ac_try) 2>&5
14597   ac_status=$?
14598   echo "$as_me:14598: \$? = $ac_status" >&5
14599   (exit "$ac_status"); }; }; then
14600   ac_cv_func_fseeko=yes
14601 else
14602   echo "$as_me: failed program was:" >&5
14603 cat "conftest.$ac_ext" >&5
14604 ac_cv_func_fseeko=no
14605 fi
14606 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14607 fi
14608 echo "$as_me:14608: result: $ac_cv_func_fseeko" >&5
14609 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14610 if test $ac_cv_func_fseeko = yes; then
14611
14612 cat >>confdefs.h <<\EOF
14613 #define HAVE_FSEEKO 1
14614 EOF
14615
14616 fi
14617
14618         # Normally we would collect these definitions in the config.h,
14619         # but (like _XOPEN_SOURCE), some environments rely on having these
14620         # defined before any of the system headers are included.  Another
14621         # case comes up with C++, e.g., on AIX the compiler compiles the
14622         # header files by themselves before looking at the body files it is
14623         # told to compile.  For ncurses, those header files do not include
14624         # the config.h
14625         if test "$ac_cv_sys_large_files" != no
14626         then
14627
14628         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14629         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14630
14631         fi
14632         if test "$ac_cv_sys_largefile_source" != no
14633         then
14634
14635         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14636         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14637
14638         fi
14639         if test "$ac_cv_sys_file_offset_bits" != no
14640         then
14641
14642         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14643         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14644
14645         fi
14646
14647         echo "$as_me:14647: checking whether to use struct dirent64" >&5
14648 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14649 if test "${cf_cv_struct_dirent64+set}" = set; then
14650   echo $ECHO_N "(cached) $ECHO_C" >&6
14651 else
14652
14653                 cat >"conftest.$ac_ext" <<_ACEOF
14654 #line 14654 "configure"
14655 #include "confdefs.h"
14656
14657 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14658 #include <sys/types.h>
14659 #include <dirent.h>
14660
14661 int
14662 main (void)
14663 {
14664
14665                 /* if transitional largefile support is setup, this is true */
14666                 extern struct dirent64 * readdir(DIR *);
14667                 struct dirent64 *x = readdir((DIR *)0);
14668                 struct dirent *y = readdir((DIR *)0);
14669                 int z = x - y;
14670                 (void)z;
14671
14672   ;
14673   return 0;
14674 }
14675 _ACEOF
14676 rm -f "conftest.$ac_objext"
14677 if { (eval echo "$as_me:14677: \"$ac_compile\"") >&5
14678   (eval $ac_compile) 2>&5
14679   ac_status=$?
14680   echo "$as_me:14680: \$? = $ac_status" >&5
14681   (exit "$ac_status"); } &&
14682          { ac_try='test -s "conftest.$ac_objext"'
14683   { (eval echo "$as_me:14683: \"$ac_try\"") >&5
14684   (eval $ac_try) 2>&5
14685   ac_status=$?
14686   echo "$as_me:14686: \$? = $ac_status" >&5
14687   (exit "$ac_status"); }; }; then
14688   cf_cv_struct_dirent64=yes
14689 else
14690   echo "$as_me: failed program was:" >&5
14691 cat "conftest.$ac_ext" >&5
14692 cf_cv_struct_dirent64=no
14693 fi
14694 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14695
14696 fi
14697 echo "$as_me:14697: result: $cf_cv_struct_dirent64" >&5
14698 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14699         test "$cf_cv_struct_dirent64" = yes &&
14700 cat >>confdefs.h <<\EOF
14701 #define HAVE_STRUCT_DIRENT64 1
14702 EOF
14703
14704         fi
14705
14706 ### Enable compiling-in rcs id's
14707 echo "$as_me:14707: checking if RCS identifiers should be compiled-in" >&5
14708 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14709
14710 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14711 if test "${with_rcs_ids+set}" = set; then
14712   withval="$with_rcs_ids"
14713   with_rcs_ids=$withval
14714 else
14715   with_rcs_ids=no
14716 fi;
14717 echo "$as_me:14717: result: $with_rcs_ids" >&5
14718 echo "${ECHO_T}$with_rcs_ids" >&6
14719 test "$with_rcs_ids" = yes &&
14720 cat >>confdefs.h <<\EOF
14721 #define USE_RCS_IDS 1
14722 EOF
14723
14724 ###############################################################################
14725
14726 ### Note that some functions (such as const) are normally disabled anyway.
14727 echo "$as_me:14727: checking if you want to build with function extensions" >&5
14728 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14729
14730 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14731 if test "${enable_ext_funcs+set}" = set; then
14732   enableval="$enable_ext_funcs"
14733   with_ext_funcs=$enableval
14734 else
14735   with_ext_funcs=yes
14736 fi;
14737 echo "$as_me:14737: result: $with_ext_funcs" >&5
14738 echo "${ECHO_T}$with_ext_funcs" >&6
14739 if test "$with_ext_funcs" = yes ; then
14740         NCURSES_EXT_FUNCS=1
14741
14742 cat >>confdefs.h <<\EOF
14743 #define HAVE_USE_DEFAULT_COLORS 1
14744 EOF
14745
14746 cat >>confdefs.h <<\EOF
14747 #define NCURSES_EXT_FUNCS 1
14748 EOF
14749
14750 else
14751         NCURSES_EXT_FUNCS=0
14752 fi
14753
14754 ###   use option --enable-const to turn on use of const beyond that in XSI.
14755 echo "$as_me:14755: checking for extended use of const keyword" >&5
14756 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14757
14758 # Check whether --enable-const or --disable-const was given.
14759 if test "${enable_const+set}" = set; then
14760   enableval="$enable_const"
14761   with_ext_const=$enableval
14762 else
14763   with_ext_const=no
14764 fi;
14765 echo "$as_me:14765: result: $with_ext_const" >&5
14766 echo "${ECHO_T}$with_ext_const" >&6
14767 NCURSES_CONST='/*nothing*/'
14768 if test "$with_ext_const" = yes ; then
14769         NCURSES_CONST=const
14770 fi
14771
14772 ###############################################################################
14773 # These options are relatively safe to experiment with.
14774
14775 echo "$as_me:14775: checking if you want all development code" >&5
14776 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14777
14778 # Check whether --with-develop or --without-develop was given.
14779 if test "${with_develop+set}" = set; then
14780   withval="$with_develop"
14781   with_develop=$withval
14782 else
14783   with_develop=no
14784 fi;
14785 echo "$as_me:14785: result: $with_develop" >&5
14786 echo "${ECHO_T}$with_develop" >&6
14787
14788 ###############################################################################
14789 # These are just experimental, probably should not be in a package:
14790
14791 # This is still experimental (20080329), but should ultimately be moved to
14792 # the script-block --with-normal, etc.
14793
14794 echo "$as_me:14794: checking if you want to link with the pthread library" >&5
14795 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14796
14797 # Check whether --with-pthread or --without-pthread was given.
14798 if test "${with_pthread+set}" = set; then
14799   withval="$with_pthread"
14800   with_pthread=$withval
14801 else
14802   with_pthread=no
14803 fi;
14804 echo "$as_me:14804: result: $with_pthread" >&5
14805 echo "${ECHO_T}$with_pthread" >&6
14806
14807 if test "$with_pthread" != no ; then
14808         echo "$as_me:14808: checking for pthread.h" >&5
14809 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14810 if test "${ac_cv_header_pthread_h+set}" = set; then
14811   echo $ECHO_N "(cached) $ECHO_C" >&6
14812 else
14813   cat >"conftest.$ac_ext" <<_ACEOF
14814 #line 14814 "configure"
14815 #include "confdefs.h"
14816 #include <pthread.h>
14817 _ACEOF
14818 if { (eval echo "$as_me:14818: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14819   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14820   ac_status=$?
14821   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14822   rm -f conftest.er1
14823   cat conftest.err >&5
14824   echo "$as_me:14824: \$? = $ac_status" >&5
14825   (exit "$ac_status"); } >/dev/null; then
14826   if test -s conftest.err; then
14827     ac_cpp_err=$ac_c_preproc_warn_flag
14828   else
14829     ac_cpp_err=
14830   fi
14831 else
14832   ac_cpp_err=yes
14833 fi
14834 if test -z "$ac_cpp_err"; then
14835   ac_cv_header_pthread_h=yes
14836 else
14837   echo "$as_me: failed program was:" >&5
14838   cat "conftest.$ac_ext" >&5
14839   ac_cv_header_pthread_h=no
14840 fi
14841 rm -f conftest.err "conftest.$ac_ext"
14842 fi
14843 echo "$as_me:14843: result: $ac_cv_header_pthread_h" >&5
14844 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14845 if test "$ac_cv_header_pthread_h" = yes; then
14846
14847 cat >>confdefs.h <<\EOF
14848 #define HAVE_PTHREADS_H 1
14849 EOF
14850
14851         for cf_lib_pthread in pthread c_r
14852         do
14853             echo "$as_me:14853: checking if we can link with the $cf_lib_pthread library" >&5
14854 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14855             cf_save_LIBS="$LIBS"
14856
14857 cf_add_libs="$LIBS"
14858 # reverse order
14859 cf_add_0lib=
14860 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14861 # filter duplicates
14862 for cf_add_1lib in $cf_add_0lib; do
14863         for cf_add_2lib in $cf_add_libs; do
14864                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14865                         cf_add_1lib=
14866                         break
14867                 fi
14868         done
14869         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14870 done
14871 LIBS="$cf_add_libs"
14872
14873             cat >"conftest.$ac_ext" <<_ACEOF
14874 #line 14874 "configure"
14875 #include "confdefs.h"
14876
14877 #include <pthread.h>
14878
14879 int
14880 main (void)
14881 {
14882
14883                 int rc = pthread_create(0,0,0,0);
14884                 int r2 = pthread_mutexattr_settype(0, 0);
14885
14886   ;
14887   return 0;
14888 }
14889 _ACEOF
14890 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14891 if { (eval echo "$as_me:14891: \"$ac_link\"") >&5
14892   (eval $ac_link) 2>&5
14893   ac_status=$?
14894   echo "$as_me:14894: \$? = $ac_status" >&5
14895   (exit "$ac_status"); } &&
14896          { ac_try='test -s "conftest$ac_exeext"'
14897   { (eval echo "$as_me:14897: \"$ac_try\"") >&5
14898   (eval $ac_try) 2>&5
14899   ac_status=$?
14900   echo "$as_me:14900: \$? = $ac_status" >&5
14901   (exit "$ac_status"); }; }; then
14902   with_pthread=yes
14903 else
14904   echo "$as_me: failed program was:" >&5
14905 cat "conftest.$ac_ext" >&5
14906 with_pthread=no
14907 fi
14908 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14909             LIBS="$cf_save_LIBS"
14910             echo "$as_me:14910: result: $with_pthread" >&5
14911 echo "${ECHO_T}$with_pthread" >&6
14912             test "$with_pthread" = yes && break
14913         done
14914
14915         if test "$with_pthread" = yes ; then
14916
14917 cf_add_libs="$LIBS"
14918 # reverse order
14919 cf_add_0lib=
14920 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14921 # filter duplicates
14922 for cf_add_1lib in $cf_add_0lib; do
14923         for cf_add_2lib in $cf_add_libs; do
14924                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14925                         cf_add_1lib=
14926                         break
14927                 fi
14928         done
14929         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14930 done
14931 LIBS="$cf_add_libs"
14932
14933 cat >>confdefs.h <<\EOF
14934 #define HAVE_LIBPTHREADS 1
14935 EOF
14936
14937         else
14938             { { echo "$as_me:14938: error: Cannot link with pthread library" >&5
14939 echo "$as_me: error: Cannot link with pthread library" >&2;}
14940    { (exit 1); exit 1; }; }
14941         fi
14942
14943 fi
14944
14945 fi
14946
14947 echo "$as_me:14947: checking if you want to use weak-symbols for pthreads" >&5
14948 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14949
14950 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14951 if test "${enable_weak_symbols+set}" = set; then
14952   enableval="$enable_weak_symbols"
14953   use_weak_symbols=$withval
14954 else
14955   use_weak_symbols=no
14956 fi;
14957 echo "$as_me:14957: result: $use_weak_symbols" >&5
14958 echo "${ECHO_T}$use_weak_symbols" >&6
14959 if test "$use_weak_symbols" = yes ; then
14960
14961 echo "$as_me:14961: checking if $CC supports weak symbols" >&5
14962 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14963 if test "${cf_cv_weak_symbols+set}" = set; then
14964   echo $ECHO_N "(cached) $ECHO_C" >&6
14965 else
14966
14967 cat >"conftest.$ac_ext" <<_ACEOF
14968 #line 14968 "configure"
14969 #include "confdefs.h"
14970
14971 #include <stdio.h>
14972 int
14973 main (void)
14974 {
14975
14976 #if defined(__GNUC__)
14977 #  if defined __USE_ISOC99
14978 #    define _cat_pragma(exp)    _Pragma(#exp)
14979 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14980 #  else
14981 #    define _weak_pragma(exp)
14982 #  endif
14983 #  define _declare(name)        __extension__ extern __typeof__(name) name
14984 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14985 #endif
14986
14987 weak_symbol(fopen);
14988
14989   ;
14990   return 0;
14991 }
14992 _ACEOF
14993 rm -f "conftest.$ac_objext"
14994 if { (eval echo "$as_me:14994: \"$ac_compile\"") >&5
14995   (eval $ac_compile) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit "$ac_status"); } &&
14999          { ac_try='test -s "conftest.$ac_objext"'
15000   { (eval echo "$as_me:15000: \"$ac_try\"") >&5
15001   (eval $ac_try) 2>&5
15002   ac_status=$?
15003   echo "$as_me:15003: \$? = $ac_status" >&5
15004   (exit "$ac_status"); }; }; then
15005   cf_cv_weak_symbols=yes
15006 else
15007   echo "$as_me: failed program was:" >&5
15008 cat "conftest.$ac_ext" >&5
15009 cf_cv_weak_symbols=no
15010 fi
15011 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15012
15013 fi
15014 echo "$as_me:15014: result: $cf_cv_weak_symbols" >&5
15015 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15016
15017 else
15018         cf_cv_weak_symbols=no
15019 fi
15020
15021 if test $cf_cv_weak_symbols = yes ; then
15022
15023 cat >>confdefs.h <<\EOF
15024 #define USE_WEAK_SYMBOLS 1
15025 EOF
15026
15027 fi
15028
15029 PTHREAD=
15030 if test "$with_pthread" = "yes" ; then
15031
15032 cat >>confdefs.h <<\EOF
15033 #define USE_PTHREADS 1
15034 EOF
15035
15036         enable_reentrant=yes
15037         if test $cf_cv_weak_symbols = yes ; then
15038                 PTHREAD=-lpthread
15039         fi
15040 fi
15041
15042 # OpenSUSE is installing ncurses6, using reentrant option.
15043 echo "$as_me:15043: checking for _nc_TABSIZE" >&5
15044 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15045 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15046   echo $ECHO_N "(cached) $ECHO_C" >&6
15047 else
15048   cat >"conftest.$ac_ext" <<_ACEOF
15049 #line 15049 "configure"
15050 #include "confdefs.h"
15051 #define _nc_TABSIZE autoconf_temporary
15052 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15053 #undef _nc_TABSIZE
15054
15055 #ifdef __cplusplus
15056 extern "C"
15057 #endif
15058
15059 /* We use char because int might match the return type of a gcc2
15060    builtin and then its argument prototype would still apply.  */
15061 char _nc_TABSIZE (void);
15062
15063 int
15064 main (void)
15065 {
15066
15067 /* The GNU C library defines stubs for functions which it implements
15068     to always fail with ENOSYS.  Some functions are actually named
15069     something starting with __ and the normal name is an alias.  */
15070 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15071 #error found stub for _nc_TABSIZE
15072 #endif
15073
15074         return _nc_TABSIZE ();
15075   ;
15076   return 0;
15077 }
15078 _ACEOF
15079 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15080 if { (eval echo "$as_me:15080: \"$ac_link\"") >&5
15081   (eval $ac_link) 2>&5
15082   ac_status=$?
15083   echo "$as_me:15083: \$? = $ac_status" >&5
15084   (exit "$ac_status"); } &&
15085          { ac_try='test -s "conftest$ac_exeext"'
15086   { (eval echo "$as_me:15086: \"$ac_try\"") >&5
15087   (eval $ac_try) 2>&5
15088   ac_status=$?
15089   echo "$as_me:15089: \$? = $ac_status" >&5
15090   (exit "$ac_status"); }; }; then
15091   ac_cv_func__nc_TABSIZE=yes
15092 else
15093   echo "$as_me: failed program was:" >&5
15094 cat "conftest.$ac_ext" >&5
15095 ac_cv_func__nc_TABSIZE=no
15096 fi
15097 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15098 fi
15099 echo "$as_me:15099: result: $ac_cv_func__nc_TABSIZE" >&5
15100 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15101 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15102   assume_reentrant=yes
15103 else
15104   assume_reentrant=no
15105 fi
15106
15107 # Reentrant code has to be opaque; there's little advantage to making ncurses
15108 # opaque outside of that, so there is no --enable-opaque option.  We can use
15109 # this option without --with-pthreads, but this will be always set for
15110 # pthreads.
15111 echo "$as_me:15111: checking if you want experimental reentrant code" >&5
15112 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15113
15114 # Check whether --enable-reentrant or --disable-reentrant was given.
15115 if test "${enable_reentrant+set}" = set; then
15116   enableval="$enable_reentrant"
15117   with_reentrant=$enableval
15118 else
15119   with_reentrant=$assume_reentrant
15120 fi;
15121 echo "$as_me:15121: result: $with_reentrant" >&5
15122 echo "${ECHO_T}$with_reentrant" >&6
15123 if test "$with_reentrant" = yes ; then
15124         cf_cv_enable_reentrant=1
15125         if test $cf_cv_weak_symbols = yes ; then
15126
15127 # remove pthread library from $LIBS
15128 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15129
15130         elif test "$assume_reentrant" = no ; then
15131                 LIB_SUFFIX="t${LIB_SUFFIX}"
15132         fi
15133
15134 cat >>confdefs.h <<\EOF
15135 #define USE_REENTRANT 1
15136 EOF
15137
15138 else
15139         cf_cv_enable_reentrant=0
15140 fi
15141
15142 ### Allow using a different wrap-prefix
15143 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15144         echo "$as_me:15144: checking for prefix used to wrap public variables" >&5
15145 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15146
15147 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15148 if test "${with_wrap_prefix+set}" = set; then
15149   withval="$with_wrap_prefix"
15150   NCURSES_WRAP_PREFIX=$withval
15151 else
15152   NCURSES_WRAP_PREFIX=_nc_
15153 fi;
15154         echo "$as_me:15154: result: $NCURSES_WRAP_PREFIX" >&5
15155 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15156 else
15157         NCURSES_WRAP_PREFIX=_nc_
15158 fi
15159
15160 cat >>confdefs.h <<EOF
15161 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15162 EOF
15163
15164 ###############################################################################
15165
15166 ###     use option --disable-echo to suppress full display compiling commands
15167
15168 echo "$as_me:15168: checking if you want to see long compiling messages" >&5
15169 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15170
15171 # Check whether --enable-echo or --disable-echo was given.
15172 if test "${enable_echo+set}" = set; then
15173   enableval="$enable_echo"
15174   test "$enableval" != no && enableval=yes
15175         if test "$enableval" != "yes" ; then
15176
15177         ECHO_LT='--silent'
15178         ECHO_LD='@echo linking $@;'
15179         RULE_CC='@echo compiling $<'
15180         SHOW_CC='@echo compiling $@'
15181         ECHO_CC='@'
15182
15183         else
15184
15185         ECHO_LT=''
15186         ECHO_LD=''
15187         RULE_CC=''
15188         SHOW_CC=''
15189         ECHO_CC=''
15190
15191         fi
15192 else
15193   enableval=yes
15194
15195         ECHO_LT=''
15196         ECHO_LD=''
15197         RULE_CC=''
15198         SHOW_CC=''
15199         ECHO_CC=''
15200
15201 fi;
15202 echo "$as_me:15202: result: $enableval" >&5
15203 echo "${ECHO_T}$enableval" >&6
15204
15205 echo "$as_me:15205: checking if you want to use C11 _Noreturn feature" >&5
15206 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15207
15208 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15209 if test "${enable_stdnoreturn+set}" = set; then
15210   enableval="$enable_stdnoreturn"
15211   test "$enableval" != yes && enableval=no
15212         if test "$enableval" != "no" ; then
15213     enable_stdnoreturn=yes
15214         else
15215                 enable_stdnoreturn=no
15216         fi
15217 else
15218   enableval=no
15219         enable_stdnoreturn=no
15220
15221 fi;
15222 echo "$as_me:15222: result: $enable_stdnoreturn" >&5
15223 echo "${ECHO_T}$enable_stdnoreturn" >&6
15224
15225 if test $enable_stdnoreturn = yes; then
15226 echo "$as_me:15226: checking for C11 _Noreturn feature" >&5
15227 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15228 if test "${cf_cv_c11_noreturn+set}" = set; then
15229   echo $ECHO_N "(cached) $ECHO_C" >&6
15230 else
15231   cat >"conftest.$ac_ext" <<_ACEOF
15232 #line 15232 "configure"
15233 #include "confdefs.h"
15234
15235 #include <stdio.h>
15236 #include <stdlib.h>
15237 #include <stdnoreturn.h>
15238 static _Noreturn void giveup(void) { exit(0); }
15239
15240 int
15241 main (void)
15242 {
15243 if (feof(stdin)) giveup()
15244   ;
15245   return 0;
15246 }
15247 _ACEOF
15248 rm -f "conftest.$ac_objext"
15249 if { (eval echo "$as_me:15249: \"$ac_compile\"") >&5
15250   (eval $ac_compile) 2>&5
15251   ac_status=$?
15252   echo "$as_me:15252: \$? = $ac_status" >&5
15253   (exit "$ac_status"); } &&
15254          { ac_try='test -s "conftest.$ac_objext"'
15255   { (eval echo "$as_me:15255: \"$ac_try\"") >&5
15256   (eval $ac_try) 2>&5
15257   ac_status=$?
15258   echo "$as_me:15258: \$? = $ac_status" >&5
15259   (exit "$ac_status"); }; }; then
15260   cf_cv_c11_noreturn=yes
15261 else
15262   echo "$as_me: failed program was:" >&5
15263 cat "conftest.$ac_ext" >&5
15264 cf_cv_c11_noreturn=no
15265 fi
15266 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15267
15268 fi
15269 echo "$as_me:15269: result: $cf_cv_c11_noreturn" >&5
15270 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15271 else
15272         cf_cv_c11_noreturn=no,
15273 fi
15274
15275 if test "$cf_cv_c11_noreturn" = yes; then
15276
15277 cat >>confdefs.h <<\EOF
15278 #define HAVE_STDNORETURN_H 1
15279 EOF
15280
15281 cat >>confdefs.h <<EOF
15282 #define STDC_NORETURN _Noreturn
15283 EOF
15284
15285         HAVE_STDNORETURN_H=1
15286 else
15287         HAVE_STDNORETURN_H=0
15288 fi
15289
15290 if test "$GCC" = yes || test "$GXX" = yes
15291 then
15292
15293 if test "$GCC" = yes || test "$GXX" = yes
15294 then
15295         case $CFLAGS in
15296         (*-Werror=*)
15297                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15298
15299 echo "${as_me:-configure}:15299: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15300
15301                 cf_temp_flags=
15302                 for cf_temp_scan in $CFLAGS
15303                 do
15304                         case "x$cf_temp_scan" in
15305                         (x-Werror=*)
15306
15307         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15308         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15309
15310                                 ;;
15311                         (*)
15312
15313         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15314         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15315
15316                                 ;;
15317                         esac
15318                 done
15319                 CFLAGS="$cf_temp_flags"
15320                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15321
15322 echo "${as_me:-configure}:15322: testing ... fixed $CFLAGS ..." 1>&5
15323
15324                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15325
15326 echo "${as_me:-configure}:15326: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15327
15328                 ;;
15329         esac
15330 fi
15331
15332 if test "$GCC" = yes || test "$GXX" = yes
15333 then
15334         case $CPPFLAGS in
15335         (*-Werror=*)
15336                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15337
15338 echo "${as_me:-configure}:15338: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15339
15340                 cf_temp_flags=
15341                 for cf_temp_scan in $CPPFLAGS
15342                 do
15343                         case "x$cf_temp_scan" in
15344                         (x-Werror=*)
15345
15346         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15347         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15348
15349                                 ;;
15350                         (*)
15351
15352         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15353         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15354
15355                                 ;;
15356                         esac
15357                 done
15358                 CPPFLAGS="$cf_temp_flags"
15359                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15360
15361 echo "${as_me:-configure}:15361: testing ... fixed $CPPFLAGS ..." 1>&5
15362
15363                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15364
15365 echo "${as_me:-configure}:15365: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15366
15367                 ;;
15368         esac
15369 fi
15370
15371 if test "$GCC" = yes || test "$GXX" = yes
15372 then
15373         case $LDFLAGS in
15374         (*-Werror=*)
15375                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15376
15377 echo "${as_me:-configure}:15377: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15378
15379                 cf_temp_flags=
15380                 for cf_temp_scan in $LDFLAGS
15381                 do
15382                         case "x$cf_temp_scan" in
15383                         (x-Werror=*)
15384
15385         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15386         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15387
15388                                 ;;
15389                         (*)
15390
15391         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15392         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15393
15394                                 ;;
15395                         esac
15396                 done
15397                 LDFLAGS="$cf_temp_flags"
15398                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15399
15400 echo "${as_me:-configure}:15400: testing ... fixed $LDFLAGS ..." 1>&5
15401
15402                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15403
15404 echo "${as_me:-configure}:15404: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15405
15406                 ;;
15407         esac
15408 fi
15409
15410 echo "$as_me:15410: checking if you want to turn on gcc warnings" >&5
15411 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15412
15413 # Check whether --enable-warnings or --disable-warnings was given.
15414 if test "${enable_warnings+set}" = set; then
15415   enableval="$enable_warnings"
15416   test "$enableval" != yes && enableval=no
15417         if test "$enableval" != "no" ; then
15418     enable_warnings=yes
15419         else
15420                 enable_warnings=no
15421         fi
15422 else
15423   enableval=no
15424         enable_warnings=no
15425
15426 fi;
15427 echo "$as_me:15427: result: $enable_warnings" >&5
15428 echo "${ECHO_T}$enable_warnings" >&6
15429 if test "$enable_warnings" = "yes"
15430 then
15431
15432 if test "x$have_x" = xyes; then
15433
15434 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15435 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15436 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15437 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15438 for cf_X_CFLAGS in $X_CFLAGS
15439 do
15440         case "x$cf_X_CFLAGS" in
15441         x-[IUD]*)
15442                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15443                 ;;
15444         *)
15445                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15446                 ;;
15447         esac
15448 done
15449
15450 cat >"conftest.$ac_ext" <<_ACEOF
15451 #line 15451 "configure"
15452 #include "confdefs.h"
15453
15454 #include <stdlib.h>
15455 #include <X11/Intrinsic.h>
15456
15457 int
15458 main (void)
15459 {
15460 String foo = malloc(1); free((void*)foo)
15461   ;
15462   return 0;
15463 }
15464 _ACEOF
15465 rm -f "conftest.$ac_objext"
15466 if { (eval echo "$as_me:15466: \"$ac_compile\"") >&5
15467   (eval $ac_compile) 2>&5
15468   ac_status=$?
15469   echo "$as_me:15469: \$? = $ac_status" >&5
15470   (exit "$ac_status"); } &&
15471          { ac_try='test -s "conftest.$ac_objext"'
15472   { (eval echo "$as_me:15472: \"$ac_try\"") >&5
15473   (eval $ac_try) 2>&5
15474   ac_status=$?
15475   echo "$as_me:15475: \$? = $ac_status" >&5
15476   (exit "$ac_status"); }; }; then
15477
15478 echo "$as_me:15478: checking for X11/Xt const-feature" >&5
15479 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15480 if test "${cf_cv_const_x_string+set}" = set; then
15481   echo $ECHO_N "(cached) $ECHO_C" >&6
15482 else
15483
15484         cat >"conftest.$ac_ext" <<_ACEOF
15485 #line 15485 "configure"
15486 #include "confdefs.h"
15487
15488 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15489 #undef  XTSTRINGDEFINES /* X11R5 and later */
15490 #include <stdlib.h>
15491 #include <X11/Intrinsic.h>
15492
15493 int
15494 main (void)
15495 {
15496 String foo = malloc(1); *foo = 0
15497   ;
15498   return 0;
15499 }
15500 _ACEOF
15501 rm -f "conftest.$ac_objext"
15502 if { (eval echo "$as_me:15502: \"$ac_compile\"") >&5
15503   (eval $ac_compile) 2>&5
15504   ac_status=$?
15505   echo "$as_me:15505: \$? = $ac_status" >&5
15506   (exit "$ac_status"); } &&
15507          { ac_try='test -s "conftest.$ac_objext"'
15508   { (eval echo "$as_me:15508: \"$ac_try\"") >&5
15509   (eval $ac_try) 2>&5
15510   ac_status=$?
15511   echo "$as_me:15511: \$? = $ac_status" >&5
15512   (exit "$ac_status"); }; }; then
15513
15514                         cf_cv_const_x_string=no
15515
15516 else
15517   echo "$as_me: failed program was:" >&5
15518 cat "conftest.$ac_ext" >&5
15519
15520                         cf_cv_const_x_string=yes
15521
15522 fi
15523 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15524
15525 fi
15526 echo "$as_me:15526: result: $cf_cv_const_x_string" >&5
15527 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15528
15529 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15530 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15531 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15532
15533 case "$cf_cv_const_x_string" in
15534 (no)
15535
15536         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15537         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15538
15539         ;;
15540 (*)
15541
15542         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15543         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15544
15545         ;;
15546 esac
15547
15548 else
15549   echo "$as_me: failed program was:" >&5
15550 cat "conftest.$ac_ext" >&5
15551 fi
15552 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15553  fi
15554 cat > "conftest.$ac_ext" <<EOF
15555 #line 15555 "${as_me:-configure}"
15556 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15557 EOF
15558 if test "$INTEL_COMPILER" = yes
15559 then
15560 # The "-wdXXX" options suppress warnings:
15561 # remark #1419: external declaration in primary source file
15562 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15563 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15564 # remark #193: zero used for undefined preprocessing identifier
15565 # remark #593: variable "curs_sb_left_arrow" was set but never used
15566 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15567 # remark #869: parameter "tw" was never referenced
15568 # remark #981: operands are evaluated in unspecified order
15569 # warning #279: controlling expression is constant
15570
15571         { echo "$as_me:15571: checking for $CC warning options..." >&5
15572 echo "$as_me: checking for $CC warning options..." >&6;}
15573         cf_save_CFLAGS="$CFLAGS"
15574         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15575         for cf_opt in \
15576                 wd1419 \
15577                 wd1683 \
15578                 wd1684 \
15579                 wd193 \
15580                 wd593 \
15581                 wd279 \
15582                 wd810 \
15583                 wd869 \
15584                 wd981
15585         do
15586                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15587                 if { (eval echo "$as_me:15587: \"$ac_compile\"") >&5
15588   (eval $ac_compile) 2>&5
15589   ac_status=$?
15590   echo "$as_me:15590: \$? = $ac_status" >&5
15591   (exit "$ac_status"); }; then
15592                         test -n "$verbose" && echo "$as_me:15592: result: ... -$cf_opt" >&5
15593 echo "${ECHO_T}... -$cf_opt" >&6
15594                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15595                 fi
15596         done
15597         CFLAGS="$cf_save_CFLAGS"
15598 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15599 then
15600         { echo "$as_me:15600: checking for $CC warning options..." >&5
15601 echo "$as_me: checking for $CC warning options..." >&6;}
15602         cf_save_CFLAGS="$CFLAGS"
15603         cf_warn_CONST=""
15604         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15605         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15606         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15607         for cf_opt in W Wall \
15608                 Wbad-function-cast \
15609                 Wcast-align \
15610                 Wcast-qual \
15611                 Wdeclaration-after-statement \
15612                 Wextra \
15613                 Winline \
15614                 Wmissing-declarations \
15615                 Wmissing-prototypes \
15616                 Wnested-externs \
15617                 Wpointer-arith \
15618                 Wshadow \
15619                 Wstrict-prototypes \
15620                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15621         do
15622                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15623                 if { (eval echo "$as_me:15623: \"$ac_compile\"") >&5
15624   (eval $ac_compile) 2>&5
15625   ac_status=$?
15626   echo "$as_me:15626: \$? = $ac_status" >&5
15627   (exit "$ac_status"); }; then
15628                         test -n "$verbose" && echo "$as_me:15628: result: ... -$cf_opt" >&5
15629 echo "${ECHO_T}... -$cf_opt" >&6
15630                         case "$cf_opt" in
15631                         (Winline)
15632                                 case "$GCC_VERSION" in
15633                                 ([34].*)
15634                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15635
15636 echo "${as_me:-configure}:15636: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15637
15638                                         continue;;
15639                                 esac
15640                                 ;;
15641                         (Wpointer-arith)
15642                                 case "$GCC_VERSION" in
15643                                 ([12].*)
15644                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15645
15646 echo "${as_me:-configure}:15646: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15647
15648                                         continue;;
15649                                 esac
15650                                 ;;
15651                         esac
15652                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15653                 fi
15654         done
15655         CFLAGS="$cf_save_CFLAGS"
15656 fi
15657 rm -rf ./conftest*
15658
15659 fi
15660
15661 if test "$GCC" = yes || test "$GXX" = yes
15662 then
15663 cat > conftest.i <<EOF
15664 #ifndef GCC_PRINTF
15665 #define GCC_PRINTF 0
15666 #endif
15667 #ifndef GCC_SCANF
15668 #define GCC_SCANF 0
15669 #endif
15670 #ifndef GCC_NORETURN
15671 #define GCC_NORETURN /* nothing */
15672 #endif
15673 #ifndef GCC_UNUSED
15674 #define GCC_UNUSED /* nothing */
15675 #endif
15676 EOF
15677 if test "$GCC" = yes
15678 then
15679         { echo "$as_me:15679: checking for $CC __attribute__ directives..." >&5
15680 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15681 cat > "conftest.$ac_ext" <<EOF
15682 #line 15682 "${as_me:-configure}"
15683 #include "confdefs.h"
15684 #include "conftest.h"
15685 #include "conftest.i"
15686 #if     GCC_PRINTF
15687 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15688 #else
15689 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15690 #endif
15691 #if     GCC_SCANF
15692 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15693 #else
15694 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15695 #endif
15696 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15697 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15698 extern GCC_NORETURN void foo(void);
15699 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15700 EOF
15701         cf_printf_attribute=no
15702         cf_scanf_attribute=no
15703         for cf_attribute in scanf printf unused noreturn
15704         do
15705
15706 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15707
15708                 cf_directive="__attribute__(($cf_attribute))"
15709                 echo "checking for $CC $cf_directive" 1>&5
15710
15711                 case "$cf_attribute" in
15712                 (printf)
15713                         cf_printf_attribute=yes
15714                         cat >conftest.h <<EOF
15715 #define GCC_$cf_ATTRIBUTE 1
15716 EOF
15717                         ;;
15718                 (scanf)
15719                         cf_scanf_attribute=yes
15720                         cat >conftest.h <<EOF
15721 #define GCC_$cf_ATTRIBUTE 1
15722 EOF
15723                         ;;
15724                 (*)
15725                         cat >conftest.h <<EOF
15726 #define GCC_$cf_ATTRIBUTE $cf_directive
15727 EOF
15728                         ;;
15729                 esac
15730
15731                 if { (eval echo "$as_me:15731: \"$ac_compile\"") >&5
15732   (eval $ac_compile) 2>&5
15733   ac_status=$?
15734   echo "$as_me:15734: \$? = $ac_status" >&5
15735   (exit "$ac_status"); }; then
15736                         test -n "$verbose" && echo "$as_me:15736: result: ... $cf_attribute" >&5
15737 echo "${ECHO_T}... $cf_attribute" >&6
15738                         cat conftest.h >>confdefs.h
15739                         case "$cf_attribute" in
15740                         (noreturn)
15741
15742 cat >>confdefs.h <<EOF
15743 #define GCC_NORETURN $cf_directive
15744 EOF
15745
15746                                 ;;
15747                         (printf)
15748                                 cf_value='/* nothing */'
15749                                 if test "$cf_printf_attribute" != no ; then
15750                                         cf_value='__attribute__((format(printf,fmt,var)))'
15751
15752 cat >>confdefs.h <<\EOF
15753 #define GCC_PRINTF 1
15754 EOF
15755
15756                                 fi
15757
15758 cat >>confdefs.h <<EOF
15759 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15760 EOF
15761
15762                                 ;;
15763                         (scanf)
15764                                 cf_value='/* nothing */'
15765                                 if test "$cf_scanf_attribute" != no ; then
15766                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15767
15768 cat >>confdefs.h <<\EOF
15769 #define GCC_SCANF 1
15770 EOF
15771
15772                                 fi
15773
15774 cat >>confdefs.h <<EOF
15775 #define GCC_SCANFLIKE(fmt,var) $cf_value
15776 EOF
15777
15778                                 ;;
15779                         (unused)
15780
15781 cat >>confdefs.h <<EOF
15782 #define GCC_UNUSED $cf_directive
15783 EOF
15784
15785                                 ;;
15786                         esac
15787                 fi
15788         done
15789 else
15790         ${FGREP-fgrep} define conftest.i >>confdefs.h
15791 fi
15792 rm -rf ./conftest*
15793 fi
15794
15795 fi
15796
15797 if test "x$enable_warnings" = "xyes"; then
15798
15799         ADAFLAGS="$ADAFLAGS -gnatg"
15800
15801 fi
15802
15803 ###     use option --enable-assertions to turn on generation of assertion code
15804 echo "$as_me:15804: checking if you want to enable runtime assertions" >&5
15805 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15806
15807 # Check whether --enable-assertions or --disable-assertions was given.
15808 if test "${enable_assertions+set}" = set; then
15809   enableval="$enable_assertions"
15810   with_assertions=$enableval
15811 else
15812   with_assertions=no
15813 fi;
15814 echo "$as_me:15814: result: $with_assertions" >&5
15815 echo "${ECHO_T}$with_assertions" >&6
15816 if test -n "$GCC"
15817 then
15818         if test "$with_assertions" = no
15819         then
15820                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15821         else
15822
15823         ADAFLAGS="$ADAFLAGS -gnata"
15824
15825         fi
15826 fi
15827
15828 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15829
15830 cat >>confdefs.h <<\EOF
15831 #define HAVE_NC_ALLOC_H 1
15832 EOF
15833
15834 ###     use option --enable-expanded to generate certain macros as functions
15835
15836 # Check whether --enable-expanded or --disable-expanded was given.
15837 if test "${enable_expanded+set}" = set; then
15838   enableval="$enable_expanded"
15839   test "$enableval" = yes &&
15840 cat >>confdefs.h <<\EOF
15841 #define NCURSES_EXPANDED 1
15842 EOF
15843
15844 fi;
15845
15846 ###     use option --disable-macros to suppress macros in favor of functions
15847
15848 # Check whether --enable-macros or --disable-macros was given.
15849 if test "${enable_macros+set}" = set; then
15850   enableval="$enable_macros"
15851   test "$enableval" = no &&
15852 cat >>confdefs.h <<\EOF
15853 #define NCURSES_NOMACROS 1
15854 EOF
15855
15856 fi;
15857
15858 # Normally we only add trace() to the debug-library.  Allow this to be
15859 # extended to all models of the ncurses library:
15860 cf_all_traces=no
15861 case "$CFLAGS $CPPFLAGS" in
15862 (*-DTRACE*)
15863         cf_all_traces=yes
15864         ;;
15865 esac
15866
15867 echo "$as_me:15867: checking whether to add trace feature to all models" >&5
15868 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15869
15870 # Check whether --with-trace or --without-trace was given.
15871 if test "${with_trace+set}" = set; then
15872   withval="$with_trace"
15873   cf_with_trace=$withval
15874 else
15875   cf_with_trace=$cf_all_traces
15876 fi;
15877 echo "$as_me:15877: result: $cf_with_trace" >&5
15878 echo "${ECHO_T}$cf_with_trace" >&6
15879
15880 if test "$cf_with_trace" = yes ; then
15881         ADA_TRACE=TRUE
15882
15883 cf_fix_cppflags=no
15884 cf_new_cflags=
15885 cf_new_cppflags=
15886 cf_new_extra_cppflags=
15887
15888 for cf_add_cflags in -DTRACE
15889 do
15890 case "$cf_fix_cppflags" in
15891 (no)
15892         case "$cf_add_cflags" in
15893         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15894                 case "$cf_add_cflags" in
15895                 (-D*)
15896                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15897
15898                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15899                                 && test -z "${cf_tst_cflags}" \
15900                                 && cf_fix_cppflags=yes
15901
15902                         if test "$cf_fix_cppflags" = yes ; then
15903
15904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15906
15907                                 continue
15908                         elif test "${cf_tst_cflags}" = "\"'" ; then
15909
15910         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15911         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15912
15913                                 continue
15914                         fi
15915                         ;;
15916                 esac
15917                 case "$CPPFLAGS" in
15918                 (*$cf_add_cflags)
15919                         ;;
15920                 (*)
15921                         case "$cf_add_cflags" in
15922                         (-D*)
15923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15924
15925 CPPFLAGS=`echo "$CPPFLAGS" | \
15926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15928
15929                                 ;;
15930                         esac
15931
15932         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15933         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15934
15935                         ;;
15936                 esac
15937                 ;;
15938         (*)
15939
15940         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15941         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15942
15943                 ;;
15944         esac
15945         ;;
15946 (yes)
15947
15948         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15949         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15950
15951         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15952
15953         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15954                 && test -z "${cf_tst_cflags}" \
15955                 && cf_fix_cppflags=no
15956         ;;
15957 esac
15958 done
15959
15960 if test -n "$cf_new_cflags" ; then
15961
15962         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15963         CFLAGS="${CFLAGS}$cf_new_cflags"
15964
15965 fi
15966
15967 if test -n "$cf_new_cppflags" ; then
15968
15969         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15970         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15971
15972 fi
15973
15974 if test -n "$cf_new_extra_cppflags" ; then
15975
15976         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15977         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15978
15979 fi
15980
15981 else
15982         ADA_TRACE=FALSE
15983 fi
15984
15985 echo "$as_me:15985: checking if we want to use GNAT projects" >&5
15986 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15987
15988 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15989 if test "${enable_gnat_projects+set}" = set; then
15990   enableval="$enable_gnat_projects"
15991   test "$enableval" != no && enableval=yes
15992         if test "$enableval" != "yes" ; then
15993     enable_gnat_projects=no
15994         else
15995                 enable_gnat_projects=yes
15996         fi
15997 else
15998   enableval=yes
15999         enable_gnat_projects=yes
16000
16001 fi;
16002 echo "$as_me:16002: result: $enable_gnat_projects" >&5
16003 echo "${ECHO_T}$enable_gnat_projects" >&6
16004
16005 ###     Checks for libraries.
16006 case $cf_cv_system_name in
16007 (*mingw32*)
16008
16009 echo "$as_me:16009: checking if ssp library is needed" >&5
16010 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16011 if test "${cf_cv_need_libssp+set}" = set; then
16012   echo $ECHO_N "(cached) $ECHO_C" >&6
16013 else
16014
16015 cat >"conftest.$ac_ext" <<_ACEOF
16016 #line 16016 "configure"
16017 #include "confdefs.h"
16018
16019 #include <sys/types.h>
16020 #include <dirent.h>
16021
16022 int
16023 main (void)
16024 {
16025
16026        DIR *dp = opendir(".");
16027
16028   ;
16029   return 0;
16030 }
16031 _ACEOF
16032 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16033 if { (eval echo "$as_me:16033: \"$ac_link\"") >&5
16034   (eval $ac_link) 2>&5
16035   ac_status=$?
16036   echo "$as_me:16036: \$? = $ac_status" >&5
16037   (exit "$ac_status"); } &&
16038          { ac_try='test -s "conftest$ac_exeext"'
16039   { (eval echo "$as_me:16039: \"$ac_try\"") >&5
16040   (eval $ac_try) 2>&5
16041   ac_status=$?
16042   echo "$as_me:16042: \$? = $ac_status" >&5
16043   (exit "$ac_status"); }; }; then
16044   cf_cv_need_libssp=no
16045 else
16046   echo "$as_me: failed program was:" >&5
16047 cat "conftest.$ac_ext" >&5
16048
16049         cf_save_LIBS="$LIBS"
16050         LIBS="$LIBS -lssp"
16051         cat >"conftest.$ac_ext" <<_ACEOF
16052 #line 16052 "configure"
16053 #include "confdefs.h"
16054
16055 #include <sys/types.h>
16056 #include <dirent.h>
16057
16058 int
16059 main (void)
16060 {
16061
16062                    DIR *dp = opendir(".");
16063
16064   ;
16065   return 0;
16066 }
16067 _ACEOF
16068 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16069 if { (eval echo "$as_me:16069: \"$ac_link\"") >&5
16070   (eval $ac_link) 2>&5
16071   ac_status=$?
16072   echo "$as_me:16072: \$? = $ac_status" >&5
16073   (exit "$ac_status"); } &&
16074          { ac_try='test -s "conftest$ac_exeext"'
16075   { (eval echo "$as_me:16075: \"$ac_try\"") >&5
16076   (eval $ac_try) 2>&5
16077   ac_status=$?
16078   echo "$as_me:16078: \$? = $ac_status" >&5
16079   (exit "$ac_status"); }; }; then
16080   cf_cv_need_libssp=yes
16081 else
16082   echo "$as_me: failed program was:" >&5
16083 cat "conftest.$ac_ext" >&5
16084 cf_cv_need_libssp=maybe
16085 fi
16086 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16087         LIBS="$cf_save_LIBS"
16088
16089 fi
16090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16091 fi
16092 echo "$as_me:16092: result: $cf_cv_need_libssp" >&5
16093 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16094
16095 if test "x$cf_cv_need_libssp" = xyes
16096 then
16097
16098 cf_add_libs="$LIBS"
16099 # reverse order
16100 cf_add_0lib=
16101 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16102 # filter duplicates
16103 for cf_add_1lib in $cf_add_0lib; do
16104         for cf_add_2lib in $cf_add_libs; do
16105                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16106                         cf_add_1lib=
16107                         break
16108                 fi
16109         done
16110         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16111 done
16112 LIBS="$cf_add_libs"
16113
16114 fi
16115
16116         ;;
16117 (*)
16118 echo "$as_me:16118: checking for gettimeofday" >&5
16119 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16120 if test "${ac_cv_func_gettimeofday+set}" = set; then
16121   echo $ECHO_N "(cached) $ECHO_C" >&6
16122 else
16123   cat >"conftest.$ac_ext" <<_ACEOF
16124 #line 16124 "configure"
16125 #include "confdefs.h"
16126 #define gettimeofday autoconf_temporary
16127 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16128 #undef gettimeofday
16129
16130 #ifdef __cplusplus
16131 extern "C"
16132 #endif
16133
16134 /* We use char because int might match the return type of a gcc2
16135    builtin and then its argument prototype would still apply.  */
16136 char gettimeofday (void);
16137
16138 int
16139 main (void)
16140 {
16141
16142 /* The GNU C library defines stubs for functions which it implements
16143     to always fail with ENOSYS.  Some functions are actually named
16144     something starting with __ and the normal name is an alias.  */
16145 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16146 #error found stub for gettimeofday
16147 #endif
16148
16149         return gettimeofday ();
16150   ;
16151   return 0;
16152 }
16153 _ACEOF
16154 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16155 if { (eval echo "$as_me:16155: \"$ac_link\"") >&5
16156   (eval $ac_link) 2>&5
16157   ac_status=$?
16158   echo "$as_me:16158: \$? = $ac_status" >&5
16159   (exit "$ac_status"); } &&
16160          { ac_try='test -s "conftest$ac_exeext"'
16161   { (eval echo "$as_me:16161: \"$ac_try\"") >&5
16162   (eval $ac_try) 2>&5
16163   ac_status=$?
16164   echo "$as_me:16164: \$? = $ac_status" >&5
16165   (exit "$ac_status"); }; }; then
16166   ac_cv_func_gettimeofday=yes
16167 else
16168   echo "$as_me: failed program was:" >&5
16169 cat "conftest.$ac_ext" >&5
16170 ac_cv_func_gettimeofday=no
16171 fi
16172 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16173 fi
16174 echo "$as_me:16174: result: $ac_cv_func_gettimeofday" >&5
16175 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16176 if test "$ac_cv_func_gettimeofday" = yes; then
16177   cat >>confdefs.h <<\EOF
16178 #define HAVE_GETTIMEOFDAY 1
16179 EOF
16180
16181 else
16182
16183 echo "$as_me:16183: checking for gettimeofday in -lbsd" >&5
16184 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16185 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16186   echo $ECHO_N "(cached) $ECHO_C" >&6
16187 else
16188   ac_check_lib_save_LIBS=$LIBS
16189 LIBS="-lbsd  $LIBS"
16190 cat >"conftest.$ac_ext" <<_ACEOF
16191 #line 16191 "configure"
16192 #include "confdefs.h"
16193
16194 /* Override any gcc2 internal prototype to avoid an error.  */
16195 #ifdef __cplusplus
16196 extern "C"
16197 #endif
16198 /* We use char because int might match the return type of a gcc2
16199    builtin and then its argument prototype would still apply.  */
16200 char gettimeofday ();
16201 int
16202 main (void)
16203 {
16204 gettimeofday ();
16205   ;
16206   return 0;
16207 }
16208 _ACEOF
16209 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16210 if { (eval echo "$as_me:16210: \"$ac_link\"") >&5
16211   (eval $ac_link) 2>&5
16212   ac_status=$?
16213   echo "$as_me:16213: \$? = $ac_status" >&5
16214   (exit "$ac_status"); } &&
16215          { ac_try='test -s "conftest$ac_exeext"'
16216   { (eval echo "$as_me:16216: \"$ac_try\"") >&5
16217   (eval $ac_try) 2>&5
16218   ac_status=$?
16219   echo "$as_me:16219: \$? = $ac_status" >&5
16220   (exit "$ac_status"); }; }; then
16221   ac_cv_lib_bsd_gettimeofday=yes
16222 else
16223   echo "$as_me: failed program was:" >&5
16224 cat "conftest.$ac_ext" >&5
16225 ac_cv_lib_bsd_gettimeofday=no
16226 fi
16227 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16228 LIBS=$ac_check_lib_save_LIBS
16229 fi
16230 echo "$as_me:16230: result: $ac_cv_lib_bsd_gettimeofday" >&5
16231 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16232 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16233
16234 cat >>confdefs.h <<\EOF
16235 #define HAVE_GETTIMEOFDAY 1
16236 EOF
16237
16238         LIBS="$LIBS -lbsd"
16239 fi
16240
16241 fi
16242         ;;
16243 esac
16244
16245 ###     Checks for header files.
16246 echo "$as_me:16246: checking for ANSI C header files" >&5
16247 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16248 if test "${ac_cv_header_stdc+set}" = set; then
16249   echo $ECHO_N "(cached) $ECHO_C" >&6
16250 else
16251   cat >"conftest.$ac_ext" <<_ACEOF
16252 #line 16252 "configure"
16253 #include "confdefs.h"
16254 #include <stdlib.h>
16255 #include <stdarg.h>
16256 #include <string.h>
16257 #include <float.h>
16258
16259 _ACEOF
16260 if { (eval echo "$as_me:16260: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16261   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16262   ac_status=$?
16263   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16264   rm -f conftest.er1
16265   cat conftest.err >&5
16266   echo "$as_me:16266: \$? = $ac_status" >&5
16267   (exit "$ac_status"); } >/dev/null; then
16268   if test -s conftest.err; then
16269     ac_cpp_err=$ac_c_preproc_warn_flag
16270   else
16271     ac_cpp_err=
16272   fi
16273 else
16274   ac_cpp_err=yes
16275 fi
16276 if test -z "$ac_cpp_err"; then
16277   ac_cv_header_stdc=yes
16278 else
16279   echo "$as_me: failed program was:" >&5
16280   cat "conftest.$ac_ext" >&5
16281   ac_cv_header_stdc=no
16282 fi
16283 rm -f conftest.err "conftest.$ac_ext"
16284
16285 if test $ac_cv_header_stdc = yes; then
16286   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16287   cat >"conftest.$ac_ext" <<_ACEOF
16288 #line 16288 "configure"
16289 #include "confdefs.h"
16290 #include <string.h>
16291
16292 _ACEOF
16293 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16294   $EGREP "memchr" >/dev/null 2>&1; then
16295   :
16296 else
16297   ac_cv_header_stdc=no
16298 fi
16299 rm -rf conftest*
16300
16301 fi
16302
16303 if test $ac_cv_header_stdc = yes; then
16304   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16305   cat >"conftest.$ac_ext" <<_ACEOF
16306 #line 16306 "configure"
16307 #include "confdefs.h"
16308 #include <stdlib.h>
16309
16310 _ACEOF
16311 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16312   $EGREP "free" >/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   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16323   if test "$cross_compiling" = yes; then
16324   :
16325 else
16326   cat >"conftest.$ac_ext" <<_ACEOF
16327 #line 16327 "configure"
16328 #include "confdefs.h"
16329 #include <ctype.h>
16330 #if ((' ' & 0x0FF) == 0x020)
16331 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16332 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16333 #else
16334 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16335                      || ('j' <= (c) && (c) <= 'r') \
16336                      || ('s' <= (c) && (c) <= 'z'))
16337 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16338 #endif
16339
16340 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16341 int
16342 main (void)
16343 {
16344   int i;
16345   for (i = 0; i < 256; i++)
16346     if (XOR (islower (i), ISLOWER (i))
16347         || toupper (i) != TOUPPER (i))
16348       $ac_main_return(2);
16349   $ac_main_return (0);
16350 }
16351 _ACEOF
16352 rm -f "conftest$ac_exeext"
16353 if { (eval echo "$as_me:16353: \"$ac_link\"") >&5
16354   (eval $ac_link) 2>&5
16355   ac_status=$?
16356   echo "$as_me:16356: \$? = $ac_status" >&5
16357   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16358   { (eval echo "$as_me:16358: \"$ac_try\"") >&5
16359   (eval $ac_try) 2>&5
16360   ac_status=$?
16361   echo "$as_me:16361: \$? = $ac_status" >&5
16362   (exit "$ac_status"); }; }; then
16363   :
16364 else
16365   echo "$as_me: program exited with status $ac_status" >&5
16366 echo "$as_me: failed program was:" >&5
16367 cat "conftest.$ac_ext" >&5
16368 ac_cv_header_stdc=no
16369 fi
16370 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16371 fi
16372 fi
16373 fi
16374 echo "$as_me:16374: result: $ac_cv_header_stdc" >&5
16375 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16376 if test $ac_cv_header_stdc = yes; then
16377
16378 cat >>confdefs.h <<\EOF
16379 #define STDC_HEADERS 1
16380 EOF
16381
16382 fi
16383
16384 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16385
16386 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16387                   inttypes.h stdint.h unistd.h
16388 do
16389 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16390 echo "$as_me:16390: checking for $ac_header" >&5
16391 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16392 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16393   echo $ECHO_N "(cached) $ECHO_C" >&6
16394 else
16395   cat >"conftest.$ac_ext" <<_ACEOF
16396 #line 16396 "configure"
16397 #include "confdefs.h"
16398 $ac_includes_default
16399 #include <$ac_header>
16400 _ACEOF
16401 rm -f "conftest.$ac_objext"
16402 if { (eval echo "$as_me:16402: \"$ac_compile\"") >&5
16403   (eval $ac_compile) 2>&5
16404   ac_status=$?
16405   echo "$as_me:16405: \$? = $ac_status" >&5
16406   (exit "$ac_status"); } &&
16407          { ac_try='test -s "conftest.$ac_objext"'
16408   { (eval echo "$as_me:16408: \"$ac_try\"") >&5
16409   (eval $ac_try) 2>&5
16410   ac_status=$?
16411   echo "$as_me:16411: \$? = $ac_status" >&5
16412   (exit "$ac_status"); }; }; then
16413   eval "$as_ac_Header=yes"
16414 else
16415   echo "$as_me: failed program was:" >&5
16416 cat "conftest.$ac_ext" >&5
16417 eval "$as_ac_Header=no"
16418 fi
16419 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16420 fi
16421 echo "$as_me:16421: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16422 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16423 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16424   cat >>confdefs.h <<EOF
16425 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16426 EOF
16427
16428 fi
16429 done
16430
16431 echo "$as_me:16431: checking for signed char" >&5
16432 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16433 if test "${ac_cv_type_signed_char+set}" = set; then
16434   echo $ECHO_N "(cached) $ECHO_C" >&6
16435 else
16436   cat >"conftest.$ac_ext" <<_ACEOF
16437 #line 16437 "configure"
16438 #include "confdefs.h"
16439 $ac_includes_default
16440 int
16441 main (void)
16442 {
16443 if ((signed char *) 0)
16444   return 0;
16445 if (sizeof (signed char))
16446   return 0;
16447   ;
16448   return 0;
16449 }
16450 _ACEOF
16451 rm -f "conftest.$ac_objext"
16452 if { (eval echo "$as_me:16452: \"$ac_compile\"") >&5
16453   (eval $ac_compile) 2>&5
16454   ac_status=$?
16455   echo "$as_me:16455: \$? = $ac_status" >&5
16456   (exit "$ac_status"); } &&
16457          { ac_try='test -s "conftest.$ac_objext"'
16458   { (eval echo "$as_me:16458: \"$ac_try\"") >&5
16459   (eval $ac_try) 2>&5
16460   ac_status=$?
16461   echo "$as_me:16461: \$? = $ac_status" >&5
16462   (exit "$ac_status"); }; }; then
16463   ac_cv_type_signed_char=yes
16464 else
16465   echo "$as_me: failed program was:" >&5
16466 cat "conftest.$ac_ext" >&5
16467 ac_cv_type_signed_char=no
16468 fi
16469 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16470 fi
16471 echo "$as_me:16471: result: $ac_cv_type_signed_char" >&5
16472 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16473
16474 echo "$as_me:16474: checking size of signed char" >&5
16475 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16476 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16477   echo $ECHO_N "(cached) $ECHO_C" >&6
16478 else
16479   if test "$ac_cv_type_signed_char" = yes; then
16480   if test "$cross_compiling" = yes; then
16481   # Depending upon the size, compute the lo and hi bounds.
16482 cat >"conftest.$ac_ext" <<_ACEOF
16483 #line 16483 "configure"
16484 #include "confdefs.h"
16485 $ac_includes_default
16486 int
16487 main (void)
16488 {
16489 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16490   ;
16491   return 0;
16492 }
16493 _ACEOF
16494 rm -f "conftest.$ac_objext"
16495 if { (eval echo "$as_me:16495: \"$ac_compile\"") >&5
16496   (eval $ac_compile) 2>&5
16497   ac_status=$?
16498   echo "$as_me:16498: \$? = $ac_status" >&5
16499   (exit "$ac_status"); } &&
16500          { ac_try='test -s "conftest.$ac_objext"'
16501   { (eval echo "$as_me:16501: \"$ac_try\"") >&5
16502   (eval $ac_try) 2>&5
16503   ac_status=$?
16504   echo "$as_me:16504: \$? = $ac_status" >&5
16505   (exit "$ac_status"); }; }; then
16506   ac_lo=0 ac_mid=0
16507   while :; do
16508     cat >"conftest.$ac_ext" <<_ACEOF
16509 #line 16509 "configure"
16510 #include "confdefs.h"
16511 $ac_includes_default
16512 int
16513 main (void)
16514 {
16515 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16516   ;
16517   return 0;
16518 }
16519 _ACEOF
16520 rm -f "conftest.$ac_objext"
16521 if { (eval echo "$as_me:16521: \"$ac_compile\"") >&5
16522   (eval $ac_compile) 2>&5
16523   ac_status=$?
16524   echo "$as_me:16524: \$? = $ac_status" >&5
16525   (exit "$ac_status"); } &&
16526          { ac_try='test -s "conftest.$ac_objext"'
16527   { (eval echo "$as_me:16527: \"$ac_try\"") >&5
16528   (eval $ac_try) 2>&5
16529   ac_status=$?
16530   echo "$as_me:16530: \$? = $ac_status" >&5
16531   (exit "$ac_status"); }; }; then
16532   ac_hi=$ac_mid; break
16533 else
16534   echo "$as_me: failed program was:" >&5
16535 cat "conftest.$ac_ext" >&5
16536 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16537 fi
16538 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16539   done
16540 else
16541   echo "$as_me: failed program was:" >&5
16542 cat "conftest.$ac_ext" >&5
16543 ac_hi=-1 ac_mid=-1
16544   while :; do
16545     cat >"conftest.$ac_ext" <<_ACEOF
16546 #line 16546 "configure"
16547 #include "confdefs.h"
16548 $ac_includes_default
16549 int
16550 main (void)
16551 {
16552 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16553   ;
16554   return 0;
16555 }
16556 _ACEOF
16557 rm -f "conftest.$ac_objext"
16558 if { (eval echo "$as_me:16558: \"$ac_compile\"") >&5
16559   (eval $ac_compile) 2>&5
16560   ac_status=$?
16561   echo "$as_me:16561: \$? = $ac_status" >&5
16562   (exit "$ac_status"); } &&
16563          { ac_try='test -s "conftest.$ac_objext"'
16564   { (eval echo "$as_me:16564: \"$ac_try\"") >&5
16565   (eval $ac_try) 2>&5
16566   ac_status=$?
16567   echo "$as_me:16567: \$? = $ac_status" >&5
16568   (exit "$ac_status"); }; }; then
16569   ac_lo=$ac_mid; break
16570 else
16571   echo "$as_me: failed program was:" >&5
16572 cat "conftest.$ac_ext" >&5
16573 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16574 fi
16575 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16576   done
16577 fi
16578 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16579 # Binary search between lo and hi bounds.
16580 while test "x$ac_lo" != "x$ac_hi"; do
16581   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16582   cat >"conftest.$ac_ext" <<_ACEOF
16583 #line 16583 "configure"
16584 #include "confdefs.h"
16585 $ac_includes_default
16586 int
16587 main (void)
16588 {
16589 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16590   ;
16591   return 0;
16592 }
16593 _ACEOF
16594 rm -f "conftest.$ac_objext"
16595 if { (eval echo "$as_me:16595: \"$ac_compile\"") >&5
16596   (eval $ac_compile) 2>&5
16597   ac_status=$?
16598   echo "$as_me:16598: \$? = $ac_status" >&5
16599   (exit "$ac_status"); } &&
16600          { ac_try='test -s "conftest.$ac_objext"'
16601   { (eval echo "$as_me:16601: \"$ac_try\"") >&5
16602   (eval $ac_try) 2>&5
16603   ac_status=$?
16604   echo "$as_me:16604: \$? = $ac_status" >&5
16605   (exit "$ac_status"); }; }; then
16606   ac_hi=$ac_mid
16607 else
16608   echo "$as_me: failed program was:" >&5
16609 cat "conftest.$ac_ext" >&5
16610 ac_lo=`expr "$ac_mid" + 1`
16611 fi
16612 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16613 done
16614 ac_cv_sizeof_signed_char=$ac_lo
16615 else
16616   if test "$cross_compiling" = yes; then
16617   { { echo "$as_me:16617: error: cannot run test program while cross compiling" >&5
16618 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16619    { (exit 1); exit 1; }; }
16620 else
16621   cat >"conftest.$ac_ext" <<_ACEOF
16622 #line 16622 "configure"
16623 #include "confdefs.h"
16624 $ac_includes_default
16625 int
16626 main (void)
16627 {
16628 FILE *f = fopen ("conftest.val", "w");
16629 if (!f)
16630   $ac_main_return (1);
16631 fprintf (f, "%ld", (long)(sizeof (signed char)));
16632 fclose (f);
16633   ;
16634   return 0;
16635 }
16636 _ACEOF
16637 rm -f "conftest$ac_exeext"
16638 if { (eval echo "$as_me:16638: \"$ac_link\"") >&5
16639   (eval $ac_link) 2>&5
16640   ac_status=$?
16641   echo "$as_me:16641: \$? = $ac_status" >&5
16642   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16643   { (eval echo "$as_me:16643: \"$ac_try\"") >&5
16644   (eval $ac_try) 2>&5
16645   ac_status=$?
16646   echo "$as_me:16646: \$? = $ac_status" >&5
16647   (exit "$ac_status"); }; }; then
16648   ac_cv_sizeof_signed_char=`cat conftest.val`
16649 else
16650   echo "$as_me: program exited with status $ac_status" >&5
16651 echo "$as_me: failed program was:" >&5
16652 cat "conftest.$ac_ext" >&5
16653 fi
16654 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16655 fi
16656 fi
16657 rm -f conftest.val
16658 else
16659   ac_cv_sizeof_signed_char=0
16660 fi
16661 fi
16662 echo "$as_me:16662: result: $ac_cv_sizeof_signed_char" >&5
16663 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16664 cat >>confdefs.h <<EOF
16665 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16666 EOF
16667
16668 echo "$as_me:16668: checking for ANSI C header files" >&5
16669 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16670 if test "${ac_cv_header_stdc+set}" = set; then
16671   echo $ECHO_N "(cached) $ECHO_C" >&6
16672 else
16673   cat >"conftest.$ac_ext" <<_ACEOF
16674 #line 16674 "configure"
16675 #include "confdefs.h"
16676 #include <stdlib.h>
16677 #include <stdarg.h>
16678 #include <string.h>
16679 #include <float.h>
16680
16681 _ACEOF
16682 if { (eval echo "$as_me:16682: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16683   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16684   ac_status=$?
16685   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16686   rm -f conftest.er1
16687   cat conftest.err >&5
16688   echo "$as_me:16688: \$? = $ac_status" >&5
16689   (exit "$ac_status"); } >/dev/null; then
16690   if test -s conftest.err; then
16691     ac_cpp_err=$ac_c_preproc_warn_flag
16692   else
16693     ac_cpp_err=
16694   fi
16695 else
16696   ac_cpp_err=yes
16697 fi
16698 if test -z "$ac_cpp_err"; then
16699   ac_cv_header_stdc=yes
16700 else
16701   echo "$as_me: failed program was:" >&5
16702   cat "conftest.$ac_ext" >&5
16703   ac_cv_header_stdc=no
16704 fi
16705 rm -f conftest.err "conftest.$ac_ext"
16706
16707 if test $ac_cv_header_stdc = yes; then
16708   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16709   cat >"conftest.$ac_ext" <<_ACEOF
16710 #line 16710 "configure"
16711 #include "confdefs.h"
16712 #include <string.h>
16713
16714 _ACEOF
16715 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16716   $EGREP "memchr" >/dev/null 2>&1; then
16717   :
16718 else
16719   ac_cv_header_stdc=no
16720 fi
16721 rm -rf conftest*
16722
16723 fi
16724
16725 if test $ac_cv_header_stdc = yes; then
16726   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16727   cat >"conftest.$ac_ext" <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730 #include <stdlib.h>
16731
16732 _ACEOF
16733 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16734   $EGREP "free" >/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   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16745   if test "$cross_compiling" = yes; then
16746   :
16747 else
16748   cat >"conftest.$ac_ext" <<_ACEOF
16749 #line 16749 "configure"
16750 #include "confdefs.h"
16751 #include <ctype.h>
16752 #if ((' ' & 0x0FF) == 0x020)
16753 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16754 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16755 #else
16756 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16757                      || ('j' <= (c) && (c) <= 'r') \
16758                      || ('s' <= (c) && (c) <= 'z'))
16759 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16760 #endif
16761
16762 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16763 int
16764 main (void)
16765 {
16766   int i;
16767   for (i = 0; i < 256; i++)
16768     if (XOR (islower (i), ISLOWER (i))
16769         || toupper (i) != TOUPPER (i))
16770       $ac_main_return(2);
16771   $ac_main_return (0);
16772 }
16773 _ACEOF
16774 rm -f "conftest$ac_exeext"
16775 if { (eval echo "$as_me:16775: \"$ac_link\"") >&5
16776   (eval $ac_link) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16780   { (eval echo "$as_me:16780: \"$ac_try\"") >&5
16781   (eval $ac_try) 2>&5
16782   ac_status=$?
16783   echo "$as_me:16783: \$? = $ac_status" >&5
16784   (exit "$ac_status"); }; }; then
16785   :
16786 else
16787   echo "$as_me: program exited with status $ac_status" >&5
16788 echo "$as_me: failed program was:" >&5
16789 cat "conftest.$ac_ext" >&5
16790 ac_cv_header_stdc=no
16791 fi
16792 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16793 fi
16794 fi
16795 fi
16796 echo "$as_me:16796: result: $ac_cv_header_stdc" >&5
16797 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16798 if test $ac_cv_header_stdc = yes; then
16799
16800 cat >>confdefs.h <<\EOF
16801 #define STDC_HEADERS 1
16802 EOF
16803
16804 fi
16805
16806 ac_header_dirent=no
16807 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16808   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16809 echo "$as_me:16809: checking for $ac_hdr that defines DIR" >&5
16810 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16811 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16812   echo $ECHO_N "(cached) $ECHO_C" >&6
16813 else
16814   cat >"conftest.$ac_ext" <<_ACEOF
16815 #line 16815 "configure"
16816 #include "confdefs.h"
16817 #include <sys/types.h>
16818 #include <$ac_hdr>
16819
16820 int
16821 main (void)
16822 {
16823 if ((DIR *) 0)
16824 return 0;
16825   ;
16826   return 0;
16827 }
16828 _ACEOF
16829 rm -f "conftest.$ac_objext"
16830 if { (eval echo "$as_me:16830: \"$ac_compile\"") >&5
16831   (eval $ac_compile) 2>&5
16832   ac_status=$?
16833   echo "$as_me:16833: \$? = $ac_status" >&5
16834   (exit "$ac_status"); } &&
16835          { ac_try='test -s "conftest.$ac_objext"'
16836   { (eval echo "$as_me:16836: \"$ac_try\"") >&5
16837   (eval $ac_try) 2>&5
16838   ac_status=$?
16839   echo "$as_me:16839: \$? = $ac_status" >&5
16840   (exit "$ac_status"); }; }; then
16841   eval "$as_ac_Header=yes"
16842 else
16843   echo "$as_me: failed program was:" >&5
16844 cat "conftest.$ac_ext" >&5
16845 eval "$as_ac_Header=no"
16846 fi
16847 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16848 fi
16849 echo "$as_me:16849: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16850 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16851 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16852   cat >>confdefs.h <<EOF
16853 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16854 EOF
16855
16856 ac_header_dirent=$ac_hdr; break
16857 fi
16858
16859 done
16860 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16861 if test $ac_header_dirent = dirent.h; then
16862   echo "$as_me:16862: checking for opendir in -ldir" >&5
16863 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16864 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16865   echo $ECHO_N "(cached) $ECHO_C" >&6
16866 else
16867   ac_check_lib_save_LIBS=$LIBS
16868 LIBS="-ldir  $LIBS"
16869 cat >"conftest.$ac_ext" <<_ACEOF
16870 #line 16870 "configure"
16871 #include "confdefs.h"
16872
16873 /* Override any gcc2 internal prototype to avoid an error.  */
16874 #ifdef __cplusplus
16875 extern "C"
16876 #endif
16877 /* We use char because int might match the return type of a gcc2
16878    builtin and then its argument prototype would still apply.  */
16879 char opendir ();
16880 int
16881 main (void)
16882 {
16883 opendir ();
16884   ;
16885   return 0;
16886 }
16887 _ACEOF
16888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16889 if { (eval echo "$as_me:16889: \"$ac_link\"") >&5
16890   (eval $ac_link) 2>&5
16891   ac_status=$?
16892   echo "$as_me:16892: \$? = $ac_status" >&5
16893   (exit "$ac_status"); } &&
16894          { ac_try='test -s "conftest$ac_exeext"'
16895   { (eval echo "$as_me:16895: \"$ac_try\"") >&5
16896   (eval $ac_try) 2>&5
16897   ac_status=$?
16898   echo "$as_me:16898: \$? = $ac_status" >&5
16899   (exit "$ac_status"); }; }; then
16900   ac_cv_lib_dir_opendir=yes
16901 else
16902   echo "$as_me: failed program was:" >&5
16903 cat "conftest.$ac_ext" >&5
16904 ac_cv_lib_dir_opendir=no
16905 fi
16906 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16907 LIBS=$ac_check_lib_save_LIBS
16908 fi
16909 echo "$as_me:16909: result: $ac_cv_lib_dir_opendir" >&5
16910 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16911 if test "$ac_cv_lib_dir_opendir" = yes; then
16912   LIBS="$LIBS -ldir"
16913 fi
16914
16915 else
16916   echo "$as_me:16916: checking for opendir in -lx" >&5
16917 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16918 if test "${ac_cv_lib_x_opendir+set}" = set; then
16919   echo $ECHO_N "(cached) $ECHO_C" >&6
16920 else
16921   ac_check_lib_save_LIBS=$LIBS
16922 LIBS="-lx  $LIBS"
16923 cat >"conftest.$ac_ext" <<_ACEOF
16924 #line 16924 "configure"
16925 #include "confdefs.h"
16926
16927 /* Override any gcc2 internal prototype to avoid an error.  */
16928 #ifdef __cplusplus
16929 extern "C"
16930 #endif
16931 /* We use char because int might match the return type of a gcc2
16932    builtin and then its argument prototype would still apply.  */
16933 char opendir ();
16934 int
16935 main (void)
16936 {
16937 opendir ();
16938   ;
16939   return 0;
16940 }
16941 _ACEOF
16942 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16943 if { (eval echo "$as_me:16943: \"$ac_link\"") >&5
16944   (eval $ac_link) 2>&5
16945   ac_status=$?
16946   echo "$as_me:16946: \$? = $ac_status" >&5
16947   (exit "$ac_status"); } &&
16948          { ac_try='test -s "conftest$ac_exeext"'
16949   { (eval echo "$as_me:16949: \"$ac_try\"") >&5
16950   (eval $ac_try) 2>&5
16951   ac_status=$?
16952   echo "$as_me:16952: \$? = $ac_status" >&5
16953   (exit "$ac_status"); }; }; then
16954   ac_cv_lib_x_opendir=yes
16955 else
16956   echo "$as_me: failed program was:" >&5
16957 cat "conftest.$ac_ext" >&5
16958 ac_cv_lib_x_opendir=no
16959 fi
16960 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16961 LIBS=$ac_check_lib_save_LIBS
16962 fi
16963 echo "$as_me:16963: result: $ac_cv_lib_x_opendir" >&5
16964 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16965 if test "$ac_cv_lib_x_opendir" = yes; then
16966   LIBS="$LIBS -lx"
16967 fi
16968
16969 fi
16970
16971 echo "$as_me:16971: checking whether time.h and sys/time.h may both be included" >&5
16972 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16973 if test "${ac_cv_header_time+set}" = set; then
16974   echo $ECHO_N "(cached) $ECHO_C" >&6
16975 else
16976   cat >"conftest.$ac_ext" <<_ACEOF
16977 #line 16977 "configure"
16978 #include "confdefs.h"
16979 #include <sys/types.h>
16980 #include <sys/time.h>
16981 #include <time.h>
16982
16983 int
16984 main (void)
16985 {
16986 if ((struct tm *) 0)
16987 return 0;
16988   ;
16989   return 0;
16990 }
16991 _ACEOF
16992 rm -f "conftest.$ac_objext"
16993 if { (eval echo "$as_me:16993: \"$ac_compile\"") >&5
16994   (eval $ac_compile) 2>&5
16995   ac_status=$?
16996   echo "$as_me:16996: \$? = $ac_status" >&5
16997   (exit "$ac_status"); } &&
16998          { ac_try='test -s "conftest.$ac_objext"'
16999   { (eval echo "$as_me:16999: \"$ac_try\"") >&5
17000   (eval $ac_try) 2>&5
17001   ac_status=$?
17002   echo "$as_me:17002: \$? = $ac_status" >&5
17003   (exit "$ac_status"); }; }; then
17004   ac_cv_header_time=yes
17005 else
17006   echo "$as_me: failed program was:" >&5
17007 cat "conftest.$ac_ext" >&5
17008 ac_cv_header_time=no
17009 fi
17010 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17011 fi
17012 echo "$as_me:17012: result: $ac_cv_header_time" >&5
17013 echo "${ECHO_T}$ac_cv_header_time" >&6
17014 if test $ac_cv_header_time = yes; then
17015
17016 cat >>confdefs.h <<\EOF
17017 #define TIME_WITH_SYS_TIME 1
17018 EOF
17019
17020 fi
17021
17022 ###     checks for compiler characteristics
17023 ac_ext=c
17024 ac_cpp='$CPP $CPPFLAGS'
17025 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17026 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17027 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17028 ac_main_return="return"
17029
17030 echo "$as_me:17030: checking for an ANSI C-conforming const" >&5
17031 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17032 if test "${ac_cv_c_const+set}" = set; then
17033   echo $ECHO_N "(cached) $ECHO_C" >&6
17034 else
17035   cat >"conftest.$ac_ext" <<_ACEOF
17036 #line 17036 "configure"
17037 #include "confdefs.h"
17038
17039 int
17040 main (void)
17041 {
17042 /* FIXME: Include the comments suggested by Paul. */
17043 #ifndef __cplusplus
17044   /* Ultrix mips cc rejects this.  */
17045   typedef int charset[2];
17046   const charset x;
17047   /* SunOS 4.1.1 cc rejects this.  */
17048   char const *const *ccp;
17049   char **p;
17050   /* NEC SVR4.0.2 mips cc rejects this.  */
17051   struct point {int x, y;};
17052   static struct point const zero = {0,0};
17053   /* AIX XL C 1.02.0.0 rejects this.
17054      It does not let you subtract one const X* pointer from another in
17055      an arm of an if-expression whose if-part is not a constant
17056      expression */
17057   const char *g = "string";
17058   ccp = &g + (g ? g-g : 0);
17059   /* HPUX 7.0 cc rejects these. */
17060   ++ccp;
17061   p = (char**) ccp;
17062   ccp = (char const *const *) p;
17063   { /* SCO 3.2v4 cc rejects this.  */
17064     char *t;
17065     char const *s = 0 ? (char *) 0 : (char const *) 0;
17066
17067     *t++ = 0;
17068   }
17069   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17070     int x[] = {25, 17};
17071     const int *foo = &x[0];
17072     ++foo;
17073   }
17074   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17075     typedef const int *iptr;
17076     iptr p = 0;
17077     ++p;
17078   }
17079   { /* AIX XL C 1.02.0.0 rejects this saying
17080        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17081     struct s { int j; const int *ap[3]; };
17082     struct s *b; b->j = 5;
17083   }
17084   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17085     const int foo = 10;
17086   }
17087 #endif
17088
17089   ;
17090   return 0;
17091 }
17092 _ACEOF
17093 rm -f "conftest.$ac_objext"
17094 if { (eval echo "$as_me:17094: \"$ac_compile\"") >&5
17095   (eval $ac_compile) 2>&5
17096   ac_status=$?
17097   echo "$as_me:17097: \$? = $ac_status" >&5
17098   (exit "$ac_status"); } &&
17099          { ac_try='test -s "conftest.$ac_objext"'
17100   { (eval echo "$as_me:17100: \"$ac_try\"") >&5
17101   (eval $ac_try) 2>&5
17102   ac_status=$?
17103   echo "$as_me:17103: \$? = $ac_status" >&5
17104   (exit "$ac_status"); }; }; then
17105   ac_cv_c_const=yes
17106 else
17107   echo "$as_me: failed program was:" >&5
17108 cat "conftest.$ac_ext" >&5
17109 ac_cv_c_const=no
17110 fi
17111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17112 fi
17113 echo "$as_me:17113: result: $ac_cv_c_const" >&5
17114 echo "${ECHO_T}$ac_cv_c_const" >&6
17115 if test $ac_cv_c_const = no; then
17116
17117 cat >>confdefs.h <<\EOF
17118 #define const
17119 EOF
17120
17121 fi
17122
17123 ###     Checks for external-data
17124
17125 echo "$as_me:17125: checking if data-only library module links" >&5
17126 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17127 if test "${cf_cv_link_dataonly+set}" = set; then
17128   echo $ECHO_N "(cached) $ECHO_C" >&6
17129 else
17130
17131         rm -f conftest.a
17132         cat >conftest.$ac_ext <<EOF
17133 #line 17133 "configure"
17134 int     testdata[3] = { 123, 456, 789 };
17135 EOF
17136         if { (eval echo "$as_me:17136: \"$ac_compile\"") >&5
17137   (eval $ac_compile) 2>&5
17138   ac_status=$?
17139   echo "$as_me:17139: \$? = $ac_status" >&5
17140   (exit "$ac_status"); } ; then
17141                 mv conftest.o data.o && \
17142                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17143         fi
17144         rm -f conftest.$ac_ext data.o
17145         cat >conftest.$ac_ext <<EOF
17146 #line 17146 "configure"
17147 int     testfunc(void)
17148 {
17149 #if defined(NeXT)
17150         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17151 #else
17152         extern int testdata[3];
17153         return testdata[0] == 123
17154            &&  testdata[1] == 456
17155            &&  testdata[2] == 789;
17156 #endif
17157 }
17158 EOF
17159         if { (eval echo "$as_me:17159: \"$ac_compile\"") >&5
17160   (eval $ac_compile) 2>&5
17161   ac_status=$?
17162   echo "$as_me:17162: \$? = $ac_status" >&5
17163   (exit "$ac_status"); }; then
17164                 mv conftest.o func.o && \
17165                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17166         fi
17167         rm -f conftest.$ac_ext func.o
17168         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17169         cf_saveLIBS="$LIBS"
17170         LIBS="conftest.a $LIBS"
17171         if test "$cross_compiling" = yes; then
17172   cf_cv_link_dataonly=unknown
17173 else
17174   cat >"conftest.$ac_ext" <<_ACEOF
17175 #line 17175 "configure"
17176 #include "confdefs.h"
17177
17178         int main(void)
17179         {
17180                 extern int testfunc();
17181                 ${cf_cv_main_return:-return} (!testfunc());
17182         }
17183
17184 _ACEOF
17185 rm -f "conftest$ac_exeext"
17186 if { (eval echo "$as_me:17186: \"$ac_link\"") >&5
17187   (eval $ac_link) 2>&5
17188   ac_status=$?
17189   echo "$as_me:17189: \$? = $ac_status" >&5
17190   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17191   { (eval echo "$as_me:17191: \"$ac_try\"") >&5
17192   (eval $ac_try) 2>&5
17193   ac_status=$?
17194   echo "$as_me:17194: \$? = $ac_status" >&5
17195   (exit "$ac_status"); }; }; then
17196   cf_cv_link_dataonly=yes
17197 else
17198   echo "$as_me: program exited with status $ac_status" >&5
17199 echo "$as_me: failed program was:" >&5
17200 cat "conftest.$ac_ext" >&5
17201 cf_cv_link_dataonly=no
17202 fi
17203 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17204 fi
17205         LIBS="$cf_saveLIBS"
17206
17207 fi
17208
17209 echo "$as_me:17209: result: $cf_cv_link_dataonly" >&5
17210 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17211
17212 if test "$cf_cv_link_dataonly" = no ; then
17213
17214 cat >>confdefs.h <<\EOF
17215 #define BROKEN_LINKER 1
17216 EOF
17217
17218         BROKEN_LINKER=1
17219 fi
17220
17221 ###     Checks for library functions.
17222
17223 for ac_header in \
17224 unistd.h \
17225
17226 do
17227 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17228 echo "$as_me:17228: checking for $ac_header" >&5
17229 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17230 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17231   echo $ECHO_N "(cached) $ECHO_C" >&6
17232 else
17233   cat >"conftest.$ac_ext" <<_ACEOF
17234 #line 17234 "configure"
17235 #include "confdefs.h"
17236 #include <$ac_header>
17237 _ACEOF
17238 if { (eval echo "$as_me:17238: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17239   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17240   ac_status=$?
17241   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17242   rm -f conftest.er1
17243   cat conftest.err >&5
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit "$ac_status"); } >/dev/null; then
17246   if test -s conftest.err; then
17247     ac_cpp_err=$ac_c_preproc_warn_flag
17248   else
17249     ac_cpp_err=
17250   fi
17251 else
17252   ac_cpp_err=yes
17253 fi
17254 if test -z "$ac_cpp_err"; then
17255   eval "$as_ac_Header=yes"
17256 else
17257   echo "$as_me: failed program was:" >&5
17258   cat "conftest.$ac_ext" >&5
17259   eval "$as_ac_Header=no"
17260 fi
17261 rm -f conftest.err "conftest.$ac_ext"
17262 fi
17263 echo "$as_me:17263: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17264 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17265 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17266   cat >>confdefs.h <<EOF
17267 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17268 EOF
17269
17270 fi
17271 done
17272
17273 echo "$as_me:17273: checking for working mkstemp" >&5
17274 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17275 if test "${cf_cv_func_mkstemp+set}" = set; then
17276   echo $ECHO_N "(cached) $ECHO_C" >&6
17277 else
17278
17279 rm -rf ./conftest*
17280 if test "$cross_compiling" = yes; then
17281   cf_cv_func_mkstemp=maybe
17282 else
17283   cat >"conftest.$ac_ext" <<_ACEOF
17284 #line 17284 "configure"
17285 #include "confdefs.h"
17286
17287 #include <sys/types.h>
17288 #ifdef HAVE_UNISTD_H
17289 #include <unistd.h>
17290 #endif
17291 #include <stdlib.h>
17292 #include <stdio.h>
17293 #include <string.h>
17294 #include <sys/stat.h>
17295 int main(void)
17296 {
17297         char *tmpl = "conftestXXXXXX";
17298         char name[2][80];
17299         int n;
17300         int result = 0;
17301         int fd;
17302         struct stat sb;
17303
17304         umask(077);
17305         for (n = 0; n < 2; ++n) {
17306                 strcpy(name[n], tmpl);
17307                 if ((fd = mkstemp(name[n])) >= 0) {
17308                         if (!strcmp(name[n], tmpl)
17309                          || stat(name[n], &sb) != 0
17310                          || (sb.st_mode & S_IFMT) != S_IFREG
17311                          || (sb.st_mode & 077) != 0) {
17312                                 result = 1;
17313                         }
17314                         close(fd);
17315                 }
17316         }
17317         if (result == 0
17318          && !strcmp(name[0], name[1]))
17319                 result = 1;
17320         ${cf_cv_main_return:-return}(result);
17321 }
17322
17323 _ACEOF
17324 rm -f "conftest$ac_exeext"
17325 if { (eval echo "$as_me:17325: \"$ac_link\"") >&5
17326   (eval $ac_link) 2>&5
17327   ac_status=$?
17328   echo "$as_me:17328: \$? = $ac_status" >&5
17329   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17330   { (eval echo "$as_me:17330: \"$ac_try\"") >&5
17331   (eval $ac_try) 2>&5
17332   ac_status=$?
17333   echo "$as_me:17333: \$? = $ac_status" >&5
17334   (exit "$ac_status"); }; }; then
17335   cf_cv_func_mkstemp=yes
17336
17337 else
17338   echo "$as_me: program exited with status $ac_status" >&5
17339 echo "$as_me: failed program was:" >&5
17340 cat "conftest.$ac_ext" >&5
17341 cf_cv_func_mkstemp=no
17342
17343 fi
17344 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17345 fi
17346
17347 fi
17348 echo "$as_me:17348: result: $cf_cv_func_mkstemp" >&5
17349 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17350 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17351         echo "$as_me:17351: checking for mkstemp" >&5
17352 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17353 if test "${ac_cv_func_mkstemp+set}" = set; then
17354   echo $ECHO_N "(cached) $ECHO_C" >&6
17355 else
17356   cat >"conftest.$ac_ext" <<_ACEOF
17357 #line 17357 "configure"
17358 #include "confdefs.h"
17359 #define mkstemp autoconf_temporary
17360 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17361 #undef mkstemp
17362
17363 #ifdef __cplusplus
17364 extern "C"
17365 #endif
17366
17367 /* We use char because int might match the return type of a gcc2
17368    builtin and then its argument prototype would still apply.  */
17369 char mkstemp (void);
17370
17371 int
17372 main (void)
17373 {
17374
17375 /* The GNU C library defines stubs for functions which it implements
17376     to always fail with ENOSYS.  Some functions are actually named
17377     something starting with __ and the normal name is an alias.  */
17378 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17379 #error found stub for mkstemp
17380 #endif
17381
17382         return mkstemp ();
17383   ;
17384   return 0;
17385 }
17386 _ACEOF
17387 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17388 if { (eval echo "$as_me:17388: \"$ac_link\"") >&5
17389   (eval $ac_link) 2>&5
17390   ac_status=$?
17391   echo "$as_me:17391: \$? = $ac_status" >&5
17392   (exit "$ac_status"); } &&
17393          { ac_try='test -s "conftest$ac_exeext"'
17394   { (eval echo "$as_me:17394: \"$ac_try\"") >&5
17395   (eval $ac_try) 2>&5
17396   ac_status=$?
17397   echo "$as_me:17397: \$? = $ac_status" >&5
17398   (exit "$ac_status"); }; }; then
17399   ac_cv_func_mkstemp=yes
17400 else
17401   echo "$as_me: failed program was:" >&5
17402 cat "conftest.$ac_ext" >&5
17403 ac_cv_func_mkstemp=no
17404 fi
17405 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17406 fi
17407 echo "$as_me:17407: result: $ac_cv_func_mkstemp" >&5
17408 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17409
17410 fi
17411 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17412
17413 cat >>confdefs.h <<\EOF
17414 #define HAVE_MKSTEMP 1
17415 EOF
17416
17417 fi
17418
17419 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17420         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17421         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17422 fi
17423
17424 cf_with_ada=yes
17425 if test "$cf_with_ada" != "no" ; then
17426
17427 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17428 do
17429
17430 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17431
17432         unset ac_cv_path_cf_TEMP_gnat
17433         unset cf_TEMP_gnat
17434         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17435 set dummy $cf_prog_gnat; ac_word=$2
17436 echo "$as_me:17436: checking for $ac_word" >&5
17437 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17438 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17439   echo $ECHO_N "(cached) $ECHO_C" >&6
17440 else
17441   case $cf_TEMP_gnat in
17442   [\\/]* | ?:[\\/]*)
17443   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17444   ;;
17445   *)
17446   ac_save_IFS=$IFS; IFS=$ac_path_separator
17447 ac_dummy="$PATH"
17448 for ac_dir in $ac_dummy; do
17449   IFS=$ac_save_IFS
17450   test -z "$ac_dir" && ac_dir=.
17451   if $as_executable_p "$ac_dir/$ac_word"; then
17452    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17453    echo "$as_me:17453: found $ac_dir/$ac_word" >&5
17454    break
17455 fi
17456 done
17457
17458   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17459   ;;
17460 esac
17461 fi
17462 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17463
17464 if test -n "$cf_TEMP_gnat"; then
17465   echo "$as_me:17465: result: $cf_TEMP_gnat" >&5
17466 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17467 else
17468   echo "$as_me:17468: result: no" >&5
17469 echo "${ECHO_T}no" >&6
17470 fi
17471
17472         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17473
17474         if test "x$cf_TEMP_gnat" != xno; then
17475                 unset cf_cv_gnat_version
17476                 unset cf_TEMP_gnat
17477
17478 echo "$as_me:17478: checking for $cf_prog_gnat version" >&5
17479 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17480 if test "${cf_cv_gnat_version+set}" = set; then
17481   echo $ECHO_N "(cached) $ECHO_C" >&6
17482 else
17483
17484 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17485         grep '[0-9].[0-9][0-9]*' |\
17486         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17487
17488 fi
17489 echo "$as_me:17489: result: $cf_cv_gnat_version" >&5
17490 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17491 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17492 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17493
17494         fi
17495         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17496
17497         unset cf_TEMP_gnat
17498         unset cf_cv_gnat_version
17499         unset ac_cv_path_cf_TEMP_gnat
17500 done
17501
17502 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17503         cf_ada_make=
17504         cf_cv_prog_gnat_correct=no
17505 else
17506         cf_ada_make=gnatmake
17507         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17508                 # gprconfig is newer than gnatmake; we can continue...
17509                 cf_ada_config="##"
17510         else
17511                 rm -rf ./conftest* ./*~conftest*
17512                 if mkdir conftest.src
17513                 then
17514                         cf_ada_config=""
17515                         cd conftest.src
17516                         for cf_gprconfig in Ada C
17517                         do
17518                                 echo "$as_me:17518: checking for gprconfig name for $cf_gprconfig" >&5
17519 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17520                                 if test "$cf_gprconfig" = C
17521                                 then
17522                                         for cf_gprconfig_param in \
17523                                                 "$cf_gprconfig,,,,GNATGCC" \
17524                                                 "$cf_gprconfig,,,,GCC" \
17525                                                 "$cf_gprconfig"
17526                                         do
17527                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17528                                                 test -n "$cf_gprconfig_value" && break
17529                                         done
17530                                 else
17531                                         cf_gprconfig_param=$cf_gprconfig
17532                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17533                                 fi
17534                                 if test -n "$cf_gprconfig_value"
17535                                 then
17536                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17537                                         echo "$as_me:17537: result: $cf_gprconfig_value" >&5
17538 echo "${ECHO_T}$cf_gprconfig_value" >&6
17539                                 else
17540                                         echo "$as_me:17540: result: missing" >&5
17541 echo "${ECHO_T}missing" >&6
17542                                         cf_ada_config="#"
17543                                         break
17544                                 fi
17545                         done
17546                         cd ..
17547                         rm -rf ./conftest* ./*~conftest*
17548                 fi
17549         fi
17550         if test "x$cf_ada_config" != "x#"
17551         then
17552
17553 echo "$as_me:17553: checking for gnat version" >&5
17554 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17555 if test "${cf_cv_gnat_version+set}" = set; then
17556   echo $ECHO_N "(cached) $ECHO_C" >&6
17557 else
17558
17559 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17560         grep '[0-9].[0-9][0-9]*' |\
17561         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17562
17563 fi
17564 echo "$as_me:17564: result: $cf_cv_gnat_version" >&5
17565 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17566 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17567
17568 case "$cf_cv_gnat_version" in
17569 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17570         cf_cv_prog_gnat_correct=yes
17571         ;;
17572 (*)
17573         { echo "$as_me:17573: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17574 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17575         cf_cv_prog_gnat_correct=no
17576         ;;
17577 esac
17578
17579                 # Extract the first word of "m4", so it can be a program name with args.
17580 set dummy m4; ac_word=$2
17581 echo "$as_me:17581: checking for $ac_word" >&5
17582 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17583 if test "${ac_cv_prog_M4_exists+set}" = set; then
17584   echo $ECHO_N "(cached) $ECHO_C" >&6
17585 else
17586   if test -n "$M4_exists"; then
17587   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17588 else
17589   ac_save_IFS=$IFS; IFS=$ac_path_separator
17590 ac_dummy="$PATH"
17591 for ac_dir in $ac_dummy; do
17592   IFS=$ac_save_IFS
17593   test -z "$ac_dir" && ac_dir=.
17594   $as_executable_p "$ac_dir/$ac_word" || continue
17595 ac_cv_prog_M4_exists="yes"
17596 echo "$as_me:17596: found $ac_dir/$ac_word" >&5
17597 break
17598 done
17599
17600   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17601 fi
17602 fi
17603 M4_exists=$ac_cv_prog_M4_exists
17604 if test -n "$M4_exists"; then
17605   echo "$as_me:17605: result: $M4_exists" >&5
17606 echo "${ECHO_T}$M4_exists" >&6
17607 else
17608   echo "$as_me:17608: result: no" >&5
17609 echo "${ECHO_T}no" >&6
17610 fi
17611
17612                 if test "$ac_cv_prog_M4_exists" = no; then
17613                         cf_cv_prog_gnat_correct=no
17614                         { echo "$as_me:17614: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17615 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17616                 fi
17617                 if test "$cf_cv_prog_gnat_correct" = yes; then
17618                         echo "$as_me:17618: checking if GNAT works" >&5
17619 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17620
17621 rm -rf ./conftest* ./*~conftest*
17622 cat >>conftest.ads <<CF_EOF
17623 procedure conftest;
17624 CF_EOF
17625 cat >>conftest.adb <<CF_EOF
17626 with Text_IO;
17627 with GNAT.OS_Lib;
17628 procedure conftest is
17629 begin
17630    Text_IO.Put ("Hello World");
17631    Text_IO.New_Line;
17632    GNAT.OS_Lib.OS_Exit (0);
17633 end conftest;
17634 CF_EOF
17635 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17636    if ( ./conftest 1>&5 2>&1 ) ; then
17637       cf_cv_prog_gnat_correct=yes
17638    else
17639       cf_cv_prog_gnat_correct=no
17640    fi
17641 else
17642    cf_cv_prog_gnat_correct=no
17643 fi
17644 rm -rf ./conftest* ./*~conftest*
17645
17646                         echo "$as_me:17646: result: $cf_cv_prog_gnat_correct" >&5
17647 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17648                 fi
17649         else
17650                 cf_cv_prog_gnat_correct=no
17651         fi
17652 fi
17653
17654         if test "$cf_cv_prog_gnat_correct" = yes; then
17655
17656         echo "$as_me:17656: checking optimization options for ADAFLAGS" >&5
17657 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17658         case "$CFLAGS" in
17659         (*-g*)
17660
17661         ADAFLAGS="$ADAFLAGS -g"
17662
17663                 ;;
17664         esac
17665         case "$CFLAGS" in
17666         (*-O*)
17667                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17668
17669         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17670
17671                 ;;
17672         esac
17673         echo "$as_me:17673: result: $ADAFLAGS" >&5
17674 echo "${ECHO_T}$ADAFLAGS" >&6
17675
17676 echo "$as_me:17676: checking if GNATPREP supports -T option" >&5
17677 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17678 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17679   echo $ECHO_N "(cached) $ECHO_C" >&6
17680 else
17681
17682 cf_cv_gnatprep_opt_t=no
17683 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17684
17685 fi
17686 echo "$as_me:17686: result: $cf_cv_gnatprep_opt_t" >&5
17687 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17688 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17689
17690 echo "$as_me:17690: checking if GNAT supports generics" >&5
17691 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17692 case "$cf_cv_gnat_version" in
17693 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17694         cf_gnat_generics=yes
17695         ;;
17696 (*)
17697         cf_gnat_generics=no
17698         ;;
17699 esac
17700 echo "$as_me:17700: result: $cf_gnat_generics" >&5
17701 echo "${ECHO_T}$cf_gnat_generics" >&6
17702
17703 if test "$cf_gnat_generics" = yes
17704 then
17705         cf_compile_generics=generics
17706         cf_generic_objects="\${GENOBJS}"
17707 else
17708         cf_compile_generics=
17709         cf_generic_objects=
17710 fi
17711
17712 echo "$as_me:17712: checking if GNAT supports SIGINT" >&5
17713 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17714 if test "${cf_cv_gnat_sigint+set}" = set; then
17715   echo $ECHO_N "(cached) $ECHO_C" >&6
17716 else
17717
17718 rm -rf ./conftest* ./*~conftest*
17719 cat >>conftest.ads <<CF_EOF
17720 with Ada.Interrupts.Names;
17721
17722 package ConfTest is
17723
17724    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17725    pragma Unreserve_All_Interrupts;
17726    pragma Warnings (On);
17727
17728    protected Process is
17729       procedure Stop;
17730       function Continue return Boolean;
17731       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17732    private
17733       Done : Boolean := False;
17734    end Process;
17735
17736 end ConfTest;
17737 CF_EOF
17738 cat >>conftest.adb <<CF_EOF
17739 package body ConfTest is
17740    protected body Process is
17741       procedure Stop is
17742       begin
17743          Done := True;
17744       end Stop;
17745       function Continue return Boolean is
17746       begin
17747          return not Done;
17748       end Continue;
17749    end Process;
17750 end ConfTest;
17751 CF_EOF
17752 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17753       cf_cv_gnat_sigint=yes
17754 else
17755    cf_cv_gnat_sigint=no
17756 fi
17757 rm -rf ./conftest* ./*~conftest*
17758
17759 fi
17760 echo "$as_me:17760: result: $cf_cv_gnat_sigint" >&5
17761 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17762
17763 if test "$cf_cv_gnat_sigint" = yes ; then
17764         USE_GNAT_SIGINT=""
17765 else
17766         USE_GNAT_SIGINT="#"
17767 fi
17768
17769 cf_gnat_libraries=no
17770 cf_gnat_projects=no
17771
17772 if test "$enable_gnat_projects" != no ; then
17773 echo "$as_me:17773: checking if GNAT supports project files" >&5
17774 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17775 case "$cf_cv_gnat_version" in
17776 (3.[0-9]*)
17777         ;;
17778 (*)
17779         case "$cf_cv_system_name" in
17780         (cygwin*|msys*)
17781                 ;;
17782         (*)
17783                 rm -rf ./conftest* ./*~conftest*
17784                 if mkdir conftest.src conftest.bin conftest.lib
17785                 then
17786                         cd conftest.src
17787                         rm -rf ./conftest* ./*~conftest*
17788                         cat >>library.gpr <<CF_EOF
17789 project Library is
17790   Kind := External ("LIB_KIND");
17791   for Library_Name use "ConfTest";
17792   for Object_Dir use ".";
17793   for Library_ALI_Dir use External("LIBRARY_DIR");
17794   for Library_Version use External ("SONAME");
17795   for Library_Kind use Kind;
17796   for Library_Dir use External("BUILD_DIR");
17797   Source_Dir := External ("SOURCE_DIR");
17798   for Source_Dirs use (Source_Dir);
17799 end Library;
17800 CF_EOF
17801                         cat >>confpackage.ads <<CF_EOF
17802 package ConfPackage is
17803    procedure conftest;
17804 end ConfPackage;
17805 CF_EOF
17806                         cat >>confpackage.adb <<CF_EOF
17807 with Text_IO;
17808 package body ConfPackage is
17809    procedure conftest is
17810    begin
17811       Text_IO.Put ("Hello World");
17812       Text_IO.New_Line;
17813    end conftest;
17814 end ConfPackage;
17815 CF_EOF
17816                         if ( "$cf_ada_make" $ADAFLAGS \
17817                                         -Plibrary.gpr \
17818                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17819                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17820                                         -XSOURCE_DIR="`pwd`" \
17821                                         -XSONAME=libConfTest.so.1 \
17822                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17823                                 cf_gnat_projects=yes
17824                         fi
17825                         cd ..
17826                 fi
17827                 if test -f conftest.lib/confpackage.ali
17828                 then
17829                         cf_gnat_libraries=yes
17830                 fi
17831                 rm -rf ./conftest* ./*~conftest*
17832                 ;;
17833         esac
17834         ;;
17835 esac
17836 echo "$as_me:17836: result: $cf_gnat_projects" >&5
17837 echo "${ECHO_T}$cf_gnat_projects" >&6
17838 fi # enable_gnat_projects
17839
17840 if test "$cf_gnat_projects" = yes
17841 then
17842         echo "$as_me:17842: checking if GNAT supports libraries" >&5
17843 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17844         echo "$as_me:17844: result: $cf_gnat_libraries" >&5
17845 echo "${ECHO_T}$cf_gnat_libraries" >&6
17846 fi
17847
17848 USE_OLD_MAKERULES=""
17849 USE_GNAT_PROJECTS="#"
17850 USE_GNAT_MAKE_GPR="#"
17851 USE_GNAT_GPRBUILD="#"
17852
17853 if test "$cf_gnat_projects" = yes
17854 then
17855         USE_OLD_MAKERULES="#"
17856         USE_GNAT_PROJECTS=""
17857         if test "$cf_cv_VERSION_GPRBUILD" != no
17858         then
17859                 USE_GNAT_GPRBUILD=""
17860         elif test "$cf_cv_VERSION_GNATMAKE" != no
17861         then
17862                 USE_GNAT_MAKE_GPR=""
17863         else
17864                 { echo "$as_me:17864: WARNING: use old makefile rules since tools are missing" >&5
17865 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17866         fi
17867 fi
17868
17869 if test "$cf_gnat_libraries" = yes
17870 then
17871         USE_GNAT_LIBRARIES=""
17872 else
17873         USE_GNAT_LIBRARIES="#"
17874 fi
17875
17876 echo "$as_me:17876: checking for ada-compiler" >&5
17877 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17878
17879 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17880 if test "${with_ada_compiler+set}" = set; then
17881   withval="$with_ada_compiler"
17882   cf_ada_compiler=$withval
17883 else
17884   cf_ada_compiler=gnatmake
17885 fi;
17886
17887 echo "$as_me:17887: result: $cf_ada_compiler" >&5
17888 echo "${ECHO_T}$cf_ada_compiler" >&6
17889
17890                 cf_ada_package=terminal_interface
17891
17892 echo "$as_me:17892: checking for ada-include" >&5
17893 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17894
17895 # Check whether --with-ada-include or --without-ada-include was given.
17896 if test "${with_ada_include+set}" = set; then
17897   withval="$with_ada_include"
17898
17899 else
17900   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17901 fi; if test -n "$prefix/share/ada/adainclude" ; then
17902
17903 if test "x$prefix" != xNONE; then
17904         cf_path_syntax="$prefix"
17905 else
17906         cf_path_syntax="$ac_default_prefix"
17907 fi
17908
17909 case ".$withval" in
17910 (.\$\(*\)*|.\'*\'*)
17911         ;;
17912 (..|./*|.\\*)
17913         ;;
17914 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17915         ;;
17916 (.\$\{*prefix\}*|.\$\{*dir\}*)
17917         eval withval="$withval"
17918         case ".$withval" in
17919         (.NONE/*)
17920                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17921                 ;;
17922         esac
17923         ;;
17924 (.no|.NONE/*)
17925         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17926         ;;
17927 (*)
17928         { { echo "$as_me:17928: error: expected a pathname, not \"$withval\"" >&5
17929 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17930    { (exit 1); exit 1; }; }
17931         ;;
17932 esac
17933
17934 fi
17935 eval ADA_INCLUDE="$withval"
17936
17937 echo "$as_me:17937: result: $ADA_INCLUDE" >&5
17938 echo "${ECHO_T}$ADA_INCLUDE" >&6
17939
17940 echo "$as_me:17940: checking for ada-objects" >&5
17941 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17942
17943 # Check whether --with-ada-objects or --without-ada-objects was given.
17944 if test "${with_ada_objects+set}" = set; then
17945   withval="$with_ada_objects"
17946
17947 else
17948   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17949 fi; if test -n "$prefix/lib/ada/adalib" ; then
17950
17951 if test "x$prefix" != xNONE; then
17952         cf_path_syntax="$prefix"
17953 else
17954         cf_path_syntax="$ac_default_prefix"
17955 fi
17956
17957 case ".$withval" in
17958 (.\$\(*\)*|.\'*\'*)
17959         ;;
17960 (..|./*|.\\*)
17961         ;;
17962 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17963         ;;
17964 (.\$\{*prefix\}*|.\$\{*dir\}*)
17965         eval withval="$withval"
17966         case ".$withval" in
17967         (.NONE/*)
17968                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17969                 ;;
17970         esac
17971         ;;
17972 (.no|.NONE/*)
17973         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17974         ;;
17975 (*)
17976         { { echo "$as_me:17976: error: expected a pathname, not \"$withval\"" >&5
17977 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17978    { (exit 1); exit 1; }; }
17979         ;;
17980 esac
17981
17982 fi
17983 eval ADA_OBJECTS="$withval"
17984
17985 echo "$as_me:17985: result: $ADA_OBJECTS" >&5
17986 echo "${ECHO_T}$ADA_OBJECTS" >&6
17987
17988 echo "$as_me:17988: checking if an Ada95 shared-library should be built" >&5
17989 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17990
17991 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17992 if test "${with_ada_sharedlib+set}" = set; then
17993   withval="$with_ada_sharedlib"
17994   with_ada_sharedlib=$withval
17995 else
17996   with_ada_sharedlib=no
17997 fi;
17998 echo "$as_me:17998: result: $with_ada_sharedlib" >&5
17999 echo "${ECHO_T}$with_ada_sharedlib" >&6
18000
18001 if test "x$with_ada_sharedlib" != xno
18002 then
18003         if test "x$cf_gnat_projects" != xyes
18004         then
18005                 { echo "$as_me:18005: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18006 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18007                 with_ada_sharedlib=no
18008         fi
18009 fi
18010
18011 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18012 MAKE_ADA_SHAREDLIB="#"
18013
18014 if test "x$with_ada_sharedlib" != xno
18015 then
18016         MAKE_ADA_SHAREDLIB=
18017         if test "x$with_ada_sharedlib" != xyes
18018         then
18019                 ADA_SHAREDLIB="$with_ada_sharedlib"
18020         fi
18021 fi
18022
18023                 # allow the Ada binding to be renamed
18024
18025 echo "$as_me:18025: checking for ada-libname" >&5
18026 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18027
18028 # Check whether --with-ada-libname or --without-ada-libname was given.
18029 if test "${with_ada_libname+set}" = set; then
18030   withval="$with_ada_libname"
18031   ADA_LIBNAME=$withval
18032 else
18033   ADA_LIBNAME=AdaCurses
18034 fi;
18035 case "x$ADA_LIBNAME" in
18036 (x|xyes|xno)
18037         ADA_LIBNAME=AdaCurses
18038         ;;
18039 esac
18040
18041 echo "$as_me:18041: result: $ADA_LIBNAME" >&5
18042 echo "${ECHO_T}$ADA_LIBNAME" >&6
18043
18044         else
18045                 { { echo "$as_me:18045: error: No usable Ada compiler found" >&5
18046 echo "$as_me: error: No usable Ada compiler found" >&2;}
18047    { (exit 1); exit 1; }; }
18048         fi
18049 else
18050         { { echo "$as_me:18050: error: The Ada compiler is needed for this package" >&5
18051 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18052    { (exit 1); exit 1; }; }
18053 fi
18054
18055 ################################################################################
18056
18057 # not needed
18058 TINFO_LDFLAGS2=
18059
18060 TINFO_LIBS=
18061
18062 ### Construct the list of include-directories to be generated
18063
18064 if test "$srcdir" != "."; then
18065         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18066 fi
18067 CPPFLAGS="-I../include $CPPFLAGS"
18068 if test "$srcdir" != "."; then
18069         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18070 fi
18071 CPPFLAGS="-I. $CPPFLAGS"
18072
18073 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18074 if test "$srcdir" != "."; then
18075         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18076 fi
18077 if test "$GCC" != yes; then
18078         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18079 elif test "$includedir" != "/usr/include"; then
18080         if test "$includedir" = '${prefix}/include' ; then
18081                 if test x$prefix != x/usr ; then
18082                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18083                 fi
18084         else
18085                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18086         fi
18087 fi
18088
18089 ### Build up pieces for makefile rules
18090 echo "$as_me:18090: checking default library suffix" >&5
18091 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18092
18093         case $DFT_LWR_MODEL in
18094         (libtool) DFT_ARG_SUFFIX=''   ;;
18095         (normal)  DFT_ARG_SUFFIX=''   ;;
18096         (debug)   DFT_ARG_SUFFIX='_g' ;;
18097         (profile) DFT_ARG_SUFFIX='_p' ;;
18098         (shared)  DFT_ARG_SUFFIX=''   ;;
18099         esac
18100         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18101 echo "$as_me:18101: result: $DFT_ARG_SUFFIX" >&5
18102 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18103
18104 echo "$as_me:18104: checking default library-dependency suffix" >&5
18105 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18106
18107         case X$DFT_LWR_MODEL in
18108         (Xlibtool)
18109                 DFT_LIB_SUFFIX='.la'
18110                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18111                 ;;
18112         (Xdebug)
18113                 case "$cf_cv_system_name" in
18114                 (*-msvc*)
18115                         DFT_LIB_SUFFIX='_g.lib'
18116                         ;;
18117                 (*)
18118                         DFT_LIB_SUFFIX='_g.a'
18119                         ;;
18120                 esac
18121                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18122                 ;;
18123         (Xprofile)
18124                 case "$cf_cv_system_name" in
18125                 (*-msvc*)
18126                         DFT_LIB_SUFFIX='_p.lib'
18127                         ;;
18128                 (*)
18129                         DFT_LIB_SUFFIX='_p.a'
18130                         ;;
18131                 esac
18132                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18133                 ;;
18134         (Xshared)
18135                 case "$cf_cv_system_name" in
18136                 (aix[5-7]*)
18137                         DFT_LIB_SUFFIX='.so'
18138                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18139                         ;;
18140                 (*-msvc*)
18141                         DFT_LIB_SUFFIX='.dll'
18142                         DFT_DEP_SUFFIX='.dll.lib'
18143                         ;;
18144                 (cygwin*|msys*|mingw*)
18145                         DFT_LIB_SUFFIX='.dll'
18146                         DFT_DEP_SUFFIX='.dll.a'
18147                         ;;
18148                 (darwin*)
18149                         DFT_LIB_SUFFIX='.dylib'
18150                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18151                         ;;
18152                 (hpux*)
18153                         case "$target" in
18154                         (ia64*)
18155                                 DFT_LIB_SUFFIX='.so'
18156                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18157                                 ;;
18158                         (*)
18159                                 DFT_LIB_SUFFIX='.sl'
18160                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18161                                 ;;
18162                         esac
18163                         ;;
18164                 (*)
18165                         DFT_LIB_SUFFIX='.so'
18166                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18167                         ;;
18168                 esac
18169                 ;;
18170         (*)
18171                 case "$target" in
18172                 (*-msvc*)
18173                         DFT_LIB_SUFFIX='.lib'
18174                         ;;
18175                 (*)
18176                         DFT_LIB_SUFFIX='.a'
18177                         ;;
18178                 esac
18179                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18180                 ;;
18181         esac
18182         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18183         then
18184                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18185                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18186         fi
18187 echo "$as_me:18187: result: $DFT_DEP_SUFFIX" >&5
18188 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18189
18190 echo "$as_me:18190: checking default object directory" >&5
18191 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18192
18193         case $DFT_LWR_MODEL in
18194         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18195         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18196         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18197         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18198         (shared)
18199                 case "$cf_cv_system_name" in
18200                 (cygwin|msys)
18201                         DFT_OBJ_SUBDIR='objects' ;;
18202                 (*)
18203                         DFT_OBJ_SUBDIR='obj_s' ;;
18204                 esac
18205         esac
18206 echo "$as_me:18206: result: $DFT_OBJ_SUBDIR" >&5
18207 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18208
18209 ### Set up low-level terminfo dependencies for makefiles.
18210
18211 if test "$DFT_LWR_MODEL" = shared ; then
18212         case $cf_cv_system_name in
18213         (cygwin*)
18214                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18215                 ;;
18216         (msys*)
18217                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18218                 ;;
18219         esac
18220 fi
18221
18222 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18223
18224 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18225
18226 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18227
18228 ### Construct the list of subdirectories for which we'll customize makefiles
18229 ### with the appropriate compile-rules.
18230
18231 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18232
18233 cat >>confdefs.h <<EOF
18234 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18235 EOF
18236
18237 ################################################################################
18238
18239 TEST_ARG2=
18240
18241 TEST_LIBS2=
18242
18243 NCURSES_SHLIB2="sh -c"
18244
18245 ADA_SUBDIRS="include gen src doc"
18246 if test "x$cf_with_tests" != "xno" ; then
18247         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18248 fi
18249 for cf_dir in $ADA_SUBDIRS
18250 do
18251         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18252 done
18253
18254 NCURSES_TREE="#"
18255
18256 EXTERNAL_TREE=
18257
18258 # match layout used by make-tar.sh
18259 ADAHTML_DIR=../doc/ada
18260
18261 if test "x$cross_compiling" = xyes ; then
18262         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18263 else
18264         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18265 fi
18266
18267 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"
18268 ac_config_commands="$ac_config_commands default"
18269 cat >confcache <<\_ACEOF
18270 # This file is a shell script that caches the results of configure
18271 # tests run on this system so they can be shared between configure
18272 # scripts and configure runs, see configure's option --config-cache.
18273 # It is not useful on other systems.  If it contains results you don't
18274 # want to keep, you may remove or edit it.
18275 #
18276 # config.status only pays attention to the cache file if you give it
18277 # the --recheck option to rerun configure.
18278 #
18279 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18280 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18281 # following values.
18282
18283 _ACEOF
18284
18285 # The following way of writing the cache mishandles newlines in values,
18286 # but we know of no workaround that is simple, portable, and efficient.
18287 # So, don't put newlines in cache variables' values.
18288 # Ultrix sh set writes to stderr and can't be redirected directly,
18289 # and sets the high bit in the cache file unless we assign to the vars.
18290 {
18291   (set) 2>&1 |
18292     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18293     *ac_space=\ *)
18294       # `set' does not quote correctly, so add quotes (double-quote
18295       # substitution turns \\\\ into \\, and sed turns \\ into \).
18296       sed -n \
18297         "s/'/'\\\\''/g;
18298           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18299       ;;
18300     *)
18301       # `set' quotes correctly as required by POSIX, so do not add quotes.
18302       sed -n \
18303         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18304       ;;
18305     esac;
18306 } |
18307   sed '
18308      t clear
18309      : clear
18310      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18311      t end
18312      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18313      : end' >>confcache
18314 if cmp -s $cache_file confcache; then :; else
18315   if test -w $cache_file; then
18316     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18317     cat confcache >$cache_file
18318   else
18319     echo "not updating unwritable cache $cache_file"
18320   fi
18321 fi
18322 rm -f confcache
18323
18324 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18325 # Let make expand exec_prefix.
18326 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18327
18328 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18329 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18330 # trailing colons and then remove the whole line if VPATH becomes empty
18331 # (actually we leave an empty line to preserve line numbers).
18332 if test "x$srcdir" = x.; then
18333   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18334 s/:*\$(srcdir):*/:/;
18335 s/:*\${srcdir}:*/:/;
18336 s/:*@srcdir@:*/:/;
18337 s/^\([^=]*=[    ]*\):*/\1/;
18338 s/:*$//;
18339 s/^[^=]*=[      ]*$//;
18340 }'
18341 fi
18342
18343 DEFS=-DHAVE_CONFIG_H
18344
18345 : "${CONFIG_STATUS=./config.status}"
18346 ac_clean_files_save=$ac_clean_files
18347 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18348 { echo "$as_me:18348: creating $CONFIG_STATUS" >&5
18349 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18350 cat >"$CONFIG_STATUS" <<_ACEOF
18351 #! $SHELL
18352 # Generated automatically by configure.
18353 # Run this file to recreate the current configuration.
18354 # Compiler output produced by configure, useful for debugging
18355 # configure, is in config.log if it exists.
18356
18357 debug=false
18358 SHELL=\${CONFIG_SHELL-$SHELL}
18359 ac_cs_invocation="\$0 \$@"
18360
18361 CLICOLOR_FORCE= GREP_OPTIONS=
18362 unset CLICOLOR_FORCE GREP_OPTIONS
18363 _ACEOF
18364
18365 cat >>"$CONFIG_STATUS" <<\_ACEOF
18366 # Be Bourne compatible
18367 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18368   emulate sh
18369   NULLCMD=:
18370 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18371   set -o posix
18372 fi
18373
18374 # Name of the executable.
18375 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18376
18377 if expr a : '\(a\)' >/dev/null 2>&1; then
18378   as_expr=expr
18379 else
18380   as_expr=false
18381 fi
18382
18383 rm -f conf$$ conf$$.exe conf$$.file
18384 echo >conf$$.file
18385 if ln -s conf$$.file conf$$ 2>/dev/null; then
18386   # We could just check for DJGPP; but this test a) works b) is more generic
18387   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18388   if test -f conf$$.exe; then
18389     # Don't use ln at all; we don't have any links
18390     as_ln_s='cp -p'
18391   else
18392     as_ln_s='ln -s'
18393   fi
18394 elif ln conf$$.file conf$$ 2>/dev/null; then
18395   as_ln_s=ln
18396 else
18397   as_ln_s='cp -p'
18398 fi
18399 rm -f conf$$ conf$$.exe conf$$.file
18400
18401 as_executable_p="test -f"
18402
18403 # Support unset when possible.
18404 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18405   as_unset="unset"
18406 else
18407   as_unset="false"
18408 fi
18409
18410 # NLS nuisances.
18411 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18412 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18413 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18414 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18415 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18416 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18417 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18418 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18419
18420 # IFS
18421 # We need space, tab and new line, in precisely that order.
18422 as_nl='
18423 '
18424 IFS="   $as_nl"
18425
18426 # CDPATH.
18427 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18428
18429 exec 6>&1
18430
18431 _ACEOF
18432
18433 # Files that config.status was made for.
18434 if test -n "$ac_config_files"; then
18435   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18436 fi
18437
18438 if test -n "$ac_config_headers"; then
18439   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18440 fi
18441
18442 if test -n "$ac_config_links"; then
18443   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18444 fi
18445
18446 if test -n "$ac_config_commands"; then
18447   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18448 fi
18449
18450 cat >>"$CONFIG_STATUS" <<\EOF
18451
18452 ac_cs_usage="\
18453 \`$as_me' instantiates files from templates according to the
18454 current configuration.
18455
18456 Usage: $0 [OPTIONS] [FILE]...
18457
18458   -h, --help       print this help, then exit
18459   -V, --version    print version number, then exit
18460   -d, --debug      don't remove temporary files
18461       --recheck    update $as_me by reconfiguring in the same conditions
18462   --file=FILE[:TEMPLATE]
18463                    instantiate the configuration file FILE
18464   --header=FILE[:TEMPLATE]
18465                    instantiate the configuration header FILE
18466
18467 Configuration files:
18468 $config_files
18469
18470 Configuration headers:
18471 $config_headers
18472
18473 Configuration commands:
18474 $config_commands
18475
18476 Report bugs to <dickey@invisible-island.net>."
18477 EOF
18478
18479 cat >>"$CONFIG_STATUS" <<EOF
18480 ac_cs_version="\\
18481 config.status
18482 configured by $0, generated by GNU Autoconf 2.52.20210509,
18483   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18484
18485 Copyright 2003-2020,2021        Thomas E. Dickey
18486 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18487 Free Software Foundation, Inc.
18488 This config.status script is free software; the Free Software Foundation
18489 gives unlimited permission to copy, distribute and modify it."
18490 srcdir="$srcdir"
18491 INSTALL="$INSTALL"
18492 EOF
18493
18494 cat >>"$CONFIG_STATUS" <<\EOF
18495 # If no file are specified by the user, then we need to provide default
18496 # value.  By we need to know if files were specified by the user.
18497 ac_need_defaults=:
18498 while test $# != 0
18499 do
18500   case $1 in
18501   --*=*)
18502     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18503     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18504     shift
18505     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18506     shift
18507     ;;
18508   -*);;
18509   *) # This is not an option, so the user has probably given explicit
18510      # arguments.
18511      ac_need_defaults=false;;
18512   esac
18513
18514   case $1 in
18515   # Handling of the options.
18516 EOF
18517 cat >>"$CONFIG_STATUS" <<EOF
18518   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18519     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18520     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18521 EOF
18522 cat >>"$CONFIG_STATUS" <<\EOF
18523   --version | --vers* | -V )
18524     echo "$ac_cs_version"; exit 0 ;;
18525   --he | --h)
18526     # Conflict between --help and --header
18527     { { echo "$as_me:18527: error: ambiguous option: $1
18528 Try \`$0 --help' for more information." >&5
18529 echo "$as_me: error: ambiguous option: $1
18530 Try \`$0 --help' for more information." >&2;}
18531    { (exit 1); exit 1; }; };;
18532   --help | --hel | -h )
18533     echo "$ac_cs_usage"; exit 0 ;;
18534   --debug | --d* | -d )
18535     debug=: ;;
18536   --file | --fil | --fi | --f )
18537     shift
18538     CONFIG_FILES="$CONFIG_FILES $1"
18539     ac_need_defaults=false;;
18540   --header | --heade | --head | --hea )
18541     shift
18542     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18543     ac_need_defaults=false;;
18544
18545   # This is an error.
18546   -*) { { echo "$as_me:18546: error: unrecognized option: $1
18547 Try \`$0 --help' for more information." >&5
18548 echo "$as_me: error: unrecognized option: $1
18549 Try \`$0 --help' for more information." >&2;}
18550    { (exit 1); exit 1; }; } ;;
18551
18552   *) ac_config_targets="$ac_config_targets $1" ;;
18553
18554   esac
18555   shift
18556 done
18557
18558 exec 5>>config.log
18559 cat >&5 << _ACEOF
18560
18561 ## ----------------------- ##
18562 ## Running config.status.  ##
18563 ## ----------------------- ##
18564
18565 This file was extended by $as_me 2.52.20210509, executed with
18566   CONFIG_FILES    = $CONFIG_FILES
18567   CONFIG_HEADERS  = $CONFIG_HEADERS
18568   CONFIG_LINKS    = $CONFIG_LINKS
18569   CONFIG_COMMANDS = $CONFIG_COMMANDS
18570   > "$ac_cs_invocation"
18571 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18572
18573 _ACEOF
18574 EOF
18575
18576 cat >>"$CONFIG_STATUS" <<EOF
18577 #
18578 # INIT-COMMANDS section.
18579 #
18580
18581 ### Special initialization commands, used to pass information from the
18582 ### configuration-run into config.status
18583
18584 AWK="$AWK"
18585 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18586 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18587 LIB_NAME="$LIB_NAME"
18588 LIB_PREFIX="$LIB_PREFIX"
18589 LIB_SUFFIX="$LIB_SUFFIX"
18590 LN_S="$LN_S"
18591 NCURSES_MAJOR="$NCURSES_MAJOR"
18592 NCURSES_MINOR="$NCURSES_MINOR"
18593 NCURSES_PATCH="$NCURSES_PATCH"
18594 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18595 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18596 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18597 cf_cv_abi_version="$cf_cv_abi_version"
18598 cf_cv_rel_version="$cf_cv_rel_version"
18599 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18600 cf_cv_shared_soname='$cf_cv_shared_soname'
18601 cf_cv_shlib_version="$cf_cv_shlib_version"
18602 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18603 cf_cv_system_name="$cf_cv_system_name"
18604 host="$host"
18605 target="$target"
18606
18607 EOF
18608
18609 cat >>"$CONFIG_STATUS" <<\EOF
18610 for ac_config_target in $ac_config_targets
18611 do
18612   case "$ac_config_target" in
18613   # Handling of arguments.
18614   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18615   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18616   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18617   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18618   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18619   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18620   *) { { echo "$as_me:18620: error: invalid argument: $ac_config_target" >&5
18621 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18622    { (exit 1); exit 1; }; };;
18623   esac
18624 done
18625
18626 # If the user did not use the arguments to specify the items to instantiate,
18627 # then the envvar interface is used.  Set only those that are not.
18628 # We use the long form for the default assignment because of an extremely
18629 # bizarre bug on SunOS 4.1.3.
18630 if "$ac_need_defaults"; then
18631   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18632   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18633   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18634 fi
18635
18636 # Create a temporary directory, and hook for its removal unless debugging.
18637 $debug ||
18638 {
18639   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18640   trap '{ (exit 1); exit 1; }' 1 2 13 15
18641 }
18642
18643 # Create a (secure) tmp directory for tmp files.
18644 : ${TMPDIR=/tmp}
18645 {
18646   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18647   test -n "$tmp" && test -d "$tmp"
18648 }  ||
18649 {
18650   tmp=$TMPDIR/cs$$-$RANDOM
18651   (umask 077 && mkdir $tmp)
18652 } ||
18653 {
18654    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18655    { (exit 1); exit 1; }
18656 }
18657
18658 EOF
18659
18660 cat >>"$CONFIG_STATUS" <<EOF
18661
18662 #
18663 # CONFIG_FILES section.
18664 #
18665
18666 # No need to generate the scripts if there are no CONFIG_FILES.
18667 # This happens for instance when ./config.status config.h
18668 if test -n "\$CONFIG_FILES"; then
18669   # Protect against being on the right side of a sed subst in config.status.
18670   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18671    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18672 s,@SHELL@,$SHELL,;t t
18673 s,@exec_prefix@,$exec_prefix,;t t
18674 s,@prefix@,$prefix,;t t
18675 s,@program_transform_name@,$program_transform_name,;t t
18676 s,@bindir@,$bindir,;t t
18677 s,@sbindir@,$sbindir,;t t
18678 s,@libexecdir@,$libexecdir,;t t
18679 s,@datarootdir@,$datarootdir,;t t
18680 s,@datadir@,$datadir,;t t
18681 s,@sysconfdir@,$sysconfdir,;t t
18682 s,@sharedstatedir@,$sharedstatedir,;t t
18683 s,@localstatedir@,$localstatedir,;t t
18684 s,@runstatedir@,$runstatedir,;t t
18685 s,@libdir@,$libdir,;t t
18686 s,@includedir@,$includedir,;t t
18687 s,@oldincludedir@,$oldincludedir,;t t
18688 s,@infodir@,$infodir,;t t
18689 s,@mandir@,$mandir,;t t
18690 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18691 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18692 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18693 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18694 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18695 s,@build_alias@,$build_alias,;t t
18696 s,@host_alias@,$host_alias,;t t
18697 s,@target_alias@,$target_alias,;t t
18698 s,@ECHO_C@,$ECHO_C,;t t
18699 s,@ECHO_N@,$ECHO_N,;t t
18700 s,@ECHO_T@,$ECHO_T,;t t
18701 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18702 s,@DEFS@,$DEFS,;t t
18703 s,@LIBS@,$LIBS,;t t
18704 s,@top_builddir@,$top_builddir,;t t
18705 s,@build@,$build,;t t
18706 s,@build_cpu@,$build_cpu,;t t
18707 s,@build_vendor@,$build_vendor,;t t
18708 s,@build_os@,$build_os,;t t
18709 s,@host@,$host,;t t
18710 s,@host_cpu@,$host_cpu,;t t
18711 s,@host_vendor@,$host_vendor,;t t
18712 s,@host_os@,$host_os,;t t
18713 s,@target@,$target,;t t
18714 s,@target_cpu@,$target_cpu,;t t
18715 s,@target_vendor@,$target_vendor,;t t
18716 s,@target_os@,$target_os,;t t
18717 s,@GREP@,$GREP,;t t
18718 s,@FGREP@,$FGREP,;t t
18719 s,@CC@,$CC,;t t
18720 s,@CFLAGS@,$CFLAGS,;t t
18721 s,@LDFLAGS@,$LDFLAGS,;t t
18722 s,@CPPFLAGS@,$CPPFLAGS,;t t
18723 s,@ac_ct_CC@,$ac_ct_CC,;t t
18724 s,@EXEEXT@,$EXEEXT,;t t
18725 s,@OBJEXT@,$OBJEXT,;t t
18726 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18727 s,@CPP@,$CPP,;t t
18728 s,@EGREP@,$EGREP,;t t
18729 s,@AWK@,$AWK,;t t
18730 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18731 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18732 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18733 s,@LN_S@,$LN_S,;t t
18734 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18735 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18736 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18737 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18738 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18739 s,@SET_MAKE@,$SET_MAKE,;t t
18740 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18741 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18742 s,@CTAGS@,$CTAGS,;t t
18743 s,@ETAGS@,$ETAGS,;t t
18744 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18745 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18746 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18747 s,@RANLIB@,$RANLIB,;t t
18748 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18749 s,@LD@,$LD,;t t
18750 s,@ac_ct_LD@,$ac_ct_LD,;t t
18751 s,@AR@,$AR,;t t
18752 s,@ac_ct_AR@,$ac_ct_AR,;t t
18753 s,@ARFLAGS@,$ARFLAGS,;t t
18754 s,@DESTDIR@,$DESTDIR,;t t
18755 s,@BUILD_CC@,$BUILD_CC,;t t
18756 s,@BUILD_CPP@,$BUILD_CPP,;t t
18757 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18758 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18759 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18760 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18761 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18762 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18763 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18764 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18765 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18766 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18767 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18768 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18769 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18770 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18771 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18772 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18773 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18774 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18775 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18776 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18777 s,@CC_G_OPT@,$CC_G_OPT,;t t
18778 s,@LD_MODEL@,$LD_MODEL,;t t
18779 s,@shlibdir@,$shlibdir,;t t
18780 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18781 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18782 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18783 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18784 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18785 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18786 s,@LINK_PROGS@,$LINK_PROGS,;t t
18787 s,@LINK_TESTS@,$LINK_TESTS,;t t
18788 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18789 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18790 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18791 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18792 s,@RPATH_LIST@,$RPATH_LIST,;t t
18793 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18794 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18795 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18796 s,@PTHREAD@,$PTHREAD,;t t
18797 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18798 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18799 s,@ECHO_LT@,$ECHO_LT,;t t
18800 s,@ECHO_LD@,$ECHO_LD,;t t
18801 s,@RULE_CC@,$RULE_CC,;t t
18802 s,@SHOW_CC@,$SHOW_CC,;t t
18803 s,@ECHO_CC@,$ECHO_CC,;t t
18804 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18805 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18806 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18807 s,@ADAFLAGS@,$ADAFLAGS,;t t
18808 s,@ADA_TRACE@,$ADA_TRACE,;t t
18809 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18810 s,@M4_exists@,$M4_exists,;t t
18811 s,@cf_ada_make@,$cf_ada_make,;t t
18812 s,@cf_ada_config@,$cf_ada_config,;t t
18813 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18814 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18815 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18816 s,@cf_compile_generics@,$cf_compile_generics,;t t
18817 s,@cf_generic_objects@,$cf_generic_objects,;t t
18818 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18819 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18820 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18821 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18822 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18823 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18824 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18825 s,@cf_ada_package@,$cf_ada_package,;t t
18826 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18827 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18828 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18829 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18830 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18831 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18832 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18833 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18834 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18835 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18836 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18837 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18838 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18839 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18840 s,@TEST_ARG2@,$TEST_ARG2,;t t
18841 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18842 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18843 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18844 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18845 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18846 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18847 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18848 CEOF
18849
18850 EOF
18851
18852   cat >>"$CONFIG_STATUS" <<\EOF
18853   # Split the substitutions into bite-sized pieces for seds with
18854   # small command number limits, like on Digital OSF/1 and HP-UX.
18855   ac_max_sed_lines=48
18856   ac_sed_frag=1 # Number of current file.
18857   ac_beg=1 # First line for current file.
18858   ac_end=$ac_max_sed_lines # Line after last line for current file.
18859   ac_more_lines=:
18860   ac_sed_cmds=
18861   while "$ac_more_lines"; do
18862     if test "$ac_beg" -gt 1; then
18863       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18864     else
18865       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18866     fi
18867     if test ! -s $tmp/subs.frag; then
18868       ac_more_lines=false
18869     else
18870       # The purpose of the label and of the branching condition is to
18871       # speed up the sed processing (if there are no `@' at all, there
18872       # is no need to browse any of the substitutions).
18873       # These are the two extra sed commands mentioned above.
18874       (echo ':t
18875   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18876       # It is possible to make a multiline substitution using escaped newlines.
18877       # Ensure that we do not split the substitution between script fragments.
18878       ac_BEG=$ac_end
18879       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18880       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18881       if test -s $tmp/subs.next; then
18882         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18883         if test ! -s $tmp/subs.edit; then
18884           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18885           if test ! -s $tmp/subs.edit; then
18886             if test "$ac_beg" -gt 1; then
18887               ac_end=`expr "$ac_end" - 1`
18888               continue
18889             fi
18890           fi
18891         fi
18892       fi
18893
18894       if test -z "$ac_sed_cmds"; then
18895         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18896       else
18897         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18898       fi
18899       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18900       ac_beg=$ac_end
18901       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18902     fi
18903   done
18904   if test -z "$ac_sed_cmds"; then
18905     ac_sed_cmds=cat
18906   fi
18907 fi # test -n "$CONFIG_FILES"
18908
18909 EOF
18910 cat >>"$CONFIG_STATUS" <<\EOF
18911 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18912   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18913   case "$ac_file" in
18914   - | *:- | *:-:* ) # input from stdin
18915         cat >$tmp/stdin
18916         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18917         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18918   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18919         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18920   * )   ac_file_in=$ac_file.in ;;
18921   esac
18922
18923   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18924   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18925          X"$ac_file" : 'X\(//\)[^/]' \| \
18926          X"$ac_file" : 'X\(//\)$' \| \
18927          X"$ac_file" : 'X\(/\)' \| \
18928          .     : '\(.\)' 2>/dev/null ||
18929 echo X"$ac_file" |
18930     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18931           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18932           /^X\(\/\/\)$/{ s//\1/; q; }
18933           /^X\(\/\).*/{ s//\1/; q; }
18934           s/.*/./; q'`
18935   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18936     { case "$ac_dir" in
18937   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18938   *)                      as_incr_dir=.;;
18939 esac
18940 as_dummy="$ac_dir"
18941 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18942   case $as_mkdir_dir in
18943     # Skip DOS drivespec
18944     ?:) as_incr_dir=$as_mkdir_dir ;;
18945     *)
18946       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18947       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18948     ;;
18949   esac
18950 done; }
18951
18952     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18953     # A "../" for each directory in $ac_dir_suffix.
18954     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18955   else
18956     ac_dir_suffix= ac_dots=
18957   fi
18958
18959   case "$srcdir" in
18960   .)  ac_srcdir=.
18961       if test -z "$ac_dots"; then
18962          ac_top_srcdir=.
18963       else
18964          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18965       fi ;;
18966   [\\/]* | ?:[\\/]* )
18967       ac_srcdir="$srcdir$ac_dir_suffix";
18968       ac_top_srcdir="$srcdir" ;;
18969   *) # Relative path.
18970     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18971     ac_top_srcdir="$ac_dots$srcdir" ;;
18972   esac
18973
18974   case $INSTALL in
18975   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18976   *) ac_INSTALL=$ac_dots$INSTALL ;;
18977   esac
18978
18979   if test x"$ac_file" != x-; then
18980     { echo "$as_me:18980: creating $ac_file" >&5
18981 echo "$as_me: creating $ac_file" >&6;}
18982     rm -f "$ac_file"
18983   fi
18984   # Let's still pretend it is `configure' which instantiates (i.e., don't
18985   # use $as_me), people would be surprised to read:
18986   #    /* config.h.  Generated automatically by config.status.  */
18987   configure_input="Generated automatically from `echo $ac_file_in |
18988                                                  sed 's,.*/,,'` by configure."
18989
18990   # First look for the input files in the build tree, otherwise in the
18991   # src tree.
18992   ac_file_inputs=`IFS=:
18993     for f in $ac_file_in; do
18994       case $f in
18995       -) echo $tmp/stdin ;;
18996       [\\/$]*)
18997          # Absolute (can't be DOS-style, as IFS=:)
18998          test -f "$f" || { { echo "$as_me:18998: error: cannot find input file: $f" >&5
18999 echo "$as_me: error: cannot find input file: $f" >&2;}
19000    { (exit 1); exit 1; }; }
19001          echo $f;;
19002       *) # Relative
19003          if test -f "$f"; then
19004            # Build tree
19005            echo $f
19006          elif test -f "$srcdir/$f"; then
19007            # Source tree
19008            echo "$srcdir/$f"
19009          else
19010            # /dev/null tree
19011            { { echo "$as_me:19011: error: cannot find input file: $f" >&5
19012 echo "$as_me: error: cannot find input file: $f" >&2;}
19013    { (exit 1); exit 1; }; }
19014          fi;;
19015       esac
19016     done` || { (exit 1); exit 1; }
19017 EOF
19018 cat >>"$CONFIG_STATUS" <<\EOF
19019   ac_warn_datarootdir=no
19020   if test x"$ac_file" != x-; then
19021     for ac_item in $ac_file_inputs
19022     do
19023       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19024       if test -n "$ac_seen"; then
19025         ac_used=`grep '@datarootdir@' "$ac_item"`
19026         if test -z "$ac_used"; then
19027           { echo "$as_me:19027: WARNING: datarootdir was used implicitly but not set:
19028 $ac_seen" >&5
19029 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19030 $ac_seen" >&2;}
19031           ac_warn_datarootdir=yes
19032         fi
19033       fi
19034       ac_seen=`grep '${datarootdir}' "$ac_item"`
19035       if test -n "$ac_seen"; then
19036         { echo "$as_me:19036: WARNING: datarootdir was used explicitly but not set:
19037 $ac_seen" >&5
19038 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19039 $ac_seen" >&2;}
19040         ac_warn_datarootdir=yes
19041       fi
19042     done
19043   fi
19044
19045 if test "x$ac_warn_datarootdir" = xyes; then
19046   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19047 fi
19048
19049 EOF
19050 cat >>"$CONFIG_STATUS" <<EOF
19051   sed "$ac_vpsub
19052 $extrasub
19053 EOF
19054 cat >>"$CONFIG_STATUS" <<\EOF
19055 :t
19056 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19057 s,@configure_input@,$configure_input,;t t
19058 s,@srcdir@,$ac_srcdir,;t t
19059 s,@top_srcdir@,$ac_top_srcdir,;t t
19060 s,@INSTALL@,$ac_INSTALL,;t t
19061 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19062   rm -f $tmp/stdin
19063   if test x"$ac_file" != x-; then
19064     cp "$tmp/out" "$ac_file"
19065
19066     for ac_name in prefix exec_prefix datarootdir
19067     do
19068         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
19069         if test -n "$ac_seen"; then
19070             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19071             if test -z "$ac_init"; then
19072               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19073               { echo "$as_me:19073: WARNING: Variable $ac_name is used but was not set:
19074 $ac_seen" >&5
19075 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19076 $ac_seen" >&2;}
19077             fi
19078         fi
19079     done
19080     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
19081     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
19082     if test -s $tmp/out; then
19083       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19084       { echo "$as_me:19084: WARNING: Some variables may not be substituted:
19085 $ac_seen" >&5
19086 echo "$as_me: WARNING: Some variables may not be substituted:
19087 $ac_seen" >&2;}
19088     fi
19089   else
19090     cat $tmp/out
19091   fi
19092   rm -f $tmp/out
19093
19094 done
19095 EOF
19096 cat >>"$CONFIG_STATUS" <<\EOF
19097
19098 #
19099 # CONFIG_HEADER section.
19100 #
19101
19102 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19103 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19104 #
19105 # ac_d sets the value in "#define NAME VALUE" lines.
19106 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19107 ac_dB='[        ].*$,\1#\2'
19108 ac_dC=' '
19109 ac_dD=',;t'
19110 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19111 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19112 ac_iB='\([      ]\),\1#\2define\3'
19113 ac_iC=' '
19114 ac_iD='\4,;t'
19115 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19116 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19117 ac_uB='$,\1#\2define\3'
19118 ac_uC=' '
19119 ac_uD=',;t'
19120
19121 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19122   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19123   case "$ac_file" in
19124   - | *:- | *:-:* ) # input from stdin
19125         cat >$tmp/stdin
19126         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19127         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19128   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19129         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19130   * )   ac_file_in=$ac_file.in ;;
19131   esac
19132
19133   test x"$ac_file" != x- && { echo "$as_me:19133: creating $ac_file" >&5
19134 echo "$as_me: creating $ac_file" >&6;}
19135
19136   # First look for the input files in the build tree, otherwise in the
19137   # src tree.
19138   ac_file_inputs=`IFS=:
19139     for f in $ac_file_in; do
19140       case $f in
19141       -) echo $tmp/stdin ;;
19142       [\\/$]*)
19143          # Absolute (can't be DOS-style, as IFS=:)
19144          test -f "$f" || { { echo "$as_me:19144: error: cannot find input file: $f" >&5
19145 echo "$as_me: error: cannot find input file: $f" >&2;}
19146    { (exit 1); exit 1; }; }
19147          echo $f;;
19148       *) # Relative
19149          if test -f "$f"; then
19150            # Build tree
19151            echo $f
19152          elif test -f "$srcdir/$f"; then
19153            # Source tree
19154            echo "$srcdir/$f"
19155          else
19156            # /dev/null tree
19157            { { echo "$as_me:19157: error: cannot find input file: $f" >&5
19158 echo "$as_me: error: cannot find input file: $f" >&2;}
19159    { (exit 1); exit 1; }; }
19160          fi;;
19161       esac
19162     done` || { (exit 1); exit 1; }
19163   # Remove the trailing spaces.
19164   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19165
19166 EOF
19167
19168 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19169 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19170 # be either 'cat' or 'sort'.
19171 cat confdefs.h | uniq >conftest.vals
19172
19173 # Break up conftest.vals because some shells have a limit on
19174 # the size of here documents, and old seds have small limits too.
19175
19176 rm -f conftest.tail
19177 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19178 while grep . conftest.vals >/dev/null
19179 do
19180   # Write chunks of a limited-size here document to conftest.frag.
19181   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19182   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19183   echo 'CEOF' >> "$CONFIG_STATUS"
19184   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19185   rm -f conftest.vals
19186   mv conftest.tail conftest.vals
19187 done
19188 rm -f conftest.vals
19189
19190 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19191 # marker @DEFS@.
19192 echo '  cat >> conftest.edit <<CEOF
19193 /@DEFS@/r conftest.frag
19194 /@DEFS@/d
19195 CEOF
19196 sed -f conftest.edit $tmp/in > $tmp/out
19197 rm -f $tmp/in
19198 mv $tmp/out $tmp/in
19199 rm -f conftest.edit conftest.frag
19200 ' >> "$CONFIG_STATUS"
19201
19202 cat >>"$CONFIG_STATUS" <<\EOF
19203   # Let's still pretend it is `configure' which instantiates (i.e., don't
19204   # use $as_me), people would be surprised to read:
19205   #    /* config.h.  Generated automatically by config.status.  */
19206   if test x"$ac_file" = x-; then
19207     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19208   else
19209     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19210   fi
19211   cat $tmp/in >>$tmp/config.h
19212   rm -f $tmp/in
19213   if test x"$ac_file" != x-; then
19214     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19215       { echo "$as_me:19215: $ac_file is unchanged" >&5
19216 echo "$as_me: $ac_file is unchanged" >&6;}
19217     else
19218       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19219          X"$ac_file" : 'X\(//\)[^/]' \| \
19220          X"$ac_file" : 'X\(//\)$' \| \
19221          X"$ac_file" : 'X\(/\)' \| \
19222          .     : '\(.\)' 2>/dev/null ||
19223 echo X"$ac_file" |
19224     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19225           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19226           /^X\(\/\/\)$/{ s//\1/; q; }
19227           /^X\(\/\).*/{ s//\1/; q; }
19228           s/.*/./; q'`
19229       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19230         { case "$ac_dir" in
19231   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19232   *)                      as_incr_dir=.;;
19233 esac
19234 as_dummy="$ac_dir"
19235 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19236   case $as_mkdir_dir in
19237     # Skip DOS drivespec
19238     ?:) as_incr_dir=$as_mkdir_dir ;;
19239     *)
19240       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19241       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19242     ;;
19243   esac
19244 done; }
19245
19246       fi
19247       rm -f "$ac_file"
19248       mv "$tmp/config.h" "$ac_file"
19249     fi
19250   else
19251     cat $tmp/config.h
19252     rm -f $tmp/config.h
19253   fi
19254 done
19255 EOF
19256 cat >>"$CONFIG_STATUS" <<\EOF
19257 #
19258 # CONFIG_COMMANDS section.
19259 #
19260 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19261   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19262   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19263
19264   case "$ac_dest" in
19265     default )
19266 if test -z "$USE_OLD_MAKERULES" ; then
19267         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19268 fi
19269  ;;
19270   esac
19271 done
19272 EOF
19273
19274 cat >>"$CONFIG_STATUS" <<\EOF
19275
19276 { (exit 0); exit 0; }
19277 EOF
19278 chmod +x "$CONFIG_STATUS"
19279 ac_clean_files=$ac_clean_files_save
19280
19281 # configure is writing to config.log, and then calls config.status.
19282 # config.status does its own redirection, appending to config.log.
19283 # Unfortunately, on DOS this fails, as config.log is still kept open
19284 # by configure, so config.status won't be able to write to it; its
19285 # output is simply discarded.  So we exec the FD to /dev/null,
19286 # effectively closing config.log, so it can be properly (re)opened and
19287 # appended to by config.status.  When coming back to configure, we
19288 # need to make the FD available again.
19289 if test "$no_create" != yes; then
19290   ac_cs_success=:
19291   exec 5>/dev/null
19292   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19293   exec 5>>config.log
19294   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19295   # would make configure fail if this is the last instruction.
19296   "$ac_cs_success" || { (exit 1); exit 1; }
19297 fi
19298 ${MAKE:-make} preinstall