]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
dfb128ddfae990f827358bc519282dab5954f853
[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=
3306         ;;
3307 (x/*)
3308         PKG_CONFIG_LIBDIR="$cf_search_path"
3309         echo "$as_me:3309: result: $PKG_CONFIG_LIBDIR" >&5
3310 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3311         cf_search_path=
3312         ;;
3313 (xyes|xauto)
3314         echo "$as_me:3314: result: auto" >&5
3315 echo "${ECHO_T}auto" >&6
3316         cf_search_path=
3317         # Look for the library directory using the same prefix as the executable
3318         echo "$as_me:3318: checking for search-list" >&5
3319 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3320         if test "x$PKG_CONFIG" != xnone
3321         then
3322                 # works for pkg-config since version 0.24 (2009)
3323                 # works for pkgconf since version 0.8.3 (2012)
3324                 for cf_pkg_program in \
3325                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3326                         pkg-config \
3327                         pkgconf
3328                 do
3329                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3330                         test -n "$cf_search_path" && break
3331                 done
3332
3333                 # works for pkg-config since import in 2005 of original 2001 HP code.
3334                 test -z "$cf_search_path" && \
3335                 cf_search_path=`
3336                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3337 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3338         sub(\"^[^']*'\",\"\"); \
3339         sub(\"'.*\",\"\"); \
3340         printf \" %s\", \\$0; } \
3341 { next; } \
3342 "`
3343         fi
3344
3345         echo "$as_me:3345: result: $cf_search_path" >&5
3346 echo "${ECHO_T}$cf_search_path" >&6
3347         ;;
3348 (*)
3349         { { echo "$as_me:3349: error: Unexpected option value: $cf_search_path" >&5
3350 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3351    { (exit 1); exit 1; }; }
3352         ;;
3353 esac
3354
3355 if test -n "$cf_search_path"
3356 then
3357         echo "$as_me:3357: checking for first directory" >&5
3358 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3359         cf_pkg_config_path=none
3360         for cf_config in $cf_search_path
3361         do
3362                 if test -d "$cf_config"
3363                 then
3364                         cf_pkg_config_path=$cf_config
3365                         break
3366                 fi
3367         done
3368         echo "$as_me:3368: result: $cf_pkg_config_path" >&5
3369 echo "${ECHO_T}$cf_pkg_config_path" >&6
3370
3371         if test "x$cf_pkg_config_path" != xnone ; then
3372                 # limit this to the first directory found
3373                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3374         fi
3375
3376         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3377         then
3378                 echo "$as_me:3378: checking for workaround" >&5
3379 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3380                 if test "$prefix" = "NONE" ; then
3381                         cf_prefix="$ac_default_prefix"
3382                 else
3383                         cf_prefix="$prefix"
3384                 fi
3385                 eval cf_libdir=$libdir
3386                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3387                 cf_backup=
3388                 for cf_config in $cf_search_path
3389                 do
3390                         case $cf_config in
3391                         $cf_libdir/pkgconfig)
3392                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3393                                 break
3394                                 ;;
3395                         *)
3396                                 test -z "$cf_backup" && cf_backup=$cf_config
3397                                 ;;
3398                         esac
3399                 done
3400                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3401                 echo "$as_me:3401: result: $PKG_CONFIG_LIBDIR" >&5
3402 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3403         fi
3404 fi
3405
3406 echo "$as_me:3406: checking if you want to build test-programs" >&5
3407 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3408
3409 # Check whether --with-tests or --without-tests was given.
3410 if test "${with_tests+set}" = set; then
3411   withval="$with_tests"
3412   cf_with_tests=$withval
3413 else
3414   cf_with_tests=yes
3415 fi;
3416 echo "$as_me:3416: result: $cf_with_tests" >&5
3417 echo "${ECHO_T}$cf_with_tests" >&6
3418
3419 echo "$as_me:3419: checking if we should assume mixed-case filenames" >&5
3420 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3421
3422 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3423 if test "${enable_mixed_case+set}" = set; then
3424   enableval="$enable_mixed_case"
3425   enable_mixedcase=$enableval
3426 else
3427   enable_mixedcase=auto
3428 fi;
3429 echo "$as_me:3429: result: $enable_mixedcase" >&5
3430 echo "${ECHO_T}$enable_mixedcase" >&6
3431 if test "$enable_mixedcase" = "auto" ; then
3432
3433 echo "$as_me:3433: checking if filesystem supports mixed-case filenames" >&5
3434 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3435 if test "${cf_cv_mixedcase+set}" = set; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438
3439 if test "$cross_compiling" = yes ; then
3440         case "$target_alias" in
3441         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3442                 cf_cv_mixedcase=no
3443                 ;;
3444         (*)
3445                 cf_cv_mixedcase=yes
3446                 ;;
3447         esac
3448 else
3449         rm -f conftest CONFTEST
3450         echo test >conftest
3451         if test -f CONFTEST ; then
3452                 cf_cv_mixedcase=no
3453         else
3454                 cf_cv_mixedcase=yes
3455         fi
3456         rm -f conftest CONFTEST
3457 fi
3458
3459 fi
3460 echo "$as_me:3460: result: $cf_cv_mixedcase" >&5
3461 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3462 test "$cf_cv_mixedcase" = yes &&
3463 cat >>confdefs.h <<\EOF
3464 #define MIXEDCASE_FILENAMES 1
3465 EOF
3466
3467 else
3468         cf_cv_mixedcase=$enable_mixedcase
3469         if test "$enable_mixedcase" = "yes" ; then
3470                 cat >>confdefs.h <<\EOF
3471 #define MIXEDCASE_FILENAMES 1
3472 EOF
3473
3474         fi
3475 fi
3476
3477 # do this after mixed-case option (tags/TAGS is not as important as tic).
3478 echo "$as_me:3478: checking whether ${MAKE-make} sets \${MAKE}" >&5
3479 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3480 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3481 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3482   echo $ECHO_N "(cached) $ECHO_C" >&6
3483 else
3484   cat >conftest.make <<\EOF
3485 all:
3486         @echo 'ac_maketemp="${MAKE}"'
3487 EOF
3488 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3489 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3490 if test -n "$ac_maketemp"; then
3491   eval ac_cv_prog_make_${ac_make}_set=yes
3492 else
3493   eval ac_cv_prog_make_${ac_make}_set=no
3494 fi
3495 rm -f conftest.make
3496 fi
3497 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3498   echo "$as_me:3498: result: yes" >&5
3499 echo "${ECHO_T}yes" >&6
3500   SET_MAKE=
3501 else
3502   echo "$as_me:3502: result: no" >&5
3503 echo "${ECHO_T}no" >&6
3504   SET_MAKE="MAKE=${MAKE-make}"
3505 fi
3506
3507 echo "$as_me:3507: checking for \".PHONY\" make-support" >&5
3508 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3509 if test "${cf_cv_make_PHONY+set}" = set; then
3510   echo $ECHO_N "(cached) $ECHO_C" >&6
3511 else
3512
3513         rm -rf conftest*
3514         (
3515                 mkdir conftest || exit 1
3516                 cd conftest
3517                 cat >makefile <<'CF_EOF'
3518 .PHONY: always
3519 DATA=0
3520 always: always.out
3521         @echo "** making $@ $(DATA)"
3522 once: once.out
3523         @echo "** making $@ $(DATA)"
3524 always.out:
3525         @echo "** making $@ $(DATA)"
3526         echo $(DATA) > $@
3527 once.out:
3528         @echo "** making $@ $(DATA)"
3529         echo $(DATA) > $@
3530 CF_EOF
3531                 for cf_data in 1 2 3
3532                 do
3533                         ${MAKE:-make} always DATA=$cf_data
3534                         ${MAKE:-make} once   DATA=$cf_data
3535                         ${MAKE:-make} -t always once
3536                         if test -f always ; then
3537                                 echo "no (case 1)" > ../conftest.tmp
3538                         elif test ! -f always.out ; then
3539                                 echo "no (case 2)" > ../conftest.tmp
3540                         elif test ! -f once.out ; then
3541                                 echo "no (case 3)" > ../conftest.tmp
3542                         elif ! cmp -s always.out once.out ; then
3543                                 echo "no (case 4)" > ../conftest.tmp
3544                                 diff always.out once.out
3545                         else
3546                                 cf_check="`cat always.out`"
3547                                 if test "x$cf_check" != "x$cf_data" ; then
3548                                         echo "no (case 5)" > ../conftest.tmp
3549                                 else
3550                                         echo yes > ../conftest.tmp
3551                                         rm -f ./*.out
3552                                         continue
3553                                 fi
3554                         fi
3555                         break
3556                 done
3557         ) >&5 2>&1
3558         cf_cv_make_PHONY="`cat conftest.tmp`"
3559         rm -rf conftest*
3560
3561 fi
3562 echo "$as_me:3562: result: $cf_cv_make_PHONY" >&5
3563 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3564 MAKE_NO_PHONY="#"
3565 MAKE_PHONY="#"
3566 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3567 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3568
3569 for ac_prog in exctags ctags
3570 do
3571   # Extract the first word of "$ac_prog", so it can be a program name with args.
3572 set dummy $ac_prog; ac_word=$2
3573 echo "$as_me:3573: checking for $ac_word" >&5
3574 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3575 if test "${ac_cv_prog_CTAGS+set}" = set; then
3576   echo $ECHO_N "(cached) $ECHO_C" >&6
3577 else
3578   if test -n "$CTAGS"; then
3579   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3580 else
3581   ac_save_IFS=$IFS; IFS=$ac_path_separator
3582 ac_dummy="$PATH"
3583 for ac_dir in $ac_dummy; do
3584   IFS=$ac_save_IFS
3585   test -z "$ac_dir" && ac_dir=.
3586   $as_executable_p "$ac_dir/$ac_word" || continue
3587 ac_cv_prog_CTAGS="$ac_prog"
3588 echo "$as_me:3588: found $ac_dir/$ac_word" >&5
3589 break
3590 done
3591
3592 fi
3593 fi
3594 CTAGS=$ac_cv_prog_CTAGS
3595 if test -n "$CTAGS"; then
3596   echo "$as_me:3596: result: $CTAGS" >&5
3597 echo "${ECHO_T}$CTAGS" >&6
3598 else
3599   echo "$as_me:3599: result: no" >&5
3600 echo "${ECHO_T}no" >&6
3601 fi
3602
3603   test -n "$CTAGS" && break
3604 done
3605
3606 for ac_prog in exetags etags
3607 do
3608   # Extract the first word of "$ac_prog", so it can be a program name with args.
3609 set dummy $ac_prog; ac_word=$2
3610 echo "$as_me:3610: checking for $ac_word" >&5
3611 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3612 if test "${ac_cv_prog_ETAGS+set}" = set; then
3613   echo $ECHO_N "(cached) $ECHO_C" >&6
3614 else
3615   if test -n "$ETAGS"; then
3616   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3617 else
3618   ac_save_IFS=$IFS; IFS=$ac_path_separator
3619 ac_dummy="$PATH"
3620 for ac_dir in $ac_dummy; do
3621   IFS=$ac_save_IFS
3622   test -z "$ac_dir" && ac_dir=.
3623   $as_executable_p "$ac_dir/$ac_word" || continue
3624 ac_cv_prog_ETAGS="$ac_prog"
3625 echo "$as_me:3625: found $ac_dir/$ac_word" >&5
3626 break
3627 done
3628
3629 fi
3630 fi
3631 ETAGS=$ac_cv_prog_ETAGS
3632 if test -n "$ETAGS"; then
3633   echo "$as_me:3633: result: $ETAGS" >&5
3634 echo "${ECHO_T}$ETAGS" >&6
3635 else
3636   echo "$as_me:3636: result: no" >&5
3637 echo "${ECHO_T}no" >&6
3638 fi
3639
3640   test -n "$ETAGS" && break
3641 done
3642
3643 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3644 set dummy ${CTAGS:-ctags}; ac_word=$2
3645 echo "$as_me:3645: checking for $ac_word" >&5
3646 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3647 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3648   echo $ECHO_N "(cached) $ECHO_C" >&6
3649 else
3650   if test -n "$MAKE_LOWER_TAGS"; then
3651   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3652 else
3653   ac_save_IFS=$IFS; IFS=$ac_path_separator
3654 ac_dummy="$PATH"
3655 for ac_dir in $ac_dummy; do
3656   IFS=$ac_save_IFS
3657   test -z "$ac_dir" && ac_dir=.
3658   $as_executable_p "$ac_dir/$ac_word" || continue
3659 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3660 echo "$as_me:3660: found $ac_dir/$ac_word" >&5
3661 break
3662 done
3663
3664   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3665 fi
3666 fi
3667 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3668 if test -n "$MAKE_LOWER_TAGS"; then
3669   echo "$as_me:3669: result: $MAKE_LOWER_TAGS" >&5
3670 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3671 else
3672   echo "$as_me:3672: result: no" >&5
3673 echo "${ECHO_T}no" >&6
3674 fi
3675
3676 if test "$cf_cv_mixedcase" = yes ; then
3677         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3678 set dummy ${ETAGS:-etags}; ac_word=$2
3679 echo "$as_me:3679: checking for $ac_word" >&5
3680 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3681 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3682   echo $ECHO_N "(cached) $ECHO_C" >&6
3683 else
3684   if test -n "$MAKE_UPPER_TAGS"; then
3685   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3686 else
3687   ac_save_IFS=$IFS; IFS=$ac_path_separator
3688 ac_dummy="$PATH"
3689 for ac_dir in $ac_dummy; do
3690   IFS=$ac_save_IFS
3691   test -z "$ac_dir" && ac_dir=.
3692   $as_executable_p "$ac_dir/$ac_word" || continue
3693 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3694 echo "$as_me:3694: found $ac_dir/$ac_word" >&5
3695 break
3696 done
3697
3698   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3699 fi
3700 fi
3701 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3702 if test -n "$MAKE_UPPER_TAGS"; then
3703   echo "$as_me:3703: result: $MAKE_UPPER_TAGS" >&5
3704 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3705 else
3706   echo "$as_me:3706: result: no" >&5
3707 echo "${ECHO_T}no" >&6
3708 fi
3709
3710 else
3711         MAKE_UPPER_TAGS=no
3712 fi
3713
3714 if test "$MAKE_UPPER_TAGS" = yes ; then
3715         MAKE_UPPER_TAGS=
3716 else
3717         MAKE_UPPER_TAGS="#"
3718 fi
3719
3720 if test "$MAKE_LOWER_TAGS" = yes ; then
3721         MAKE_LOWER_TAGS=
3722 else
3723         MAKE_LOWER_TAGS="#"
3724 fi
3725
3726 echo "$as_me:3726: checking for makeflags variable" >&5
3727 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3728 if test "${cf_cv_makeflags+set}" = set; then
3729   echo $ECHO_N "(cached) $ECHO_C" >&6
3730 else
3731
3732         cf_cv_makeflags=''
3733         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3734         do
3735                 cat >cf_makeflags.tmp <<CF_EOF
3736 SHELL = $SHELL
3737 all :
3738         @ echo '.$cf_option'
3739 CF_EOF
3740                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3741                 case "$cf_result" in
3742                 (.*k|.*kw)
3743                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3744                         case "$cf_result" in
3745                         (.*CC=*)        cf_cv_makeflags=
3746                                 ;;
3747                         (*)     cf_cv_makeflags=$cf_option
3748                                 ;;
3749                         esac
3750                         break
3751                         ;;
3752                 (.-)
3753                         ;;
3754                 (*)
3755
3756 echo "${as_me:-configure}:3756: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3757
3758                         ;;
3759                 esac
3760         done
3761         rm -f cf_makeflags.tmp
3762
3763 fi
3764 echo "$as_me:3764: result: $cf_cv_makeflags" >&5
3765 echo "${ECHO_T}$cf_cv_makeflags" >&6
3766
3767 if test -n "$ac_tool_prefix"; then
3768   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3769 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3770 echo "$as_me:3770: checking for $ac_word" >&5
3771 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3772 if test "${ac_cv_prog_RANLIB+set}" = set; then
3773   echo $ECHO_N "(cached) $ECHO_C" >&6
3774 else
3775   if test -n "$RANLIB"; then
3776   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3777 else
3778   ac_save_IFS=$IFS; IFS=$ac_path_separator
3779 ac_dummy="$PATH"
3780 for ac_dir in $ac_dummy; do
3781   IFS=$ac_save_IFS
3782   test -z "$ac_dir" && ac_dir=.
3783   $as_executable_p "$ac_dir/$ac_word" || continue
3784 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3785 echo "$as_me:3785: found $ac_dir/$ac_word" >&5
3786 break
3787 done
3788
3789 fi
3790 fi
3791 RANLIB=$ac_cv_prog_RANLIB
3792 if test -n "$RANLIB"; then
3793   echo "$as_me:3793: result: $RANLIB" >&5
3794 echo "${ECHO_T}$RANLIB" >&6
3795 else
3796   echo "$as_me:3796: result: no" >&5
3797 echo "${ECHO_T}no" >&6
3798 fi
3799
3800 fi
3801 if test -z "$ac_cv_prog_RANLIB"; then
3802   ac_ct_RANLIB=$RANLIB
3803   # Extract the first word of "ranlib", so it can be a program name with args.
3804 set dummy ranlib; ac_word=$2
3805 echo "$as_me:3805: checking for $ac_word" >&5
3806 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3807 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810   if test -n "$ac_ct_RANLIB"; then
3811   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3812 else
3813   ac_save_IFS=$IFS; IFS=$ac_path_separator
3814 ac_dummy="$PATH"
3815 for ac_dir in $ac_dummy; do
3816   IFS=$ac_save_IFS
3817   test -z "$ac_dir" && ac_dir=.
3818   $as_executable_p "$ac_dir/$ac_word" || continue
3819 ac_cv_prog_ac_ct_RANLIB="ranlib"
3820 echo "$as_me:3820: found $ac_dir/$ac_word" >&5
3821 break
3822 done
3823
3824   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3825 fi
3826 fi
3827 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3828 if test -n "$ac_ct_RANLIB"; then
3829   echo "$as_me:3829: result: $ac_ct_RANLIB" >&5
3830 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3831 else
3832   echo "$as_me:3832: result: no" >&5
3833 echo "${ECHO_T}no" >&6
3834 fi
3835
3836   RANLIB=$ac_ct_RANLIB
3837 else
3838   RANLIB="$ac_cv_prog_RANLIB"
3839 fi
3840
3841 if test -n "$ac_tool_prefix"; then
3842   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3843 set dummy ${ac_tool_prefix}ld; ac_word=$2
3844 echo "$as_me:3844: checking for $ac_word" >&5
3845 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3846 if test "${ac_cv_prog_LD+set}" = set; then
3847   echo $ECHO_N "(cached) $ECHO_C" >&6
3848 else
3849   if test -n "$LD"; then
3850   ac_cv_prog_LD="$LD" # Let the user override the test.
3851 else
3852   ac_save_IFS=$IFS; IFS=$ac_path_separator
3853 ac_dummy="$PATH"
3854 for ac_dir in $ac_dummy; do
3855   IFS=$ac_save_IFS
3856   test -z "$ac_dir" && ac_dir=.
3857   $as_executable_p "$ac_dir/$ac_word" || continue
3858 ac_cv_prog_LD="${ac_tool_prefix}ld"
3859 echo "$as_me:3859: found $ac_dir/$ac_word" >&5
3860 break
3861 done
3862
3863 fi
3864 fi
3865 LD=$ac_cv_prog_LD
3866 if test -n "$LD"; then
3867   echo "$as_me:3867: result: $LD" >&5
3868 echo "${ECHO_T}$LD" >&6
3869 else
3870   echo "$as_me:3870: result: no" >&5
3871 echo "${ECHO_T}no" >&6
3872 fi
3873
3874 fi
3875 if test -z "$ac_cv_prog_LD"; then
3876   ac_ct_LD=$LD
3877   # Extract the first word of "ld", so it can be a program name with args.
3878 set dummy ld; ac_word=$2
3879 echo "$as_me:3879: checking for $ac_word" >&5
3880 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3881 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3882   echo $ECHO_N "(cached) $ECHO_C" >&6
3883 else
3884   if test -n "$ac_ct_LD"; then
3885   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3886 else
3887   ac_save_IFS=$IFS; IFS=$ac_path_separator
3888 ac_dummy="$PATH"
3889 for ac_dir in $ac_dummy; do
3890   IFS=$ac_save_IFS
3891   test -z "$ac_dir" && ac_dir=.
3892   $as_executable_p "$ac_dir/$ac_word" || continue
3893 ac_cv_prog_ac_ct_LD="ld"
3894 echo "$as_me:3894: found $ac_dir/$ac_word" >&5
3895 break
3896 done
3897
3898   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3899 fi
3900 fi
3901 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3902 if test -n "$ac_ct_LD"; then
3903   echo "$as_me:3903: result: $ac_ct_LD" >&5
3904 echo "${ECHO_T}$ac_ct_LD" >&6
3905 else
3906   echo "$as_me:3906: result: no" >&5
3907 echo "${ECHO_T}no" >&6
3908 fi
3909
3910   LD=$ac_ct_LD
3911 else
3912   LD="$ac_cv_prog_LD"
3913 fi
3914
3915 if test -n "$ac_tool_prefix"; then
3916   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3917 set dummy ${ac_tool_prefix}ar; ac_word=$2
3918 echo "$as_me:3918: checking for $ac_word" >&5
3919 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3920 if test "${ac_cv_prog_AR+set}" = set; then
3921   echo $ECHO_N "(cached) $ECHO_C" >&6
3922 else
3923   if test -n "$AR"; then
3924   ac_cv_prog_AR="$AR" # Let the user override the test.
3925 else
3926   ac_save_IFS=$IFS; IFS=$ac_path_separator
3927 ac_dummy="$PATH"
3928 for ac_dir in $ac_dummy; do
3929   IFS=$ac_save_IFS
3930   test -z "$ac_dir" && ac_dir=.
3931   $as_executable_p "$ac_dir/$ac_word" || continue
3932 ac_cv_prog_AR="${ac_tool_prefix}ar"
3933 echo "$as_me:3933: found $ac_dir/$ac_word" >&5
3934 break
3935 done
3936
3937 fi
3938 fi
3939 AR=$ac_cv_prog_AR
3940 if test -n "$AR"; then
3941   echo "$as_me:3941: result: $AR" >&5
3942 echo "${ECHO_T}$AR" >&6
3943 else
3944   echo "$as_me:3944: result: no" >&5
3945 echo "${ECHO_T}no" >&6
3946 fi
3947
3948 fi
3949 if test -z "$ac_cv_prog_AR"; then
3950   ac_ct_AR=$AR
3951   # Extract the first word of "ar", so it can be a program name with args.
3952 set dummy ar; ac_word=$2
3953 echo "$as_me:3953: checking for $ac_word" >&5
3954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3955 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958   if test -n "$ac_ct_AR"; then
3959   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3960 else
3961   ac_save_IFS=$IFS; IFS=$ac_path_separator
3962 ac_dummy="$PATH"
3963 for ac_dir in $ac_dummy; do
3964   IFS=$ac_save_IFS
3965   test -z "$ac_dir" && ac_dir=.
3966   $as_executable_p "$ac_dir/$ac_word" || continue
3967 ac_cv_prog_ac_ct_AR="ar"
3968 echo "$as_me:3968: found $ac_dir/$ac_word" >&5
3969 break
3970 done
3971
3972   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3973 fi
3974 fi
3975 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3976 if test -n "$ac_ct_AR"; then
3977   echo "$as_me:3977: result: $ac_ct_AR" >&5
3978 echo "${ECHO_T}$ac_ct_AR" >&6
3979 else
3980   echo "$as_me:3980: result: no" >&5
3981 echo "${ECHO_T}no" >&6
3982 fi
3983
3984   AR=$ac_ct_AR
3985 else
3986   AR="$ac_cv_prog_AR"
3987 fi
3988
3989 if test -n "$ac_tool_prefix"; then
3990   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3991 set dummy ${ac_tool_prefix}ar; ac_word=$2
3992 echo "$as_me:3992: checking for $ac_word" >&5
3993 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3994 if test "${ac_cv_prog_AR+set}" = set; then
3995   echo $ECHO_N "(cached) $ECHO_C" >&6
3996 else
3997   if test -n "$AR"; then
3998   ac_cv_prog_AR="$AR" # Let the user override the test.
3999 else
4000   ac_save_IFS=$IFS; IFS=$ac_path_separator
4001 ac_dummy="$PATH"
4002 for ac_dir in $ac_dummy; do
4003   IFS=$ac_save_IFS
4004   test -z "$ac_dir" && ac_dir=.
4005   $as_executable_p "$ac_dir/$ac_word" || continue
4006 ac_cv_prog_AR="${ac_tool_prefix}ar"
4007 echo "$as_me:4007: found $ac_dir/$ac_word" >&5
4008 break
4009 done
4010
4011 fi
4012 fi
4013 AR=$ac_cv_prog_AR
4014 if test -n "$AR"; then
4015   echo "$as_me:4015: result: $AR" >&5
4016 echo "${ECHO_T}$AR" >&6
4017 else
4018   echo "$as_me:4018: result: no" >&5
4019 echo "${ECHO_T}no" >&6
4020 fi
4021
4022 fi
4023 if test -z "$ac_cv_prog_AR"; then
4024   ac_ct_AR=$AR
4025   # Extract the first word of "ar", so it can be a program name with args.
4026 set dummy ar; ac_word=$2
4027 echo "$as_me:4027: checking for $ac_word" >&5
4028 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4029 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4030   echo $ECHO_N "(cached) $ECHO_C" >&6
4031 else
4032   if test -n "$ac_ct_AR"; then
4033   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4034 else
4035   ac_save_IFS=$IFS; IFS=$ac_path_separator
4036 ac_dummy="$PATH"
4037 for ac_dir in $ac_dummy; do
4038   IFS=$ac_save_IFS
4039   test -z "$ac_dir" && ac_dir=.
4040   $as_executable_p "$ac_dir/$ac_word" || continue
4041 ac_cv_prog_ac_ct_AR="ar"
4042 echo "$as_me:4042: found $ac_dir/$ac_word" >&5
4043 break
4044 done
4045
4046   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4047 fi
4048 fi
4049 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4050 if test -n "$ac_ct_AR"; then
4051   echo "$as_me:4051: result: $ac_ct_AR" >&5
4052 echo "${ECHO_T}$ac_ct_AR" >&6
4053 else
4054   echo "$as_me:4054: result: no" >&5
4055 echo "${ECHO_T}no" >&6
4056 fi
4057
4058   AR=$ac_ct_AR
4059 else
4060   AR="$ac_cv_prog_AR"
4061 fi
4062
4063 echo "$as_me:4063: checking for options to update archives" >&5
4064 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4065 if test "${cf_cv_ar_flags+set}" = set; then
4066   echo $ECHO_N "(cached) $ECHO_C" >&6
4067 else
4068
4069         case "$cf_cv_system_name" in
4070         (*-msvc*)
4071                 cf_cv_ar_flags=''
4072                 cat >mk_static_lib.sh <<-EOF
4073                 #!$SHELL
4074                 MSVC_BIN="$AR"
4075                 out="\$1"
4076                 shift
4077                 exec \$MSVC_BIN -out:"\$out" \$@
4078                 EOF
4079                 chmod +x mk_static_lib.sh
4080                 AR=`pwd`/mk_static_lib.sh
4081                 ;;
4082         (*)
4083                 cf_cv_ar_flags=unknown
4084                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4085                 do
4086
4087                         # check if $ARFLAGS already contains this choice
4088                         if test "x$ARFLAGS" != "x" ; then
4089                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4090                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4091                                         cf_cv_ar_flags=
4092                                         break
4093                                 fi
4094                         fi
4095
4096                         rm -f "conftest.$ac_cv_objext"
4097                         rm -f conftest.a
4098
4099                         cat >"conftest.$ac_ext" <<EOF
4100 #line 4100 "configure"
4101 int     testdata[3] = { 123, 456, 789 };
4102 EOF
4103                         if { (eval echo "$as_me:4103: \"$ac_compile\"") >&5
4104   (eval $ac_compile) 2>&5
4105   ac_status=$?
4106   echo "$as_me:4106: \$? = $ac_status" >&5
4107   (exit "$ac_status"); } ; then
4108                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4109                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4110                                 if test -f conftest.a ; then
4111                                         cf_cv_ar_flags="$cf_ar_flags"
4112                                         break
4113                                 fi
4114                         else
4115                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4116
4117 echo "${as_me:-configure}:4117: testing cannot compile test-program ..." 1>&5
4118
4119                                 break
4120                         fi
4121                 done
4122                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4123                 ;;
4124         esac
4125
4126 fi
4127 echo "$as_me:4127: result: $cf_cv_ar_flags" >&5
4128 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4129
4130 if test -n "$ARFLAGS" ; then
4131         if test -n "$cf_cv_ar_flags" ; then
4132                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4133         fi
4134 else
4135         ARFLAGS=$cf_cv_ar_flags
4136 fi
4137
4138         echo "$as_me:4138: checking for PATH separator" >&5
4139 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4140         case "$cf_cv_system_name" in
4141         (os2*)  PATH_SEPARATOR=';'  ;;
4142         (*)     ${PATH_SEPARATOR:=':'}  ;;
4143         esac
4144
4145         echo "$as_me:4145: result: $PATH_SEPARATOR" >&5
4146 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4147
4148 echo "$as_me:4148: checking if you have specified an install-prefix" >&5
4149 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4150
4151 # Check whether --with-install-prefix or --without-install-prefix was given.
4152 if test "${with_install_prefix+set}" = set; then
4153   withval="$with_install_prefix"
4154   case "$withval" in
4155         (yes|no)
4156                 ;;
4157         (*)     DESTDIR="$withval"
4158                 ;;
4159         esac
4160 fi;
4161 echo "$as_me:4161: result: $DESTDIR" >&5
4162 echo "${ECHO_T}$DESTDIR" >&6
4163
4164 ###############################################################################
4165
4166 # If we're cross-compiling, allow the user to override the tools and their
4167 # options.  The configure script is oriented toward identifying the host
4168 # compiler, etc., but we need a build compiler to generate parts of the source.
4169
4170 if test "$cross_compiling" = yes ; then
4171
4172         # defaults that we might want to override
4173         : ${BUILD_CFLAGS:=''}
4174         : ${BUILD_CPPFLAGS:=''}
4175         : ${BUILD_LDFLAGS:=''}
4176         : ${BUILD_LIBS:=''}
4177         : ${BUILD_EXEEXT:='$x'}
4178         : ${BUILD_OBJEXT:='o'}
4179
4180 # Check whether --with-build-cc or --without-build-cc was given.
4181 if test "${with_build_cc+set}" = set; then
4182   withval="$with_build_cc"
4183   BUILD_CC="$withval"
4184 else
4185   for ac_prog in gcc clang c99 c89 cc cl
4186 do
4187   # Extract the first word of "$ac_prog", so it can be a program name with args.
4188 set dummy $ac_prog; ac_word=$2
4189 echo "$as_me:4189: checking for $ac_word" >&5
4190 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4191 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4192   echo $ECHO_N "(cached) $ECHO_C" >&6
4193 else
4194   if test -n "$BUILD_CC"; then
4195   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4196 else
4197   ac_save_IFS=$IFS; IFS=$ac_path_separator
4198 ac_dummy="$PATH"
4199 for ac_dir in $ac_dummy; do
4200   IFS=$ac_save_IFS
4201   test -z "$ac_dir" && ac_dir=.
4202   $as_executable_p "$ac_dir/$ac_word" || continue
4203 ac_cv_prog_BUILD_CC="$ac_prog"
4204 echo "$as_me:4204: found $ac_dir/$ac_word" >&5
4205 break
4206 done
4207
4208 fi
4209 fi
4210 BUILD_CC=$ac_cv_prog_BUILD_CC
4211 if test -n "$BUILD_CC"; then
4212   echo "$as_me:4212: result: $BUILD_CC" >&5
4213 echo "${ECHO_T}$BUILD_CC" >&6
4214 else
4215   echo "$as_me:4215: result: no" >&5
4216 echo "${ECHO_T}no" >&6
4217 fi
4218
4219   test -n "$BUILD_CC" && break
4220 done
4221 test -n "$BUILD_CC" || BUILD_CC="none"
4222
4223 fi;
4224         echo "$as_me:4224: checking for native build C compiler" >&5
4225 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4226         echo "$as_me:4226: result: $BUILD_CC" >&5
4227 echo "${ECHO_T}$BUILD_CC" >&6
4228
4229         echo "$as_me:4229: checking for native build C preprocessor" >&5
4230 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4231
4232 # Check whether --with-build-cpp or --without-build-cpp was given.
4233 if test "${with_build_cpp+set}" = set; then
4234   withval="$with_build_cpp"
4235   BUILD_CPP="$withval"
4236 else
4237   BUILD_CPP='${BUILD_CC} -E'
4238 fi;
4239         echo "$as_me:4239: result: $BUILD_CPP" >&5
4240 echo "${ECHO_T}$BUILD_CPP" >&6
4241
4242         echo "$as_me:4242: checking for native build C flags" >&5
4243 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4244
4245 # Check whether --with-build-cflags or --without-build-cflags was given.
4246 if test "${with_build_cflags+set}" = set; then
4247   withval="$with_build_cflags"
4248   BUILD_CFLAGS="$withval"
4249 fi;
4250         echo "$as_me:4250: result: $BUILD_CFLAGS" >&5
4251 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4252
4253         echo "$as_me:4253: checking for native build C preprocessor-flags" >&5
4254 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4255
4256 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4257 if test "${with_build_cppflags+set}" = set; then
4258   withval="$with_build_cppflags"
4259   BUILD_CPPFLAGS="$withval"
4260 fi;
4261         echo "$as_me:4261: result: $BUILD_CPPFLAGS" >&5
4262 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4263
4264         echo "$as_me:4264: checking for native build linker-flags" >&5
4265 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4266
4267 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4268 if test "${with_build_ldflags+set}" = set; then
4269   withval="$with_build_ldflags"
4270   BUILD_LDFLAGS="$withval"
4271 fi;
4272         echo "$as_me:4272: result: $BUILD_LDFLAGS" >&5
4273 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4274
4275         echo "$as_me:4275: checking for native build linker-libraries" >&5
4276 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4277
4278 # Check whether --with-build-libs or --without-build-libs was given.
4279 if test "${with_build_libs+set}" = set; then
4280   withval="$with_build_libs"
4281   BUILD_LIBS="$withval"
4282 fi;
4283         echo "$as_me:4283: result: $BUILD_LIBS" >&5
4284 echo "${ECHO_T}$BUILD_LIBS" >&6
4285
4286         # this assumes we're on Unix.
4287         BUILD_EXEEXT=
4288         BUILD_OBJEXT=o
4289
4290         : ${BUILD_CC:='${CC}'}
4291
4292         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4293                 { { echo "$as_me:4293: error: Cross-build requires two compilers.
4294 Use --with-build-cc to specify the native compiler." >&5
4295 echo "$as_me: error: Cross-build requires two compilers.
4296 Use --with-build-cc to specify the native compiler." >&2;}
4297    { (exit 1); exit 1; }; }
4298         fi
4299
4300 else
4301         : ${BUILD_CC:='${CC}'}
4302         : ${BUILD_CPP:='${CPP}'}
4303         : ${BUILD_CFLAGS:='${CFLAGS}'}
4304         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4305         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4306         : ${BUILD_LIBS:='${LIBS}'}
4307         : ${BUILD_EXEEXT:='$x'}
4308         : ${BUILD_OBJEXT:='o'}
4309 fi
4310
4311 ###############################################################################
4312
4313 ### Options to allow the user to specify the set of libraries which are used.
4314 ### Use "--without-normal --with-shared" to allow the default model to be
4315 ### shared, for example.
4316 cf_list_models=""
4317
4318 echo "$as_me:4318: checking if you want to build shared C-objects" >&5
4319 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4320
4321 # Check whether --with-shared or --without-shared was given.
4322 if test "${with_shared+set}" = set; then
4323   withval="$with_shared"
4324   with_shared=$withval
4325 else
4326   with_shared=no
4327 fi;
4328 echo "$as_me:4328: result: $with_shared" >&5
4329 echo "${ECHO_T}$with_shared" >&6
4330 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4331
4332 echo "$as_me:4332: checking for specified models" >&5
4333 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4334 test -z "$cf_list_models" && cf_list_models=normal
4335 echo "$as_me:4335: result: $cf_list_models" >&5
4336 echo "${ECHO_T}$cf_list_models" >&6
4337
4338 ### Use the first model as the default, and save its suffix for use in building
4339 ### up test-applications.
4340 echo "$as_me:4340: checking for default model" >&5
4341 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4342 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4343 echo "$as_me:4343: result: $DFT_LWR_MODEL" >&5
4344 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4345
4346 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4347
4348 echo "$as_me:4348: checking for specific curses-directory" >&5
4349 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4350
4351 # Check whether --with-curses-dir or --without-curses-dir was given.
4352 if test "${with_curses_dir+set}" = set; then
4353   withval="$with_curses_dir"
4354   cf_cv_curses_dir=$withval
4355 else
4356   cf_cv_curses_dir=no
4357 fi;
4358 echo "$as_me:4358: result: $cf_cv_curses_dir" >&5
4359 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4360
4361 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4362 then
4363
4364 if test "x$prefix" != xNONE; then
4365         cf_path_syntax="$prefix"
4366 else
4367         cf_path_syntax="$ac_default_prefix"
4368 fi
4369
4370 case ".$withval" in
4371 (.\$\(*\)*|.\'*\'*)
4372         ;;
4373 (..|./*|.\\*)
4374         ;;
4375 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4376         ;;
4377 (.\$\{*prefix\}*|.\$\{*dir\}*)
4378         eval withval="$withval"
4379         case ".$withval" in
4380         (.NONE/*)
4381                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4382                 ;;
4383         esac
4384         ;;
4385 (.no|.NONE/*)
4386         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4387         ;;
4388 (*)
4389         { { echo "$as_me:4389: error: expected a pathname, not \"$withval\"" >&5
4390 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4391    { (exit 1); exit 1; }; }
4392         ;;
4393 esac
4394
4395         if test -d "$cf_cv_curses_dir"
4396         then
4397
4398 if test -n "$cf_cv_curses_dir/include" ; then
4399   for cf_add_incdir in $cf_cv_curses_dir/include
4400   do
4401         while test "$cf_add_incdir" != /usr/include
4402         do
4403           if test -d "$cf_add_incdir"
4404           then
4405                 cf_have_incdir=no
4406                 if test -n "$CFLAGS$CPPFLAGS" ; then
4407                   # a loop is needed to ensure we can add subdirs of existing dirs
4408                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4409                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4410                           cf_have_incdir=yes; break
4411                         fi
4412                   done
4413                 fi
4414
4415                 if test "$cf_have_incdir" = no ; then
4416                   if test "$cf_add_incdir" = /usr/local/include ; then
4417                         if test "$GCC" = yes
4418                         then
4419                           cf_save_CPPFLAGS=$CPPFLAGS
4420
4421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4422         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4423
4424                           cat >"conftest.$ac_ext" <<_ACEOF
4425 #line 4425 "configure"
4426 #include "confdefs.h"
4427 #include <stdio.h>
4428 int
4429 main (void)
4430 {
4431 printf("Hello")
4432   ;
4433   return 0;
4434 }
4435 _ACEOF
4436 rm -f "conftest.$ac_objext"
4437 if { (eval echo "$as_me:4437: \"$ac_compile\"") >&5
4438   (eval $ac_compile) 2>&5
4439   ac_status=$?
4440   echo "$as_me:4440: \$? = $ac_status" >&5
4441   (exit "$ac_status"); } &&
4442          { ac_try='test -s "conftest.$ac_objext"'
4443   { (eval echo "$as_me:4443: \"$ac_try\"") >&5
4444   (eval $ac_try) 2>&5
4445   ac_status=$?
4446   echo "$as_me:4446: \$? = $ac_status" >&5
4447   (exit "$ac_status"); }; }; then
4448   :
4449 else
4450   echo "$as_me: failed program was:" >&5
4451 cat "conftest.$ac_ext" >&5
4452 cf_have_incdir=yes
4453 fi
4454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4455                           CPPFLAGS=$cf_save_CPPFLAGS
4456                         fi
4457                   fi
4458                 fi
4459
4460                 if test "$cf_have_incdir" = no ; then
4461                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4462
4463 echo "${as_me:-configure}:4463: testing adding $cf_add_incdir to include-path ..." 1>&5
4464
4465                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4466
4467                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4468                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4469                   cf_add_incdir="$cf_top_incdir"
4470                 else
4471                   break
4472                 fi
4473           else
4474                 break
4475           fi
4476         done
4477   done
4478 fi
4479
4480 if test -n "$cf_cv_curses_dir/lib" ; then
4481         for cf_add_libdir in $cf_cv_curses_dir/lib
4482         do
4483                 if test "$cf_add_libdir" = /usr/lib ; then
4484                         :
4485                 elif test -d "$cf_add_libdir"
4486                 then
4487                         cf_have_libdir=no
4488                         if test -n "$LDFLAGS$LIBS" ; then
4489                                 # a loop is needed to ensure we can add subdirs of existing dirs
4490                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4491                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4492                                                 cf_have_libdir=yes; break
4493                                         fi
4494                                 done
4495                         fi
4496                         if test "$cf_have_libdir" = no ; then
4497                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4498
4499 echo "${as_me:-configure}:4499: testing adding $cf_add_libdir to library-path ..." 1>&5
4500
4501                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4502                         fi
4503                 fi
4504         done
4505 fi
4506
4507         fi
4508 fi
4509
4510 cf_ncuconfig_root=ncurses
4511 cf_have_ncuconfig=no
4512
4513 if test "x${PKG_CONFIG:=none}" != xnone; then
4514         echo "$as_me:4514: checking pkg-config for $cf_ncuconfig_root" >&5
4515 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4516         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4517                 echo "$as_me:4517: result: yes" >&5
4518 echo "${ECHO_T}yes" >&6
4519
4520                 echo "$as_me:4520: checking if the $cf_ncuconfig_root package files work" >&5
4521 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4522                 cf_have_ncuconfig=unknown
4523
4524                 cf_save_CFLAGS="$CFLAGS"
4525                 cf_save_CPPFLAGS="$CPPFLAGS"
4526                 cf_save_LIBS="$LIBS"
4527
4528                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4529                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4530
4531                 # while -W for passing linker flags is prevalent, it is not "standard".
4532                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4533                 # incompatible _and_ non-standard -W option which gives an error.  Work
4534                 # around that pitfall.
4535                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4536                 (x*c[89]9@@*-W*)
4537
4538 cf_fix_cppflags=no
4539 cf_new_cflags=
4540 cf_new_cppflags=
4541 cf_new_extra_cppflags=
4542
4543 for cf_add_cflags in $cf_pkg_cflags
4544 do
4545 case "$cf_fix_cppflags" in
4546 (no)
4547         case "$cf_add_cflags" in
4548         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4549                 case "$cf_add_cflags" in
4550                 (-D*)
4551                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4552
4553                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4554                                 && test -z "${cf_tst_cflags}" \
4555                                 && cf_fix_cppflags=yes
4556
4557                         if test "$cf_fix_cppflags" = yes ; then
4558
4559         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4560         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4561
4562                                 continue
4563                         elif test "${cf_tst_cflags}" = "\"'" ; then
4564
4565         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4566         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4567
4568                                 continue
4569                         fi
4570                         ;;
4571                 esac
4572                 case "$CPPFLAGS" in
4573                 (*$cf_add_cflags)
4574                         ;;
4575                 (*)
4576                         case "$cf_add_cflags" in
4577                         (-D*)
4578                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4579
4580 CPPFLAGS=`echo "$CPPFLAGS" | \
4581         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4582                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4583
4584                                 ;;
4585                         esac
4586
4587         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4588         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4589
4590                         ;;
4591                 esac
4592                 ;;
4593         (*)
4594
4595         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4596         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4597
4598                 ;;
4599         esac
4600         ;;
4601 (yes)
4602
4603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4605
4606         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4607
4608         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4609                 && test -z "${cf_tst_cflags}" \
4610                 && cf_fix_cppflags=no
4611         ;;
4612 esac
4613 done
4614
4615 if test -n "$cf_new_cflags" ; then
4616
4617         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4618         CFLAGS="${CFLAGS}$cf_new_cflags"
4619
4620 fi
4621
4622 if test -n "$cf_new_cppflags" ; then
4623
4624         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4625         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4626
4627 fi
4628
4629 if test -n "$cf_new_extra_cppflags" ; then
4630
4631         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4632         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4633
4634 fi
4635
4636 cf_add_libs="$LIBS"
4637 # reverse order
4638 cf_add_0lib=
4639 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4640 # filter duplicates
4641 for cf_add_1lib in $cf_add_0lib; do
4642         for cf_add_2lib in $cf_add_libs; do
4643                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4644                         cf_add_1lib=
4645                         break
4646                 fi
4647         done
4648         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4649 done
4650 LIBS="$cf_add_libs"
4651
4652                         cat >"conftest.$ac_ext" <<_ACEOF
4653 #line 4653 "configure"
4654 #include "confdefs.h"
4655 #include <${cf_cv_ncurses_header:-curses.h}>
4656 int
4657 main (void)
4658 {
4659 initscr(); mousemask(0,0); tigetstr((char *)0);
4660   ;
4661   return 0;
4662 }
4663 _ACEOF
4664 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4665 if { (eval echo "$as_me:4665: \"$ac_link\"") >&5
4666   (eval $ac_link) 2>&5
4667   ac_status=$?
4668   echo "$as_me:4668: \$? = $ac_status" >&5
4669   (exit "$ac_status"); } &&
4670          { ac_try='test -s "conftest$ac_exeext"'
4671   { (eval echo "$as_me:4671: \"$ac_try\"") >&5
4672   (eval $ac_try) 2>&5
4673   ac_status=$?
4674   echo "$as_me:4674: \$? = $ac_status" >&5
4675   (exit "$ac_status"); }; }; then
4676   if test "$cross_compiling" = yes; then
4677   cf_test_ncuconfig=maybe
4678 else
4679   cat >"conftest.$ac_ext" <<_ACEOF
4680 #line 4680 "configure"
4681 #include "confdefs.h"
4682 #include <${cf_cv_ncurses_header:-curses.h}>
4683                                         int main(void)
4684                                         { const char *xx = curses_version(); return (xx == 0); }
4685 _ACEOF
4686 rm -f "conftest$ac_exeext"
4687 if { (eval echo "$as_me:4687: \"$ac_link\"") >&5
4688   (eval $ac_link) 2>&5
4689   ac_status=$?
4690   echo "$as_me:4690: \$? = $ac_status" >&5
4691   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4692   { (eval echo "$as_me:4692: \"$ac_try\"") >&5
4693   (eval $ac_try) 2>&5
4694   ac_status=$?
4695   echo "$as_me:4695: \$? = $ac_status" >&5
4696   (exit "$ac_status"); }; }; then
4697   cf_test_ncuconfig=yes
4698 else
4699   echo "$as_me: program exited with status $ac_status" >&5
4700 echo "$as_me: failed program was:" >&5
4701 cat "conftest.$ac_ext" >&5
4702 cf_test_ncuconfig=no
4703 fi
4704 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4705 fi
4706 else
4707   echo "$as_me: failed program was:" >&5
4708 cat "conftest.$ac_ext" >&5
4709 cf_test_ncuconfig=no
4710 fi
4711 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4712
4713                         CFLAGS="$cf_save_CFLAGS"
4714                         CPPFLAGS="$cf_save_CPPFLAGS"
4715                         LIBS="$cf_save_LIBS"
4716
4717                         if test "x$cf_test_ncuconfig" != xyes; then
4718                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4719                                 cf_pkg_cflags="$cf_temp"
4720                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4721                                 cf_pkg_libs="$cf_temp"
4722                         fi
4723                         ;;
4724                 esac
4725
4726 for cf_add_cflags in $cf_pkg_cflags
4727 do
4728         case "x$cf_add_cflags" in
4729         (x-[DU]*)
4730
4731 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4732 while true
4733 do
4734         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'`
4735         test "$CFLAGS" != "$cf_old_cflag" || break
4736
4737         CFLAGS="$cf_old_cflag"
4738 done
4739
4740 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4741 while true
4742 do
4743         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'`
4744         test "$CPPFLAGS" != "$cf_old_cflag" || break
4745
4746         CPPFLAGS="$cf_old_cflag"
4747 done
4748
4749                 ;;
4750         esac
4751
4752 cf_fix_cppflags=no
4753 cf_new_cflags=
4754 cf_new_cppflags=
4755 cf_new_extra_cppflags=
4756
4757 for cf_add_cflags in $cf_add_cflags
4758 do
4759 case "$cf_fix_cppflags" in
4760 (no)
4761         case "$cf_add_cflags" in
4762         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4763                 case "$cf_add_cflags" in
4764                 (-D*)
4765                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4766
4767                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4768                                 && test -z "${cf_tst_cflags}" \
4769                                 && cf_fix_cppflags=yes
4770
4771                         if test "$cf_fix_cppflags" = yes ; then
4772
4773         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4774         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4775
4776                                 continue
4777                         elif test "${cf_tst_cflags}" = "\"'" ; then
4778
4779         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4780         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4781
4782                                 continue
4783                         fi
4784                         ;;
4785                 esac
4786                 case "$CPPFLAGS" in
4787                 (*$cf_add_cflags)
4788                         ;;
4789                 (*)
4790                         case "$cf_add_cflags" in
4791                         (-D*)
4792                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4793
4794 CPPFLAGS=`echo "$CPPFLAGS" | \
4795         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4796                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4797
4798                                 ;;
4799                         esac
4800
4801         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4802         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4803
4804                         ;;
4805                 esac
4806                 ;;
4807         (*)
4808
4809         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4810         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4811
4812                 ;;
4813         esac
4814         ;;
4815 (yes)
4816
4817         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4818         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4819
4820         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4821
4822         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4823                 && test -z "${cf_tst_cflags}" \
4824                 && cf_fix_cppflags=no
4825         ;;
4826 esac
4827 done
4828
4829 if test -n "$cf_new_cflags" ; then
4830
4831         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4832         CFLAGS="${CFLAGS}$cf_new_cflags"
4833
4834 fi
4835
4836 if test -n "$cf_new_cppflags" ; then
4837
4838         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4839         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4840
4841 fi
4842
4843 if test -n "$cf_new_extra_cppflags" ; then
4844
4845         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4846         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4847
4848 fi
4849
4850 done
4851
4852 cf_add_libs="$LIBS"
4853 # reverse order
4854 cf_add_0lib=
4855 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4856 # filter duplicates
4857 for cf_add_1lib in $cf_add_0lib; do
4858         for cf_add_2lib in $cf_add_libs; do
4859                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4860                         cf_add_1lib=
4861                         break
4862                 fi
4863         done
4864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4865 done
4866 LIBS="$cf_add_libs"
4867
4868                 cat >"conftest.$ac_ext" <<_ACEOF
4869 #line 4869 "configure"
4870 #include "confdefs.h"
4871 #include <${cf_cv_ncurses_header:-curses.h}>
4872 int
4873 main (void)
4874 {
4875 initscr(); mousemask(0,0); tigetstr((char *)0);
4876   ;
4877   return 0;
4878 }
4879 _ACEOF
4880 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4881 if { (eval echo "$as_me:4881: \"$ac_link\"") >&5
4882   (eval $ac_link) 2>&5
4883   ac_status=$?
4884   echo "$as_me:4884: \$? = $ac_status" >&5
4885   (exit "$ac_status"); } &&
4886          { ac_try='test -s "conftest$ac_exeext"'
4887   { (eval echo "$as_me:4887: \"$ac_try\"") >&5
4888   (eval $ac_try) 2>&5
4889   ac_status=$?
4890   echo "$as_me:4890: \$? = $ac_status" >&5
4891   (exit "$ac_status"); }; }; then
4892   if test "$cross_compiling" = yes; then
4893   cf_have_ncuconfig=maybe
4894 else
4895   cat >"conftest.$ac_ext" <<_ACEOF
4896 #line 4896 "configure"
4897 #include "confdefs.h"
4898 #include <${cf_cv_ncurses_header:-curses.h}>
4899                                 int main(void)
4900                                 { const char *xx = curses_version(); return (xx == 0); }
4901 _ACEOF
4902 rm -f "conftest$ac_exeext"
4903 if { (eval echo "$as_me:4903: \"$ac_link\"") >&5
4904   (eval $ac_link) 2>&5
4905   ac_status=$?
4906   echo "$as_me:4906: \$? = $ac_status" >&5
4907   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4908   { (eval echo "$as_me:4908: \"$ac_try\"") >&5
4909   (eval $ac_try) 2>&5
4910   ac_status=$?
4911   echo "$as_me:4911: \$? = $ac_status" >&5
4912   (exit "$ac_status"); }; }; then
4913   cf_have_ncuconfig=yes
4914 else
4915   echo "$as_me: program exited with status $ac_status" >&5
4916 echo "$as_me: failed program was:" >&5
4917 cat "conftest.$ac_ext" >&5
4918 cf_have_ncuconfig=no
4919 fi
4920 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4921 fi
4922 else
4923   echo "$as_me: failed program was:" >&5
4924 cat "conftest.$ac_ext" >&5
4925 cf_have_ncuconfig=no
4926 fi
4927 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4928                 echo "$as_me:4928: result: $cf_have_ncuconfig" >&5
4929 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4930                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4931                 if test "$cf_have_ncuconfig" != "yes"
4932                 then
4933                         CPPFLAGS="$cf_save_CPPFLAGS"
4934                         LIBS="$cf_save_LIBS"
4935                         NCURSES_CONFIG_PKG=none
4936                 else
4937
4938 cat >>confdefs.h <<\EOF
4939 #define NCURSES 1
4940 EOF
4941
4942                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4943
4944 echo "$as_me:4944: checking for terminfo header" >&5
4945 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4946 if test "${cf_cv_term_header+set}" = set; then
4947   echo $ECHO_N "(cached) $ECHO_C" >&6
4948 else
4949
4950 case "${cf_cv_ncurses_header}" in
4951 (*/ncurses.h|*/ncursesw.h)
4952         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4953         ;;
4954 (*)
4955         cf_term_header=term.h
4956         ;;
4957 esac
4958
4959 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4960 do
4961 cat >"conftest.$ac_ext" <<_ACEOF
4962 #line 4962 "configure"
4963 #include "confdefs.h"
4964 #include <stdio.h>
4965 #include <${cf_cv_ncurses_header:-curses.h}>
4966 #include <$cf_test>
4967
4968 int
4969 main (void)
4970 {
4971 int x = auto_left_margin; (void)x
4972   ;
4973   return 0;
4974 }
4975 _ACEOF
4976 rm -f "conftest.$ac_objext"
4977 if { (eval echo "$as_me:4977: \"$ac_compile\"") >&5
4978   (eval $ac_compile) 2>&5
4979   ac_status=$?
4980   echo "$as_me:4980: \$? = $ac_status" >&5
4981   (exit "$ac_status"); } &&
4982          { ac_try='test -s "conftest.$ac_objext"'
4983   { (eval echo "$as_me:4983: \"$ac_try\"") >&5
4984   (eval $ac_try) 2>&5
4985   ac_status=$?
4986   echo "$as_me:4986: \$? = $ac_status" >&5
4987   (exit "$ac_status"); }; }; then
4988
4989         cf_cv_term_header="$cf_test"
4990 else
4991   echo "$as_me: failed program was:" >&5
4992 cat "conftest.$ac_ext" >&5
4993
4994         cf_cv_term_header=unknown
4995
4996 fi
4997 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4998         test "$cf_cv_term_header" != unknown && break
4999 done
5000
5001 fi
5002 echo "$as_me:5002: result: $cf_cv_term_header" >&5
5003 echo "${ECHO_T}$cf_cv_term_header" >&6
5004
5005 # Set definitions to allow ifdef'ing to accommodate subdirectories
5006
5007 case "$cf_cv_term_header" in
5008 (*term.h)
5009
5010 cat >>confdefs.h <<\EOF
5011 #define HAVE_TERM_H 1
5012 EOF
5013
5014         ;;
5015 esac
5016
5017 case "$cf_cv_term_header" in
5018 (ncurses/term.h)
5019
5020 cat >>confdefs.h <<\EOF
5021 #define HAVE_NCURSES_TERM_H 1
5022 EOF
5023
5024         ;;
5025 (ncursesw/term.h)
5026
5027 cat >>confdefs.h <<\EOF
5028 #define HAVE_NCURSESW_TERM_H 1
5029 EOF
5030
5031         ;;
5032 esac
5033
5034                 fi
5035
5036         else
5037                 echo "$as_me:5037: result: no" >&5
5038 echo "${ECHO_T}no" >&6
5039                 NCURSES_CONFIG_PKG=none
5040         fi
5041 else
5042         NCURSES_CONFIG_PKG=none
5043 fi
5044
5045 if test "x$cf_have_ncuconfig" = "xno"; then
5046         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5047
5048 if test -n "$ac_tool_prefix"; then
5049   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5050   do
5051     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5052 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5053 echo "$as_me:5053: checking for $ac_word" >&5
5054 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5055 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5056   echo $ECHO_N "(cached) $ECHO_C" >&6
5057 else
5058   if test -n "$NCURSES_CONFIG"; then
5059   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5060 else
5061   ac_save_IFS=$IFS; IFS=$ac_path_separator
5062 ac_dummy="$PATH"
5063 for ac_dir in $ac_dummy; do
5064   IFS=$ac_save_IFS
5065   test -z "$ac_dir" && ac_dir=.
5066   $as_executable_p "$ac_dir/$ac_word" || continue
5067 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5068 echo "$as_me:5068: found $ac_dir/$ac_word" >&5
5069 break
5070 done
5071
5072 fi
5073 fi
5074 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5075 if test -n "$NCURSES_CONFIG"; then
5076   echo "$as_me:5076: result: $NCURSES_CONFIG" >&5
5077 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5078 else
5079   echo "$as_me:5079: result: no" >&5
5080 echo "${ECHO_T}no" >&6
5081 fi
5082
5083     test -n "$NCURSES_CONFIG" && break
5084   done
5085 fi
5086 if test -z "$NCURSES_CONFIG"; then
5087   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5088   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5089 do
5090   # Extract the first word of "$ac_prog", so it can be a program name with args.
5091 set dummy $ac_prog; ac_word=$2
5092 echo "$as_me:5092: checking for $ac_word" >&5
5093 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5094 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5095   echo $ECHO_N "(cached) $ECHO_C" >&6
5096 else
5097   if test -n "$ac_ct_NCURSES_CONFIG"; then
5098   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5099 else
5100   ac_save_IFS=$IFS; IFS=$ac_path_separator
5101 ac_dummy="$PATH"
5102 for ac_dir in $ac_dummy; do
5103   IFS=$ac_save_IFS
5104   test -z "$ac_dir" && ac_dir=.
5105   $as_executable_p "$ac_dir/$ac_word" || continue
5106 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5107 echo "$as_me:5107: found $ac_dir/$ac_word" >&5
5108 break
5109 done
5110
5111 fi
5112 fi
5113 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5114 if test -n "$ac_ct_NCURSES_CONFIG"; then
5115   echo "$as_me:5115: result: $ac_ct_NCURSES_CONFIG" >&5
5116 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5117 else
5118   echo "$as_me:5118: result: no" >&5
5119 echo "${ECHO_T}no" >&6
5120 fi
5121
5122   test -n "$ac_ct_NCURSES_CONFIG" && break
5123 done
5124 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5125
5126   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5127 fi
5128
5129         if test "$NCURSES_CONFIG" != none ; then
5130
5131 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5132 do
5133         case "x$cf_add_cflags" in
5134         (x-[DU]*)
5135
5136 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5137 while true
5138 do
5139         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'`
5140         test "$CFLAGS" != "$cf_old_cflag" || break
5141
5142         CFLAGS="$cf_old_cflag"
5143 done
5144
5145 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5146 while true
5147 do
5148         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'`
5149         test "$CPPFLAGS" != "$cf_old_cflag" || break
5150
5151         CPPFLAGS="$cf_old_cflag"
5152 done
5153
5154                 ;;
5155         esac
5156
5157 cf_fix_cppflags=no
5158 cf_new_cflags=
5159 cf_new_cppflags=
5160 cf_new_extra_cppflags=
5161
5162 for cf_add_cflags in $cf_add_cflags
5163 do
5164 case "$cf_fix_cppflags" in
5165 (no)
5166         case "$cf_add_cflags" in
5167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5168                 case "$cf_add_cflags" in
5169                 (-D*)
5170                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5171
5172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5173                                 && test -z "${cf_tst_cflags}" \
5174                                 && cf_fix_cppflags=yes
5175
5176                         if test "$cf_fix_cppflags" = yes ; then
5177
5178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5180
5181                                 continue
5182                         elif test "${cf_tst_cflags}" = "\"'" ; then
5183
5184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5186
5187                                 continue
5188                         fi
5189                         ;;
5190                 esac
5191                 case "$CPPFLAGS" in
5192                 (*$cf_add_cflags)
5193                         ;;
5194                 (*)
5195                         case "$cf_add_cflags" in
5196                         (-D*)
5197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5198
5199 CPPFLAGS=`echo "$CPPFLAGS" | \
5200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5202
5203                                 ;;
5204                         esac
5205
5206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5208
5209                         ;;
5210                 esac
5211                 ;;
5212         (*)
5213
5214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5216
5217                 ;;
5218         esac
5219         ;;
5220 (yes)
5221
5222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5224
5225         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5226
5227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5228                 && test -z "${cf_tst_cflags}" \
5229                 && cf_fix_cppflags=no
5230         ;;
5231 esac
5232 done
5233
5234 if test -n "$cf_new_cflags" ; then
5235
5236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5237         CFLAGS="${CFLAGS}$cf_new_cflags"
5238
5239 fi
5240
5241 if test -n "$cf_new_cppflags" ; then
5242
5243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5245
5246 fi
5247
5248 if test -n "$cf_new_extra_cppflags" ; then
5249
5250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5252
5253 fi
5254
5255 done
5256
5257 cf_add_libs="$LIBS"
5258 # reverse order
5259 cf_add_0lib=
5260 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5261 # filter duplicates
5262 for cf_add_1lib in $cf_add_0lib; do
5263         for cf_add_2lib in $cf_add_libs; do
5264                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5265                         cf_add_1lib=
5266                         break
5267                 fi
5268         done
5269         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5270 done
5271 LIBS="$cf_add_libs"
5272
5273                 # even with config script, some packages use no-override for curses.h
5274
5275 echo "$as_me:5275: checking if we have identified curses headers" >&5
5276 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5277 if test "${cf_cv_ncurses_header+set}" = set; then
5278   echo $ECHO_N "(cached) $ECHO_C" >&6
5279 else
5280
5281 cf_cv_ncurses_header=none
5282 for cf_header in \
5283         ncurses.h ncurses/ncurses.h \
5284         curses.h ncurses/curses.h
5285 do
5286 cat >"conftest.$ac_ext" <<_ACEOF
5287 #line 5287 "configure"
5288 #include "confdefs.h"
5289 #include <${cf_header}>
5290 int
5291 main (void)
5292 {
5293 initscr(); tgoto("?", 0,0)
5294   ;
5295   return 0;
5296 }
5297 _ACEOF
5298 rm -f "conftest.$ac_objext"
5299 if { (eval echo "$as_me:5299: \"$ac_compile\"") >&5
5300   (eval $ac_compile) 2>&5
5301   ac_status=$?
5302   echo "$as_me:5302: \$? = $ac_status" >&5
5303   (exit "$ac_status"); } &&
5304          { ac_try='test -s "conftest.$ac_objext"'
5305   { (eval echo "$as_me:5305: \"$ac_try\"") >&5
5306   (eval $ac_try) 2>&5
5307   ac_status=$?
5308   echo "$as_me:5308: \$? = $ac_status" >&5
5309   (exit "$ac_status"); }; }; then
5310   cf_cv_ncurses_header=$cf_header; break
5311 else
5312   echo "$as_me: failed program was:" >&5
5313 cat "conftest.$ac_ext" >&5
5314 fi
5315 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5316 done
5317
5318 fi
5319 echo "$as_me:5319: result: $cf_cv_ncurses_header" >&5
5320 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5321
5322 if test "$cf_cv_ncurses_header" = none ; then
5323         { { echo "$as_me:5323: error: No curses header-files found" >&5
5324 echo "$as_me: error: No curses header-files found" >&2;}
5325    { (exit 1); exit 1; }; }
5326 fi
5327
5328 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5329
5330 for ac_header in $cf_cv_ncurses_header
5331 do
5332 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5333 echo "$as_me:5333: checking for $ac_header" >&5
5334 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5335 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5336   echo $ECHO_N "(cached) $ECHO_C" >&6
5337 else
5338   cat >"conftest.$ac_ext" <<_ACEOF
5339 #line 5339 "configure"
5340 #include "confdefs.h"
5341 #include <$ac_header>
5342 _ACEOF
5343 if { (eval echo "$as_me:5343: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5344   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5345   ac_status=$?
5346   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5347   rm -f conftest.er1
5348   cat conftest.err >&5
5349   echo "$as_me:5349: \$? = $ac_status" >&5
5350   (exit "$ac_status"); } >/dev/null; then
5351   if test -s conftest.err; then
5352     ac_cpp_err=$ac_c_preproc_warn_flag
5353   else
5354     ac_cpp_err=
5355   fi
5356 else
5357   ac_cpp_err=yes
5358 fi
5359 if test -z "$ac_cpp_err"; then
5360   eval "$as_ac_Header=yes"
5361 else
5362   echo "$as_me: failed program was:" >&5
5363   cat "conftest.$ac_ext" >&5
5364   eval "$as_ac_Header=no"
5365 fi
5366 rm -f conftest.err "conftest.$ac_ext"
5367 fi
5368 echo "$as_me:5368: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5369 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5370 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5371   cat >>confdefs.h <<EOF
5372 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5373 EOF
5374
5375 fi
5376 done
5377
5378 cat >>confdefs.h <<\EOF
5379 #define NCURSES 1
5380 EOF
5381
5382 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5383
5384                 cat >>confdefs.h <<EOF
5385 #define $cf_nculib_ROOT 1
5386 EOF
5387
5388                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5389
5390         else
5391
5392 cf_ncuhdr_root=ncurses
5393
5394 test -n "$cf_cv_curses_dir" && \
5395 test "$cf_cv_curses_dir" != "no" && { \
5396
5397 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5398   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5399   do
5400         while test "$cf_add_incdir" != /usr/include
5401         do
5402           if test -d "$cf_add_incdir"
5403           then
5404                 cf_have_incdir=no
5405                 if test -n "$CFLAGS$CPPFLAGS" ; then
5406                   # a loop is needed to ensure we can add subdirs of existing dirs
5407                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5408                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5409                           cf_have_incdir=yes; break
5410                         fi
5411                   done
5412                 fi
5413
5414                 if test "$cf_have_incdir" = no ; then
5415                   if test "$cf_add_incdir" = /usr/local/include ; then
5416                         if test "$GCC" = yes
5417                         then
5418                           cf_save_CPPFLAGS=$CPPFLAGS
5419
5420         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5421         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5422
5423                           cat >"conftest.$ac_ext" <<_ACEOF
5424 #line 5424 "configure"
5425 #include "confdefs.h"
5426 #include <stdio.h>
5427 int
5428 main (void)
5429 {
5430 printf("Hello")
5431   ;
5432   return 0;
5433 }
5434 _ACEOF
5435 rm -f "conftest.$ac_objext"
5436 if { (eval echo "$as_me:5436: \"$ac_compile\"") >&5
5437   (eval $ac_compile) 2>&5
5438   ac_status=$?
5439   echo "$as_me:5439: \$? = $ac_status" >&5
5440   (exit "$ac_status"); } &&
5441          { ac_try='test -s "conftest.$ac_objext"'
5442   { (eval echo "$as_me:5442: \"$ac_try\"") >&5
5443   (eval $ac_try) 2>&5
5444   ac_status=$?
5445   echo "$as_me:5445: \$? = $ac_status" >&5
5446   (exit "$ac_status"); }; }; then
5447   :
5448 else
5449   echo "$as_me: failed program was:" >&5
5450 cat "conftest.$ac_ext" >&5
5451 cf_have_incdir=yes
5452 fi
5453 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5454                           CPPFLAGS=$cf_save_CPPFLAGS
5455                         fi
5456                   fi
5457                 fi
5458
5459                 if test "$cf_have_incdir" = no ; then
5460                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5461
5462 echo "${as_me:-configure}:5462: testing adding $cf_add_incdir to include-path ..." 1>&5
5463
5464                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5465
5466                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5467                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5468                   cf_add_incdir="$cf_top_incdir"
5469                 else
5470                   break
5471                 fi
5472           else
5473                 break
5474           fi
5475         done
5476   done
5477 fi
5478
5479 }
5480
5481 echo "$as_me:5481: checking for $cf_ncuhdr_root header in include-path" >&5
5482 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5483 if test "${cf_cv_ncurses_h+set}" = set; then
5484   echo $ECHO_N "(cached) $ECHO_C" >&6
5485 else
5486
5487         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5488         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5489         for cf_header in $cf_header_list
5490         do
5491
5492         cat >"conftest.$ac_ext" <<_ACEOF
5493 #line 5493 "configure"
5494 #include "confdefs.h"
5495
5496 #include <$cf_header>
5497 int
5498 main (void)
5499 {
5500
5501 #ifdef NCURSES_VERSION
5502
5503 printf("%s\\n", NCURSES_VERSION);
5504 #else
5505 #ifdef __NCURSES_H
5506 printf("old\\n");
5507 #else
5508         make an error
5509 #endif
5510 #endif
5511
5512   ;
5513   return 0;
5514 }
5515 _ACEOF
5516 rm -f "conftest.$ac_objext"
5517 if { (eval echo "$as_me:5517: \"$ac_compile\"") >&5
5518   (eval $ac_compile) 2>&5
5519   ac_status=$?
5520   echo "$as_me:5520: \$? = $ac_status" >&5
5521   (exit "$ac_status"); } &&
5522          { ac_try='test -s "conftest.$ac_objext"'
5523   { (eval echo "$as_me:5523: \"$ac_try\"") >&5
5524   (eval $ac_try) 2>&5
5525   ac_status=$?
5526   echo "$as_me:5526: \$? = $ac_status" >&5
5527   (exit "$ac_status"); }; }; then
5528   cf_cv_ncurses_h=$cf_header
5529
5530 else
5531   echo "$as_me: failed program was:" >&5
5532 cat "conftest.$ac_ext" >&5
5533 cf_cv_ncurses_h=no
5534 fi
5535 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5536
5537                 test "$cf_cv_ncurses_h" != no && break
5538         done
5539
5540 fi
5541 echo "$as_me:5541: result: $cf_cv_ncurses_h" >&5
5542 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5543
5544 if test "$cf_cv_ncurses_h" != no ; then
5545         cf_cv_ncurses_header=$cf_cv_ncurses_h
5546 else
5547
5548 echo "$as_me:5548: checking for $cf_ncuhdr_root include-path" >&5
5549 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5550 if test "${cf_cv_ncurses_h2+set}" = set; then
5551   echo $ECHO_N "(cached) $ECHO_C" >&6
5552 else
5553
5554         test -n "$verbose" && echo
5555
5556 cf_search=
5557
5558 # collect the current set of include-directories from compiler flags
5559 cf_header_path_list=""
5560 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5561         for cf_header_path in $CPPFLAGS $CFLAGS
5562         do
5563                 case "$cf_header_path" in
5564                 (-I*)
5565                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5566
5567 test "x$cf_header_path" != "xNONE" && \
5568 test -d "$cf_header_path" && \
5569  {
5570         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5571         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5572         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5573         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5574         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5575         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"
5576 }
5577
5578                         cf_header_path_list="$cf_header_path_list $cf_search"
5579                         ;;
5580                 esac
5581         done
5582 fi
5583
5584 # add the variations for the package we are looking for
5585
5586 cf_search=
5587
5588 test "x$prefix" != "xNONE" && \
5589 test -d "$prefix" && \
5590  {
5591         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5592         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5593         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5594         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5595         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5596         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5597 }
5598
5599 for cf_subdir_prefix in \
5600         /usr \
5601         /usr/local \
5602         /usr/pkg \
5603         /opt \
5604         /opt/local \
5605         $HOME
5606 do
5607
5608 test "x$cf_subdir_prefix" != "x$prefix" && \
5609 test -d "$cf_subdir_prefix" && \
5610 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5611         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5612         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5613         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5614         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5615         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5616         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"
5617 }
5618
5619 done
5620
5621 test "$includedir" != NONE && \
5622 test "$includedir" != "/usr/include" && \
5623 test -d "$includedir" && {
5624         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5625         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5626 }
5627
5628 test "$oldincludedir" != NONE && \
5629 test "$oldincludedir" != "/usr/include" && \
5630 test -d "$oldincludedir" && {
5631         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5632         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5633 }
5634
5635 cf_search="$cf_search $cf_header_path_list"
5636
5637         test -n "$verbose" && echo "search path $cf_search"
5638         cf_save2_CPPFLAGS="$CPPFLAGS"
5639         for cf_incdir in $cf_search
5640         do
5641
5642 if test -n "$cf_incdir" ; then
5643   for cf_add_incdir in $cf_incdir
5644   do
5645         while test "$cf_add_incdir" != /usr/include
5646         do
5647           if test -d "$cf_add_incdir"
5648           then
5649                 cf_have_incdir=no
5650                 if test -n "$CFLAGS$CPPFLAGS" ; then
5651                   # a loop is needed to ensure we can add subdirs of existing dirs
5652                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5653                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5654                           cf_have_incdir=yes; break
5655                         fi
5656                   done
5657                 fi
5658
5659                 if test "$cf_have_incdir" = no ; then
5660                   if test "$cf_add_incdir" = /usr/local/include ; then
5661                         if test "$GCC" = yes
5662                         then
5663                           cf_save_CPPFLAGS=$CPPFLAGS
5664
5665         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5666         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5667
5668                           cat >"conftest.$ac_ext" <<_ACEOF
5669 #line 5669 "configure"
5670 #include "confdefs.h"
5671 #include <stdio.h>
5672 int
5673 main (void)
5674 {
5675 printf("Hello")
5676   ;
5677   return 0;
5678 }
5679 _ACEOF
5680 rm -f "conftest.$ac_objext"
5681 if { (eval echo "$as_me:5681: \"$ac_compile\"") >&5
5682   (eval $ac_compile) 2>&5
5683   ac_status=$?
5684   echo "$as_me:5684: \$? = $ac_status" >&5
5685   (exit "$ac_status"); } &&
5686          { ac_try='test -s "conftest.$ac_objext"'
5687   { (eval echo "$as_me:5687: \"$ac_try\"") >&5
5688   (eval $ac_try) 2>&5
5689   ac_status=$?
5690   echo "$as_me:5690: \$? = $ac_status" >&5
5691   (exit "$ac_status"); }; }; then
5692   :
5693 else
5694   echo "$as_me: failed program was:" >&5
5695 cat "conftest.$ac_ext" >&5
5696 cf_have_incdir=yes
5697 fi
5698 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5699                           CPPFLAGS=$cf_save_CPPFLAGS
5700                         fi
5701                   fi
5702                 fi
5703
5704                 if test "$cf_have_incdir" = no ; then
5705                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5706
5707 echo "${as_me:-configure}:5707: testing adding $cf_add_incdir to include-path ..." 1>&5
5708
5709                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5710
5711                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5712                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5713                   cf_add_incdir="$cf_top_incdir"
5714                 else
5715                   break
5716                 fi
5717           else
5718                 break
5719           fi
5720         done
5721   done
5722 fi
5723
5724                 for cf_header in \
5725                         ncurses.h \
5726                         curses.h
5727                 do
5728
5729         cat >"conftest.$ac_ext" <<_ACEOF
5730 #line 5730 "configure"
5731 #include "confdefs.h"
5732
5733 #include <$cf_header>
5734 int
5735 main (void)
5736 {
5737
5738 #ifdef NCURSES_VERSION
5739
5740 printf("%s\\n", NCURSES_VERSION);
5741 #else
5742 #ifdef __NCURSES_H
5743 printf("old\\n");
5744 #else
5745         make an error
5746 #endif
5747 #endif
5748
5749   ;
5750   return 0;
5751 }
5752 _ACEOF
5753 rm -f "conftest.$ac_objext"
5754 if { (eval echo "$as_me:5754: \"$ac_compile\"") >&5
5755   (eval $ac_compile) 2>&5
5756   ac_status=$?
5757   echo "$as_me:5757: \$? = $ac_status" >&5
5758   (exit "$ac_status"); } &&
5759          { ac_try='test -s "conftest.$ac_objext"'
5760   { (eval echo "$as_me:5760: \"$ac_try\"") >&5
5761   (eval $ac_try) 2>&5
5762   ac_status=$?
5763   echo "$as_me:5763: \$? = $ac_status" >&5
5764   (exit "$ac_status"); }; }; then
5765   cf_cv_ncurses_h2=$cf_header
5766
5767 else
5768   echo "$as_me: failed program was:" >&5
5769 cat "conftest.$ac_ext" >&5
5770 cf_cv_ncurses_h2=no
5771 fi
5772 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5773
5774                         if test "$cf_cv_ncurses_h2" != no ; then
5775                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5776                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5777                                 break
5778                         fi
5779                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5780                 done
5781                 CPPFLAGS="$cf_save2_CPPFLAGS"
5782                 test "$cf_cv_ncurses_h2" != no && break
5783         done
5784         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5784: error: not found" >&5
5785 echo "$as_me: error: not found" >&2;}
5786    { (exit 1); exit 1; }; }
5787
5788 fi
5789 echo "$as_me:5789: result: $cf_cv_ncurses_h2" >&5
5790 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5791
5792         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5793         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5794         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5795                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5796         fi
5797
5798 if test -n "$cf_1st_incdir" ; then
5799   for cf_add_incdir in $cf_1st_incdir
5800   do
5801         while test "$cf_add_incdir" != /usr/include
5802         do
5803           if test -d "$cf_add_incdir"
5804           then
5805                 cf_have_incdir=no
5806                 if test -n "$CFLAGS$CPPFLAGS" ; then
5807                   # a loop is needed to ensure we can add subdirs of existing dirs
5808                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5809                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5810                           cf_have_incdir=yes; break
5811                         fi
5812                   done
5813                 fi
5814
5815                 if test "$cf_have_incdir" = no ; then
5816                   if test "$cf_add_incdir" = /usr/local/include ; then
5817                         if test "$GCC" = yes
5818                         then
5819                           cf_save_CPPFLAGS=$CPPFLAGS
5820
5821         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5822         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5823
5824                           cat >"conftest.$ac_ext" <<_ACEOF
5825 #line 5825 "configure"
5826 #include "confdefs.h"
5827 #include <stdio.h>
5828 int
5829 main (void)
5830 {
5831 printf("Hello")
5832   ;
5833   return 0;
5834 }
5835 _ACEOF
5836 rm -f "conftest.$ac_objext"
5837 if { (eval echo "$as_me:5837: \"$ac_compile\"") >&5
5838   (eval $ac_compile) 2>&5
5839   ac_status=$?
5840   echo "$as_me:5840: \$? = $ac_status" >&5
5841   (exit "$ac_status"); } &&
5842          { ac_try='test -s "conftest.$ac_objext"'
5843   { (eval echo "$as_me:5843: \"$ac_try\"") >&5
5844   (eval $ac_try) 2>&5
5845   ac_status=$?
5846   echo "$as_me:5846: \$? = $ac_status" >&5
5847   (exit "$ac_status"); }; }; then
5848   :
5849 else
5850   echo "$as_me: failed program was:" >&5
5851 cat "conftest.$ac_ext" >&5
5852 cf_have_incdir=yes
5853 fi
5854 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5855                           CPPFLAGS=$cf_save_CPPFLAGS
5856                         fi
5857                   fi
5858                 fi
5859
5860                 if test "$cf_have_incdir" = no ; then
5861                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5862
5863 echo "${as_me:-configure}:5863: testing adding $cf_add_incdir to include-path ..." 1>&5
5864
5865                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5866
5867                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5868                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5869                   cf_add_incdir="$cf_top_incdir"
5870                 else
5871                   break
5872                 fi
5873           else
5874                 break
5875           fi
5876         done
5877   done
5878 fi
5879
5880 fi
5881
5882 # Set definitions to allow ifdef'ing for ncurses.h
5883
5884 case "$cf_cv_ncurses_header" in
5885 (*ncurses.h)
5886
5887 cat >>confdefs.h <<\EOF
5888 #define HAVE_NCURSES_H 1
5889 EOF
5890
5891         ;;
5892 esac
5893
5894 case "$cf_cv_ncurses_header" in
5895 (ncurses/curses.h|ncurses/ncurses.h)
5896
5897 cat >>confdefs.h <<\EOF
5898 #define HAVE_NCURSES_NCURSES_H 1
5899 EOF
5900
5901         ;;
5902 (ncursesw/curses.h|ncursesw/ncurses.h)
5903
5904 cat >>confdefs.h <<\EOF
5905 #define HAVE_NCURSESW_NCURSES_H 1
5906 EOF
5907
5908         ;;
5909 esac
5910
5911 echo "$as_me:5911: checking for terminfo header" >&5
5912 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5913 if test "${cf_cv_term_header+set}" = set; then
5914   echo $ECHO_N "(cached) $ECHO_C" >&6
5915 else
5916
5917 case "${cf_cv_ncurses_header}" in
5918 (*/ncurses.h|*/ncursesw.h)
5919         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5920         ;;
5921 (*)
5922         cf_term_header=term.h
5923         ;;
5924 esac
5925
5926 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5927 do
5928 cat >"conftest.$ac_ext" <<_ACEOF
5929 #line 5929 "configure"
5930 #include "confdefs.h"
5931 #include <stdio.h>
5932 #include <${cf_cv_ncurses_header:-curses.h}>
5933 #include <$cf_test>
5934
5935 int
5936 main (void)
5937 {
5938 int x = auto_left_margin; (void)x
5939   ;
5940   return 0;
5941 }
5942 _ACEOF
5943 rm -f "conftest.$ac_objext"
5944 if { (eval echo "$as_me:5944: \"$ac_compile\"") >&5
5945   (eval $ac_compile) 2>&5
5946   ac_status=$?
5947   echo "$as_me:5947: \$? = $ac_status" >&5
5948   (exit "$ac_status"); } &&
5949          { ac_try='test -s "conftest.$ac_objext"'
5950   { (eval echo "$as_me:5950: \"$ac_try\"") >&5
5951   (eval $ac_try) 2>&5
5952   ac_status=$?
5953   echo "$as_me:5953: \$? = $ac_status" >&5
5954   (exit "$ac_status"); }; }; then
5955
5956         cf_cv_term_header="$cf_test"
5957 else
5958   echo "$as_me: failed program was:" >&5
5959 cat "conftest.$ac_ext" >&5
5960
5961         cf_cv_term_header=unknown
5962
5963 fi
5964 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5965         test "$cf_cv_term_header" != unknown && break
5966 done
5967
5968 fi
5969 echo "$as_me:5969: result: $cf_cv_term_header" >&5
5970 echo "${ECHO_T}$cf_cv_term_header" >&6
5971
5972 # Set definitions to allow ifdef'ing to accommodate subdirectories
5973
5974 case "$cf_cv_term_header" in
5975 (*term.h)
5976
5977 cat >>confdefs.h <<\EOF
5978 #define HAVE_TERM_H 1
5979 EOF
5980
5981         ;;
5982 esac
5983
5984 case "$cf_cv_term_header" in
5985 (ncurses/term.h)
5986
5987 cat >>confdefs.h <<\EOF
5988 #define HAVE_NCURSES_TERM_H 1
5989 EOF
5990
5991         ;;
5992 (ncursesw/term.h)
5993
5994 cat >>confdefs.h <<\EOF
5995 #define HAVE_NCURSESW_TERM_H 1
5996 EOF
5997
5998         ;;
5999 esac
6000
6001 # some applications need this, but should check for NCURSES_VERSION
6002
6003 cat >>confdefs.h <<\EOF
6004 #define NCURSES 1
6005 EOF
6006
6007 echo "$as_me:6007: checking for ncurses version" >&5
6008 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6009 if test "${cf_cv_ncurses_version+set}" = set; then
6010   echo $ECHO_N "(cached) $ECHO_C" >&6
6011 else
6012
6013         cf_cv_ncurses_version=no
6014         cf_tempfile=out$$
6015         rm -f "$cf_tempfile"
6016         if test "$cross_compiling" = yes; then
6017
6018         # This will not work if the preprocessor splits the line after the
6019         # Autoconf token.  The 'unproto' program does that.
6020         cat > "conftest.$ac_ext" <<EOF
6021 #include <${cf_cv_ncurses_header:-curses.h}>
6022 #undef Autoconf
6023 #ifdef NCURSES_VERSION
6024 Autoconf NCURSES_VERSION
6025 #else
6026 #ifdef __NCURSES_H
6027 Autoconf "old"
6028 #endif
6029 ;
6030 #endif
6031 EOF
6032         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6033         { (eval echo "$as_me:6033: \"$cf_try\"") >&5
6034   (eval $cf_try) 2>&5
6035   ac_status=$?
6036   echo "$as_me:6036: \$? = $ac_status" >&5
6037   (exit "$ac_status"); }
6038         if test -f conftest.out ; then
6039                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6040                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6041                 rm -f conftest.out
6042         fi
6043
6044 else
6045   cat >"conftest.$ac_ext" <<_ACEOF
6046 #line 6046 "configure"
6047 #include "confdefs.h"
6048
6049 #include <${cf_cv_ncurses_header:-curses.h}>
6050 #include <stdio.h>
6051 int main(void)
6052 {
6053         FILE *fp = fopen("$cf_tempfile", "w");
6054 #ifdef NCURSES_VERSION
6055 # ifdef NCURSES_VERSION_PATCH
6056         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6057 # else
6058         fprintf(fp, "%s\\n", NCURSES_VERSION);
6059 # endif
6060 #else
6061 # ifdef __NCURSES_H
6062         fprintf(fp, "old\\n");
6063 # else
6064         make an error
6065 # endif
6066 #endif
6067         ${cf_cv_main_return:-return}(0);
6068 }
6069 _ACEOF
6070 rm -f "conftest$ac_exeext"
6071 if { (eval echo "$as_me:6071: \"$ac_link\"") >&5
6072   (eval $ac_link) 2>&5
6073   ac_status=$?
6074   echo "$as_me:6074: \$? = $ac_status" >&5
6075   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6076   { (eval echo "$as_me:6076: \"$ac_try\"") >&5
6077   (eval $ac_try) 2>&5
6078   ac_status=$?
6079   echo "$as_me:6079: \$? = $ac_status" >&5
6080   (exit "$ac_status"); }; }; then
6081
6082         cf_cv_ncurses_version=`cat $cf_tempfile`
6083 else
6084   echo "$as_me: program exited with status $ac_status" >&5
6085 echo "$as_me: failed program was:" >&5
6086 cat "conftest.$ac_ext" >&5
6087 fi
6088 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6089 fi
6090         rm -f "$cf_tempfile"
6091
6092 fi
6093 echo "$as_me:6093: result: $cf_cv_ncurses_version" >&5
6094 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6095 test "$cf_cv_ncurses_version" = no ||
6096 cat >>confdefs.h <<\EOF
6097 #define NCURSES 1
6098 EOF
6099
6100 cf_nculib_root=ncurses
6101         # This works, except for the special case where we find gpm, but
6102         # ncurses is in a nonstandard location via $LIBS, and we really want
6103         # to link gpm.
6104 cf_ncurses_LIBS=""
6105 cf_ncurses_SAVE="$LIBS"
6106 echo "$as_me:6106: checking for Gpm_Open in -lgpm" >&5
6107 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6108 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6109   echo $ECHO_N "(cached) $ECHO_C" >&6
6110 else
6111   ac_check_lib_save_LIBS=$LIBS
6112 LIBS="-lgpm  $LIBS"
6113 cat >"conftest.$ac_ext" <<_ACEOF
6114 #line 6114 "configure"
6115 #include "confdefs.h"
6116
6117 /* Override any gcc2 internal prototype to avoid an error.  */
6118 #ifdef __cplusplus
6119 extern "C"
6120 #endif
6121 /* We use char because int might match the return type of a gcc2
6122    builtin and then its argument prototype would still apply.  */
6123 char Gpm_Open ();
6124 int
6125 main (void)
6126 {
6127 Gpm_Open ();
6128   ;
6129   return 0;
6130 }
6131 _ACEOF
6132 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6133 if { (eval echo "$as_me:6133: \"$ac_link\"") >&5
6134   (eval $ac_link) 2>&5
6135   ac_status=$?
6136   echo "$as_me:6136: \$? = $ac_status" >&5
6137   (exit "$ac_status"); } &&
6138          { ac_try='test -s "conftest$ac_exeext"'
6139   { (eval echo "$as_me:6139: \"$ac_try\"") >&5
6140   (eval $ac_try) 2>&5
6141   ac_status=$?
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit "$ac_status"); }; }; then
6144   ac_cv_lib_gpm_Gpm_Open=yes
6145 else
6146   echo "$as_me: failed program was:" >&5
6147 cat "conftest.$ac_ext" >&5
6148 ac_cv_lib_gpm_Gpm_Open=no
6149 fi
6150 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6151 LIBS=$ac_check_lib_save_LIBS
6152 fi
6153 echo "$as_me:6153: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6154 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6155 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6156   echo "$as_me:6156: checking for initscr in -lgpm" >&5
6157 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6158 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6159   echo $ECHO_N "(cached) $ECHO_C" >&6
6160 else
6161   ac_check_lib_save_LIBS=$LIBS
6162 LIBS="-lgpm  $LIBS"
6163 cat >"conftest.$ac_ext" <<_ACEOF
6164 #line 6164 "configure"
6165 #include "confdefs.h"
6166
6167 /* Override any gcc2 internal prototype to avoid an error.  */
6168 #ifdef __cplusplus
6169 extern "C"
6170 #endif
6171 /* We use char because int might match the return type of a gcc2
6172    builtin and then its argument prototype would still apply.  */
6173 char initscr ();
6174 int
6175 main (void)
6176 {
6177 initscr ();
6178   ;
6179   return 0;
6180 }
6181 _ACEOF
6182 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6183 if { (eval echo "$as_me:6183: \"$ac_link\"") >&5
6184   (eval $ac_link) 2>&5
6185   ac_status=$?
6186   echo "$as_me:6186: \$? = $ac_status" >&5
6187   (exit "$ac_status"); } &&
6188          { ac_try='test -s "conftest$ac_exeext"'
6189   { (eval echo "$as_me:6189: \"$ac_try\"") >&5
6190   (eval $ac_try) 2>&5
6191   ac_status=$?
6192   echo "$as_me:6192: \$? = $ac_status" >&5
6193   (exit "$ac_status"); }; }; then
6194   ac_cv_lib_gpm_initscr=yes
6195 else
6196   echo "$as_me: failed program was:" >&5
6197 cat "conftest.$ac_ext" >&5
6198 ac_cv_lib_gpm_initscr=no
6199 fi
6200 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6201 LIBS=$ac_check_lib_save_LIBS
6202 fi
6203 echo "$as_me:6203: result: $ac_cv_lib_gpm_initscr" >&5
6204 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6205 if test "$ac_cv_lib_gpm_initscr" = yes; then
6206   LIBS="$cf_ncurses_SAVE"
6207 else
6208   cf_ncurses_LIBS="-lgpm"
6209 fi
6210
6211 fi
6212
6213 case "$host_os" in
6214 (freebsd*)
6215         # This is only necessary if you are linking against an obsolete
6216         # version of ncurses (but it should do no harm, since it is static).
6217         if test "$cf_nculib_root" = ncurses ; then
6218                 echo "$as_me:6218: checking for tgoto in -lmytinfo" >&5
6219 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6220 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6221   echo $ECHO_N "(cached) $ECHO_C" >&6
6222 else
6223   ac_check_lib_save_LIBS=$LIBS
6224 LIBS="-lmytinfo  $LIBS"
6225 cat >"conftest.$ac_ext" <<_ACEOF
6226 #line 6226 "configure"
6227 #include "confdefs.h"
6228
6229 /* Override any gcc2 internal prototype to avoid an error.  */
6230 #ifdef __cplusplus
6231 extern "C"
6232 #endif
6233 /* We use char because int might match the return type of a gcc2
6234    builtin and then its argument prototype would still apply.  */
6235 char tgoto ();
6236 int
6237 main (void)
6238 {
6239 tgoto ();
6240   ;
6241   return 0;
6242 }
6243 _ACEOF
6244 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6245 if { (eval echo "$as_me:6245: \"$ac_link\"") >&5
6246   (eval $ac_link) 2>&5
6247   ac_status=$?
6248   echo "$as_me:6248: \$? = $ac_status" >&5
6249   (exit "$ac_status"); } &&
6250          { ac_try='test -s "conftest$ac_exeext"'
6251   { (eval echo "$as_me:6251: \"$ac_try\"") >&5
6252   (eval $ac_try) 2>&5
6253   ac_status=$?
6254   echo "$as_me:6254: \$? = $ac_status" >&5
6255   (exit "$ac_status"); }; }; then
6256   ac_cv_lib_mytinfo_tgoto=yes
6257 else
6258   echo "$as_me: failed program was:" >&5
6259 cat "conftest.$ac_ext" >&5
6260 ac_cv_lib_mytinfo_tgoto=no
6261 fi
6262 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6263 LIBS=$ac_check_lib_save_LIBS
6264 fi
6265 echo "$as_me:6265: result: $ac_cv_lib_mytinfo_tgoto" >&5
6266 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6267 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6268   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6269 fi
6270
6271         fi
6272         ;;
6273 esac
6274
6275 cf_add_libs="$LIBS"
6276 # reverse order
6277 cf_add_0lib=
6278 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6279 # filter duplicates
6280 for cf_add_1lib in $cf_add_0lib; do
6281         for cf_add_2lib in $cf_add_libs; do
6282                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6283                         cf_add_1lib=
6284                         break
6285                 fi
6286         done
6287         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6288 done
6289 LIBS="$cf_add_libs"
6290
6291 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6292 then
6293
6294 cf_add_libs="$LIBS"
6295 # reverse order
6296 cf_add_0lib=
6297 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6298 # filter duplicates
6299 for cf_add_1lib in $cf_add_0lib; do
6300         for cf_add_2lib in $cf_add_libs; do
6301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6302                         cf_add_1lib=
6303                         break
6304                 fi
6305         done
6306         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6307 done
6308 LIBS="$cf_add_libs"
6309
6310 else
6311
6312         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6313         cf_libdir=""
6314         echo "$as_me:6314: checking for initscr" >&5
6315 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6316 if test "${ac_cv_func_initscr+set}" = set; then
6317   echo $ECHO_N "(cached) $ECHO_C" >&6
6318 else
6319   cat >"conftest.$ac_ext" <<_ACEOF
6320 #line 6320 "configure"
6321 #include "confdefs.h"
6322 #define initscr autoconf_temporary
6323 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6324 #undef initscr
6325
6326 #ifdef __cplusplus
6327 extern "C"
6328 #endif
6329
6330 /* We use char because int might match the return type of a gcc2
6331    builtin and then its argument prototype would still apply.  */
6332 char initscr (void);
6333
6334 int
6335 main (void)
6336 {
6337
6338 /* The GNU C library defines stubs for functions which it implements
6339     to always fail with ENOSYS.  Some functions are actually named
6340     something starting with __ and the normal name is an alias.  */
6341 #if defined (__stub_initscr) || defined (__stub___initscr)
6342 #error found stub for initscr
6343 #endif
6344
6345         return initscr ();
6346   ;
6347   return 0;
6348 }
6349 _ACEOF
6350 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6351 if { (eval echo "$as_me:6351: \"$ac_link\"") >&5
6352   (eval $ac_link) 2>&5
6353   ac_status=$?
6354   echo "$as_me:6354: \$? = $ac_status" >&5
6355   (exit "$ac_status"); } &&
6356          { ac_try='test -s "conftest$ac_exeext"'
6357   { (eval echo "$as_me:6357: \"$ac_try\"") >&5
6358   (eval $ac_try) 2>&5
6359   ac_status=$?
6360   echo "$as_me:6360: \$? = $ac_status" >&5
6361   (exit "$ac_status"); }; }; then
6362   ac_cv_func_initscr=yes
6363 else
6364   echo "$as_me: failed program was:" >&5
6365 cat "conftest.$ac_ext" >&5
6366 ac_cv_func_initscr=no
6367 fi
6368 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6369 fi
6370 echo "$as_me:6370: result: $ac_cv_func_initscr" >&5
6371 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6372 if test "$ac_cv_func_initscr" = yes; then
6373   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6374 else
6375
6376                 cf_save_LIBS="$LIBS"
6377                 echo "$as_me:6377: checking for initscr in -l$cf_nculib_root" >&5
6378 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6379                 LIBS="-l$cf_nculib_root $LIBS"
6380                 cat >"conftest.$ac_ext" <<_ACEOF
6381 #line 6381 "configure"
6382 #include "confdefs.h"
6383 #include <${cf_cv_ncurses_header:-curses.h}>
6384 int
6385 main (void)
6386 {
6387 initscr()
6388   ;
6389   return 0;
6390 }
6391 _ACEOF
6392 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6393 if { (eval echo "$as_me:6393: \"$ac_link\"") >&5
6394   (eval $ac_link) 2>&5
6395   ac_status=$?
6396   echo "$as_me:6396: \$? = $ac_status" >&5
6397   (exit "$ac_status"); } &&
6398          { ac_try='test -s "conftest$ac_exeext"'
6399   { (eval echo "$as_me:6399: \"$ac_try\"") >&5
6400   (eval $ac_try) 2>&5
6401   ac_status=$?
6402   echo "$as_me:6402: \$? = $ac_status" >&5
6403   (exit "$ac_status"); }; }; then
6404   echo "$as_me:6404: result: yes" >&5
6405 echo "${ECHO_T}yes" >&6
6406                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6407
6408 else
6409   echo "$as_me: failed program was:" >&5
6410 cat "conftest.$ac_ext" >&5
6411 echo "$as_me:6411: result: no" >&5
6412 echo "${ECHO_T}no" >&6
6413
6414 cf_search=
6415 cf_library_path_list=""
6416 if test -n "${LDFLAGS}${LIBS}" ; then
6417         for cf_library_path in $LDFLAGS $LIBS
6418         do
6419                 case "$cf_library_path" in
6420                 (-L*)
6421                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6422
6423 test "x$cf_library_path" != "xNONE" && \
6424 test -d "$cf_library_path" && \
6425  {
6426         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6427         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6428         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6429         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6430         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6431         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"
6432 }
6433
6434                         cf_library_path_list="$cf_library_path_list $cf_search"
6435                         ;;
6436                 esac
6437         done
6438 fi
6439
6440 cf_search=
6441
6442 test "x$prefix" != "xNONE" && \
6443 test -d "$prefix" && \
6444  {
6445         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6446         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6447         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6448         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6449         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6450         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6451 }
6452
6453 for cf_subdir_prefix in \
6454         /usr \
6455         /usr/local \
6456         /usr/pkg \
6457         /opt \
6458         /opt/local \
6459         $HOME
6460 do
6461
6462 test "x$cf_subdir_prefix" != "x$prefix" && \
6463 test -d "$cf_subdir_prefix" && \
6464 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6465         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6466         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6467         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6468         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6469         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6470         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"
6471 }
6472
6473 done
6474
6475 cf_search="$cf_library_path_list $cf_search"
6476
6477                         for cf_libdir in $cf_search
6478                         do
6479                                 echo "$as_me:6479: checking for -l$cf_nculib_root in $cf_libdir" >&5
6480 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6481                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6482                                 cat >"conftest.$ac_ext" <<_ACEOF
6483 #line 6483 "configure"
6484 #include "confdefs.h"
6485 #include <${cf_cv_ncurses_header:-curses.h}>
6486 int
6487 main (void)
6488 {
6489 initscr()
6490   ;
6491   return 0;
6492 }
6493 _ACEOF
6494 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6495 if { (eval echo "$as_me:6495: \"$ac_link\"") >&5
6496   (eval $ac_link) 2>&5
6497   ac_status=$?
6498   echo "$as_me:6498: \$? = $ac_status" >&5
6499   (exit "$ac_status"); } &&
6500          { ac_try='test -s "conftest$ac_exeext"'
6501   { (eval echo "$as_me:6501: \"$ac_try\"") >&5
6502   (eval $ac_try) 2>&5
6503   ac_status=$?
6504   echo "$as_me:6504: \$? = $ac_status" >&5
6505   (exit "$ac_status"); }; }; then
6506   echo "$as_me:6506: result: yes" >&5
6507 echo "${ECHO_T}yes" >&6
6508                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6509                                          break
6510 else
6511   echo "$as_me: failed program was:" >&5
6512 cat "conftest.$ac_ext" >&5
6513 echo "$as_me:6513: result: no" >&5
6514 echo "${ECHO_T}no" >&6
6515                                          LIBS="$cf_save_LIBS"
6516 fi
6517 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6518                         done
6519
6520 fi
6521 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6522
6523 fi
6524
6525 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6526
6527 if test "$cf_found_library" = no ; then
6528         { { echo "$as_me:6528: error: Cannot link $cf_nculib_root library" >&5
6529 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6530    { (exit 1); exit 1; }; }
6531 fi
6532
6533 fi
6534
6535 if test -n "$cf_ncurses_LIBS" ; then
6536         echo "$as_me:6536: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6537 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6538         cf_ncurses_SAVE="$LIBS"
6539         for p in $cf_ncurses_LIBS ; do
6540                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6541                 if test "$q" != "$LIBS" ; then
6542                         LIBS="$q"
6543                 fi
6544         done
6545         cat >"conftest.$ac_ext" <<_ACEOF
6546 #line 6546 "configure"
6547 #include "confdefs.h"
6548 #include <${cf_cv_ncurses_header:-curses.h}>
6549 int
6550 main (void)
6551 {
6552 initscr(); mousemask(0,0); tigetstr((char *)0);
6553   ;
6554   return 0;
6555 }
6556 _ACEOF
6557 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6558 if { (eval echo "$as_me:6558: \"$ac_link\"") >&5
6559   (eval $ac_link) 2>&5
6560   ac_status=$?
6561   echo "$as_me:6561: \$? = $ac_status" >&5
6562   (exit "$ac_status"); } &&
6563          { ac_try='test -s "conftest$ac_exeext"'
6564   { (eval echo "$as_me:6564: \"$ac_try\"") >&5
6565   (eval $ac_try) 2>&5
6566   ac_status=$?
6567   echo "$as_me:6567: \$? = $ac_status" >&5
6568   (exit "$ac_status"); }; }; then
6569   echo "$as_me:6569: result: yes" >&5
6570 echo "${ECHO_T}yes" >&6
6571 else
6572   echo "$as_me: failed program was:" >&5
6573 cat "conftest.$ac_ext" >&5
6574 echo "$as_me:6574: result: no" >&5
6575 echo "${ECHO_T}no" >&6
6576                  LIBS="$cf_ncurses_SAVE"
6577 fi
6578 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6579 fi
6580
6581 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6582
6583 cat >>confdefs.h <<EOF
6584 #define $cf_nculib_ROOT 1
6585 EOF
6586
6587         fi
6588 else
6589         NCURSES_CONFIG=none
6590 fi
6591
6592 echo "$as_me:6592: checking if you want wide-character code" >&5
6593 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6594
6595 # Check whether --enable-widec or --disable-widec was given.
6596 if test "${enable_widec+set}" = set; then
6597   enableval="$enable_widec"
6598   with_widec=$enableval
6599 else
6600   with_widec=no
6601 fi;
6602 echo "$as_me:6602: result: $with_widec" >&5
6603 echo "${ECHO_T}$with_widec" >&6
6604 if test "$with_widec" = yes ; then
6605
6606 for ac_header in wchar.h
6607 do
6608 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6609 echo "$as_me:6609: checking for $ac_header" >&5
6610 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6611 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6612   echo $ECHO_N "(cached) $ECHO_C" >&6
6613 else
6614   cat >"conftest.$ac_ext" <<_ACEOF
6615 #line 6615 "configure"
6616 #include "confdefs.h"
6617 #include <$ac_header>
6618 _ACEOF
6619 if { (eval echo "$as_me:6619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6621   ac_status=$?
6622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6623   rm -f conftest.er1
6624   cat conftest.err >&5
6625   echo "$as_me:6625: \$? = $ac_status" >&5
6626   (exit "$ac_status"); } >/dev/null; then
6627   if test -s conftest.err; then
6628     ac_cpp_err=$ac_c_preproc_warn_flag
6629   else
6630     ac_cpp_err=
6631   fi
6632 else
6633   ac_cpp_err=yes
6634 fi
6635 if test -z "$ac_cpp_err"; then
6636   eval "$as_ac_Header=yes"
6637 else
6638   echo "$as_me: failed program was:" >&5
6639   cat "conftest.$ac_ext" >&5
6640   eval "$as_ac_Header=no"
6641 fi
6642 rm -f conftest.err "conftest.$ac_ext"
6643 fi
6644 echo "$as_me:6644: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6645 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6646 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6647   cat >>confdefs.h <<EOF
6648 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6649 EOF
6650
6651 fi
6652 done
6653
6654 echo "$as_me:6654: checking for multibyte character support" >&5
6655 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6656 if test "${cf_cv_utf8_lib+set}" = set; then
6657   echo $ECHO_N "(cached) $ECHO_C" >&6
6658 else
6659
6660         cf_save_LIBS="$LIBS"
6661         cat >"conftest.$ac_ext" <<_ACEOF
6662 #line 6662 "configure"
6663 #include "confdefs.h"
6664
6665 #include <stdlib.h>
6666 #include <stdio.h>
6667 #ifdef HAVE_WCHAR_H
6668 #include <wchar.h>
6669 #endif
6670
6671 int
6672 main (void)
6673 {
6674 putwc(0,0);
6675   ;
6676   return 0;
6677 }
6678 _ACEOF
6679 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6680 if { (eval echo "$as_me:6680: \"$ac_link\"") >&5
6681   (eval $ac_link) 2>&5
6682   ac_status=$?
6683   echo "$as_me:6683: \$? = $ac_status" >&5
6684   (exit "$ac_status"); } &&
6685          { ac_try='test -s "conftest$ac_exeext"'
6686   { (eval echo "$as_me:6686: \"$ac_try\"") >&5
6687   (eval $ac_try) 2>&5
6688   ac_status=$?
6689   echo "$as_me:6689: \$? = $ac_status" >&5
6690   (exit "$ac_status"); }; }; then
6691   cf_cv_utf8_lib=yes
6692 else
6693   echo "$as_me: failed program was:" >&5
6694 cat "conftest.$ac_ext" >&5
6695
6696 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6697 # will be set on completion of the AC_TRY_LINK below.
6698 cf_cv_header_path_utf8=
6699 cf_cv_library_path_utf8=
6700
6701 echo "${as_me:-configure}:6701: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6702
6703 cf_save_LIBS="$LIBS"
6704
6705 cat >"conftest.$ac_ext" <<_ACEOF
6706 #line 6706 "configure"
6707 #include "confdefs.h"
6708
6709 #include <libutf8.h>
6710 int
6711 main (void)
6712 {
6713 putwc(0,0);
6714   ;
6715   return 0;
6716 }
6717 _ACEOF
6718 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6719 if { (eval echo "$as_me:6719: \"$ac_link\"") >&5
6720   (eval $ac_link) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit "$ac_status"); } &&
6724          { ac_try='test -s "conftest$ac_exeext"'
6725   { (eval echo "$as_me:6725: \"$ac_try\"") >&5
6726   (eval $ac_try) 2>&5
6727   ac_status=$?
6728   echo "$as_me:6728: \$? = $ac_status" >&5
6729   (exit "$ac_status"); }; }; then
6730
6731         cf_cv_find_linkage_utf8=yes
6732         cf_cv_header_path_utf8=/usr/include
6733         cf_cv_library_path_utf8=/usr/lib
6734
6735 else
6736   echo "$as_me: failed program was:" >&5
6737 cat "conftest.$ac_ext" >&5
6738
6739 LIBS="-lutf8  $cf_save_LIBS"
6740
6741 cat >"conftest.$ac_ext" <<_ACEOF
6742 #line 6742 "configure"
6743 #include "confdefs.h"
6744
6745 #include <libutf8.h>
6746 int
6747 main (void)
6748 {
6749 putwc(0,0);
6750   ;
6751   return 0;
6752 }
6753 _ACEOF
6754 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6755 if { (eval echo "$as_me:6755: \"$ac_link\"") >&5
6756   (eval $ac_link) 2>&5
6757   ac_status=$?
6758   echo "$as_me:6758: \$? = $ac_status" >&5
6759   (exit "$ac_status"); } &&
6760          { ac_try='test -s "conftest$ac_exeext"'
6761   { (eval echo "$as_me:6761: \"$ac_try\"") >&5
6762   (eval $ac_try) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit "$ac_status"); }; }; then
6766
6767         cf_cv_find_linkage_utf8=yes
6768         cf_cv_header_path_utf8=/usr/include
6769         cf_cv_library_path_utf8=/usr/lib
6770         cf_cv_library_file_utf8="-lutf8"
6771
6772 else
6773   echo "$as_me: failed program was:" >&5
6774 cat "conftest.$ac_ext" >&5
6775
6776         cf_cv_find_linkage_utf8=no
6777         LIBS="$cf_save_LIBS"
6778
6779         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6780
6781 echo "${as_me:-configure}:6781: testing find linkage for utf8 library ..." 1>&5
6782
6783 echo "${as_me:-configure}:6783: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6784
6785         cf_save_CPPFLAGS="$CPPFLAGS"
6786         cf_test_CPPFLAGS="$CPPFLAGS"
6787
6788 cf_search=
6789
6790 # collect the current set of include-directories from compiler flags
6791 cf_header_path_list=""
6792 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6793         for cf_header_path in $CPPFLAGS $CFLAGS
6794         do
6795                 case "$cf_header_path" in
6796                 (-I*)
6797                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6798
6799 test "x$cf_header_path" != "xNONE" && \
6800 test -d "$cf_header_path" && \
6801  {
6802         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6803         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6804         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6805         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6806         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6807         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6808 }
6809
6810                         cf_header_path_list="$cf_header_path_list $cf_search"
6811                         ;;
6812                 esac
6813         done
6814 fi
6815
6816 # add the variations for the package we are looking for
6817
6818 cf_search=
6819
6820 test "x$prefix" != "xNONE" && \
6821 test -d "$prefix" && \
6822  {
6823         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6824         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6825         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6826         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6827         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6828         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6829 }
6830
6831 for cf_subdir_prefix in \
6832         /usr \
6833         /usr/local \
6834         /usr/pkg \
6835         /opt \
6836         /opt/local \
6837         $HOME
6838 do
6839
6840 test "x$cf_subdir_prefix" != "x$prefix" && \
6841 test -d "$cf_subdir_prefix" && \
6842 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6843         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6844         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6845         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6846         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6847         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6848         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6849 }
6850
6851 done
6852
6853 test "$includedir" != NONE && \
6854 test "$includedir" != "/usr/include" && \
6855 test -d "$includedir" && {
6856         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6857         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6858 }
6859
6860 test "$oldincludedir" != NONE && \
6861 test "$oldincludedir" != "/usr/include" && \
6862 test -d "$oldincludedir" && {
6863         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6864         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6865 }
6866
6867 cf_search="$cf_search $cf_header_path_list"
6868
6869         for cf_cv_header_path_utf8 in $cf_search
6870         do
6871                 if test -d "$cf_cv_header_path_utf8" ; then
6872                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6873
6874 echo "${as_me:-configure}:6874: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6875
6876                         CPPFLAGS="$cf_save_CPPFLAGS"
6877
6878         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6879         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6880
6881                         cat >"conftest.$ac_ext" <<_ACEOF
6882 #line 6882 "configure"
6883 #include "confdefs.h"
6884
6885 #include <libutf8.h>
6886 int
6887 main (void)
6888 {
6889 putwc(0,0);
6890   ;
6891   return 0;
6892 }
6893 _ACEOF
6894 rm -f "conftest.$ac_objext"
6895 if { (eval echo "$as_me:6895: \"$ac_compile\"") >&5
6896   (eval $ac_compile) 2>&5
6897   ac_status=$?
6898   echo "$as_me:6898: \$? = $ac_status" >&5
6899   (exit "$ac_status"); } &&
6900          { ac_try='test -s "conftest.$ac_objext"'
6901   { (eval echo "$as_me:6901: \"$ac_try\"") >&5
6902   (eval $ac_try) 2>&5
6903   ac_status=$?
6904   echo "$as_me:6904: \$? = $ac_status" >&5
6905   (exit "$ac_status"); }; }; then
6906
6907                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6908
6909 echo "${as_me:-configure}:6909: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6910
6911                                 cf_cv_find_linkage_utf8=maybe
6912                                 cf_test_CPPFLAGS="$CPPFLAGS"
6913                                 break
6914 else
6915   echo "$as_me: failed program was:" >&5
6916 cat "conftest.$ac_ext" >&5
6917
6918                                 CPPFLAGS="$cf_save_CPPFLAGS"
6919
6920 fi
6921 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6922                 fi
6923         done
6924
6925         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6926
6927 echo "${as_me:-configure}:6927: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6928
6929                 cf_save_LIBS="$LIBS"
6930                 cf_save_LDFLAGS="$LDFLAGS"
6931
6932                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6933
6934 cf_search=
6935 cf_library_path_list=""
6936 if test -n "${LDFLAGS}${LIBS}" ; then
6937         for cf_library_path in $LDFLAGS $LIBS
6938         do
6939                 case "$cf_library_path" in
6940                 (-L*)
6941                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6942
6943 test "x$cf_library_path" != "xNONE" && \
6944 test -d "$cf_library_path" && \
6945  {
6946         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6947         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6948         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6949         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6950         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6951         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6952 }
6953
6954                         cf_library_path_list="$cf_library_path_list $cf_search"
6955                         ;;
6956                 esac
6957         done
6958 fi
6959
6960 cf_search=
6961
6962 test "x$prefix" != "xNONE" && \
6963 test -d "$prefix" && \
6964  {
6965         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6966         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6967         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6968         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6969         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6970         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6971 }
6972
6973 for cf_subdir_prefix in \
6974         /usr \
6975         /usr/local \
6976         /usr/pkg \
6977         /opt \
6978         /opt/local \
6979         $HOME
6980 do
6981
6982 test "x$cf_subdir_prefix" != "x$prefix" && \
6983 test -d "$cf_subdir_prefix" && \
6984 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6985         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6986         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6987         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6988         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6989         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6990         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6991 }
6992
6993 done
6994
6995 cf_search="$cf_library_path_list $cf_search"
6996
6997                         for cf_cv_library_path_utf8 in $cf_search
6998                         do
6999                                 if test -d "$cf_cv_library_path_utf8" ; then
7000                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7001
7002 echo "${as_me:-configure}:7002: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7003
7004                                         CPPFLAGS="$cf_test_CPPFLAGS"
7005                                         LIBS="-lutf8  $cf_save_LIBS"
7006                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7007                                         cat >"conftest.$ac_ext" <<_ACEOF
7008 #line 7008 "configure"
7009 #include "confdefs.h"
7010
7011 #include <libutf8.h>
7012 int
7013 main (void)
7014 {
7015 putwc(0,0);
7016   ;
7017   return 0;
7018 }
7019 _ACEOF
7020 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7021 if { (eval echo "$as_me:7021: \"$ac_link\"") >&5
7022   (eval $ac_link) 2>&5
7023   ac_status=$?
7024   echo "$as_me:7024: \$? = $ac_status" >&5
7025   (exit "$ac_status"); } &&
7026          { ac_try='test -s "conftest$ac_exeext"'
7027   { (eval echo "$as_me:7027: \"$ac_try\"") >&5
7028   (eval $ac_try) 2>&5
7029   ac_status=$?
7030   echo "$as_me:7030: \$? = $ac_status" >&5
7031   (exit "$ac_status"); }; }; then
7032
7033                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7034
7035 echo "${as_me:-configure}:7035: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7036
7037                                         cf_cv_find_linkage_utf8=yes
7038                                         cf_cv_library_file_utf8="-lutf8"
7039                                         break
7040 else
7041   echo "$as_me: failed program was:" >&5
7042 cat "conftest.$ac_ext" >&5
7043
7044                                         CPPFLAGS="$cf_save_CPPFLAGS"
7045                                         LIBS="$cf_save_LIBS"
7046                                         LDFLAGS="$cf_save_LDFLAGS"
7047
7048 fi
7049 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7050                                 fi
7051                         done
7052                         CPPFLAGS="$cf_save_CPPFLAGS"
7053                         LDFLAGS="$cf_save_LDFLAGS"
7054                 fi
7055
7056         else
7057                 cf_cv_find_linkage_utf8=no
7058         fi
7059
7060 fi
7061 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7062
7063 fi
7064 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7065
7066 LIBS="$cf_save_LIBS"
7067
7068 if test "$cf_cv_find_linkage_utf8" = yes ; then
7069 cf_cv_utf8_lib=add-on
7070 else
7071 cf_cv_utf8_lib=no
7072 fi
7073
7074 fi
7075 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7076 fi
7077 echo "$as_me:7077: result: $cf_cv_utf8_lib" >&5
7078 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7079
7080 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7081 # ncurses/ncursesw:
7082 if test "$cf_cv_utf8_lib" = "add-on" ; then
7083
7084 cat >>confdefs.h <<\EOF
7085 #define HAVE_LIBUTF8_H 1
7086 EOF
7087
7088 if test -n "$cf_cv_header_path_utf8" ; then
7089   for cf_add_incdir in $cf_cv_header_path_utf8
7090   do
7091         while test "$cf_add_incdir" != /usr/include
7092         do
7093           if test -d "$cf_add_incdir"
7094           then
7095                 cf_have_incdir=no
7096                 if test -n "$CFLAGS$CPPFLAGS" ; then
7097                   # a loop is needed to ensure we can add subdirs of existing dirs
7098                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7099                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7100                           cf_have_incdir=yes; break
7101                         fi
7102                   done
7103                 fi
7104
7105                 if test "$cf_have_incdir" = no ; then
7106                   if test "$cf_add_incdir" = /usr/local/include ; then
7107                         if test "$GCC" = yes
7108                         then
7109                           cf_save_CPPFLAGS=$CPPFLAGS
7110
7111         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7112         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7113
7114                           cat >"conftest.$ac_ext" <<_ACEOF
7115 #line 7115 "configure"
7116 #include "confdefs.h"
7117 #include <stdio.h>
7118 int
7119 main (void)
7120 {
7121 printf("Hello")
7122   ;
7123   return 0;
7124 }
7125 _ACEOF
7126 rm -f "conftest.$ac_objext"
7127 if { (eval echo "$as_me:7127: \"$ac_compile\"") >&5
7128   (eval $ac_compile) 2>&5
7129   ac_status=$?
7130   echo "$as_me:7130: \$? = $ac_status" >&5
7131   (exit "$ac_status"); } &&
7132          { ac_try='test -s "conftest.$ac_objext"'
7133   { (eval echo "$as_me:7133: \"$ac_try\"") >&5
7134   (eval $ac_try) 2>&5
7135   ac_status=$?
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit "$ac_status"); }; }; then
7138   :
7139 else
7140   echo "$as_me: failed program was:" >&5
7141 cat "conftest.$ac_ext" >&5
7142 cf_have_incdir=yes
7143 fi
7144 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7145                           CPPFLAGS=$cf_save_CPPFLAGS
7146                         fi
7147                   fi
7148                 fi
7149
7150                 if test "$cf_have_incdir" = no ; then
7151                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7152
7153 echo "${as_me:-configure}:7153: testing adding $cf_add_incdir to include-path ..." 1>&5
7154
7155                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7156
7157                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7158                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7159                   cf_add_incdir="$cf_top_incdir"
7160                 else
7161                   break
7162                 fi
7163           else
7164                 break
7165           fi
7166         done
7167   done
7168 fi
7169
7170 if test -n "$cf_cv_library_path_utf8" ; then
7171         for cf_add_libdir in $cf_cv_library_path_utf8
7172         do
7173                 if test "$cf_add_libdir" = /usr/lib ; then
7174                         :
7175                 elif test -d "$cf_add_libdir"
7176                 then
7177                         cf_have_libdir=no
7178                         if test -n "$LDFLAGS$LIBS" ; then
7179                                 # a loop is needed to ensure we can add subdirs of existing dirs
7180                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7181                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7182                                                 cf_have_libdir=yes; break
7183                                         fi
7184                                 done
7185                         fi
7186                         if test "$cf_have_libdir" = no ; then
7187                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7188
7189 echo "${as_me:-configure}:7189: testing adding $cf_add_libdir to library-path ..." 1>&5
7190
7191                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7192                         fi
7193                 fi
7194         done
7195 fi
7196
7197 cf_add_libs="$LIBS"
7198 # reverse order
7199 cf_add_0lib=
7200 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7201 # filter duplicates
7202 for cf_add_1lib in $cf_add_0lib; do
7203         for cf_add_2lib in $cf_add_libs; do
7204                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7205                         cf_add_1lib=
7206                         break
7207                 fi
7208         done
7209         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7210 done
7211 LIBS="$cf_add_libs"
7212
7213 fi
7214
7215 cf_ncuconfig_root=ncursesw
7216 cf_have_ncuconfig=no
7217
7218 if test "x${PKG_CONFIG:=none}" != xnone; then
7219         echo "$as_me:7219: checking pkg-config for $cf_ncuconfig_root" >&5
7220 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7221         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7222                 echo "$as_me:7222: result: yes" >&5
7223 echo "${ECHO_T}yes" >&6
7224
7225                 echo "$as_me:7225: checking if the $cf_ncuconfig_root package files work" >&5
7226 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7227                 cf_have_ncuconfig=unknown
7228
7229                 cf_save_CFLAGS="$CFLAGS"
7230                 cf_save_CPPFLAGS="$CPPFLAGS"
7231                 cf_save_LIBS="$LIBS"
7232
7233                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7234                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7235
7236                 # while -W for passing linker flags is prevalent, it is not "standard".
7237                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7238                 # incompatible _and_ non-standard -W option which gives an error.  Work
7239                 # around that pitfall.
7240                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7241                 (x*c[89]9@@*-W*)
7242
7243 cf_fix_cppflags=no
7244 cf_new_cflags=
7245 cf_new_cppflags=
7246 cf_new_extra_cppflags=
7247
7248 for cf_add_cflags in $cf_pkg_cflags
7249 do
7250 case "$cf_fix_cppflags" in
7251 (no)
7252         case "$cf_add_cflags" in
7253         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7254                 case "$cf_add_cflags" in
7255                 (-D*)
7256                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7257
7258                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7259                                 && test -z "${cf_tst_cflags}" \
7260                                 && cf_fix_cppflags=yes
7261
7262                         if test "$cf_fix_cppflags" = yes ; then
7263
7264         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7265         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7266
7267                                 continue
7268                         elif test "${cf_tst_cflags}" = "\"'" ; then
7269
7270         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7271         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7272
7273                                 continue
7274                         fi
7275                         ;;
7276                 esac
7277                 case "$CPPFLAGS" in
7278                 (*$cf_add_cflags)
7279                         ;;
7280                 (*)
7281                         case "$cf_add_cflags" in
7282                         (-D*)
7283                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7284
7285 CPPFLAGS=`echo "$CPPFLAGS" | \
7286         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7287                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7288
7289                                 ;;
7290                         esac
7291
7292         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7293         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7294
7295                         ;;
7296                 esac
7297                 ;;
7298         (*)
7299
7300         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7301         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7302
7303                 ;;
7304         esac
7305         ;;
7306 (yes)
7307
7308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7310
7311         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7312
7313         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7314                 && test -z "${cf_tst_cflags}" \
7315                 && cf_fix_cppflags=no
7316         ;;
7317 esac
7318 done
7319
7320 if test -n "$cf_new_cflags" ; then
7321
7322         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7323         CFLAGS="${CFLAGS}$cf_new_cflags"
7324
7325 fi
7326
7327 if test -n "$cf_new_cppflags" ; then
7328
7329         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7330         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7331
7332 fi
7333
7334 if test -n "$cf_new_extra_cppflags" ; then
7335
7336         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7337         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7338
7339 fi
7340
7341 cf_add_libs="$LIBS"
7342 # reverse order
7343 cf_add_0lib=
7344 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7345 # filter duplicates
7346 for cf_add_1lib in $cf_add_0lib; do
7347         for cf_add_2lib in $cf_add_libs; do
7348                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7349                         cf_add_1lib=
7350                         break
7351                 fi
7352         done
7353         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7354 done
7355 LIBS="$cf_add_libs"
7356
7357                         cat >"conftest.$ac_ext" <<_ACEOF
7358 #line 7358 "configure"
7359 #include "confdefs.h"
7360 #include <${cf_cv_ncurses_header:-curses.h}>
7361 int
7362 main (void)
7363 {
7364 initscr(); mousemask(0,0); tigetstr((char *)0);
7365   ;
7366   return 0;
7367 }
7368 _ACEOF
7369 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7370 if { (eval echo "$as_me:7370: \"$ac_link\"") >&5
7371   (eval $ac_link) 2>&5
7372   ac_status=$?
7373   echo "$as_me:7373: \$? = $ac_status" >&5
7374   (exit "$ac_status"); } &&
7375          { ac_try='test -s "conftest$ac_exeext"'
7376   { (eval echo "$as_me:7376: \"$ac_try\"") >&5
7377   (eval $ac_try) 2>&5
7378   ac_status=$?
7379   echo "$as_me:7379: \$? = $ac_status" >&5
7380   (exit "$ac_status"); }; }; then
7381   if test "$cross_compiling" = yes; then
7382   cf_test_ncuconfig=maybe
7383 else
7384   cat >"conftest.$ac_ext" <<_ACEOF
7385 #line 7385 "configure"
7386 #include "confdefs.h"
7387 #include <${cf_cv_ncurses_header:-curses.h}>
7388                                         int main(void)
7389                                         { const char *xx = curses_version(); return (xx == 0); }
7390 _ACEOF
7391 rm -f "conftest$ac_exeext"
7392 if { (eval echo "$as_me:7392: \"$ac_link\"") >&5
7393   (eval $ac_link) 2>&5
7394   ac_status=$?
7395   echo "$as_me:7395: \$? = $ac_status" >&5
7396   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7397   { (eval echo "$as_me:7397: \"$ac_try\"") >&5
7398   (eval $ac_try) 2>&5
7399   ac_status=$?
7400   echo "$as_me:7400: \$? = $ac_status" >&5
7401   (exit "$ac_status"); }; }; then
7402   cf_test_ncuconfig=yes
7403 else
7404   echo "$as_me: program exited with status $ac_status" >&5
7405 echo "$as_me: failed program was:" >&5
7406 cat "conftest.$ac_ext" >&5
7407 cf_test_ncuconfig=no
7408 fi
7409 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7410 fi
7411 else
7412   echo "$as_me: failed program was:" >&5
7413 cat "conftest.$ac_ext" >&5
7414 cf_test_ncuconfig=no
7415 fi
7416 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7417
7418                         CFLAGS="$cf_save_CFLAGS"
7419                         CPPFLAGS="$cf_save_CPPFLAGS"
7420                         LIBS="$cf_save_LIBS"
7421
7422                         if test "x$cf_test_ncuconfig" != xyes; then
7423                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7424                                 cf_pkg_cflags="$cf_temp"
7425                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7426                                 cf_pkg_libs="$cf_temp"
7427                         fi
7428                         ;;
7429                 esac
7430
7431 for cf_add_cflags in $cf_pkg_cflags
7432 do
7433         case "x$cf_add_cflags" in
7434         (x-[DU]*)
7435
7436 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7437 while true
7438 do
7439         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'`
7440         test "$CFLAGS" != "$cf_old_cflag" || break
7441
7442         CFLAGS="$cf_old_cflag"
7443 done
7444
7445 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7446 while true
7447 do
7448         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'`
7449         test "$CPPFLAGS" != "$cf_old_cflag" || break
7450
7451         CPPFLAGS="$cf_old_cflag"
7452 done
7453
7454                 ;;
7455         esac
7456
7457 cf_fix_cppflags=no
7458 cf_new_cflags=
7459 cf_new_cppflags=
7460 cf_new_extra_cppflags=
7461
7462 for cf_add_cflags in $cf_add_cflags
7463 do
7464 case "$cf_fix_cppflags" in
7465 (no)
7466         case "$cf_add_cflags" in
7467         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7468                 case "$cf_add_cflags" in
7469                 (-D*)
7470                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7471
7472                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7473                                 && test -z "${cf_tst_cflags}" \
7474                                 && cf_fix_cppflags=yes
7475
7476                         if test "$cf_fix_cppflags" = yes ; then
7477
7478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7480
7481                                 continue
7482                         elif test "${cf_tst_cflags}" = "\"'" ; then
7483
7484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7486
7487                                 continue
7488                         fi
7489                         ;;
7490                 esac
7491                 case "$CPPFLAGS" in
7492                 (*$cf_add_cflags)
7493                         ;;
7494                 (*)
7495                         case "$cf_add_cflags" in
7496                         (-D*)
7497                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7498
7499 CPPFLAGS=`echo "$CPPFLAGS" | \
7500         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7501                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7502
7503                                 ;;
7504                         esac
7505
7506         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7507         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7508
7509                         ;;
7510                 esac
7511                 ;;
7512         (*)
7513
7514         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7515         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7516
7517                 ;;
7518         esac
7519         ;;
7520 (yes)
7521
7522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7524
7525         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7526
7527         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7528                 && test -z "${cf_tst_cflags}" \
7529                 && cf_fix_cppflags=no
7530         ;;
7531 esac
7532 done
7533
7534 if test -n "$cf_new_cflags" ; then
7535
7536         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7537         CFLAGS="${CFLAGS}$cf_new_cflags"
7538
7539 fi
7540
7541 if test -n "$cf_new_cppflags" ; then
7542
7543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7544         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7545
7546 fi
7547
7548 if test -n "$cf_new_extra_cppflags" ; then
7549
7550         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7551         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7552
7553 fi
7554
7555 done
7556
7557 cf_add_libs="$LIBS"
7558 # reverse order
7559 cf_add_0lib=
7560 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7561 # filter duplicates
7562 for cf_add_1lib in $cf_add_0lib; do
7563         for cf_add_2lib in $cf_add_libs; do
7564                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7565                         cf_add_1lib=
7566                         break
7567                 fi
7568         done
7569         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7570 done
7571 LIBS="$cf_add_libs"
7572
7573                 cat >"conftest.$ac_ext" <<_ACEOF
7574 #line 7574 "configure"
7575 #include "confdefs.h"
7576 #include <${cf_cv_ncurses_header:-curses.h}>
7577 int
7578 main (void)
7579 {
7580 initscr(); mousemask(0,0); tigetstr((char *)0);
7581   ;
7582   return 0;
7583 }
7584 _ACEOF
7585 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7586 if { (eval echo "$as_me:7586: \"$ac_link\"") >&5
7587   (eval $ac_link) 2>&5
7588   ac_status=$?
7589   echo "$as_me:7589: \$? = $ac_status" >&5
7590   (exit "$ac_status"); } &&
7591          { ac_try='test -s "conftest$ac_exeext"'
7592   { (eval echo "$as_me:7592: \"$ac_try\"") >&5
7593   (eval $ac_try) 2>&5
7594   ac_status=$?
7595   echo "$as_me:7595: \$? = $ac_status" >&5
7596   (exit "$ac_status"); }; }; then
7597   if test "$cross_compiling" = yes; then
7598   cf_have_ncuconfig=maybe
7599 else
7600   cat >"conftest.$ac_ext" <<_ACEOF
7601 #line 7601 "configure"
7602 #include "confdefs.h"
7603 #include <${cf_cv_ncurses_header:-curses.h}>
7604                                 int main(void)
7605                                 { const char *xx = curses_version(); return (xx == 0); }
7606 _ACEOF
7607 rm -f "conftest$ac_exeext"
7608 if { (eval echo "$as_me:7608: \"$ac_link\"") >&5
7609   (eval $ac_link) 2>&5
7610   ac_status=$?
7611   echo "$as_me:7611: \$? = $ac_status" >&5
7612   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7613   { (eval echo "$as_me:7613: \"$ac_try\"") >&5
7614   (eval $ac_try) 2>&5
7615   ac_status=$?
7616   echo "$as_me:7616: \$? = $ac_status" >&5
7617   (exit "$ac_status"); }; }; then
7618   cf_have_ncuconfig=yes
7619 else
7620   echo "$as_me: program exited with status $ac_status" >&5
7621 echo "$as_me: failed program was:" >&5
7622 cat "conftest.$ac_ext" >&5
7623 cf_have_ncuconfig=no
7624 fi
7625 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7626 fi
7627 else
7628   echo "$as_me: failed program was:" >&5
7629 cat "conftest.$ac_ext" >&5
7630 cf_have_ncuconfig=no
7631 fi
7632 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7633                 echo "$as_me:7633: result: $cf_have_ncuconfig" >&5
7634 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7635                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7636                 if test "$cf_have_ncuconfig" != "yes"
7637                 then
7638                         CPPFLAGS="$cf_save_CPPFLAGS"
7639                         LIBS="$cf_save_LIBS"
7640                         NCURSES_CONFIG_PKG=none
7641                 else
7642
7643 cat >>confdefs.h <<\EOF
7644 #define NCURSES 1
7645 EOF
7646
7647                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7648
7649 echo "$as_me:7649: checking for terminfo header" >&5
7650 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7651 if test "${cf_cv_term_header+set}" = set; then
7652   echo $ECHO_N "(cached) $ECHO_C" >&6
7653 else
7654
7655 case "${cf_cv_ncurses_header}" in
7656 (*/ncurses.h|*/ncursesw.h)
7657         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7658         ;;
7659 (*)
7660         cf_term_header=term.h
7661         ;;
7662 esac
7663
7664 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7665 do
7666 cat >"conftest.$ac_ext" <<_ACEOF
7667 #line 7667 "configure"
7668 #include "confdefs.h"
7669 #include <stdio.h>
7670 #include <${cf_cv_ncurses_header:-curses.h}>
7671 #include <$cf_test>
7672
7673 int
7674 main (void)
7675 {
7676 int x = auto_left_margin; (void)x
7677   ;
7678   return 0;
7679 }
7680 _ACEOF
7681 rm -f "conftest.$ac_objext"
7682 if { (eval echo "$as_me:7682: \"$ac_compile\"") >&5
7683   (eval $ac_compile) 2>&5
7684   ac_status=$?
7685   echo "$as_me:7685: \$? = $ac_status" >&5
7686   (exit "$ac_status"); } &&
7687          { ac_try='test -s "conftest.$ac_objext"'
7688   { (eval echo "$as_me:7688: \"$ac_try\"") >&5
7689   (eval $ac_try) 2>&5
7690   ac_status=$?
7691   echo "$as_me:7691: \$? = $ac_status" >&5
7692   (exit "$ac_status"); }; }; then
7693
7694         cf_cv_term_header="$cf_test"
7695 else
7696   echo "$as_me: failed program was:" >&5
7697 cat "conftest.$ac_ext" >&5
7698
7699         cf_cv_term_header=unknown
7700
7701 fi
7702 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7703         test "$cf_cv_term_header" != unknown && break
7704 done
7705
7706 fi
7707 echo "$as_me:7707: result: $cf_cv_term_header" >&5
7708 echo "${ECHO_T}$cf_cv_term_header" >&6
7709
7710 # Set definitions to allow ifdef'ing to accommodate subdirectories
7711
7712 case "$cf_cv_term_header" in
7713 (*term.h)
7714
7715 cat >>confdefs.h <<\EOF
7716 #define HAVE_TERM_H 1
7717 EOF
7718
7719         ;;
7720 esac
7721
7722 case "$cf_cv_term_header" in
7723 (ncurses/term.h)
7724
7725 cat >>confdefs.h <<\EOF
7726 #define HAVE_NCURSES_TERM_H 1
7727 EOF
7728
7729         ;;
7730 (ncursesw/term.h)
7731
7732 cat >>confdefs.h <<\EOF
7733 #define HAVE_NCURSESW_TERM_H 1
7734 EOF
7735
7736         ;;
7737 esac
7738
7739                 fi
7740
7741         else
7742                 echo "$as_me:7742: result: no" >&5
7743 echo "${ECHO_T}no" >&6
7744                 NCURSES_CONFIG_PKG=none
7745         fi
7746 else
7747         NCURSES_CONFIG_PKG=none
7748 fi
7749
7750 if test "x$cf_have_ncuconfig" = "xno"; then
7751         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7752
7753 if test -n "$ac_tool_prefix"; then
7754   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7755   do
7756     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7757 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7758 echo "$as_me:7758: checking for $ac_word" >&5
7759 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7760 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7761   echo $ECHO_N "(cached) $ECHO_C" >&6
7762 else
7763   if test -n "$NCURSES_CONFIG"; then
7764   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7765 else
7766   ac_save_IFS=$IFS; IFS=$ac_path_separator
7767 ac_dummy="$PATH"
7768 for ac_dir in $ac_dummy; do
7769   IFS=$ac_save_IFS
7770   test -z "$ac_dir" && ac_dir=.
7771   $as_executable_p "$ac_dir/$ac_word" || continue
7772 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7773 echo "$as_me:7773: found $ac_dir/$ac_word" >&5
7774 break
7775 done
7776
7777 fi
7778 fi
7779 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7780 if test -n "$NCURSES_CONFIG"; then
7781   echo "$as_me:7781: result: $NCURSES_CONFIG" >&5
7782 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7783 else
7784   echo "$as_me:7784: result: no" >&5
7785 echo "${ECHO_T}no" >&6
7786 fi
7787
7788     test -n "$NCURSES_CONFIG" && break
7789   done
7790 fi
7791 if test -z "$NCURSES_CONFIG"; then
7792   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7793   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7794 do
7795   # Extract the first word of "$ac_prog", so it can be a program name with args.
7796 set dummy $ac_prog; ac_word=$2
7797 echo "$as_me:7797: checking for $ac_word" >&5
7798 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7799 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7800   echo $ECHO_N "(cached) $ECHO_C" >&6
7801 else
7802   if test -n "$ac_ct_NCURSES_CONFIG"; then
7803   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7804 else
7805   ac_save_IFS=$IFS; IFS=$ac_path_separator
7806 ac_dummy="$PATH"
7807 for ac_dir in $ac_dummy; do
7808   IFS=$ac_save_IFS
7809   test -z "$ac_dir" && ac_dir=.
7810   $as_executable_p "$ac_dir/$ac_word" || continue
7811 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7812 echo "$as_me:7812: found $ac_dir/$ac_word" >&5
7813 break
7814 done
7815
7816 fi
7817 fi
7818 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7819 if test -n "$ac_ct_NCURSES_CONFIG"; then
7820   echo "$as_me:7820: result: $ac_ct_NCURSES_CONFIG" >&5
7821 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7822 else
7823   echo "$as_me:7823: result: no" >&5
7824 echo "${ECHO_T}no" >&6
7825 fi
7826
7827   test -n "$ac_ct_NCURSES_CONFIG" && break
7828 done
7829 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7830
7831   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7832 fi
7833
7834         if test "$NCURSES_CONFIG" != none ; then
7835
7836 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7837 do
7838         case "x$cf_add_cflags" in
7839         (x-[DU]*)
7840
7841 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7842 while true
7843 do
7844         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'`
7845         test "$CFLAGS" != "$cf_old_cflag" || break
7846
7847         CFLAGS="$cf_old_cflag"
7848 done
7849
7850 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7851 while true
7852 do
7853         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'`
7854         test "$CPPFLAGS" != "$cf_old_cflag" || break
7855
7856         CPPFLAGS="$cf_old_cflag"
7857 done
7858
7859                 ;;
7860         esac
7861
7862 cf_fix_cppflags=no
7863 cf_new_cflags=
7864 cf_new_cppflags=
7865 cf_new_extra_cppflags=
7866
7867 for cf_add_cflags in $cf_add_cflags
7868 do
7869 case "$cf_fix_cppflags" in
7870 (no)
7871         case "$cf_add_cflags" in
7872         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7873                 case "$cf_add_cflags" in
7874                 (-D*)
7875                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7876
7877                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7878                                 && test -z "${cf_tst_cflags}" \
7879                                 && cf_fix_cppflags=yes
7880
7881                         if test "$cf_fix_cppflags" = yes ; then
7882
7883         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7884         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7885
7886                                 continue
7887                         elif test "${cf_tst_cflags}" = "\"'" ; then
7888
7889         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7890         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7891
7892                                 continue
7893                         fi
7894                         ;;
7895                 esac
7896                 case "$CPPFLAGS" in
7897                 (*$cf_add_cflags)
7898                         ;;
7899                 (*)
7900                         case "$cf_add_cflags" in
7901                         (-D*)
7902                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7903
7904 CPPFLAGS=`echo "$CPPFLAGS" | \
7905         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7906                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7907
7908                                 ;;
7909                         esac
7910
7911         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7912         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7913
7914                         ;;
7915                 esac
7916                 ;;
7917         (*)
7918
7919         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7920         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7921
7922                 ;;
7923         esac
7924         ;;
7925 (yes)
7926
7927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7929
7930         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7931
7932         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7933                 && test -z "${cf_tst_cflags}" \
7934                 && cf_fix_cppflags=no
7935         ;;
7936 esac
7937 done
7938
7939 if test -n "$cf_new_cflags" ; then
7940
7941         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7942         CFLAGS="${CFLAGS}$cf_new_cflags"
7943
7944 fi
7945
7946 if test -n "$cf_new_cppflags" ; then
7947
7948         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7949         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7950
7951 fi
7952
7953 if test -n "$cf_new_extra_cppflags" ; then
7954
7955         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7956         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7957
7958 fi
7959
7960 done
7961
7962 cf_add_libs="$LIBS"
7963 # reverse order
7964 cf_add_0lib=
7965 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7966 # filter duplicates
7967 for cf_add_1lib in $cf_add_0lib; do
7968         for cf_add_2lib in $cf_add_libs; do
7969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7970                         cf_add_1lib=
7971                         break
7972                 fi
7973         done
7974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7975 done
7976 LIBS="$cf_add_libs"
7977
7978                 # even with config script, some packages use no-override for curses.h
7979
7980 echo "$as_me:7980: checking if we have identified curses headers" >&5
7981 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7982 if test "${cf_cv_ncurses_header+set}" = set; then
7983   echo $ECHO_N "(cached) $ECHO_C" >&6
7984 else
7985
7986 cf_cv_ncurses_header=none
7987 for cf_header in \
7988         ncurses.h ncursesw/ncurses.h \
7989         curses.h ncursesw/curses.h
7990 do
7991 cat >"conftest.$ac_ext" <<_ACEOF
7992 #line 7992 "configure"
7993 #include "confdefs.h"
7994 #include <${cf_header}>
7995 int
7996 main (void)
7997 {
7998 initscr(); tgoto("?", 0,0)
7999   ;
8000   return 0;
8001 }
8002 _ACEOF
8003 rm -f "conftest.$ac_objext"
8004 if { (eval echo "$as_me:8004: \"$ac_compile\"") >&5
8005   (eval $ac_compile) 2>&5
8006   ac_status=$?
8007   echo "$as_me:8007: \$? = $ac_status" >&5
8008   (exit "$ac_status"); } &&
8009          { ac_try='test -s "conftest.$ac_objext"'
8010   { (eval echo "$as_me:8010: \"$ac_try\"") >&5
8011   (eval $ac_try) 2>&5
8012   ac_status=$?
8013   echo "$as_me:8013: \$? = $ac_status" >&5
8014   (exit "$ac_status"); }; }; then
8015   cf_cv_ncurses_header=$cf_header; break
8016 else
8017   echo "$as_me: failed program was:" >&5
8018 cat "conftest.$ac_ext" >&5
8019 fi
8020 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8021 done
8022
8023 fi
8024 echo "$as_me:8024: result: $cf_cv_ncurses_header" >&5
8025 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8026
8027 if test "$cf_cv_ncurses_header" = none ; then
8028         { { echo "$as_me:8028: error: No curses header-files found" >&5
8029 echo "$as_me: error: No curses header-files found" >&2;}
8030    { (exit 1); exit 1; }; }
8031 fi
8032
8033 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8034
8035 for ac_header in $cf_cv_ncurses_header
8036 do
8037 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8038 echo "$as_me:8038: checking for $ac_header" >&5
8039 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8040 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8041   echo $ECHO_N "(cached) $ECHO_C" >&6
8042 else
8043   cat >"conftest.$ac_ext" <<_ACEOF
8044 #line 8044 "configure"
8045 #include "confdefs.h"
8046 #include <$ac_header>
8047 _ACEOF
8048 if { (eval echo "$as_me:8048: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8049   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8050   ac_status=$?
8051   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8052   rm -f conftest.er1
8053   cat conftest.err >&5
8054   echo "$as_me:8054: \$? = $ac_status" >&5
8055   (exit "$ac_status"); } >/dev/null; then
8056   if test -s conftest.err; then
8057     ac_cpp_err=$ac_c_preproc_warn_flag
8058   else
8059     ac_cpp_err=
8060   fi
8061 else
8062   ac_cpp_err=yes
8063 fi
8064 if test -z "$ac_cpp_err"; then
8065   eval "$as_ac_Header=yes"
8066 else
8067   echo "$as_me: failed program was:" >&5
8068   cat "conftest.$ac_ext" >&5
8069   eval "$as_ac_Header=no"
8070 fi
8071 rm -f conftest.err "conftest.$ac_ext"
8072 fi
8073 echo "$as_me:8073: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8074 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8075 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8076   cat >>confdefs.h <<EOF
8077 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8078 EOF
8079
8080 fi
8081 done
8082
8083 cat >>confdefs.h <<\EOF
8084 #define NCURSES 1
8085 EOF
8086
8087 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8088
8089                 cat >>confdefs.h <<EOF
8090 #define $cf_nculib_ROOT 1
8091 EOF
8092
8093                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8094
8095         else
8096
8097 cf_ncuhdr_root=ncursesw
8098
8099 test -n "$cf_cv_curses_dir" && \
8100 test "$cf_cv_curses_dir" != "no" && { \
8101
8102 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8103   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8104   do
8105         while test "$cf_add_incdir" != /usr/include
8106         do
8107           if test -d "$cf_add_incdir"
8108           then
8109                 cf_have_incdir=no
8110                 if test -n "$CFLAGS$CPPFLAGS" ; then
8111                   # a loop is needed to ensure we can add subdirs of existing dirs
8112                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8113                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8114                           cf_have_incdir=yes; break
8115                         fi
8116                   done
8117                 fi
8118
8119                 if test "$cf_have_incdir" = no ; then
8120                   if test "$cf_add_incdir" = /usr/local/include ; then
8121                         if test "$GCC" = yes
8122                         then
8123                           cf_save_CPPFLAGS=$CPPFLAGS
8124
8125         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8126         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8127
8128                           cat >"conftest.$ac_ext" <<_ACEOF
8129 #line 8129 "configure"
8130 #include "confdefs.h"
8131 #include <stdio.h>
8132 int
8133 main (void)
8134 {
8135 printf("Hello")
8136   ;
8137   return 0;
8138 }
8139 _ACEOF
8140 rm -f "conftest.$ac_objext"
8141 if { (eval echo "$as_me:8141: \"$ac_compile\"") >&5
8142   (eval $ac_compile) 2>&5
8143   ac_status=$?
8144   echo "$as_me:8144: \$? = $ac_status" >&5
8145   (exit "$ac_status"); } &&
8146          { ac_try='test -s "conftest.$ac_objext"'
8147   { (eval echo "$as_me:8147: \"$ac_try\"") >&5
8148   (eval $ac_try) 2>&5
8149   ac_status=$?
8150   echo "$as_me:8150: \$? = $ac_status" >&5
8151   (exit "$ac_status"); }; }; then
8152   :
8153 else
8154   echo "$as_me: failed program was:" >&5
8155 cat "conftest.$ac_ext" >&5
8156 cf_have_incdir=yes
8157 fi
8158 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8159                           CPPFLAGS=$cf_save_CPPFLAGS
8160                         fi
8161                   fi
8162                 fi
8163
8164                 if test "$cf_have_incdir" = no ; then
8165                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8166
8167 echo "${as_me:-configure}:8167: testing adding $cf_add_incdir to include-path ..." 1>&5
8168
8169                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8170
8171                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8172                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8173                   cf_add_incdir="$cf_top_incdir"
8174                 else
8175                   break
8176                 fi
8177           else
8178                 break
8179           fi
8180         done
8181   done
8182 fi
8183
8184 }
8185
8186 echo "$as_me:8186: checking for $cf_ncuhdr_root header in include-path" >&5
8187 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8188 if test "${cf_cv_ncurses_h+set}" = set; then
8189   echo $ECHO_N "(cached) $ECHO_C" >&6
8190 else
8191
8192         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8193         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8194         for cf_header in $cf_header_list
8195         do
8196
8197         cat >"conftest.$ac_ext" <<_ACEOF
8198 #line 8198 "configure"
8199 #include "confdefs.h"
8200
8201 #define _XOPEN_SOURCE_EXTENDED
8202 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8203 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8204
8205 #include <$cf_header>
8206 int
8207 main (void)
8208 {
8209
8210 #ifdef NCURSES_VERSION
8211
8212 #ifndef WACS_BSSB
8213         make an error
8214 #endif
8215
8216 printf("%s\\n", NCURSES_VERSION);
8217 #else
8218 #ifdef __NCURSES_H
8219 printf("old\\n");
8220 #else
8221         make an error
8222 #endif
8223 #endif
8224
8225   ;
8226   return 0;
8227 }
8228 _ACEOF
8229 rm -f "conftest.$ac_objext"
8230 if { (eval echo "$as_me:8230: \"$ac_compile\"") >&5
8231   (eval $ac_compile) 2>&5
8232   ac_status=$?
8233   echo "$as_me:8233: \$? = $ac_status" >&5
8234   (exit "$ac_status"); } &&
8235          { ac_try='test -s "conftest.$ac_objext"'
8236   { (eval echo "$as_me:8236: \"$ac_try\"") >&5
8237   (eval $ac_try) 2>&5
8238   ac_status=$?
8239   echo "$as_me:8239: \$? = $ac_status" >&5
8240   (exit "$ac_status"); }; }; then
8241   cf_cv_ncurses_h=$cf_header
8242
8243 else
8244   echo "$as_me: failed program was:" >&5
8245 cat "conftest.$ac_ext" >&5
8246 cf_cv_ncurses_h=no
8247 fi
8248 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8249
8250                 test "$cf_cv_ncurses_h" != no && break
8251         done
8252
8253 fi
8254 echo "$as_me:8254: result: $cf_cv_ncurses_h" >&5
8255 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8256
8257 if test "$cf_cv_ncurses_h" != no ; then
8258         cf_cv_ncurses_header=$cf_cv_ncurses_h
8259 else
8260
8261 echo "$as_me:8261: checking for $cf_ncuhdr_root include-path" >&5
8262 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8263 if test "${cf_cv_ncurses_h2+set}" = set; then
8264   echo $ECHO_N "(cached) $ECHO_C" >&6
8265 else
8266
8267         test -n "$verbose" && echo
8268
8269 cf_search=
8270
8271 # collect the current set of include-directories from compiler flags
8272 cf_header_path_list=""
8273 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8274         for cf_header_path in $CPPFLAGS $CFLAGS
8275         do
8276                 case "$cf_header_path" in
8277                 (-I*)
8278                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8279
8280 test "x$cf_header_path" != "xNONE" && \
8281 test -d "$cf_header_path" && \
8282  {
8283         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8284         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8285         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8286         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8287         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8288         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"
8289 }
8290
8291                         cf_header_path_list="$cf_header_path_list $cf_search"
8292                         ;;
8293                 esac
8294         done
8295 fi
8296
8297 # add the variations for the package we are looking for
8298
8299 cf_search=
8300
8301 test "x$prefix" != "xNONE" && \
8302 test -d "$prefix" && \
8303  {
8304         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8305         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8306         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8307         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8308         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8309         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8310 }
8311
8312 for cf_subdir_prefix in \
8313         /usr \
8314         /usr/local \
8315         /usr/pkg \
8316         /opt \
8317         /opt/local \
8318         $HOME
8319 do
8320
8321 test "x$cf_subdir_prefix" != "x$prefix" && \
8322 test -d "$cf_subdir_prefix" && \
8323 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8324         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8325         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8326         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8327         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8328         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8329         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"
8330 }
8331
8332 done
8333
8334 test "$includedir" != NONE && \
8335 test "$includedir" != "/usr/include" && \
8336 test -d "$includedir" && {
8337         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8338         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8339 }
8340
8341 test "$oldincludedir" != NONE && \
8342 test "$oldincludedir" != "/usr/include" && \
8343 test -d "$oldincludedir" && {
8344         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8345         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8346 }
8347
8348 cf_search="$cf_search $cf_header_path_list"
8349
8350         test -n "$verbose" && echo "search path $cf_search"
8351         cf_save2_CPPFLAGS="$CPPFLAGS"
8352         for cf_incdir in $cf_search
8353         do
8354
8355 if test -n "$cf_incdir" ; then
8356   for cf_add_incdir in $cf_incdir
8357   do
8358         while test "$cf_add_incdir" != /usr/include
8359         do
8360           if test -d "$cf_add_incdir"
8361           then
8362                 cf_have_incdir=no
8363                 if test -n "$CFLAGS$CPPFLAGS" ; then
8364                   # a loop is needed to ensure we can add subdirs of existing dirs
8365                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8366                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8367                           cf_have_incdir=yes; break
8368                         fi
8369                   done
8370                 fi
8371
8372                 if test "$cf_have_incdir" = no ; then
8373                   if test "$cf_add_incdir" = /usr/local/include ; then
8374                         if test "$GCC" = yes
8375                         then
8376                           cf_save_CPPFLAGS=$CPPFLAGS
8377
8378         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8379         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8380
8381                           cat >"conftest.$ac_ext" <<_ACEOF
8382 #line 8382 "configure"
8383 #include "confdefs.h"
8384 #include <stdio.h>
8385 int
8386 main (void)
8387 {
8388 printf("Hello")
8389   ;
8390   return 0;
8391 }
8392 _ACEOF
8393 rm -f "conftest.$ac_objext"
8394 if { (eval echo "$as_me:8394: \"$ac_compile\"") >&5
8395   (eval $ac_compile) 2>&5
8396   ac_status=$?
8397   echo "$as_me:8397: \$? = $ac_status" >&5
8398   (exit "$ac_status"); } &&
8399          { ac_try='test -s "conftest.$ac_objext"'
8400   { (eval echo "$as_me:8400: \"$ac_try\"") >&5
8401   (eval $ac_try) 2>&5
8402   ac_status=$?
8403   echo "$as_me:8403: \$? = $ac_status" >&5
8404   (exit "$ac_status"); }; }; then
8405   :
8406 else
8407   echo "$as_me: failed program was:" >&5
8408 cat "conftest.$ac_ext" >&5
8409 cf_have_incdir=yes
8410 fi
8411 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8412                           CPPFLAGS=$cf_save_CPPFLAGS
8413                         fi
8414                   fi
8415                 fi
8416
8417                 if test "$cf_have_incdir" = no ; then
8418                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8419
8420 echo "${as_me:-configure}:8420: testing adding $cf_add_incdir to include-path ..." 1>&5
8421
8422                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8423
8424                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8425                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8426                   cf_add_incdir="$cf_top_incdir"
8427                 else
8428                   break
8429                 fi
8430           else
8431                 break
8432           fi
8433         done
8434   done
8435 fi
8436
8437                 for cf_header in \
8438                         ncurses.h \
8439                         curses.h
8440                 do
8441
8442         cat >"conftest.$ac_ext" <<_ACEOF
8443 #line 8443 "configure"
8444 #include "confdefs.h"
8445
8446 #include <$cf_header>
8447 int
8448 main (void)
8449 {
8450
8451 #ifdef NCURSES_VERSION
8452
8453 printf("%s\\n", NCURSES_VERSION);
8454 #else
8455 #ifdef __NCURSES_H
8456 printf("old\\n");
8457 #else
8458         make an error
8459 #endif
8460 #endif
8461
8462   ;
8463   return 0;
8464 }
8465 _ACEOF
8466 rm -f "conftest.$ac_objext"
8467 if { (eval echo "$as_me:8467: \"$ac_compile\"") >&5
8468   (eval $ac_compile) 2>&5
8469   ac_status=$?
8470   echo "$as_me:8470: \$? = $ac_status" >&5
8471   (exit "$ac_status"); } &&
8472          { ac_try='test -s "conftest.$ac_objext"'
8473   { (eval echo "$as_me:8473: \"$ac_try\"") >&5
8474   (eval $ac_try) 2>&5
8475   ac_status=$?
8476   echo "$as_me:8476: \$? = $ac_status" >&5
8477   (exit "$ac_status"); }; }; then
8478   cf_cv_ncurses_h2=$cf_header
8479
8480 else
8481   echo "$as_me: failed program was:" >&5
8482 cat "conftest.$ac_ext" >&5
8483 cf_cv_ncurses_h2=no
8484 fi
8485 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8486
8487                         if test "$cf_cv_ncurses_h2" != no ; then
8488                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8489                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8490                                 break
8491                         fi
8492                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8493                 done
8494                 CPPFLAGS="$cf_save2_CPPFLAGS"
8495                 test "$cf_cv_ncurses_h2" != no && break
8496         done
8497         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8497: error: not found" >&5
8498 echo "$as_me: error: not found" >&2;}
8499    { (exit 1); exit 1; }; }
8500
8501 fi
8502 echo "$as_me:8502: result: $cf_cv_ncurses_h2" >&5
8503 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8504
8505         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8506         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8507         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8508                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8509         fi
8510
8511 if test -n "$cf_1st_incdir" ; then
8512   for cf_add_incdir in $cf_1st_incdir
8513   do
8514         while test "$cf_add_incdir" != /usr/include
8515         do
8516           if test -d "$cf_add_incdir"
8517           then
8518                 cf_have_incdir=no
8519                 if test -n "$CFLAGS$CPPFLAGS" ; then
8520                   # a loop is needed to ensure we can add subdirs of existing dirs
8521                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8522                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8523                           cf_have_incdir=yes; break
8524                         fi
8525                   done
8526                 fi
8527
8528                 if test "$cf_have_incdir" = no ; then
8529                   if test "$cf_add_incdir" = /usr/local/include ; then
8530                         if test "$GCC" = yes
8531                         then
8532                           cf_save_CPPFLAGS=$CPPFLAGS
8533
8534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8535         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8536
8537                           cat >"conftest.$ac_ext" <<_ACEOF
8538 #line 8538 "configure"
8539 #include "confdefs.h"
8540 #include <stdio.h>
8541 int
8542 main (void)
8543 {
8544 printf("Hello")
8545   ;
8546   return 0;
8547 }
8548 _ACEOF
8549 rm -f "conftest.$ac_objext"
8550 if { (eval echo "$as_me:8550: \"$ac_compile\"") >&5
8551   (eval $ac_compile) 2>&5
8552   ac_status=$?
8553   echo "$as_me:8553: \$? = $ac_status" >&5
8554   (exit "$ac_status"); } &&
8555          { ac_try='test -s "conftest.$ac_objext"'
8556   { (eval echo "$as_me:8556: \"$ac_try\"") >&5
8557   (eval $ac_try) 2>&5
8558   ac_status=$?
8559   echo "$as_me:8559: \$? = $ac_status" >&5
8560   (exit "$ac_status"); }; }; then
8561   :
8562 else
8563   echo "$as_me: failed program was:" >&5
8564 cat "conftest.$ac_ext" >&5
8565 cf_have_incdir=yes
8566 fi
8567 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8568                           CPPFLAGS=$cf_save_CPPFLAGS
8569                         fi
8570                   fi
8571                 fi
8572
8573                 if test "$cf_have_incdir" = no ; then
8574                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8575
8576 echo "${as_me:-configure}:8576: testing adding $cf_add_incdir to include-path ..." 1>&5
8577
8578                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8579
8580                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8581                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8582                   cf_add_incdir="$cf_top_incdir"
8583                 else
8584                   break
8585                 fi
8586           else
8587                 break
8588           fi
8589         done
8590   done
8591 fi
8592
8593 fi
8594
8595 # Set definitions to allow ifdef'ing for ncurses.h
8596
8597 case "$cf_cv_ncurses_header" in
8598 (*ncurses.h)
8599
8600 cat >>confdefs.h <<\EOF
8601 #define HAVE_NCURSES_H 1
8602 EOF
8603
8604         ;;
8605 esac
8606
8607 case "$cf_cv_ncurses_header" in
8608 (ncurses/curses.h|ncurses/ncurses.h)
8609
8610 cat >>confdefs.h <<\EOF
8611 #define HAVE_NCURSES_NCURSES_H 1
8612 EOF
8613
8614         ;;
8615 (ncursesw/curses.h|ncursesw/ncurses.h)
8616
8617 cat >>confdefs.h <<\EOF
8618 #define HAVE_NCURSESW_NCURSES_H 1
8619 EOF
8620
8621         ;;
8622 esac
8623
8624 echo "$as_me:8624: checking for terminfo header" >&5
8625 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8626 if test "${cf_cv_term_header+set}" = set; then
8627   echo $ECHO_N "(cached) $ECHO_C" >&6
8628 else
8629
8630 case "${cf_cv_ncurses_header}" in
8631 (*/ncurses.h|*/ncursesw.h)
8632         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8633         ;;
8634 (*)
8635         cf_term_header=term.h
8636         ;;
8637 esac
8638
8639 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8640 do
8641 cat >"conftest.$ac_ext" <<_ACEOF
8642 #line 8642 "configure"
8643 #include "confdefs.h"
8644 #include <stdio.h>
8645 #include <${cf_cv_ncurses_header:-curses.h}>
8646 #include <$cf_test>
8647
8648 int
8649 main (void)
8650 {
8651 int x = auto_left_margin; (void)x
8652   ;
8653   return 0;
8654 }
8655 _ACEOF
8656 rm -f "conftest.$ac_objext"
8657 if { (eval echo "$as_me:8657: \"$ac_compile\"") >&5
8658   (eval $ac_compile) 2>&5
8659   ac_status=$?
8660   echo "$as_me:8660: \$? = $ac_status" >&5
8661   (exit "$ac_status"); } &&
8662          { ac_try='test -s "conftest.$ac_objext"'
8663   { (eval echo "$as_me:8663: \"$ac_try\"") >&5
8664   (eval $ac_try) 2>&5
8665   ac_status=$?
8666   echo "$as_me:8666: \$? = $ac_status" >&5
8667   (exit "$ac_status"); }; }; then
8668
8669         cf_cv_term_header="$cf_test"
8670 else
8671   echo "$as_me: failed program was:" >&5
8672 cat "conftest.$ac_ext" >&5
8673
8674         cf_cv_term_header=unknown
8675
8676 fi
8677 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8678         test "$cf_cv_term_header" != unknown && break
8679 done
8680
8681 fi
8682 echo "$as_me:8682: result: $cf_cv_term_header" >&5
8683 echo "${ECHO_T}$cf_cv_term_header" >&6
8684
8685 # Set definitions to allow ifdef'ing to accommodate subdirectories
8686
8687 case "$cf_cv_term_header" in
8688 (*term.h)
8689
8690 cat >>confdefs.h <<\EOF
8691 #define HAVE_TERM_H 1
8692 EOF
8693
8694         ;;
8695 esac
8696
8697 case "$cf_cv_term_header" in
8698 (ncurses/term.h)
8699
8700 cat >>confdefs.h <<\EOF
8701 #define HAVE_NCURSES_TERM_H 1
8702 EOF
8703
8704         ;;
8705 (ncursesw/term.h)
8706
8707 cat >>confdefs.h <<\EOF
8708 #define HAVE_NCURSESW_TERM_H 1
8709 EOF
8710
8711         ;;
8712 esac
8713
8714 # some applications need this, but should check for NCURSES_VERSION
8715
8716 cat >>confdefs.h <<\EOF
8717 #define NCURSES 1
8718 EOF
8719
8720 echo "$as_me:8720: checking for ncurses version" >&5
8721 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8722 if test "${cf_cv_ncurses_version+set}" = set; then
8723   echo $ECHO_N "(cached) $ECHO_C" >&6
8724 else
8725
8726         cf_cv_ncurses_version=no
8727         cf_tempfile=out$$
8728         rm -f "$cf_tempfile"
8729         if test "$cross_compiling" = yes; then
8730
8731         # This will not work if the preprocessor splits the line after the
8732         # Autoconf token.  The 'unproto' program does that.
8733         cat > "conftest.$ac_ext" <<EOF
8734 #include <${cf_cv_ncurses_header:-curses.h}>
8735 #undef Autoconf
8736 #ifdef NCURSES_VERSION
8737 Autoconf NCURSES_VERSION
8738 #else
8739 #ifdef __NCURSES_H
8740 Autoconf "old"
8741 #endif
8742 ;
8743 #endif
8744 EOF
8745         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8746         { (eval echo "$as_me:8746: \"$cf_try\"") >&5
8747   (eval $cf_try) 2>&5
8748   ac_status=$?
8749   echo "$as_me:8749: \$? = $ac_status" >&5
8750   (exit "$ac_status"); }
8751         if test -f conftest.out ; then
8752                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8753                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8754                 rm -f conftest.out
8755         fi
8756
8757 else
8758   cat >"conftest.$ac_ext" <<_ACEOF
8759 #line 8759 "configure"
8760 #include "confdefs.h"
8761
8762 #include <${cf_cv_ncurses_header:-curses.h}>
8763 #include <stdio.h>
8764 int main(void)
8765 {
8766         FILE *fp = fopen("$cf_tempfile", "w");
8767 #ifdef NCURSES_VERSION
8768 # ifdef NCURSES_VERSION_PATCH
8769         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8770 # else
8771         fprintf(fp, "%s\\n", NCURSES_VERSION);
8772 # endif
8773 #else
8774 # ifdef __NCURSES_H
8775         fprintf(fp, "old\\n");
8776 # else
8777         make an error
8778 # endif
8779 #endif
8780         ${cf_cv_main_return:-return}(0);
8781 }
8782 _ACEOF
8783 rm -f "conftest$ac_exeext"
8784 if { (eval echo "$as_me:8784: \"$ac_link\"") >&5
8785   (eval $ac_link) 2>&5
8786   ac_status=$?
8787   echo "$as_me:8787: \$? = $ac_status" >&5
8788   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8789   { (eval echo "$as_me:8789: \"$ac_try\"") >&5
8790   (eval $ac_try) 2>&5
8791   ac_status=$?
8792   echo "$as_me:8792: \$? = $ac_status" >&5
8793   (exit "$ac_status"); }; }; then
8794
8795         cf_cv_ncurses_version=`cat $cf_tempfile`
8796 else
8797   echo "$as_me: program exited with status $ac_status" >&5
8798 echo "$as_me: failed program was:" >&5
8799 cat "conftest.$ac_ext" >&5
8800 fi
8801 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8802 fi
8803         rm -f "$cf_tempfile"
8804
8805 fi
8806 echo "$as_me:8806: result: $cf_cv_ncurses_version" >&5
8807 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8808 test "$cf_cv_ncurses_version" = no ||
8809 cat >>confdefs.h <<\EOF
8810 #define NCURSES 1
8811 EOF
8812
8813 cf_nculib_root=ncursesw
8814         # This works, except for the special case where we find gpm, but
8815         # ncurses is in a nonstandard location via $LIBS, and we really want
8816         # to link gpm.
8817 cf_ncurses_LIBS=""
8818 cf_ncurses_SAVE="$LIBS"
8819 echo "$as_me:8819: checking for Gpm_Open in -lgpm" >&5
8820 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8821 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8822   echo $ECHO_N "(cached) $ECHO_C" >&6
8823 else
8824   ac_check_lib_save_LIBS=$LIBS
8825 LIBS="-lgpm  $LIBS"
8826 cat >"conftest.$ac_ext" <<_ACEOF
8827 #line 8827 "configure"
8828 #include "confdefs.h"
8829
8830 /* Override any gcc2 internal prototype to avoid an error.  */
8831 #ifdef __cplusplus
8832 extern "C"
8833 #endif
8834 /* We use char because int might match the return type of a gcc2
8835    builtin and then its argument prototype would still apply.  */
8836 char Gpm_Open ();
8837 int
8838 main (void)
8839 {
8840 Gpm_Open ();
8841   ;
8842   return 0;
8843 }
8844 _ACEOF
8845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8846 if { (eval echo "$as_me:8846: \"$ac_link\"") >&5
8847   (eval $ac_link) 2>&5
8848   ac_status=$?
8849   echo "$as_me:8849: \$? = $ac_status" >&5
8850   (exit "$ac_status"); } &&
8851          { ac_try='test -s "conftest$ac_exeext"'
8852   { (eval echo "$as_me:8852: \"$ac_try\"") >&5
8853   (eval $ac_try) 2>&5
8854   ac_status=$?
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit "$ac_status"); }; }; then
8857   ac_cv_lib_gpm_Gpm_Open=yes
8858 else
8859   echo "$as_me: failed program was:" >&5
8860 cat "conftest.$ac_ext" >&5
8861 ac_cv_lib_gpm_Gpm_Open=no
8862 fi
8863 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8864 LIBS=$ac_check_lib_save_LIBS
8865 fi
8866 echo "$as_me:8866: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8867 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8868 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8869   echo "$as_me:8869: checking for initscr in -lgpm" >&5
8870 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8871 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8872   echo $ECHO_N "(cached) $ECHO_C" >&6
8873 else
8874   ac_check_lib_save_LIBS=$LIBS
8875 LIBS="-lgpm  $LIBS"
8876 cat >"conftest.$ac_ext" <<_ACEOF
8877 #line 8877 "configure"
8878 #include "confdefs.h"
8879
8880 /* Override any gcc2 internal prototype to avoid an error.  */
8881 #ifdef __cplusplus
8882 extern "C"
8883 #endif
8884 /* We use char because int might match the return type of a gcc2
8885    builtin and then its argument prototype would still apply.  */
8886 char initscr ();
8887 int
8888 main (void)
8889 {
8890 initscr ();
8891   ;
8892   return 0;
8893 }
8894 _ACEOF
8895 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8896 if { (eval echo "$as_me:8896: \"$ac_link\"") >&5
8897   (eval $ac_link) 2>&5
8898   ac_status=$?
8899   echo "$as_me:8899: \$? = $ac_status" >&5
8900   (exit "$ac_status"); } &&
8901          { ac_try='test -s "conftest$ac_exeext"'
8902   { (eval echo "$as_me:8902: \"$ac_try\"") >&5
8903   (eval $ac_try) 2>&5
8904   ac_status=$?
8905   echo "$as_me:8905: \$? = $ac_status" >&5
8906   (exit "$ac_status"); }; }; then
8907   ac_cv_lib_gpm_initscr=yes
8908 else
8909   echo "$as_me: failed program was:" >&5
8910 cat "conftest.$ac_ext" >&5
8911 ac_cv_lib_gpm_initscr=no
8912 fi
8913 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8914 LIBS=$ac_check_lib_save_LIBS
8915 fi
8916 echo "$as_me:8916: result: $ac_cv_lib_gpm_initscr" >&5
8917 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8918 if test "$ac_cv_lib_gpm_initscr" = yes; then
8919   LIBS="$cf_ncurses_SAVE"
8920 else
8921   cf_ncurses_LIBS="-lgpm"
8922 fi
8923
8924 fi
8925
8926 case "$host_os" in
8927 (freebsd*)
8928         # This is only necessary if you are linking against an obsolete
8929         # version of ncurses (but it should do no harm, since it is static).
8930         if test "$cf_nculib_root" = ncurses ; then
8931                 echo "$as_me:8931: checking for tgoto in -lmytinfo" >&5
8932 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8933 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8934   echo $ECHO_N "(cached) $ECHO_C" >&6
8935 else
8936   ac_check_lib_save_LIBS=$LIBS
8937 LIBS="-lmytinfo  $LIBS"
8938 cat >"conftest.$ac_ext" <<_ACEOF
8939 #line 8939 "configure"
8940 #include "confdefs.h"
8941
8942 /* Override any gcc2 internal prototype to avoid an error.  */
8943 #ifdef __cplusplus
8944 extern "C"
8945 #endif
8946 /* We use char because int might match the return type of a gcc2
8947    builtin and then its argument prototype would still apply.  */
8948 char tgoto ();
8949 int
8950 main (void)
8951 {
8952 tgoto ();
8953   ;
8954   return 0;
8955 }
8956 _ACEOF
8957 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8958 if { (eval echo "$as_me:8958: \"$ac_link\"") >&5
8959   (eval $ac_link) 2>&5
8960   ac_status=$?
8961   echo "$as_me:8961: \$? = $ac_status" >&5
8962   (exit "$ac_status"); } &&
8963          { ac_try='test -s "conftest$ac_exeext"'
8964   { (eval echo "$as_me:8964: \"$ac_try\"") >&5
8965   (eval $ac_try) 2>&5
8966   ac_status=$?
8967   echo "$as_me:8967: \$? = $ac_status" >&5
8968   (exit "$ac_status"); }; }; then
8969   ac_cv_lib_mytinfo_tgoto=yes
8970 else
8971   echo "$as_me: failed program was:" >&5
8972 cat "conftest.$ac_ext" >&5
8973 ac_cv_lib_mytinfo_tgoto=no
8974 fi
8975 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8976 LIBS=$ac_check_lib_save_LIBS
8977 fi
8978 echo "$as_me:8978: result: $ac_cv_lib_mytinfo_tgoto" >&5
8979 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8980 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8981   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8982 fi
8983
8984         fi
8985         ;;
8986 esac
8987
8988 cf_add_libs="$LIBS"
8989 # reverse order
8990 cf_add_0lib=
8991 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8992 # filter duplicates
8993 for cf_add_1lib in $cf_add_0lib; do
8994         for cf_add_2lib in $cf_add_libs; do
8995                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8996                         cf_add_1lib=
8997                         break
8998                 fi
8999         done
9000         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9001 done
9002 LIBS="$cf_add_libs"
9003
9004 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9005 then
9006
9007 cf_add_libs="$LIBS"
9008 # reverse order
9009 cf_add_0lib=
9010 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9011 # filter duplicates
9012 for cf_add_1lib in $cf_add_0lib; do
9013         for cf_add_2lib in $cf_add_libs; do
9014                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9015                         cf_add_1lib=
9016                         break
9017                 fi
9018         done
9019         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9020 done
9021 LIBS="$cf_add_libs"
9022
9023 else
9024
9025         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9026         cf_libdir=""
9027         echo "$as_me:9027: checking for initscr" >&5
9028 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9029 if test "${ac_cv_func_initscr+set}" = set; then
9030   echo $ECHO_N "(cached) $ECHO_C" >&6
9031 else
9032   cat >"conftest.$ac_ext" <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035 #define initscr autoconf_temporary
9036 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9037 #undef initscr
9038
9039 #ifdef __cplusplus
9040 extern "C"
9041 #endif
9042
9043 /* We use char because int might match the return type of a gcc2
9044    builtin and then its argument prototype would still apply.  */
9045 char initscr (void);
9046
9047 int
9048 main (void)
9049 {
9050
9051 /* The GNU C library defines stubs for functions which it implements
9052     to always fail with ENOSYS.  Some functions are actually named
9053     something starting with __ and the normal name is an alias.  */
9054 #if defined (__stub_initscr) || defined (__stub___initscr)
9055 #error found stub for initscr
9056 #endif
9057
9058         return initscr ();
9059   ;
9060   return 0;
9061 }
9062 _ACEOF
9063 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9064 if { (eval echo "$as_me:9064: \"$ac_link\"") >&5
9065   (eval $ac_link) 2>&5
9066   ac_status=$?
9067   echo "$as_me:9067: \$? = $ac_status" >&5
9068   (exit "$ac_status"); } &&
9069          { ac_try='test -s "conftest$ac_exeext"'
9070   { (eval echo "$as_me:9070: \"$ac_try\"") >&5
9071   (eval $ac_try) 2>&5
9072   ac_status=$?
9073   echo "$as_me:9073: \$? = $ac_status" >&5
9074   (exit "$ac_status"); }; }; then
9075   ac_cv_func_initscr=yes
9076 else
9077   echo "$as_me: failed program was:" >&5
9078 cat "conftest.$ac_ext" >&5
9079 ac_cv_func_initscr=no
9080 fi
9081 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9082 fi
9083 echo "$as_me:9083: result: $ac_cv_func_initscr" >&5
9084 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9085 if test "$ac_cv_func_initscr" = yes; then
9086   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9087 else
9088
9089                 cf_save_LIBS="$LIBS"
9090                 echo "$as_me:9090: checking for initscr in -l$cf_nculib_root" >&5
9091 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9092                 LIBS="-l$cf_nculib_root $LIBS"
9093                 cat >"conftest.$ac_ext" <<_ACEOF
9094 #line 9094 "configure"
9095 #include "confdefs.h"
9096 #include <${cf_cv_ncurses_header:-curses.h}>
9097 int
9098 main (void)
9099 {
9100 initscr()
9101   ;
9102   return 0;
9103 }
9104 _ACEOF
9105 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9106 if { (eval echo "$as_me:9106: \"$ac_link\"") >&5
9107   (eval $ac_link) 2>&5
9108   ac_status=$?
9109   echo "$as_me:9109: \$? = $ac_status" >&5
9110   (exit "$ac_status"); } &&
9111          { ac_try='test -s "conftest$ac_exeext"'
9112   { (eval echo "$as_me:9112: \"$ac_try\"") >&5
9113   (eval $ac_try) 2>&5
9114   ac_status=$?
9115   echo "$as_me:9115: \$? = $ac_status" >&5
9116   (exit "$ac_status"); }; }; then
9117   echo "$as_me:9117: result: yes" >&5
9118 echo "${ECHO_T}yes" >&6
9119                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9120
9121 else
9122   echo "$as_me: failed program was:" >&5
9123 cat "conftest.$ac_ext" >&5
9124 echo "$as_me:9124: result: no" >&5
9125 echo "${ECHO_T}no" >&6
9126
9127 cf_search=
9128 cf_library_path_list=""
9129 if test -n "${LDFLAGS}${LIBS}" ; then
9130         for cf_library_path in $LDFLAGS $LIBS
9131         do
9132                 case "$cf_library_path" in
9133                 (-L*)
9134                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9135
9136 test "x$cf_library_path" != "xNONE" && \
9137 test -d "$cf_library_path" && \
9138  {
9139         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9140         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9141         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9142         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9143         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9144         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"
9145 }
9146
9147                         cf_library_path_list="$cf_library_path_list $cf_search"
9148                         ;;
9149                 esac
9150         done
9151 fi
9152
9153 cf_search=
9154
9155 test "x$prefix" != "xNONE" && \
9156 test -d "$prefix" && \
9157  {
9158         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9159         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9160         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9161         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9162         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9163         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9164 }
9165
9166 for cf_subdir_prefix in \
9167         /usr \
9168         /usr/local \
9169         /usr/pkg \
9170         /opt \
9171         /opt/local \
9172         $HOME
9173 do
9174
9175 test "x$cf_subdir_prefix" != "x$prefix" && \
9176 test -d "$cf_subdir_prefix" && \
9177 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9178         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9179         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9180         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9181         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9182         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9183         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"
9184 }
9185
9186 done
9187
9188 cf_search="$cf_library_path_list $cf_search"
9189
9190                         for cf_libdir in $cf_search
9191                         do
9192                                 echo "$as_me:9192: checking for -l$cf_nculib_root in $cf_libdir" >&5
9193 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9194                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9195                                 cat >"conftest.$ac_ext" <<_ACEOF
9196 #line 9196 "configure"
9197 #include "confdefs.h"
9198 #include <${cf_cv_ncurses_header:-curses.h}>
9199 int
9200 main (void)
9201 {
9202 initscr()
9203   ;
9204   return 0;
9205 }
9206 _ACEOF
9207 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9208 if { (eval echo "$as_me:9208: \"$ac_link\"") >&5
9209   (eval $ac_link) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit "$ac_status"); } &&
9213          { ac_try='test -s "conftest$ac_exeext"'
9214   { (eval echo "$as_me:9214: \"$ac_try\"") >&5
9215   (eval $ac_try) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit "$ac_status"); }; }; then
9219   echo "$as_me:9219: result: yes" >&5
9220 echo "${ECHO_T}yes" >&6
9221                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9222                                          break
9223 else
9224   echo "$as_me: failed program was:" >&5
9225 cat "conftest.$ac_ext" >&5
9226 echo "$as_me:9226: result: no" >&5
9227 echo "${ECHO_T}no" >&6
9228                                          LIBS="$cf_save_LIBS"
9229 fi
9230 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9231                         done
9232
9233 fi
9234 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9235
9236 fi
9237
9238 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9239
9240 if test "$cf_found_library" = no ; then
9241         { { echo "$as_me:9241: error: Cannot link $cf_nculib_root library" >&5
9242 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9243    { (exit 1); exit 1; }; }
9244 fi
9245
9246 fi
9247
9248 if test -n "$cf_ncurses_LIBS" ; then
9249         echo "$as_me:9249: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9250 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9251         cf_ncurses_SAVE="$LIBS"
9252         for p in $cf_ncurses_LIBS ; do
9253                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9254                 if test "$q" != "$LIBS" ; then
9255                         LIBS="$q"
9256                 fi
9257         done
9258         cat >"conftest.$ac_ext" <<_ACEOF
9259 #line 9259 "configure"
9260 #include "confdefs.h"
9261 #include <${cf_cv_ncurses_header:-curses.h}>
9262 int
9263 main (void)
9264 {
9265 initscr(); mousemask(0,0); tigetstr((char *)0);
9266   ;
9267   return 0;
9268 }
9269 _ACEOF
9270 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9271 if { (eval echo "$as_me:9271: \"$ac_link\"") >&5
9272   (eval $ac_link) 2>&5
9273   ac_status=$?
9274   echo "$as_me:9274: \$? = $ac_status" >&5
9275   (exit "$ac_status"); } &&
9276          { ac_try='test -s "conftest$ac_exeext"'
9277   { (eval echo "$as_me:9277: \"$ac_try\"") >&5
9278   (eval $ac_try) 2>&5
9279   ac_status=$?
9280   echo "$as_me:9280: \$? = $ac_status" >&5
9281   (exit "$ac_status"); }; }; then
9282   echo "$as_me:9282: result: yes" >&5
9283 echo "${ECHO_T}yes" >&6
9284 else
9285   echo "$as_me: failed program was:" >&5
9286 cat "conftest.$ac_ext" >&5
9287 echo "$as_me:9287: result: no" >&5
9288 echo "${ECHO_T}no" >&6
9289                  LIBS="$cf_ncurses_SAVE"
9290 fi
9291 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9292 fi
9293
9294 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9295
9296 cat >>confdefs.h <<EOF
9297 #define $cf_nculib_ROOT 1
9298 EOF
9299
9300         fi
9301 else
9302         NCURSES_CONFIG=none
9303 fi
9304
9305 else
9306
9307 cf_ncuconfig_root=ncurses
9308 cf_have_ncuconfig=no
9309
9310 if test "x${PKG_CONFIG:=none}" != xnone; then
9311         echo "$as_me:9311: checking pkg-config for $cf_ncuconfig_root" >&5
9312 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9313         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9314                 echo "$as_me:9314: result: yes" >&5
9315 echo "${ECHO_T}yes" >&6
9316
9317                 echo "$as_me:9317: checking if the $cf_ncuconfig_root package files work" >&5
9318 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9319                 cf_have_ncuconfig=unknown
9320
9321                 cf_save_CFLAGS="$CFLAGS"
9322                 cf_save_CPPFLAGS="$CPPFLAGS"
9323                 cf_save_LIBS="$LIBS"
9324
9325                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9326                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9327
9328                 # while -W for passing linker flags is prevalent, it is not "standard".
9329                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9330                 # incompatible _and_ non-standard -W option which gives an error.  Work
9331                 # around that pitfall.
9332                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9333                 (x*c[89]9@@*-W*)
9334
9335 cf_fix_cppflags=no
9336 cf_new_cflags=
9337 cf_new_cppflags=
9338 cf_new_extra_cppflags=
9339
9340 for cf_add_cflags in $cf_pkg_cflags
9341 do
9342 case "$cf_fix_cppflags" in
9343 (no)
9344         case "$cf_add_cflags" in
9345         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9346                 case "$cf_add_cflags" in
9347                 (-D*)
9348                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9349
9350                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9351                                 && test -z "${cf_tst_cflags}" \
9352                                 && cf_fix_cppflags=yes
9353
9354                         if test "$cf_fix_cppflags" = yes ; then
9355
9356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9358
9359                                 continue
9360                         elif test "${cf_tst_cflags}" = "\"'" ; then
9361
9362         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9363         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9364
9365                                 continue
9366                         fi
9367                         ;;
9368                 esac
9369                 case "$CPPFLAGS" in
9370                 (*$cf_add_cflags)
9371                         ;;
9372                 (*)
9373                         case "$cf_add_cflags" in
9374                         (-D*)
9375                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9376
9377 CPPFLAGS=`echo "$CPPFLAGS" | \
9378         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9379                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9380
9381                                 ;;
9382                         esac
9383
9384         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9385         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9386
9387                         ;;
9388                 esac
9389                 ;;
9390         (*)
9391
9392         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9393         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9394
9395                 ;;
9396         esac
9397         ;;
9398 (yes)
9399
9400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9402
9403         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9404
9405         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9406                 && test -z "${cf_tst_cflags}" \
9407                 && cf_fix_cppflags=no
9408         ;;
9409 esac
9410 done
9411
9412 if test -n "$cf_new_cflags" ; then
9413
9414         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9415         CFLAGS="${CFLAGS}$cf_new_cflags"
9416
9417 fi
9418
9419 if test -n "$cf_new_cppflags" ; then
9420
9421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9422         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9423
9424 fi
9425
9426 if test -n "$cf_new_extra_cppflags" ; then
9427
9428         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9429         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9430
9431 fi
9432
9433 cf_add_libs="$LIBS"
9434 # reverse order
9435 cf_add_0lib=
9436 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9437 # filter duplicates
9438 for cf_add_1lib in $cf_add_0lib; do
9439         for cf_add_2lib in $cf_add_libs; do
9440                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9441                         cf_add_1lib=
9442                         break
9443                 fi
9444         done
9445         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9446 done
9447 LIBS="$cf_add_libs"
9448
9449                         cat >"conftest.$ac_ext" <<_ACEOF
9450 #line 9450 "configure"
9451 #include "confdefs.h"
9452 #include <${cf_cv_ncurses_header:-curses.h}>
9453 int
9454 main (void)
9455 {
9456 initscr(); mousemask(0,0); tigetstr((char *)0);
9457   ;
9458   return 0;
9459 }
9460 _ACEOF
9461 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9462 if { (eval echo "$as_me:9462: \"$ac_link\"") >&5
9463   (eval $ac_link) 2>&5
9464   ac_status=$?
9465   echo "$as_me:9465: \$? = $ac_status" >&5
9466   (exit "$ac_status"); } &&
9467          { ac_try='test -s "conftest$ac_exeext"'
9468   { (eval echo "$as_me:9468: \"$ac_try\"") >&5
9469   (eval $ac_try) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit "$ac_status"); }; }; then
9473   if test "$cross_compiling" = yes; then
9474   cf_test_ncuconfig=maybe
9475 else
9476   cat >"conftest.$ac_ext" <<_ACEOF
9477 #line 9477 "configure"
9478 #include "confdefs.h"
9479 #include <${cf_cv_ncurses_header:-curses.h}>
9480                                         int main(void)
9481                                         { const char *xx = curses_version(); return (xx == 0); }
9482 _ACEOF
9483 rm -f "conftest$ac_exeext"
9484 if { (eval echo "$as_me:9484: \"$ac_link\"") >&5
9485   (eval $ac_link) 2>&5
9486   ac_status=$?
9487   echo "$as_me:9487: \$? = $ac_status" >&5
9488   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9489   { (eval echo "$as_me:9489: \"$ac_try\"") >&5
9490   (eval $ac_try) 2>&5
9491   ac_status=$?
9492   echo "$as_me:9492: \$? = $ac_status" >&5
9493   (exit "$ac_status"); }; }; then
9494   cf_test_ncuconfig=yes
9495 else
9496   echo "$as_me: program exited with status $ac_status" >&5
9497 echo "$as_me: failed program was:" >&5
9498 cat "conftest.$ac_ext" >&5
9499 cf_test_ncuconfig=no
9500 fi
9501 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9502 fi
9503 else
9504   echo "$as_me: failed program was:" >&5
9505 cat "conftest.$ac_ext" >&5
9506 cf_test_ncuconfig=no
9507 fi
9508 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9509
9510                         CFLAGS="$cf_save_CFLAGS"
9511                         CPPFLAGS="$cf_save_CPPFLAGS"
9512                         LIBS="$cf_save_LIBS"
9513
9514                         if test "x$cf_test_ncuconfig" != xyes; then
9515                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9516                                 cf_pkg_cflags="$cf_temp"
9517                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9518                                 cf_pkg_libs="$cf_temp"
9519                         fi
9520                         ;;
9521                 esac
9522
9523 for cf_add_cflags in $cf_pkg_cflags
9524 do
9525         case "x$cf_add_cflags" in
9526         (x-[DU]*)
9527
9528 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9529 while true
9530 do
9531         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'`
9532         test "$CFLAGS" != "$cf_old_cflag" || break
9533
9534         CFLAGS="$cf_old_cflag"
9535 done
9536
9537 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9538 while true
9539 do
9540         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'`
9541         test "$CPPFLAGS" != "$cf_old_cflag" || break
9542
9543         CPPFLAGS="$cf_old_cflag"
9544 done
9545
9546                 ;;
9547         esac
9548
9549 cf_fix_cppflags=no
9550 cf_new_cflags=
9551 cf_new_cppflags=
9552 cf_new_extra_cppflags=
9553
9554 for cf_add_cflags in $cf_add_cflags
9555 do
9556 case "$cf_fix_cppflags" in
9557 (no)
9558         case "$cf_add_cflags" in
9559         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9560                 case "$cf_add_cflags" in
9561                 (-D*)
9562                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9563
9564                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9565                                 && test -z "${cf_tst_cflags}" \
9566                                 && cf_fix_cppflags=yes
9567
9568                         if test "$cf_fix_cppflags" = yes ; then
9569
9570         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9571         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9572
9573                                 continue
9574                         elif test "${cf_tst_cflags}" = "\"'" ; then
9575
9576         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9577         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9578
9579                                 continue
9580                         fi
9581                         ;;
9582                 esac
9583                 case "$CPPFLAGS" in
9584                 (*$cf_add_cflags)
9585                         ;;
9586                 (*)
9587                         case "$cf_add_cflags" in
9588                         (-D*)
9589                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9590
9591 CPPFLAGS=`echo "$CPPFLAGS" | \
9592         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9593                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9594
9595                                 ;;
9596                         esac
9597
9598         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9599         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9600
9601                         ;;
9602                 esac
9603                 ;;
9604         (*)
9605
9606         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9607         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9608
9609                 ;;
9610         esac
9611         ;;
9612 (yes)
9613
9614         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9615         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9616
9617         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9618
9619         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9620                 && test -z "${cf_tst_cflags}" \
9621                 && cf_fix_cppflags=no
9622         ;;
9623 esac
9624 done
9625
9626 if test -n "$cf_new_cflags" ; then
9627
9628         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9629         CFLAGS="${CFLAGS}$cf_new_cflags"
9630
9631 fi
9632
9633 if test -n "$cf_new_cppflags" ; then
9634
9635         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9636         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9637
9638 fi
9639
9640 if test -n "$cf_new_extra_cppflags" ; then
9641
9642         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9643         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9644
9645 fi
9646
9647 done
9648
9649 cf_add_libs="$LIBS"
9650 # reverse order
9651 cf_add_0lib=
9652 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9653 # filter duplicates
9654 for cf_add_1lib in $cf_add_0lib; do
9655         for cf_add_2lib in $cf_add_libs; do
9656                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9657                         cf_add_1lib=
9658                         break
9659                 fi
9660         done
9661         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9662 done
9663 LIBS="$cf_add_libs"
9664
9665                 cat >"conftest.$ac_ext" <<_ACEOF
9666 #line 9666 "configure"
9667 #include "confdefs.h"
9668 #include <${cf_cv_ncurses_header:-curses.h}>
9669 int
9670 main (void)
9671 {
9672 initscr(); mousemask(0,0); tigetstr((char *)0);
9673   ;
9674   return 0;
9675 }
9676 _ACEOF
9677 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9678 if { (eval echo "$as_me:9678: \"$ac_link\"") >&5
9679   (eval $ac_link) 2>&5
9680   ac_status=$?
9681   echo "$as_me:9681: \$? = $ac_status" >&5
9682   (exit "$ac_status"); } &&
9683          { ac_try='test -s "conftest$ac_exeext"'
9684   { (eval echo "$as_me:9684: \"$ac_try\"") >&5
9685   (eval $ac_try) 2>&5
9686   ac_status=$?
9687   echo "$as_me:9687: \$? = $ac_status" >&5
9688   (exit "$ac_status"); }; }; then
9689   if test "$cross_compiling" = yes; then
9690   cf_have_ncuconfig=maybe
9691 else
9692   cat >"conftest.$ac_ext" <<_ACEOF
9693 #line 9693 "configure"
9694 #include "confdefs.h"
9695 #include <${cf_cv_ncurses_header:-curses.h}>
9696                                 int main(void)
9697                                 { const char *xx = curses_version(); return (xx == 0); }
9698 _ACEOF
9699 rm -f "conftest$ac_exeext"
9700 if { (eval echo "$as_me:9700: \"$ac_link\"") >&5
9701   (eval $ac_link) 2>&5
9702   ac_status=$?
9703   echo "$as_me:9703: \$? = $ac_status" >&5
9704   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9705   { (eval echo "$as_me:9705: \"$ac_try\"") >&5
9706   (eval $ac_try) 2>&5
9707   ac_status=$?
9708   echo "$as_me:9708: \$? = $ac_status" >&5
9709   (exit "$ac_status"); }; }; then
9710   cf_have_ncuconfig=yes
9711 else
9712   echo "$as_me: program exited with status $ac_status" >&5
9713 echo "$as_me: failed program was:" >&5
9714 cat "conftest.$ac_ext" >&5
9715 cf_have_ncuconfig=no
9716 fi
9717 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9718 fi
9719 else
9720   echo "$as_me: failed program was:" >&5
9721 cat "conftest.$ac_ext" >&5
9722 cf_have_ncuconfig=no
9723 fi
9724 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9725                 echo "$as_me:9725: result: $cf_have_ncuconfig" >&5
9726 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9727                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9728                 if test "$cf_have_ncuconfig" != "yes"
9729                 then
9730                         CPPFLAGS="$cf_save_CPPFLAGS"
9731                         LIBS="$cf_save_LIBS"
9732                         NCURSES_CONFIG_PKG=none
9733                 else
9734
9735 cat >>confdefs.h <<\EOF
9736 #define NCURSES 1
9737 EOF
9738
9739                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9740
9741 echo "$as_me:9741: checking for terminfo header" >&5
9742 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9743 if test "${cf_cv_term_header+set}" = set; then
9744   echo $ECHO_N "(cached) $ECHO_C" >&6
9745 else
9746
9747 case "${cf_cv_ncurses_header}" in
9748 (*/ncurses.h|*/ncursesw.h)
9749         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9750         ;;
9751 (*)
9752         cf_term_header=term.h
9753         ;;
9754 esac
9755
9756 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9757 do
9758 cat >"conftest.$ac_ext" <<_ACEOF
9759 #line 9759 "configure"
9760 #include "confdefs.h"
9761 #include <stdio.h>
9762 #include <${cf_cv_ncurses_header:-curses.h}>
9763 #include <$cf_test>
9764
9765 int
9766 main (void)
9767 {
9768 int x = auto_left_margin; (void)x
9769   ;
9770   return 0;
9771 }
9772 _ACEOF
9773 rm -f "conftest.$ac_objext"
9774 if { (eval echo "$as_me:9774: \"$ac_compile\"") >&5
9775   (eval $ac_compile) 2>&5
9776   ac_status=$?
9777   echo "$as_me:9777: \$? = $ac_status" >&5
9778   (exit "$ac_status"); } &&
9779          { ac_try='test -s "conftest.$ac_objext"'
9780   { (eval echo "$as_me:9780: \"$ac_try\"") >&5
9781   (eval $ac_try) 2>&5
9782   ac_status=$?
9783   echo "$as_me:9783: \$? = $ac_status" >&5
9784   (exit "$ac_status"); }; }; then
9785
9786         cf_cv_term_header="$cf_test"
9787 else
9788   echo "$as_me: failed program was:" >&5
9789 cat "conftest.$ac_ext" >&5
9790
9791         cf_cv_term_header=unknown
9792
9793 fi
9794 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9795         test "$cf_cv_term_header" != unknown && break
9796 done
9797
9798 fi
9799 echo "$as_me:9799: result: $cf_cv_term_header" >&5
9800 echo "${ECHO_T}$cf_cv_term_header" >&6
9801
9802 # Set definitions to allow ifdef'ing to accommodate subdirectories
9803
9804 case "$cf_cv_term_header" in
9805 (*term.h)
9806
9807 cat >>confdefs.h <<\EOF
9808 #define HAVE_TERM_H 1
9809 EOF
9810
9811         ;;
9812 esac
9813
9814 case "$cf_cv_term_header" in
9815 (ncurses/term.h)
9816
9817 cat >>confdefs.h <<\EOF
9818 #define HAVE_NCURSES_TERM_H 1
9819 EOF
9820
9821         ;;
9822 (ncursesw/term.h)
9823
9824 cat >>confdefs.h <<\EOF
9825 #define HAVE_NCURSESW_TERM_H 1
9826 EOF
9827
9828         ;;
9829 esac
9830
9831                 fi
9832
9833         else
9834                 echo "$as_me:9834: result: no" >&5
9835 echo "${ECHO_T}no" >&6
9836                 NCURSES_CONFIG_PKG=none
9837         fi
9838 else
9839         NCURSES_CONFIG_PKG=none
9840 fi
9841
9842 if test "x$cf_have_ncuconfig" = "xno"; then
9843         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9844
9845 if test -n "$ac_tool_prefix"; then
9846   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9847   do
9848     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9849 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9850 echo "$as_me:9850: checking for $ac_word" >&5
9851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9852 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9853   echo $ECHO_N "(cached) $ECHO_C" >&6
9854 else
9855   if test -n "$NCURSES_CONFIG"; then
9856   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9857 else
9858   ac_save_IFS=$IFS; IFS=$ac_path_separator
9859 ac_dummy="$PATH"
9860 for ac_dir in $ac_dummy; do
9861   IFS=$ac_save_IFS
9862   test -z "$ac_dir" && ac_dir=.
9863   $as_executable_p "$ac_dir/$ac_word" || continue
9864 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9865 echo "$as_me:9865: found $ac_dir/$ac_word" >&5
9866 break
9867 done
9868
9869 fi
9870 fi
9871 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9872 if test -n "$NCURSES_CONFIG"; then
9873   echo "$as_me:9873: result: $NCURSES_CONFIG" >&5
9874 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9875 else
9876   echo "$as_me:9876: result: no" >&5
9877 echo "${ECHO_T}no" >&6
9878 fi
9879
9880     test -n "$NCURSES_CONFIG" && break
9881   done
9882 fi
9883 if test -z "$NCURSES_CONFIG"; then
9884   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9885   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9886 do
9887   # Extract the first word of "$ac_prog", so it can be a program name with args.
9888 set dummy $ac_prog; ac_word=$2
9889 echo "$as_me:9889: checking for $ac_word" >&5
9890 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9891 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9892   echo $ECHO_N "(cached) $ECHO_C" >&6
9893 else
9894   if test -n "$ac_ct_NCURSES_CONFIG"; then
9895   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9896 else
9897   ac_save_IFS=$IFS; IFS=$ac_path_separator
9898 ac_dummy="$PATH"
9899 for ac_dir in $ac_dummy; do
9900   IFS=$ac_save_IFS
9901   test -z "$ac_dir" && ac_dir=.
9902   $as_executable_p "$ac_dir/$ac_word" || continue
9903 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9904 echo "$as_me:9904: found $ac_dir/$ac_word" >&5
9905 break
9906 done
9907
9908 fi
9909 fi
9910 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9911 if test -n "$ac_ct_NCURSES_CONFIG"; then
9912   echo "$as_me:9912: result: $ac_ct_NCURSES_CONFIG" >&5
9913 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9914 else
9915   echo "$as_me:9915: result: no" >&5
9916 echo "${ECHO_T}no" >&6
9917 fi
9918
9919   test -n "$ac_ct_NCURSES_CONFIG" && break
9920 done
9921 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9922
9923   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9924 fi
9925
9926         if test "$NCURSES_CONFIG" != none ; then
9927
9928 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9929 do
9930         case "x$cf_add_cflags" in
9931         (x-[DU]*)
9932
9933 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9934 while true
9935 do
9936         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'`
9937         test "$CFLAGS" != "$cf_old_cflag" || break
9938
9939         CFLAGS="$cf_old_cflag"
9940 done
9941
9942 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9943 while true
9944 do
9945         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'`
9946         test "$CPPFLAGS" != "$cf_old_cflag" || break
9947
9948         CPPFLAGS="$cf_old_cflag"
9949 done
9950
9951                 ;;
9952         esac
9953
9954 cf_fix_cppflags=no
9955 cf_new_cflags=
9956 cf_new_cppflags=
9957 cf_new_extra_cppflags=
9958
9959 for cf_add_cflags in $cf_add_cflags
9960 do
9961 case "$cf_fix_cppflags" in
9962 (no)
9963         case "$cf_add_cflags" in
9964         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9965                 case "$cf_add_cflags" in
9966                 (-D*)
9967                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9968
9969                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9970                                 && test -z "${cf_tst_cflags}" \
9971                                 && cf_fix_cppflags=yes
9972
9973                         if test "$cf_fix_cppflags" = yes ; then
9974
9975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9977
9978                                 continue
9979                         elif test "${cf_tst_cflags}" = "\"'" ; then
9980
9981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9983
9984                                 continue
9985                         fi
9986                         ;;
9987                 esac
9988                 case "$CPPFLAGS" in
9989                 (*$cf_add_cflags)
9990                         ;;
9991                 (*)
9992                         case "$cf_add_cflags" in
9993                         (-D*)
9994                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9995
9996 CPPFLAGS=`echo "$CPPFLAGS" | \
9997         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9998                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9999
10000                                 ;;
10001                         esac
10002
10003         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10004         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10005
10006                         ;;
10007                 esac
10008                 ;;
10009         (*)
10010
10011         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10012         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10013
10014                 ;;
10015         esac
10016         ;;
10017 (yes)
10018
10019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10021
10022         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10023
10024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10025                 && test -z "${cf_tst_cflags}" \
10026                 && cf_fix_cppflags=no
10027         ;;
10028 esac
10029 done
10030
10031 if test -n "$cf_new_cflags" ; then
10032
10033         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10034         CFLAGS="${CFLAGS}$cf_new_cflags"
10035
10036 fi
10037
10038 if test -n "$cf_new_cppflags" ; then
10039
10040         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10041         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10042
10043 fi
10044
10045 if test -n "$cf_new_extra_cppflags" ; then
10046
10047         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10048         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10049
10050 fi
10051
10052 done
10053
10054 cf_add_libs="$LIBS"
10055 # reverse order
10056 cf_add_0lib=
10057 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10058 # filter duplicates
10059 for cf_add_1lib in $cf_add_0lib; do
10060         for cf_add_2lib in $cf_add_libs; do
10061                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10062                         cf_add_1lib=
10063                         break
10064                 fi
10065         done
10066         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10067 done
10068 LIBS="$cf_add_libs"
10069
10070                 # even with config script, some packages use no-override for curses.h
10071
10072 echo "$as_me:10072: checking if we have identified curses headers" >&5
10073 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10074 if test "${cf_cv_ncurses_header+set}" = set; then
10075   echo $ECHO_N "(cached) $ECHO_C" >&6
10076 else
10077
10078 cf_cv_ncurses_header=none
10079 for cf_header in \
10080         ncurses.h ncurses/ncurses.h \
10081         curses.h ncurses/curses.h
10082 do
10083 cat >"conftest.$ac_ext" <<_ACEOF
10084 #line 10084 "configure"
10085 #include "confdefs.h"
10086 #include <${cf_header}>
10087 int
10088 main (void)
10089 {
10090 initscr(); tgoto("?", 0,0)
10091   ;
10092   return 0;
10093 }
10094 _ACEOF
10095 rm -f "conftest.$ac_objext"
10096 if { (eval echo "$as_me:10096: \"$ac_compile\"") >&5
10097   (eval $ac_compile) 2>&5
10098   ac_status=$?
10099   echo "$as_me:10099: \$? = $ac_status" >&5
10100   (exit "$ac_status"); } &&
10101          { ac_try='test -s "conftest.$ac_objext"'
10102   { (eval echo "$as_me:10102: \"$ac_try\"") >&5
10103   (eval $ac_try) 2>&5
10104   ac_status=$?
10105   echo "$as_me:10105: \$? = $ac_status" >&5
10106   (exit "$ac_status"); }; }; then
10107   cf_cv_ncurses_header=$cf_header; break
10108 else
10109   echo "$as_me: failed program was:" >&5
10110 cat "conftest.$ac_ext" >&5
10111 fi
10112 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10113 done
10114
10115 fi
10116 echo "$as_me:10116: result: $cf_cv_ncurses_header" >&5
10117 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10118
10119 if test "$cf_cv_ncurses_header" = none ; then
10120         { { echo "$as_me:10120: error: No curses header-files found" >&5
10121 echo "$as_me: error: No curses header-files found" >&2;}
10122    { (exit 1); exit 1; }; }
10123 fi
10124
10125 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10126
10127 for ac_header in $cf_cv_ncurses_header
10128 do
10129 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10130 echo "$as_me:10130: checking for $ac_header" >&5
10131 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10132 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10133   echo $ECHO_N "(cached) $ECHO_C" >&6
10134 else
10135   cat >"conftest.$ac_ext" <<_ACEOF
10136 #line 10136 "configure"
10137 #include "confdefs.h"
10138 #include <$ac_header>
10139 _ACEOF
10140 if { (eval echo "$as_me:10140: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10141   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10142   ac_status=$?
10143   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10144   rm -f conftest.er1
10145   cat conftest.err >&5
10146   echo "$as_me:10146: \$? = $ac_status" >&5
10147   (exit "$ac_status"); } >/dev/null; then
10148   if test -s conftest.err; then
10149     ac_cpp_err=$ac_c_preproc_warn_flag
10150   else
10151     ac_cpp_err=
10152   fi
10153 else
10154   ac_cpp_err=yes
10155 fi
10156 if test -z "$ac_cpp_err"; then
10157   eval "$as_ac_Header=yes"
10158 else
10159   echo "$as_me: failed program was:" >&5
10160   cat "conftest.$ac_ext" >&5
10161   eval "$as_ac_Header=no"
10162 fi
10163 rm -f conftest.err "conftest.$ac_ext"
10164 fi
10165 echo "$as_me:10165: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10166 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10167 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10168   cat >>confdefs.h <<EOF
10169 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10170 EOF
10171
10172 fi
10173 done
10174
10175 cat >>confdefs.h <<\EOF
10176 #define NCURSES 1
10177 EOF
10178
10179 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10180
10181                 cat >>confdefs.h <<EOF
10182 #define $cf_nculib_ROOT 1
10183 EOF
10184
10185                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10186
10187         else
10188
10189 cf_ncuhdr_root=ncurses
10190
10191 test -n "$cf_cv_curses_dir" && \
10192 test "$cf_cv_curses_dir" != "no" && { \
10193
10194 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10195   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10196   do
10197         while test "$cf_add_incdir" != /usr/include
10198         do
10199           if test -d "$cf_add_incdir"
10200           then
10201                 cf_have_incdir=no
10202                 if test -n "$CFLAGS$CPPFLAGS" ; then
10203                   # a loop is needed to ensure we can add subdirs of existing dirs
10204                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10205                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10206                           cf_have_incdir=yes; break
10207                         fi
10208                   done
10209                 fi
10210
10211                 if test "$cf_have_incdir" = no ; then
10212                   if test "$cf_add_incdir" = /usr/local/include ; then
10213                         if test "$GCC" = yes
10214                         then
10215                           cf_save_CPPFLAGS=$CPPFLAGS
10216
10217         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10218         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10219
10220                           cat >"conftest.$ac_ext" <<_ACEOF
10221 #line 10221 "configure"
10222 #include "confdefs.h"
10223 #include <stdio.h>
10224 int
10225 main (void)
10226 {
10227 printf("Hello")
10228   ;
10229   return 0;
10230 }
10231 _ACEOF
10232 rm -f "conftest.$ac_objext"
10233 if { (eval echo "$as_me:10233: \"$ac_compile\"") >&5
10234   (eval $ac_compile) 2>&5
10235   ac_status=$?
10236   echo "$as_me:10236: \$? = $ac_status" >&5
10237   (exit "$ac_status"); } &&
10238          { ac_try='test -s "conftest.$ac_objext"'
10239   { (eval echo "$as_me:10239: \"$ac_try\"") >&5
10240   (eval $ac_try) 2>&5
10241   ac_status=$?
10242   echo "$as_me:10242: \$? = $ac_status" >&5
10243   (exit "$ac_status"); }; }; then
10244   :
10245 else
10246   echo "$as_me: failed program was:" >&5
10247 cat "conftest.$ac_ext" >&5
10248 cf_have_incdir=yes
10249 fi
10250 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10251                           CPPFLAGS=$cf_save_CPPFLAGS
10252                         fi
10253                   fi
10254                 fi
10255
10256                 if test "$cf_have_incdir" = no ; then
10257                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10258
10259 echo "${as_me:-configure}:10259: testing adding $cf_add_incdir to include-path ..." 1>&5
10260
10261                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10262
10263                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10264                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10265                   cf_add_incdir="$cf_top_incdir"
10266                 else
10267                   break
10268                 fi
10269           else
10270                 break
10271           fi
10272         done
10273   done
10274 fi
10275
10276 }
10277
10278 echo "$as_me:10278: checking for $cf_ncuhdr_root header in include-path" >&5
10279 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10280 if test "${cf_cv_ncurses_h+set}" = set; then
10281   echo $ECHO_N "(cached) $ECHO_C" >&6
10282 else
10283
10284         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10285         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10286         for cf_header in $cf_header_list
10287         do
10288
10289         cat >"conftest.$ac_ext" <<_ACEOF
10290 #line 10290 "configure"
10291 #include "confdefs.h"
10292
10293 #include <$cf_header>
10294 int
10295 main (void)
10296 {
10297
10298 #ifdef NCURSES_VERSION
10299
10300 printf("%s\\n", NCURSES_VERSION);
10301 #else
10302 #ifdef __NCURSES_H
10303 printf("old\\n");
10304 #else
10305         make an error
10306 #endif
10307 #endif
10308
10309   ;
10310   return 0;
10311 }
10312 _ACEOF
10313 rm -f "conftest.$ac_objext"
10314 if { (eval echo "$as_me:10314: \"$ac_compile\"") >&5
10315   (eval $ac_compile) 2>&5
10316   ac_status=$?
10317   echo "$as_me:10317: \$? = $ac_status" >&5
10318   (exit "$ac_status"); } &&
10319          { ac_try='test -s "conftest.$ac_objext"'
10320   { (eval echo "$as_me:10320: \"$ac_try\"") >&5
10321   (eval $ac_try) 2>&5
10322   ac_status=$?
10323   echo "$as_me:10323: \$? = $ac_status" >&5
10324   (exit "$ac_status"); }; }; then
10325   cf_cv_ncurses_h=$cf_header
10326
10327 else
10328   echo "$as_me: failed program was:" >&5
10329 cat "conftest.$ac_ext" >&5
10330 cf_cv_ncurses_h=no
10331 fi
10332 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10333
10334                 test "$cf_cv_ncurses_h" != no && break
10335         done
10336
10337 fi
10338 echo "$as_me:10338: result: $cf_cv_ncurses_h" >&5
10339 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10340
10341 if test "$cf_cv_ncurses_h" != no ; then
10342         cf_cv_ncurses_header=$cf_cv_ncurses_h
10343 else
10344
10345 echo "$as_me:10345: checking for $cf_ncuhdr_root include-path" >&5
10346 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10347 if test "${cf_cv_ncurses_h2+set}" = set; then
10348   echo $ECHO_N "(cached) $ECHO_C" >&6
10349 else
10350
10351         test -n "$verbose" && echo
10352
10353 cf_search=
10354
10355 # collect the current set of include-directories from compiler flags
10356 cf_header_path_list=""
10357 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10358         for cf_header_path in $CPPFLAGS $CFLAGS
10359         do
10360                 case "$cf_header_path" in
10361                 (-I*)
10362                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10363
10364 test "x$cf_header_path" != "xNONE" && \
10365 test -d "$cf_header_path" && \
10366  {
10367         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10368         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10369         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10370         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10371         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10372         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"
10373 }
10374
10375                         cf_header_path_list="$cf_header_path_list $cf_search"
10376                         ;;
10377                 esac
10378         done
10379 fi
10380
10381 # add the variations for the package we are looking for
10382
10383 cf_search=
10384
10385 test "x$prefix" != "xNONE" && \
10386 test -d "$prefix" && \
10387  {
10388         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10389         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10390         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10391         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10392         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10393         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10394 }
10395
10396 for cf_subdir_prefix in \
10397         /usr \
10398         /usr/local \
10399         /usr/pkg \
10400         /opt \
10401         /opt/local \
10402         $HOME
10403 do
10404
10405 test "x$cf_subdir_prefix" != "x$prefix" && \
10406 test -d "$cf_subdir_prefix" && \
10407 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10408         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10409         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10410         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10411         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10412         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10413         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"
10414 }
10415
10416 done
10417
10418 test "$includedir" != NONE && \
10419 test "$includedir" != "/usr/include" && \
10420 test -d "$includedir" && {
10421         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10422         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10423 }
10424
10425 test "$oldincludedir" != NONE && \
10426 test "$oldincludedir" != "/usr/include" && \
10427 test -d "$oldincludedir" && {
10428         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10429         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10430 }
10431
10432 cf_search="$cf_search $cf_header_path_list"
10433
10434         test -n "$verbose" && echo "search path $cf_search"
10435         cf_save2_CPPFLAGS="$CPPFLAGS"
10436         for cf_incdir in $cf_search
10437         do
10438
10439 if test -n "$cf_incdir" ; then
10440   for cf_add_incdir in $cf_incdir
10441   do
10442         while test "$cf_add_incdir" != /usr/include
10443         do
10444           if test -d "$cf_add_incdir"
10445           then
10446                 cf_have_incdir=no
10447                 if test -n "$CFLAGS$CPPFLAGS" ; then
10448                   # a loop is needed to ensure we can add subdirs of existing dirs
10449                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10450                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10451                           cf_have_incdir=yes; break
10452                         fi
10453                   done
10454                 fi
10455
10456                 if test "$cf_have_incdir" = no ; then
10457                   if test "$cf_add_incdir" = /usr/local/include ; then
10458                         if test "$GCC" = yes
10459                         then
10460                           cf_save_CPPFLAGS=$CPPFLAGS
10461
10462         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10463         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10464
10465                           cat >"conftest.$ac_ext" <<_ACEOF
10466 #line 10466 "configure"
10467 #include "confdefs.h"
10468 #include <stdio.h>
10469 int
10470 main (void)
10471 {
10472 printf("Hello")
10473   ;
10474   return 0;
10475 }
10476 _ACEOF
10477 rm -f "conftest.$ac_objext"
10478 if { (eval echo "$as_me:10478: \"$ac_compile\"") >&5
10479   (eval $ac_compile) 2>&5
10480   ac_status=$?
10481   echo "$as_me:10481: \$? = $ac_status" >&5
10482   (exit "$ac_status"); } &&
10483          { ac_try='test -s "conftest.$ac_objext"'
10484   { (eval echo "$as_me:10484: \"$ac_try\"") >&5
10485   (eval $ac_try) 2>&5
10486   ac_status=$?
10487   echo "$as_me:10487: \$? = $ac_status" >&5
10488   (exit "$ac_status"); }; }; then
10489   :
10490 else
10491   echo "$as_me: failed program was:" >&5
10492 cat "conftest.$ac_ext" >&5
10493 cf_have_incdir=yes
10494 fi
10495 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10496                           CPPFLAGS=$cf_save_CPPFLAGS
10497                         fi
10498                   fi
10499                 fi
10500
10501                 if test "$cf_have_incdir" = no ; then
10502                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10503
10504 echo "${as_me:-configure}:10504: testing adding $cf_add_incdir to include-path ..." 1>&5
10505
10506                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10507
10508                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10509                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10510                   cf_add_incdir="$cf_top_incdir"
10511                 else
10512                   break
10513                 fi
10514           else
10515                 break
10516           fi
10517         done
10518   done
10519 fi
10520
10521                 for cf_header in \
10522                         ncurses.h \
10523                         curses.h
10524                 do
10525
10526         cat >"conftest.$ac_ext" <<_ACEOF
10527 #line 10527 "configure"
10528 #include "confdefs.h"
10529
10530 #include <$cf_header>
10531 int
10532 main (void)
10533 {
10534
10535 #ifdef NCURSES_VERSION
10536
10537 printf("%s\\n", NCURSES_VERSION);
10538 #else
10539 #ifdef __NCURSES_H
10540 printf("old\\n");
10541 #else
10542         make an error
10543 #endif
10544 #endif
10545
10546   ;
10547   return 0;
10548 }
10549 _ACEOF
10550 rm -f "conftest.$ac_objext"
10551 if { (eval echo "$as_me:10551: \"$ac_compile\"") >&5
10552   (eval $ac_compile) 2>&5
10553   ac_status=$?
10554   echo "$as_me:10554: \$? = $ac_status" >&5
10555   (exit "$ac_status"); } &&
10556          { ac_try='test -s "conftest.$ac_objext"'
10557   { (eval echo "$as_me:10557: \"$ac_try\"") >&5
10558   (eval $ac_try) 2>&5
10559   ac_status=$?
10560   echo "$as_me:10560: \$? = $ac_status" >&5
10561   (exit "$ac_status"); }; }; then
10562   cf_cv_ncurses_h2=$cf_header
10563
10564 else
10565   echo "$as_me: failed program was:" >&5
10566 cat "conftest.$ac_ext" >&5
10567 cf_cv_ncurses_h2=no
10568 fi
10569 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10570
10571                         if test "$cf_cv_ncurses_h2" != no ; then
10572                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10573                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10574                                 break
10575                         fi
10576                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10577                 done
10578                 CPPFLAGS="$cf_save2_CPPFLAGS"
10579                 test "$cf_cv_ncurses_h2" != no && break
10580         done
10581         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10581: error: not found" >&5
10582 echo "$as_me: error: not found" >&2;}
10583    { (exit 1); exit 1; }; }
10584
10585 fi
10586 echo "$as_me:10586: result: $cf_cv_ncurses_h2" >&5
10587 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10588
10589         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10590         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10591         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10592                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10593         fi
10594
10595 if test -n "$cf_1st_incdir" ; then
10596   for cf_add_incdir in $cf_1st_incdir
10597   do
10598         while test "$cf_add_incdir" != /usr/include
10599         do
10600           if test -d "$cf_add_incdir"
10601           then
10602                 cf_have_incdir=no
10603                 if test -n "$CFLAGS$CPPFLAGS" ; then
10604                   # a loop is needed to ensure we can add subdirs of existing dirs
10605                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10606                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10607                           cf_have_incdir=yes; break
10608                         fi
10609                   done
10610                 fi
10611
10612                 if test "$cf_have_incdir" = no ; then
10613                   if test "$cf_add_incdir" = /usr/local/include ; then
10614                         if test "$GCC" = yes
10615                         then
10616                           cf_save_CPPFLAGS=$CPPFLAGS
10617
10618         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10619         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10620
10621                           cat >"conftest.$ac_ext" <<_ACEOF
10622 #line 10622 "configure"
10623 #include "confdefs.h"
10624 #include <stdio.h>
10625 int
10626 main (void)
10627 {
10628 printf("Hello")
10629   ;
10630   return 0;
10631 }
10632 _ACEOF
10633 rm -f "conftest.$ac_objext"
10634 if { (eval echo "$as_me:10634: \"$ac_compile\"") >&5
10635   (eval $ac_compile) 2>&5
10636   ac_status=$?
10637   echo "$as_me:10637: \$? = $ac_status" >&5
10638   (exit "$ac_status"); } &&
10639          { ac_try='test -s "conftest.$ac_objext"'
10640   { (eval echo "$as_me:10640: \"$ac_try\"") >&5
10641   (eval $ac_try) 2>&5
10642   ac_status=$?
10643   echo "$as_me:10643: \$? = $ac_status" >&5
10644   (exit "$ac_status"); }; }; then
10645   :
10646 else
10647   echo "$as_me: failed program was:" >&5
10648 cat "conftest.$ac_ext" >&5
10649 cf_have_incdir=yes
10650 fi
10651 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10652                           CPPFLAGS=$cf_save_CPPFLAGS
10653                         fi
10654                   fi
10655                 fi
10656
10657                 if test "$cf_have_incdir" = no ; then
10658                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10659
10660 echo "${as_me:-configure}:10660: testing adding $cf_add_incdir to include-path ..." 1>&5
10661
10662                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10663
10664                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10665                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10666                   cf_add_incdir="$cf_top_incdir"
10667                 else
10668                   break
10669                 fi
10670           else
10671                 break
10672           fi
10673         done
10674   done
10675 fi
10676
10677 fi
10678
10679 # Set definitions to allow ifdef'ing for ncurses.h
10680
10681 case "$cf_cv_ncurses_header" in
10682 (*ncurses.h)
10683
10684 cat >>confdefs.h <<\EOF
10685 #define HAVE_NCURSES_H 1
10686 EOF
10687
10688         ;;
10689 esac
10690
10691 case "$cf_cv_ncurses_header" in
10692 (ncurses/curses.h|ncurses/ncurses.h)
10693
10694 cat >>confdefs.h <<\EOF
10695 #define HAVE_NCURSES_NCURSES_H 1
10696 EOF
10697
10698         ;;
10699 (ncursesw/curses.h|ncursesw/ncurses.h)
10700
10701 cat >>confdefs.h <<\EOF
10702 #define HAVE_NCURSESW_NCURSES_H 1
10703 EOF
10704
10705         ;;
10706 esac
10707
10708 echo "$as_me:10708: checking for terminfo header" >&5
10709 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10710 if test "${cf_cv_term_header+set}" = set; then
10711   echo $ECHO_N "(cached) $ECHO_C" >&6
10712 else
10713
10714 case "${cf_cv_ncurses_header}" in
10715 (*/ncurses.h|*/ncursesw.h)
10716         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10717         ;;
10718 (*)
10719         cf_term_header=term.h
10720         ;;
10721 esac
10722
10723 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10724 do
10725 cat >"conftest.$ac_ext" <<_ACEOF
10726 #line 10726 "configure"
10727 #include "confdefs.h"
10728 #include <stdio.h>
10729 #include <${cf_cv_ncurses_header:-curses.h}>
10730 #include <$cf_test>
10731
10732 int
10733 main (void)
10734 {
10735 int x = auto_left_margin; (void)x
10736   ;
10737   return 0;
10738 }
10739 _ACEOF
10740 rm -f "conftest.$ac_objext"
10741 if { (eval echo "$as_me:10741: \"$ac_compile\"") >&5
10742   (eval $ac_compile) 2>&5
10743   ac_status=$?
10744   echo "$as_me:10744: \$? = $ac_status" >&5
10745   (exit "$ac_status"); } &&
10746          { ac_try='test -s "conftest.$ac_objext"'
10747   { (eval echo "$as_me:10747: \"$ac_try\"") >&5
10748   (eval $ac_try) 2>&5
10749   ac_status=$?
10750   echo "$as_me:10750: \$? = $ac_status" >&5
10751   (exit "$ac_status"); }; }; then
10752
10753         cf_cv_term_header="$cf_test"
10754 else
10755   echo "$as_me: failed program was:" >&5
10756 cat "conftest.$ac_ext" >&5
10757
10758         cf_cv_term_header=unknown
10759
10760 fi
10761 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10762         test "$cf_cv_term_header" != unknown && break
10763 done
10764
10765 fi
10766 echo "$as_me:10766: result: $cf_cv_term_header" >&5
10767 echo "${ECHO_T}$cf_cv_term_header" >&6
10768
10769 # Set definitions to allow ifdef'ing to accommodate subdirectories
10770
10771 case "$cf_cv_term_header" in
10772 (*term.h)
10773
10774 cat >>confdefs.h <<\EOF
10775 #define HAVE_TERM_H 1
10776 EOF
10777
10778         ;;
10779 esac
10780
10781 case "$cf_cv_term_header" in
10782 (ncurses/term.h)
10783
10784 cat >>confdefs.h <<\EOF
10785 #define HAVE_NCURSES_TERM_H 1
10786 EOF
10787
10788         ;;
10789 (ncursesw/term.h)
10790
10791 cat >>confdefs.h <<\EOF
10792 #define HAVE_NCURSESW_TERM_H 1
10793 EOF
10794
10795         ;;
10796 esac
10797
10798 # some applications need this, but should check for NCURSES_VERSION
10799
10800 cat >>confdefs.h <<\EOF
10801 #define NCURSES 1
10802 EOF
10803
10804 echo "$as_me:10804: checking for ncurses version" >&5
10805 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10806 if test "${cf_cv_ncurses_version+set}" = set; then
10807   echo $ECHO_N "(cached) $ECHO_C" >&6
10808 else
10809
10810         cf_cv_ncurses_version=no
10811         cf_tempfile=out$$
10812         rm -f "$cf_tempfile"
10813         if test "$cross_compiling" = yes; then
10814
10815         # This will not work if the preprocessor splits the line after the
10816         # Autoconf token.  The 'unproto' program does that.
10817         cat > "conftest.$ac_ext" <<EOF
10818 #include <${cf_cv_ncurses_header:-curses.h}>
10819 #undef Autoconf
10820 #ifdef NCURSES_VERSION
10821 Autoconf NCURSES_VERSION
10822 #else
10823 #ifdef __NCURSES_H
10824 Autoconf "old"
10825 #endif
10826 ;
10827 #endif
10828 EOF
10829         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10830         { (eval echo "$as_me:10830: \"$cf_try\"") >&5
10831   (eval $cf_try) 2>&5
10832   ac_status=$?
10833   echo "$as_me:10833: \$? = $ac_status" >&5
10834   (exit "$ac_status"); }
10835         if test -f conftest.out ; then
10836                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10837                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10838                 rm -f conftest.out
10839         fi
10840
10841 else
10842   cat >"conftest.$ac_ext" <<_ACEOF
10843 #line 10843 "configure"
10844 #include "confdefs.h"
10845
10846 #include <${cf_cv_ncurses_header:-curses.h}>
10847 #include <stdio.h>
10848 int main(void)
10849 {
10850         FILE *fp = fopen("$cf_tempfile", "w");
10851 #ifdef NCURSES_VERSION
10852 # ifdef NCURSES_VERSION_PATCH
10853         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10854 # else
10855         fprintf(fp, "%s\\n", NCURSES_VERSION);
10856 # endif
10857 #else
10858 # ifdef __NCURSES_H
10859         fprintf(fp, "old\\n");
10860 # else
10861         make an error
10862 # endif
10863 #endif
10864         ${cf_cv_main_return:-return}(0);
10865 }
10866 _ACEOF
10867 rm -f "conftest$ac_exeext"
10868 if { (eval echo "$as_me:10868: \"$ac_link\"") >&5
10869   (eval $ac_link) 2>&5
10870   ac_status=$?
10871   echo "$as_me:10871: \$? = $ac_status" >&5
10872   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10873   { (eval echo "$as_me:10873: \"$ac_try\"") >&5
10874   (eval $ac_try) 2>&5
10875   ac_status=$?
10876   echo "$as_me:10876: \$? = $ac_status" >&5
10877   (exit "$ac_status"); }; }; then
10878
10879         cf_cv_ncurses_version=`cat $cf_tempfile`
10880 else
10881   echo "$as_me: program exited with status $ac_status" >&5
10882 echo "$as_me: failed program was:" >&5
10883 cat "conftest.$ac_ext" >&5
10884 fi
10885 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10886 fi
10887         rm -f "$cf_tempfile"
10888
10889 fi
10890 echo "$as_me:10890: result: $cf_cv_ncurses_version" >&5
10891 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10892 test "$cf_cv_ncurses_version" = no ||
10893 cat >>confdefs.h <<\EOF
10894 #define NCURSES 1
10895 EOF
10896
10897 cf_nculib_root=ncurses
10898         # This works, except for the special case where we find gpm, but
10899         # ncurses is in a nonstandard location via $LIBS, and we really want
10900         # to link gpm.
10901 cf_ncurses_LIBS=""
10902 cf_ncurses_SAVE="$LIBS"
10903 echo "$as_me:10903: checking for Gpm_Open in -lgpm" >&5
10904 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10905 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10906   echo $ECHO_N "(cached) $ECHO_C" >&6
10907 else
10908   ac_check_lib_save_LIBS=$LIBS
10909 LIBS="-lgpm  $LIBS"
10910 cat >"conftest.$ac_ext" <<_ACEOF
10911 #line 10911 "configure"
10912 #include "confdefs.h"
10913
10914 /* Override any gcc2 internal prototype to avoid an error.  */
10915 #ifdef __cplusplus
10916 extern "C"
10917 #endif
10918 /* We use char because int might match the return type of a gcc2
10919    builtin and then its argument prototype would still apply.  */
10920 char Gpm_Open ();
10921 int
10922 main (void)
10923 {
10924 Gpm_Open ();
10925   ;
10926   return 0;
10927 }
10928 _ACEOF
10929 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10930 if { (eval echo "$as_me:10930: \"$ac_link\"") >&5
10931   (eval $ac_link) 2>&5
10932   ac_status=$?
10933   echo "$as_me:10933: \$? = $ac_status" >&5
10934   (exit "$ac_status"); } &&
10935          { ac_try='test -s "conftest$ac_exeext"'
10936   { (eval echo "$as_me:10936: \"$ac_try\"") >&5
10937   (eval $ac_try) 2>&5
10938   ac_status=$?
10939   echo "$as_me:10939: \$? = $ac_status" >&5
10940   (exit "$ac_status"); }; }; then
10941   ac_cv_lib_gpm_Gpm_Open=yes
10942 else
10943   echo "$as_me: failed program was:" >&5
10944 cat "conftest.$ac_ext" >&5
10945 ac_cv_lib_gpm_Gpm_Open=no
10946 fi
10947 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10948 LIBS=$ac_check_lib_save_LIBS
10949 fi
10950 echo "$as_me:10950: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10951 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10952 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10953   echo "$as_me:10953: checking for initscr in -lgpm" >&5
10954 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10955 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10956   echo $ECHO_N "(cached) $ECHO_C" >&6
10957 else
10958   ac_check_lib_save_LIBS=$LIBS
10959 LIBS="-lgpm  $LIBS"
10960 cat >"conftest.$ac_ext" <<_ACEOF
10961 #line 10961 "configure"
10962 #include "confdefs.h"
10963
10964 /* Override any gcc2 internal prototype to avoid an error.  */
10965 #ifdef __cplusplus
10966 extern "C"
10967 #endif
10968 /* We use char because int might match the return type of a gcc2
10969    builtin and then its argument prototype would still apply.  */
10970 char initscr ();
10971 int
10972 main (void)
10973 {
10974 initscr ();
10975   ;
10976   return 0;
10977 }
10978 _ACEOF
10979 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10980 if { (eval echo "$as_me:10980: \"$ac_link\"") >&5
10981   (eval $ac_link) 2>&5
10982   ac_status=$?
10983   echo "$as_me:10983: \$? = $ac_status" >&5
10984   (exit "$ac_status"); } &&
10985          { ac_try='test -s "conftest$ac_exeext"'
10986   { (eval echo "$as_me:10986: \"$ac_try\"") >&5
10987   (eval $ac_try) 2>&5
10988   ac_status=$?
10989   echo "$as_me:10989: \$? = $ac_status" >&5
10990   (exit "$ac_status"); }; }; then
10991   ac_cv_lib_gpm_initscr=yes
10992 else
10993   echo "$as_me: failed program was:" >&5
10994 cat "conftest.$ac_ext" >&5
10995 ac_cv_lib_gpm_initscr=no
10996 fi
10997 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10998 LIBS=$ac_check_lib_save_LIBS
10999 fi
11000 echo "$as_me:11000: result: $ac_cv_lib_gpm_initscr" >&5
11001 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11002 if test "$ac_cv_lib_gpm_initscr" = yes; then
11003   LIBS="$cf_ncurses_SAVE"
11004 else
11005   cf_ncurses_LIBS="-lgpm"
11006 fi
11007
11008 fi
11009
11010 case "$host_os" in
11011 (freebsd*)
11012         # This is only necessary if you are linking against an obsolete
11013         # version of ncurses (but it should do no harm, since it is static).
11014         if test "$cf_nculib_root" = ncurses ; then
11015                 echo "$as_me:11015: checking for tgoto in -lmytinfo" >&5
11016 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11017 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11018   echo $ECHO_N "(cached) $ECHO_C" >&6
11019 else
11020   ac_check_lib_save_LIBS=$LIBS
11021 LIBS="-lmytinfo  $LIBS"
11022 cat >"conftest.$ac_ext" <<_ACEOF
11023 #line 11023 "configure"
11024 #include "confdefs.h"
11025
11026 /* Override any gcc2 internal prototype to avoid an error.  */
11027 #ifdef __cplusplus
11028 extern "C"
11029 #endif
11030 /* We use char because int might match the return type of a gcc2
11031    builtin and then its argument prototype would still apply.  */
11032 char tgoto ();
11033 int
11034 main (void)
11035 {
11036 tgoto ();
11037   ;
11038   return 0;
11039 }
11040 _ACEOF
11041 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11042 if { (eval echo "$as_me:11042: \"$ac_link\"") >&5
11043   (eval $ac_link) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit "$ac_status"); } &&
11047          { ac_try='test -s "conftest$ac_exeext"'
11048   { (eval echo "$as_me:11048: \"$ac_try\"") >&5
11049   (eval $ac_try) 2>&5
11050   ac_status=$?
11051   echo "$as_me:11051: \$? = $ac_status" >&5
11052   (exit "$ac_status"); }; }; then
11053   ac_cv_lib_mytinfo_tgoto=yes
11054 else
11055   echo "$as_me: failed program was:" >&5
11056 cat "conftest.$ac_ext" >&5
11057 ac_cv_lib_mytinfo_tgoto=no
11058 fi
11059 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11060 LIBS=$ac_check_lib_save_LIBS
11061 fi
11062 echo "$as_me:11062: result: $ac_cv_lib_mytinfo_tgoto" >&5
11063 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11064 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11065   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11066 fi
11067
11068         fi
11069         ;;
11070 esac
11071
11072 cf_add_libs="$LIBS"
11073 # reverse order
11074 cf_add_0lib=
11075 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11076 # filter duplicates
11077 for cf_add_1lib in $cf_add_0lib; do
11078         for cf_add_2lib in $cf_add_libs; do
11079                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11080                         cf_add_1lib=
11081                         break
11082                 fi
11083         done
11084         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11085 done
11086 LIBS="$cf_add_libs"
11087
11088 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11089 then
11090
11091 cf_add_libs="$LIBS"
11092 # reverse order
11093 cf_add_0lib=
11094 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11095 # filter duplicates
11096 for cf_add_1lib in $cf_add_0lib; do
11097         for cf_add_2lib in $cf_add_libs; do
11098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11099                         cf_add_1lib=
11100                         break
11101                 fi
11102         done
11103         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11104 done
11105 LIBS="$cf_add_libs"
11106
11107 else
11108
11109         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11110         cf_libdir=""
11111         echo "$as_me:11111: checking for initscr" >&5
11112 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11113 if test "${ac_cv_func_initscr+set}" = set; then
11114   echo $ECHO_N "(cached) $ECHO_C" >&6
11115 else
11116   cat >"conftest.$ac_ext" <<_ACEOF
11117 #line 11117 "configure"
11118 #include "confdefs.h"
11119 #define initscr autoconf_temporary
11120 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11121 #undef initscr
11122
11123 #ifdef __cplusplus
11124 extern "C"
11125 #endif
11126
11127 /* We use char because int might match the return type of a gcc2
11128    builtin and then its argument prototype would still apply.  */
11129 char initscr (void);
11130
11131 int
11132 main (void)
11133 {
11134
11135 /* The GNU C library defines stubs for functions which it implements
11136     to always fail with ENOSYS.  Some functions are actually named
11137     something starting with __ and the normal name is an alias.  */
11138 #if defined (__stub_initscr) || defined (__stub___initscr)
11139 #error found stub for initscr
11140 #endif
11141
11142         return initscr ();
11143   ;
11144   return 0;
11145 }
11146 _ACEOF
11147 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11148 if { (eval echo "$as_me:11148: \"$ac_link\"") >&5
11149   (eval $ac_link) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit "$ac_status"); } &&
11153          { ac_try='test -s "conftest$ac_exeext"'
11154   { (eval echo "$as_me:11154: \"$ac_try\"") >&5
11155   (eval $ac_try) 2>&5
11156   ac_status=$?
11157   echo "$as_me:11157: \$? = $ac_status" >&5
11158   (exit "$ac_status"); }; }; then
11159   ac_cv_func_initscr=yes
11160 else
11161   echo "$as_me: failed program was:" >&5
11162 cat "conftest.$ac_ext" >&5
11163 ac_cv_func_initscr=no
11164 fi
11165 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11166 fi
11167 echo "$as_me:11167: result: $ac_cv_func_initscr" >&5
11168 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11169 if test "$ac_cv_func_initscr" = yes; then
11170   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11171 else
11172
11173                 cf_save_LIBS="$LIBS"
11174                 echo "$as_me:11174: checking for initscr in -l$cf_nculib_root" >&5
11175 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11176                 LIBS="-l$cf_nculib_root $LIBS"
11177                 cat >"conftest.$ac_ext" <<_ACEOF
11178 #line 11178 "configure"
11179 #include "confdefs.h"
11180 #include <${cf_cv_ncurses_header:-curses.h}>
11181 int
11182 main (void)
11183 {
11184 initscr()
11185   ;
11186   return 0;
11187 }
11188 _ACEOF
11189 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11190 if { (eval echo "$as_me:11190: \"$ac_link\"") >&5
11191   (eval $ac_link) 2>&5
11192   ac_status=$?
11193   echo "$as_me:11193: \$? = $ac_status" >&5
11194   (exit "$ac_status"); } &&
11195          { ac_try='test -s "conftest$ac_exeext"'
11196   { (eval echo "$as_me:11196: \"$ac_try\"") >&5
11197   (eval $ac_try) 2>&5
11198   ac_status=$?
11199   echo "$as_me:11199: \$? = $ac_status" >&5
11200   (exit "$ac_status"); }; }; then
11201   echo "$as_me:11201: result: yes" >&5
11202 echo "${ECHO_T}yes" >&6
11203                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11204
11205 else
11206   echo "$as_me: failed program was:" >&5
11207 cat "conftest.$ac_ext" >&5
11208 echo "$as_me:11208: result: no" >&5
11209 echo "${ECHO_T}no" >&6
11210
11211 cf_search=
11212 cf_library_path_list=""
11213 if test -n "${LDFLAGS}${LIBS}" ; then
11214         for cf_library_path in $LDFLAGS $LIBS
11215         do
11216                 case "$cf_library_path" in
11217                 (-L*)
11218                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11219
11220 test "x$cf_library_path" != "xNONE" && \
11221 test -d "$cf_library_path" && \
11222  {
11223         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11224         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11225         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11226         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11227         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11228         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"
11229 }
11230
11231                         cf_library_path_list="$cf_library_path_list $cf_search"
11232                         ;;
11233                 esac
11234         done
11235 fi
11236
11237 cf_search=
11238
11239 test "x$prefix" != "xNONE" && \
11240 test -d "$prefix" && \
11241  {
11242         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11243         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11244         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11245         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11246         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11247         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11248 }
11249
11250 for cf_subdir_prefix in \
11251         /usr \
11252         /usr/local \
11253         /usr/pkg \
11254         /opt \
11255         /opt/local \
11256         $HOME
11257 do
11258
11259 test "x$cf_subdir_prefix" != "x$prefix" && \
11260 test -d "$cf_subdir_prefix" && \
11261 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11262         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11263         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11264         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11265         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11266         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11267         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"
11268 }
11269
11270 done
11271
11272 cf_search="$cf_library_path_list $cf_search"
11273
11274                         for cf_libdir in $cf_search
11275                         do
11276                                 echo "$as_me:11276: checking for -l$cf_nculib_root in $cf_libdir" >&5
11277 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11278                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11279                                 cat >"conftest.$ac_ext" <<_ACEOF
11280 #line 11280 "configure"
11281 #include "confdefs.h"
11282 #include <${cf_cv_ncurses_header:-curses.h}>
11283 int
11284 main (void)
11285 {
11286 initscr()
11287   ;
11288   return 0;
11289 }
11290 _ACEOF
11291 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11292 if { (eval echo "$as_me:11292: \"$ac_link\"") >&5
11293   (eval $ac_link) 2>&5
11294   ac_status=$?
11295   echo "$as_me:11295: \$? = $ac_status" >&5
11296   (exit "$ac_status"); } &&
11297          { ac_try='test -s "conftest$ac_exeext"'
11298   { (eval echo "$as_me:11298: \"$ac_try\"") >&5
11299   (eval $ac_try) 2>&5
11300   ac_status=$?
11301   echo "$as_me:11301: \$? = $ac_status" >&5
11302   (exit "$ac_status"); }; }; then
11303   echo "$as_me:11303: result: yes" >&5
11304 echo "${ECHO_T}yes" >&6
11305                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11306                                          break
11307 else
11308   echo "$as_me: failed program was:" >&5
11309 cat "conftest.$ac_ext" >&5
11310 echo "$as_me:11310: result: no" >&5
11311 echo "${ECHO_T}no" >&6
11312                                          LIBS="$cf_save_LIBS"
11313 fi
11314 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11315                         done
11316
11317 fi
11318 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11319
11320 fi
11321
11322 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11323
11324 if test "$cf_found_library" = no ; then
11325         { { echo "$as_me:11325: error: Cannot link $cf_nculib_root library" >&5
11326 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11327    { (exit 1); exit 1; }; }
11328 fi
11329
11330 fi
11331
11332 if test -n "$cf_ncurses_LIBS" ; then
11333         echo "$as_me:11333: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11334 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11335         cf_ncurses_SAVE="$LIBS"
11336         for p in $cf_ncurses_LIBS ; do
11337                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11338                 if test "$q" != "$LIBS" ; then
11339                         LIBS="$q"
11340                 fi
11341         done
11342         cat >"conftest.$ac_ext" <<_ACEOF
11343 #line 11343 "configure"
11344 #include "confdefs.h"
11345 #include <${cf_cv_ncurses_header:-curses.h}>
11346 int
11347 main (void)
11348 {
11349 initscr(); mousemask(0,0); tigetstr((char *)0);
11350   ;
11351   return 0;
11352 }
11353 _ACEOF
11354 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11355 if { (eval echo "$as_me:11355: \"$ac_link\"") >&5
11356   (eval $ac_link) 2>&5
11357   ac_status=$?
11358   echo "$as_me:11358: \$? = $ac_status" >&5
11359   (exit "$ac_status"); } &&
11360          { ac_try='test -s "conftest$ac_exeext"'
11361   { (eval echo "$as_me:11361: \"$ac_try\"") >&5
11362   (eval $ac_try) 2>&5
11363   ac_status=$?
11364   echo "$as_me:11364: \$? = $ac_status" >&5
11365   (exit "$ac_status"); }; }; then
11366   echo "$as_me:11366: result: yes" >&5
11367 echo "${ECHO_T}yes" >&6
11368 else
11369   echo "$as_me: failed program was:" >&5
11370 cat "conftest.$ac_ext" >&5
11371 echo "$as_me:11371: result: no" >&5
11372 echo "${ECHO_T}no" >&6
11373                  LIBS="$cf_ncurses_SAVE"
11374 fi
11375 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11376 fi
11377
11378 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11379
11380 cat >>confdefs.h <<EOF
11381 #define $cf_nculib_ROOT 1
11382 EOF
11383
11384         fi
11385 else
11386         NCURSES_CONFIG=none
11387 fi
11388
11389 fi
11390
11391 if test "$NCURSES_CONFIG_PKG" != none ; then
11392         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11393
11394         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11395         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11396         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11397
11398         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11399         if test -z "$cf_cv_abi_version"
11400         then
11401                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11402         fi
11403
11404 elif test "$NCURSES_CONFIG" != none ; then
11405
11406         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11407
11408         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11409         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11410         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11411
11412         # ABI version is not available from headers
11413         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11414
11415 else
11416
11417         for cf_name in MAJOR MINOR PATCH
11418         do
11419         cat >conftest.$ac_ext <<CF_EOF
11420         #include <${cf_cv_ncurses_header:-curses.h}>
11421         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11422 CF_EOF
11423                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11424                 { (eval echo "$as_me:11424: \"$cf_try\"") >&5
11425   (eval $cf_try) 2>&5
11426   ac_status=$?
11427   echo "$as_me:11427: \$? = $ac_status" >&5
11428   (exit "$ac_status"); }
11429                 if test -f conftest.out ; then
11430                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11431                         eval NCURSES_$cf_name=\"$cf_result\"
11432                         # cat conftest.$ac_ext
11433                         # cat conftest.out
11434                 fi
11435         done
11436
11437         cf_cv_abi_version=${NCURSES_MAJOR}
11438
11439 fi
11440
11441 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11442
11443 cf_cv_timestamp=`date`
11444
11445 echo "$as_me:11445: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11446 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11447
11448 echo "$as_me:11448: checking if you want to have a library-prefix" >&5
11449 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11450
11451 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11452 if test "${with_lib_prefix+set}" = set; then
11453   withval="$with_lib_prefix"
11454   with_lib_prefix=$withval
11455 else
11456   with_lib_prefix=auto
11457 fi;
11458 echo "$as_me:11458: result: $with_lib_prefix" >&5
11459 echo "${ECHO_T}$with_lib_prefix" >&6
11460
11461 if test "$with_lib_prefix" = auto
11462 then
11463
11464         case "$cf_cv_system_name" in
11465         (OS/2*|os2*)
11466                 if test "$DFT_LWR_MODEL" = libtool; then
11467                         LIB_PREFIX='lib'
11468                 else
11469                         LIB_PREFIX=''
11470                 fi
11471                 ;;
11472         (*-msvc*)
11473                 LIB_PREFIX=''
11474                 ;;
11475         (*)     LIB_PREFIX='lib'
11476                 ;;
11477         esac
11478 cf_prefix=$LIB_PREFIX
11479
11480 elif test "$with_lib_prefix" = no
11481 then
11482         LIB_PREFIX=
11483 else
11484         LIB_PREFIX=$with_lib_prefix
11485 fi
11486
11487 LIB_SUFFIX=
11488
11489 ###############################################################################
11490
11491 if test X"$CC_G_OPT" = X"" ; then
11492         CC_G_OPT='-g'
11493         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11494 fi
11495
11496 echo "$as_me:11496: checking for default loader flags" >&5
11497 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11498 case $DFT_LWR_MODEL in
11499 (normal)  LD_MODEL=''   ;;
11500 (debug)   LD_MODEL=$CC_G_OPT ;;
11501 (profile) LD_MODEL='-pg';;
11502 (shared)  LD_MODEL=''   ;;
11503 esac
11504 echo "$as_me:11504: result: $LD_MODEL" >&5
11505 echo "${ECHO_T}$LD_MODEL" >&6
11506
11507 LD_RPATH_OPT=
11508 if test "x$cf_cv_enable_rpath" != xno
11509 then
11510         echo "$as_me:11510: checking for an rpath option" >&5
11511 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11512         case "$cf_cv_system_name" in
11513         (irix*)
11514                 if test "$GCC" = yes; then
11515                         LD_RPATH_OPT="-Wl,-rpath,"
11516                 else
11517                         LD_RPATH_OPT="-rpath "
11518                 fi
11519                 ;;
11520         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11521                 LD_RPATH_OPT="-Wl,-rpath,"
11522                 ;;
11523         (openbsd[2-9].*|mirbsd*)
11524                 LD_RPATH_OPT="-Wl,-rpath,"
11525                 ;;
11526         (dragonfly*)
11527                 LD_RPATH_OPT="-rpath "
11528                 ;;
11529         (netbsd*)
11530                 LD_RPATH_OPT="-Wl,-rpath,"
11531                 ;;
11532         (osf*|mls+*)
11533                 LD_RPATH_OPT="-rpath "
11534                 ;;
11535         (solaris2*)
11536                 LD_RPATH_OPT="-R"
11537                 ;;
11538         (*)
11539                 ;;
11540         esac
11541         echo "$as_me:11541: result: $LD_RPATH_OPT" >&5
11542 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11543
11544         case "x$LD_RPATH_OPT" in
11545         (x-R*)
11546                 echo "$as_me:11546: checking if we need a space after rpath option" >&5
11547 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11548                 cf_save_LIBS="$LIBS"
11549
11550 cf_add_libs="$LIBS"
11551 # reverse order
11552 cf_add_0lib=
11553 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11554 # filter duplicates
11555 for cf_add_1lib in $cf_add_0lib; do
11556         for cf_add_2lib in $cf_add_libs; do
11557                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11558                         cf_add_1lib=
11559                         break
11560                 fi
11561         done
11562         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11563 done
11564 LIBS="$cf_add_libs"
11565
11566                 cat >"conftest.$ac_ext" <<_ACEOF
11567 #line 11567 "configure"
11568 #include "confdefs.h"
11569
11570 int
11571 main (void)
11572 {
11573
11574   ;
11575   return 0;
11576 }
11577 _ACEOF
11578 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11579 if { (eval echo "$as_me:11579: \"$ac_link\"") >&5
11580   (eval $ac_link) 2>&5
11581   ac_status=$?
11582   echo "$as_me:11582: \$? = $ac_status" >&5
11583   (exit "$ac_status"); } &&
11584          { ac_try='test -s "conftest$ac_exeext"'
11585   { (eval echo "$as_me:11585: \"$ac_try\"") >&5
11586   (eval $ac_try) 2>&5
11587   ac_status=$?
11588   echo "$as_me:11588: \$? = $ac_status" >&5
11589   (exit "$ac_status"); }; }; then
11590   cf_rpath_space=no
11591 else
11592   echo "$as_me: failed program was:" >&5
11593 cat "conftest.$ac_ext" >&5
11594 cf_rpath_space=yes
11595 fi
11596 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11597                 LIBS="$cf_save_LIBS"
11598                 echo "$as_me:11598: result: $cf_rpath_space" >&5
11599 echo "${ECHO_T}$cf_rpath_space" >&6
11600                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11601                 ;;
11602         esac
11603 fi
11604
11605         RM_SHARED_OPTS=
11606         LOCAL_LDFLAGS=
11607         LOCAL_LDFLAGS2=
11608         LD_SHARED_OPTS=
11609         INSTALL_LIB="-m 644"
11610         : ${rel_builddir:=.}
11611
11612         shlibdir=$libdir
11613
11614         MAKE_DLLS="#"
11615
11616         cf_cv_do_symlinks=no
11617         cf_ld_rpath_opt=
11618         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11619
11620         echo "$as_me:11620: checking if release/abi version should be used for shared libs" >&5
11621 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11622
11623 # Check whether --with-shlib-version or --without-shlib-version was given.
11624 if test "${with_shlib_version+set}" = set; then
11625   withval="$with_shlib_version"
11626   test -z "$withval" && withval=auto
11627         case "$withval" in
11628         (yes)
11629                 cf_cv_shlib_version=auto
11630                 ;;
11631         (rel|abi|auto)
11632                 cf_cv_shlib_version=$withval
11633                 ;;
11634         (*)
11635                 echo "$as_me:11635: result: $withval" >&5
11636 echo "${ECHO_T}$withval" >&6
11637                 { { echo "$as_me:11637: error: option value must be one of: rel, abi, or auto" >&5
11638 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11639    { (exit 1); exit 1; }; }
11640                 ;;
11641         esac
11642
11643 else
11644   cf_cv_shlib_version=auto
11645 fi;
11646         echo "$as_me:11646: result: $cf_cv_shlib_version" >&5
11647 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11648
11649         cf_cv_rm_so_locs=no
11650         cf_try_cflags=
11651
11652         # Some less-capable ports of gcc support only -fpic
11653         CC_SHARED_OPTS=
11654
11655         cf_try_fPIC=no
11656         if test "$GCC" = yes
11657         then
11658                 cf_try_fPIC=yes
11659         else
11660                 case "$cf_cv_system_name" in
11661                 (*linux*)       # e.g., PGI compiler
11662                         cf_try_fPIC=yes
11663                         ;;
11664                 esac
11665         fi
11666
11667         if test "$cf_try_fPIC" = yes
11668         then
11669                 echo "$as_me:11669: checking which $CC option to use" >&5
11670 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11671                 cf_save_CFLAGS="$CFLAGS"
11672                 for CC_SHARED_OPTS in -fPIC -fpic ''
11673                 do
11674                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11675                         cat >"conftest.$ac_ext" <<_ACEOF
11676 #line 11676 "configure"
11677 #include "confdefs.h"
11678 #include <stdio.h>
11679 int
11680 main (void)
11681 {
11682 int x = 1
11683   ;
11684   return 0;
11685 }
11686 _ACEOF
11687 rm -f "conftest.$ac_objext"
11688 if { (eval echo "$as_me:11688: \"$ac_compile\"") >&5
11689   (eval $ac_compile) 2>&5
11690   ac_status=$?
11691   echo "$as_me:11691: \$? = $ac_status" >&5
11692   (exit "$ac_status"); } &&
11693          { ac_try='test -s "conftest.$ac_objext"'
11694   { (eval echo "$as_me:11694: \"$ac_try\"") >&5
11695   (eval $ac_try) 2>&5
11696   ac_status=$?
11697   echo "$as_me:11697: \$? = $ac_status" >&5
11698   (exit "$ac_status"); }; }; then
11699   break
11700 else
11701   echo "$as_me: failed program was:" >&5
11702 cat "conftest.$ac_ext" >&5
11703 fi
11704 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11705                 done
11706                 echo "$as_me:11706: result: $CC_SHARED_OPTS" >&5
11707 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11708                 CFLAGS="$cf_save_CFLAGS"
11709         fi
11710
11711         cf_cv_shlib_version_infix=no
11712
11713         case "$cf_cv_system_name" in
11714         (aix4.3-9*|aix[5-7]*)
11715                 if test "$GCC" = yes; then
11716                         CC_SHARED_OPTS='-Wl,-brtl'
11717                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11718                 else
11719                         CC_SHARED_OPTS='-brtl'
11720                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11721                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11722                 fi
11723                 ;;
11724         (beos*)
11725                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11726                 ;;
11727         (cygwin*)
11728                 CC_SHARED_OPTS=
11729                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11730                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11731                 cf_cv_shlib_version=cygdll
11732                 cf_cv_shlib_version_infix=cygdll
11733                 shlibdir=$bindir
11734                 MAKE_DLLS=
11735                 cat >mk_shared_lib.sh <<-CF_EOF
11736                 #!$SHELL
11737                 SHARED_LIB=\$1
11738                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11739                 shift
11740                 cat <<-EOF
11741                 Linking shared library
11742                 ** SHARED_LIB \$SHARED_LIB
11743                 ** IMPORT_LIB \$IMPORT_LIB
11744 EOF
11745                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11746 CF_EOF
11747                 chmod +x mk_shared_lib.sh
11748                 ;;
11749         (msys*)
11750                 CC_SHARED_OPTS=
11751                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11752                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11753                 cf_cv_shlib_version=msysdll
11754                 cf_cv_shlib_version_infix=msysdll
11755                 shlibdir=$bindir
11756                 MAKE_DLLS=
11757                 cat >mk_shared_lib.sh <<-CF_EOF
11758                 #!$SHELL
11759                 SHARED_LIB=\$1
11760                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11761                 shift
11762                 cat <<-EOF
11763                 Linking shared library
11764                 ** SHARED_LIB \$SHARED_LIB
11765                 ** IMPORT_LIB \$IMPORT_LIB
11766 EOF
11767                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11768 CF_EOF
11769                 chmod +x mk_shared_lib.sh
11770                 ;;
11771         (darwin*)
11772                 cf_try_cflags="no-cpp-precomp"
11773                 CC_SHARED_OPTS="-dynamic"
11774                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11775                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11776                 cf_cv_shlib_version_infix=yes
11777                 echo "$as_me:11777: checking if ld -search_paths_first works" >&5
11778 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11779 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11780   echo $ECHO_N "(cached) $ECHO_C" >&6
11781 else
11782
11783                         cf_save_LDFLAGS=$LDFLAGS
11784                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11785                         cat >"conftest.$ac_ext" <<_ACEOF
11786 #line 11786 "configure"
11787 #include "confdefs.h"
11788
11789 int
11790 main (void)
11791 {
11792 int i;
11793   ;
11794   return 0;
11795 }
11796 _ACEOF
11797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11798 if { (eval echo "$as_me:11798: \"$ac_link\"") >&5
11799   (eval $ac_link) 2>&5
11800   ac_status=$?
11801   echo "$as_me:11801: \$? = $ac_status" >&5
11802   (exit "$ac_status"); } &&
11803          { ac_try='test -s "conftest$ac_exeext"'
11804   { (eval echo "$as_me:11804: \"$ac_try\"") >&5
11805   (eval $ac_try) 2>&5
11806   ac_status=$?
11807   echo "$as_me:11807: \$? = $ac_status" >&5
11808   (exit "$ac_status"); }; }; then
11809   cf_cv_ldflags_search_paths_first=yes
11810 else
11811   echo "$as_me: failed program was:" >&5
11812 cat "conftest.$ac_ext" >&5
11813 cf_cv_ldflags_search_paths_first=no
11814 fi
11815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11816                                 LDFLAGS=$cf_save_LDFLAGS
11817 fi
11818 echo "$as_me:11818: result: $cf_cv_ldflags_search_paths_first" >&5
11819 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11820                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11821                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11822                 fi
11823                 ;;
11824         (haiku*)
11825
11826         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11827         if test "$cf_cv_shlib_version" = rel; then
11828                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11829         else
11830                 cf_cv_shared_soname='`basename $@`'
11831         fi
11832
11833                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11834                 ;;
11835         (hpux[7-8]*)
11836                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11837                 if test "$GCC" != yes; then
11838                         CC_SHARED_OPTS='+Z'
11839                 fi
11840                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11841                 INSTALL_LIB="-m 555"
11842                 ;;
11843         (hpux*)
11844                 # (tested with gcc 2.7.2 -- I don't have c89)
11845                 if test "$GCC" = yes; then
11846                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11847                 else
11848                         CC_SHARED_OPTS='+Z'
11849                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11850                 fi
11851                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11852                 # HP-UX shared libraries must be executable, and should be
11853                 # readonly to exploit a quirk in the memory manager.
11854                 INSTALL_LIB="-m 555"
11855                 ;;
11856         (interix*)
11857                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11858                 if test "$cf_cv_shlib_version" = rel; then
11859                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11860                 else
11861                         cf_shared_soname='`basename $@`'
11862                 fi
11863                 CC_SHARED_OPTS=
11864                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11865                 ;;
11866         (irix*)
11867                 if test "$cf_cv_enable_rpath" = yes ; then
11868                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11869                 fi
11870                 # tested with IRIX 5.2 and 'cc'.
11871                 if test "$GCC" != yes; then
11872                         CC_SHARED_OPTS='-KPIC'
11873                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11874                 else
11875                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11876                 fi
11877                 cf_cv_rm_so_locs=yes
11878                 ;;
11879         (linux*|gnu*|k*bsd*-gnu)
11880                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11881                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11882                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11883                 fi
11884                 if test "$cf_cv_enable_rpath" = yes ; then
11885                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11886                 fi
11887
11888         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11889         if test "$cf_cv_shlib_version" = rel; then
11890                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11891         else
11892                 cf_cv_shared_soname='`basename $@`'
11893         fi
11894
11895                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11896                 ;;
11897         (mingw*msvc*)
11898                 cf_cv_shlib_version=msvcdll
11899                 cf_cv_shlib_version_infix=msvcdll
11900                 shlibdir=$bindir
11901                 MAKE_DLLS=
11902                 if test "$DFT_LWR_MODEL" = "shared" ; then
11903                         LOCAL_LDFLAGS="-link -dll"
11904                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11905                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11906                 fi
11907                 CC_SHARED_OPTS=
11908                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11909                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11910                 cat >mk_shared_lib.sh <<-CF_EOF
11911                 #!$SHELL
11912                 SHARED_LIB=\$1
11913                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11914                 shift
11915                 my_ld=\$1
11916                 shift
11917                 cat <<-EOF
11918                 Linking shared library
11919                 ** SHARED LIB \$SHARED_LIB
11920                 ** IMPORT_LIB \$IMPORT_LIB
11921 EOF
11922                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11923                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11924                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11925 CF_EOF
11926                 chmod +x mk_shared_lib.sh
11927                 cat >mk_prog.sh <<-CF_EOF
11928                 #!$SHELL
11929                 shift
11930                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11931                 LD="$LD"
11932                 clopts=()
11933                 ldopts=("/subsystem:console")
11934                 libs=()
11935                 isdll=0
11936                 while test \$# -gt 0; do
11937                         case "\$1" in
11938                                 -link)
11939                                         # ignore -link argument
11940                                         ;;
11941                                 -M[TD] | -M[TD]d)
11942                                         # ignore runtime-library option
11943                                         ;;
11944                                 -dll)
11945                                         isdll=1
11946                                         ;;
11947                                 -W* | -w*)
11948                                         # ignore warnings
11949                                         ;;
11950                                 -D*)
11951                                         clopts+=("\$1")
11952                                         ;;
11953                                 -I*)
11954                                         clopts+=("\$1")
11955                                         ;;
11956                                 -l*)
11957                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11958                                         ;;
11959                                 -L*)
11960                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11961                                         ;;
11962                                 *.obj | *.o)
11963                                         ldopts+=("\$1")
11964                                         ;;
11965                                 -Wl,*)
11966                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11967                                                 ldopts+=("\${linkarg}")
11968                                         done
11969                                         ;;
11970                                 *.lib)
11971                                         ldopts+=("\$1")
11972                                         ;;
11973                                 -o)
11974                                         shift
11975                                         ldopts+=("-out:\$1")
11976                                         ;;
11977                                 *)
11978                                         clopts+=("\$1")
11979                                         ldopts+=("\$1")
11980                                         ;;
11981                         esac
11982                         shift
11983                 done
11984                 if [ "\$isdll" -ne 0 ]; then
11985                         for lib in \${libs[*]}; do
11986                                 ldopts+=("\$lib.dll.lib")
11987                         done
11988                 else
11989                         for lib in \${libs[*]}; do
11990                                 ldopts+=("\$lib.lib")
11991                         done
11992                 fi
11993                 cat <<-EOF
11994                 Creating program
11995                 ** ld options:   "\${ldopts[@]}"
11996 EOF
11997                 exec \$LD \${ldopts[@]}
11998 CF_EOF
11999                 chmod +x mk_prog.sh
12000                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12001                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12002                 ;;
12003         (mingw*)
12004                 cf_cv_shlib_version=mingw
12005                 cf_cv_shlib_version_infix=mingw
12006                 shlibdir=$bindir
12007                 MAKE_DLLS=
12008                 if test "$DFT_LWR_MODEL" = "shared" ; then
12009                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12010                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12011                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12012                 fi
12013                 CC_SHARED_OPTS=
12014                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12015                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12016                 cat >mk_shared_lib.sh <<-CF_EOF
12017                 #!$SHELL
12018                 SHARED_LIB=\$1
12019                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12020                 shift
12021                 cat <<-EOF
12022                 Linking shared library
12023                 ** SHARED_LIB \$SHARED_LIB
12024                 ** IMPORT_LIB \$IMPORT_LIB
12025 EOF
12026                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12027 CF_EOF
12028                 chmod +x mk_shared_lib.sh
12029                 ;;
12030         (openbsd[2-9].*|mirbsd*)
12031                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12032                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12033                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12034                 fi
12035                 if test "$cf_cv_enable_rpath" = yes ; then
12036                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12037                 fi
12038                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12039
12040         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12041         if test "$cf_cv_shlib_version" = rel; then
12042                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12043         else
12044                 cf_cv_shared_soname='`basename $@`'
12045         fi
12046
12047                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12048                 ;;
12049         (nskJ*)
12050                 CC_SHARED_OPTS=
12051                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12052                 ;;
12053         (nskL*)
12054                 CC_SHARED_OPTS=
12055                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12056                 ;;
12057         (nto-qnx*|openbsd*|freebsd[12].*)
12058                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12059                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12060                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12061                 ;;
12062         (dragonfly*|freebsd*)
12063                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12064                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12065                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12066                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12067                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12068                 fi
12069
12070         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12071         if test "$cf_cv_shlib_version" = rel; then
12072                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12073         else
12074                 cf_cv_shared_soname='`basename $@`'
12075         fi
12076
12077                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12078                 ;;
12079         (netbsd*)
12080                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12081                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12082                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12083                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12084                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12085                         if test "$cf_cv_shlib_version" = auto; then
12086                         if test -f /usr/libexec/ld.elf_so; then
12087                                 cf_cv_shlib_version=abi
12088                         else
12089                                 cf_cv_shlib_version=rel
12090                         fi
12091                         fi
12092
12093         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12094         if test "$cf_cv_shlib_version" = rel; then
12095                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12096         else
12097                 cf_cv_shared_soname='`basename $@`'
12098         fi
12099
12100                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12101                 else
12102                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12103                 fi
12104                 ;;
12105         (osf*|mls+*)
12106                 # tested with OSF/1 V3.2 and 'cc'
12107                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12108                 # link with shared libs).
12109                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12110                 case "$host_os" in
12111                 (osf4*)
12112                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12113                         ;;
12114                 esac
12115                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12116                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12117                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12118                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12119                 fi
12120                 cf_cv_rm_so_locs=yes
12121                 ;;
12122         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12123                 # tested with osr5.0.5
12124                 if test "$GCC" != yes; then
12125                         CC_SHARED_OPTS='-belf -KPIC'
12126                 fi
12127                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12128                 if test "$cf_cv_enable_rpath" = yes ; then
12129                         # only way is to set LD_RUN_PATH but no switch for it
12130                         RUN_PATH=$libdir
12131                 fi
12132                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12133                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12134                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12135                 ;;
12136         (sunos4*)
12137                 # tested with SunOS 4.1.1 and gcc 2.7.0
12138                 if test "$GCC" != yes; then
12139                         CC_SHARED_OPTS='-KPIC'
12140                 fi
12141                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12142                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12143                 ;;
12144         (solaris2*)
12145                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12146                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12147                 if test "$DFT_LWR_MODEL" = "shared" ; then
12148                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12149                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12150                 fi
12151                 if test "$cf_cv_enable_rpath" = yes ; then
12152                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12153                 fi
12154
12155         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12156         if test "$cf_cv_shlib_version" = rel; then
12157                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12158         else
12159                 cf_cv_shared_soname='`basename $@`'
12160         fi
12161
12162                 if test "$GCC" != yes; then
12163                         cf_save_CFLAGS="$CFLAGS"
12164                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12165                         do
12166                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12167                                 cat >"conftest.$ac_ext" <<_ACEOF
12168 #line 12168 "configure"
12169 #include "confdefs.h"
12170 #include <stdio.h>
12171 int
12172 main (void)
12173 {
12174 printf("Hello\\n");
12175   ;
12176   return 0;
12177 }
12178 _ACEOF
12179 rm -f "conftest.$ac_objext"
12180 if { (eval echo "$as_me:12180: \"$ac_compile\"") >&5
12181   (eval $ac_compile) 2>&5
12182   ac_status=$?
12183   echo "$as_me:12183: \$? = $ac_status" >&5
12184   (exit "$ac_status"); } &&
12185          { ac_try='test -s "conftest.$ac_objext"'
12186   { (eval echo "$as_me:12186: \"$ac_try\"") >&5
12187   (eval $ac_try) 2>&5
12188   ac_status=$?
12189   echo "$as_me:12189: \$? = $ac_status" >&5
12190   (exit "$ac_status"); }; }; then
12191   break
12192 else
12193   echo "$as_me: failed program was:" >&5
12194 cat "conftest.$ac_ext" >&5
12195 fi
12196 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12197                         done
12198                         CFLAGS="$cf_save_CFLAGS"
12199                         CC_SHARED_OPTS=$cf_shared_opts
12200                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12201                 else
12202                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12203                 fi
12204                 ;;
12205         (sysv5uw7*|unix_sv*)
12206                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12207                 if test "$GCC" != yes; then
12208                         CC_SHARED_OPTS='-KPIC'
12209                 fi
12210                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12211                 ;;
12212         (*)
12213                 CC_SHARED_OPTS='unknown'
12214                 MK_SHARED_LIB='echo unknown'
12215                 ;;
12216         esac
12217
12218         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12219         case "$cf_cv_shlib_version" in
12220         (rel|abi)
12221                 case "$MK_SHARED_LIB" in
12222                 (*'-o $@')
12223                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12224                         ;;
12225                 (*)
12226                         { echo "$as_me:12226: WARNING: ignored --with-shlib-version" >&5
12227 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12228                         ;;
12229                 esac
12230                 ;;
12231         esac
12232
12233         if test -n "$cf_try_cflags"
12234         then
12235 cat > conftest.$ac_ext <<EOF
12236 #line 12236 "${as_me:-configure}"
12237 #include <stdio.h>
12238 int main(int argc, char *argv[])
12239 {
12240         printf("hello\\n");
12241         return (argv[argc-1] == 0) ;
12242 }
12243 EOF
12244                 cf_save_CFLAGS="$CFLAGS"
12245                 for cf_opt in $cf_try_cflags
12246                 do
12247                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12248                         echo "$as_me:12248: checking if CFLAGS option -$cf_opt works" >&5
12249 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12250                         if { (eval echo "$as_me:12250: \"$ac_compile\"") >&5
12251   (eval $ac_compile) 2>&5
12252   ac_status=$?
12253   echo "$as_me:12253: \$? = $ac_status" >&5
12254   (exit "$ac_status"); }; then
12255                                 echo "$as_me:12255: result: yes" >&5
12256 echo "${ECHO_T}yes" >&6
12257                                 cf_save_CFLAGS="$CFLAGS"
12258                         else
12259                                 echo "$as_me:12259: result: no" >&5
12260 echo "${ECHO_T}no" >&6
12261                         fi
12262                 done
12263                 CFLAGS="$cf_save_CFLAGS"
12264         fi
12265
12266         # RPATH_LIST is a colon-separated list of directories
12267         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12268         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12269
12270         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12271
12272         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12273
12274 echo "${as_me:-configure}:12274: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12275
12276         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12277
12278 echo "${as_me:-configure}:12278: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12279
12280 # The test/sample programs in the original tree link using rpath option.
12281 # Make it optional for packagers.
12282 if test -n "$LOCAL_LDFLAGS"
12283 then
12284         echo "$as_me:12284: checking if you want to link sample programs with rpath option" >&5
12285 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12286
12287 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12288 if test "${enable_rpath_link+set}" = set; then
12289   enableval="$enable_rpath_link"
12290   with_rpath_link=$enableval
12291 else
12292   with_rpath_link=yes
12293 fi;
12294         echo "$as_me:12294: result: $with_rpath_link" >&5
12295 echo "${ECHO_T}$with_rpath_link" >&6
12296         if test "$with_rpath_link" = no
12297         then
12298                 LOCAL_LDFLAGS=
12299                 LOCAL_LDFLAGS2=
12300         fi
12301 fi
12302
12303 ###############################################################################
12304
12305 ###   use option --enable-broken-linker to force on use of broken-linker support
12306
12307 echo "$as_me:12307: checking if you want broken-linker support code" >&5
12308 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12309
12310 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12311 if test "${enable_broken_linker+set}" = set; then
12312   enableval="$enable_broken_linker"
12313   with_broken_linker=$enableval
12314 else
12315   with_broken_linker=no
12316 fi;
12317 echo "$as_me:12317: result: $with_broken_linker" >&5
12318 echo "${ECHO_T}$with_broken_linker" >&6
12319
12320 : "${BROKEN_LINKER:=0}"
12321 if test "x$with_broken_linker" = xyes ; then
12322
12323 cat >>confdefs.h <<\EOF
12324 #define BROKEN_LINKER 1
12325 EOF
12326
12327         BROKEN_LINKER=1
12328 fi
12329
12330 # Check to define _XOPEN_SOURCE "automatically"
12331
12332 echo "$as_me:12332: checking if the POSIX test-macros are already defined" >&5
12333 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12334 if test "${cf_cv_posix_visible+set}" = set; then
12335   echo $ECHO_N "(cached) $ECHO_C" >&6
12336 else
12337
12338 cat >"conftest.$ac_ext" <<_ACEOF
12339 #line 12339 "configure"
12340 #include "confdefs.h"
12341 #include <stdio.h>
12342 int
12343 main (void)
12344 {
12345
12346 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12347         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12348         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12349         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12350 #error conflicting symbols found
12351 #endif
12352
12353   ;
12354   return 0;
12355 }
12356 _ACEOF
12357 rm -f "conftest.$ac_objext"
12358 if { (eval echo "$as_me:12358: \"$ac_compile\"") >&5
12359   (eval $ac_compile) 2>&5
12360   ac_status=$?
12361   echo "$as_me:12361: \$? = $ac_status" >&5
12362   (exit "$ac_status"); } &&
12363          { ac_try='test -s "conftest.$ac_objext"'
12364   { (eval echo "$as_me:12364: \"$ac_try\"") >&5
12365   (eval $ac_try) 2>&5
12366   ac_status=$?
12367   echo "$as_me:12367: \$? = $ac_status" >&5
12368   (exit "$ac_status"); }; }; then
12369   cf_cv_posix_visible=no
12370 else
12371   echo "$as_me: failed program was:" >&5
12372 cat "conftest.$ac_ext" >&5
12373 cf_cv_posix_visible=yes
12374 fi
12375 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12376
12377 fi
12378 echo "$as_me:12378: result: $cf_cv_posix_visible" >&5
12379 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12380
12381 if test "$cf_cv_posix_visible" = no; then
12382
12383 cf_XOPEN_SOURCE=600
12384 cf_POSIX_C_SOURCE=199506L
12385 cf_xopen_source=
12386
12387 case "$host_os" in
12388 (aix[4-7]*)
12389         cf_xopen_source="-D_ALL_SOURCE"
12390         ;;
12391 (msys)
12392         cf_XOPEN_SOURCE=600
12393         ;;
12394 (darwin[0-8].*)
12395         cf_xopen_source="-D_APPLE_C_SOURCE"
12396         ;;
12397 (darwin*)
12398         cf_xopen_source="-D_DARWIN_C_SOURCE"
12399         cf_XOPEN_SOURCE=
12400         ;;
12401 (freebsd*|dragonfly*|midnightbsd*)
12402         # 5.x headers associate
12403         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12404         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12405         cf_POSIX_C_SOURCE=200112L
12406         cf_XOPEN_SOURCE=600
12407         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12408         ;;
12409 (hpux11*)
12410         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12411         ;;
12412 (hpux*)
12413         cf_xopen_source="-D_HPUX_SOURCE"
12414         ;;
12415 (irix[56].*)
12416         cf_xopen_source="-D_SGI_SOURCE"
12417         cf_XOPEN_SOURCE=
12418         ;;
12419 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12420
12421 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12422
12423 echo "$as_me:12423: checking if this is the GNU C library" >&5
12424 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12425 if test "${cf_cv_gnu_library+set}" = set; then
12426   echo $ECHO_N "(cached) $ECHO_C" >&6
12427 else
12428
12429 cat >"conftest.$ac_ext" <<_ACEOF
12430 #line 12430 "configure"
12431 #include "confdefs.h"
12432 #include <sys/types.h>
12433 int
12434 main (void)
12435 {
12436
12437         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12438                 return 0;
12439         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12440                 return 0;
12441         #else
12442         #       error not GNU C library
12443         #endif
12444   ;
12445   return 0;
12446 }
12447 _ACEOF
12448 rm -f "conftest.$ac_objext"
12449 if { (eval echo "$as_me:12449: \"$ac_compile\"") >&5
12450   (eval $ac_compile) 2>&5
12451   ac_status=$?
12452   echo "$as_me:12452: \$? = $ac_status" >&5
12453   (exit "$ac_status"); } &&
12454          { ac_try='test -s "conftest.$ac_objext"'
12455   { (eval echo "$as_me:12455: \"$ac_try\"") >&5
12456   (eval $ac_try) 2>&5
12457   ac_status=$?
12458   echo "$as_me:12458: \$? = $ac_status" >&5
12459   (exit "$ac_status"); }; }; then
12460   cf_cv_gnu_library=yes
12461 else
12462   echo "$as_me: failed program was:" >&5
12463 cat "conftest.$ac_ext" >&5
12464 cf_cv_gnu_library=no
12465 fi
12466 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12467
12468 fi
12469 echo "$as_me:12469: result: $cf_cv_gnu_library" >&5
12470 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12471
12472 if test x$cf_cv_gnu_library = xyes; then
12473
12474         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12475         # was changed to help a little.  newlib incorporated the change about 4
12476         # years later.
12477         echo "$as_me:12477: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12478 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12479 if test "${cf_cv_gnu_library_219+set}" = set; then
12480   echo $ECHO_N "(cached) $ECHO_C" >&6
12481 else
12482
12483                 cf_save="$CPPFLAGS"
12484
12485         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12486         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12487
12488                 cat >"conftest.$ac_ext" <<_ACEOF
12489 #line 12489 "configure"
12490 #include "confdefs.h"
12491 #include <sys/types.h>
12492 int
12493 main (void)
12494 {
12495
12496                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12497                                 return 0;
12498                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12499                                 return 0;
12500                         #else
12501                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12502                         #endif
12503   ;
12504   return 0;
12505 }
12506 _ACEOF
12507 rm -f "conftest.$ac_objext"
12508 if { (eval echo "$as_me:12508: \"$ac_compile\"") >&5
12509   (eval $ac_compile) 2>&5
12510   ac_status=$?
12511   echo "$as_me:12511: \$? = $ac_status" >&5
12512   (exit "$ac_status"); } &&
12513          { ac_try='test -s "conftest.$ac_objext"'
12514   { (eval echo "$as_me:12514: \"$ac_try\"") >&5
12515   (eval $ac_try) 2>&5
12516   ac_status=$?
12517   echo "$as_me:12517: \$? = $ac_status" >&5
12518   (exit "$ac_status"); }; }; then
12519   cf_cv_gnu_library_219=yes
12520 else
12521   echo "$as_me: failed program was:" >&5
12522 cat "conftest.$ac_ext" >&5
12523 cf_cv_gnu_library_219=no
12524 fi
12525 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12526                 CPPFLAGS="$cf_save"
12527
12528 fi
12529 echo "$as_me:12529: result: $cf_cv_gnu_library_219" >&5
12530 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12531
12532         if test "x$cf_cv_gnu_library_219" = xyes; then
12533                 cf_save="$CPPFLAGS"
12534                 echo "$as_me:12534: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12535 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12536 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12537   echo $ECHO_N "(cached) $ECHO_C" >&6
12538 else
12539
12540 cf_fix_cppflags=no
12541 cf_new_cflags=
12542 cf_new_cppflags=
12543 cf_new_extra_cppflags=
12544
12545 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12546 do
12547 case "$cf_fix_cppflags" in
12548 (no)
12549         case "$cf_add_cflags" in
12550         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12551                 case "$cf_add_cflags" in
12552                 (-D*)
12553                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12554
12555                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12556                                 && test -z "${cf_tst_cflags}" \
12557                                 && cf_fix_cppflags=yes
12558
12559                         if test "$cf_fix_cppflags" = yes ; then
12560
12561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12563
12564                                 continue
12565                         elif test "${cf_tst_cflags}" = "\"'" ; then
12566
12567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12569
12570                                 continue
12571                         fi
12572                         ;;
12573                 esac
12574                 case "$CPPFLAGS" in
12575                 (*$cf_add_cflags)
12576                         ;;
12577                 (*)
12578                         case "$cf_add_cflags" in
12579                         (-D*)
12580                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12581
12582 CPPFLAGS=`echo "$CPPFLAGS" | \
12583         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12584                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12585
12586                                 ;;
12587                         esac
12588
12589         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12590         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12591
12592                         ;;
12593                 esac
12594                 ;;
12595         (*)
12596
12597         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12598         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12599
12600                 ;;
12601         esac
12602         ;;
12603 (yes)
12604
12605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12607
12608         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12609
12610         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12611                 && test -z "${cf_tst_cflags}" \
12612                 && cf_fix_cppflags=no
12613         ;;
12614 esac
12615 done
12616
12617 if test -n "$cf_new_cflags" ; then
12618
12619         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12620         CFLAGS="${CFLAGS}$cf_new_cflags"
12621
12622 fi
12623
12624 if test -n "$cf_new_cppflags" ; then
12625
12626         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12627         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12628
12629 fi
12630
12631 if test -n "$cf_new_extra_cppflags" ; then
12632
12633         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12634         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12635
12636 fi
12637
12638                         cat >"conftest.$ac_ext" <<_ACEOF
12639 #line 12639 "configure"
12640 #include "confdefs.h"
12641
12642                                 #include <limits.h>
12643                                 #include <sys/types.h>
12644
12645 int
12646 main (void)
12647 {
12648
12649                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12650                                         return 0;
12651                                 #else
12652                                 #       error GNU C library is too old
12653                                 #endif
12654   ;
12655   return 0;
12656 }
12657 _ACEOF
12658 rm -f "conftest.$ac_objext"
12659 if { (eval echo "$as_me:12659: \"$ac_compile\"") >&5
12660   (eval $ac_compile) 2>&5
12661   ac_status=$?
12662   echo "$as_me:12662: \$? = $ac_status" >&5
12663   (exit "$ac_status"); } &&
12664          { ac_try='test -s "conftest.$ac_objext"'
12665   { (eval echo "$as_me:12665: \"$ac_try\"") >&5
12666   (eval $ac_try) 2>&5
12667   ac_status=$?
12668   echo "$as_me:12668: \$? = $ac_status" >&5
12669   (exit "$ac_status"); }; }; then
12670   cf_cv_gnu_dftsrc_219=yes
12671 else
12672   echo "$as_me: failed program was:" >&5
12673 cat "conftest.$ac_ext" >&5
12674 cf_cv_gnu_dftsrc_219=no
12675 fi
12676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12677
12678 fi
12679 echo "$as_me:12679: result: $cf_cv_gnu_dftsrc_219" >&5
12680 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12681                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12682         else
12683                 cf_cv_gnu_dftsrc_219=maybe
12684         fi
12685
12686         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12687
12688                 echo "$as_me:12688: checking if we must define _GNU_SOURCE" >&5
12689 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12690 if test "${cf_cv_gnu_source+set}" = set; then
12691   echo $ECHO_N "(cached) $ECHO_C" >&6
12692 else
12693
12694                 cat >"conftest.$ac_ext" <<_ACEOF
12695 #line 12695 "configure"
12696 #include "confdefs.h"
12697 #include <sys/types.h>
12698 int
12699 main (void)
12700 {
12701
12702                         #ifndef _XOPEN_SOURCE
12703                         #error  expected _XOPEN_SOURCE to be defined
12704                         #endif
12705   ;
12706   return 0;
12707 }
12708 _ACEOF
12709 rm -f "conftest.$ac_objext"
12710 if { (eval echo "$as_me:12710: \"$ac_compile\"") >&5
12711   (eval $ac_compile) 2>&5
12712   ac_status=$?
12713   echo "$as_me:12713: \$? = $ac_status" >&5
12714   (exit "$ac_status"); } &&
12715          { ac_try='test -s "conftest.$ac_objext"'
12716   { (eval echo "$as_me:12716: \"$ac_try\"") >&5
12717   (eval $ac_try) 2>&5
12718   ac_status=$?
12719   echo "$as_me:12719: \$? = $ac_status" >&5
12720   (exit "$ac_status"); }; }; then
12721   cf_cv_gnu_source=no
12722 else
12723   echo "$as_me: failed program was:" >&5
12724 cat "conftest.$ac_ext" >&5
12725 cf_save="$CPPFLAGS"
12726
12727 cf_fix_cppflags=no
12728 cf_new_cflags=
12729 cf_new_cppflags=
12730 cf_new_extra_cppflags=
12731
12732 for cf_add_cflags in -D_GNU_SOURCE
12733 do
12734 case "$cf_fix_cppflags" in
12735 (no)
12736         case "$cf_add_cflags" in
12737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12738                 case "$cf_add_cflags" in
12739                 (-D*)
12740                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12741
12742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12743                                 && test -z "${cf_tst_cflags}" \
12744                                 && cf_fix_cppflags=yes
12745
12746                         if test "$cf_fix_cppflags" = yes ; then
12747
12748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12750
12751                                 continue
12752                         elif test "${cf_tst_cflags}" = "\"'" ; then
12753
12754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12756
12757                                 continue
12758                         fi
12759                         ;;
12760                 esac
12761                 case "$CPPFLAGS" in
12762                 (*$cf_add_cflags)
12763                         ;;
12764                 (*)
12765                         case "$cf_add_cflags" in
12766                         (-D*)
12767                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12768
12769 CPPFLAGS=`echo "$CPPFLAGS" | \
12770         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12771                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12772
12773                                 ;;
12774                         esac
12775
12776         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12777         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12778
12779                         ;;
12780                 esac
12781                 ;;
12782         (*)
12783
12784         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12785         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12786
12787                 ;;
12788         esac
12789         ;;
12790 (yes)
12791
12792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12794
12795         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12796
12797         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12798                 && test -z "${cf_tst_cflags}" \
12799                 && cf_fix_cppflags=no
12800         ;;
12801 esac
12802 done
12803
12804 if test -n "$cf_new_cflags" ; then
12805
12806         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12807         CFLAGS="${CFLAGS}$cf_new_cflags"
12808
12809 fi
12810
12811 if test -n "$cf_new_cppflags" ; then
12812
12813         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12814         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12815
12816 fi
12817
12818 if test -n "$cf_new_extra_cppflags" ; then
12819
12820         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12821         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12822
12823 fi
12824
12825                          cat >"conftest.$ac_ext" <<_ACEOF
12826 #line 12826 "configure"
12827 #include "confdefs.h"
12828 #include <sys/types.h>
12829 int
12830 main (void)
12831 {
12832
12833                                 #ifdef _XOPEN_SOURCE
12834                                 #error  expected _XOPEN_SOURCE to be undefined
12835                                 #endif
12836   ;
12837   return 0;
12838 }
12839 _ACEOF
12840 rm -f "conftest.$ac_objext"
12841 if { (eval echo "$as_me:12841: \"$ac_compile\"") >&5
12842   (eval $ac_compile) 2>&5
12843   ac_status=$?
12844   echo "$as_me:12844: \$? = $ac_status" >&5
12845   (exit "$ac_status"); } &&
12846          { ac_try='test -s "conftest.$ac_objext"'
12847   { (eval echo "$as_me:12847: \"$ac_try\"") >&5
12848   (eval $ac_try) 2>&5
12849   ac_status=$?
12850   echo "$as_me:12850: \$? = $ac_status" >&5
12851   (exit "$ac_status"); }; }; then
12852   cf_cv_gnu_source=no
12853 else
12854   echo "$as_me: failed program was:" >&5
12855 cat "conftest.$ac_ext" >&5
12856 cf_cv_gnu_source=yes
12857 fi
12858 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12859                         CPPFLAGS="$cf_save"
12860
12861 fi
12862 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12863
12864 fi
12865 echo "$as_me:12865: result: $cf_cv_gnu_source" >&5
12866 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12867
12868                 if test "$cf_cv_gnu_source" = yes
12869                 then
12870                 echo "$as_me:12870: checking if we should also define _DEFAULT_SOURCE" >&5
12871 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12872 if test "${cf_cv_default_source+set}" = set; then
12873   echo $ECHO_N "(cached) $ECHO_C" >&6
12874 else
12875
12876         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12877         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12878
12879                         cat >"conftest.$ac_ext" <<_ACEOF
12880 #line 12880 "configure"
12881 #include "confdefs.h"
12882 #include <sys/types.h>
12883 int
12884 main (void)
12885 {
12886
12887                                 #ifdef _DEFAULT_SOURCE
12888                                 #error  expected _DEFAULT_SOURCE to be undefined
12889                                 #endif
12890   ;
12891   return 0;
12892 }
12893 _ACEOF
12894 rm -f "conftest.$ac_objext"
12895 if { (eval echo "$as_me:12895: \"$ac_compile\"") >&5
12896   (eval $ac_compile) 2>&5
12897   ac_status=$?
12898   echo "$as_me:12898: \$? = $ac_status" >&5
12899   (exit "$ac_status"); } &&
12900          { ac_try='test -s "conftest.$ac_objext"'
12901   { (eval echo "$as_me:12901: \"$ac_try\"") >&5
12902   (eval $ac_try) 2>&5
12903   ac_status=$?
12904   echo "$as_me:12904: \$? = $ac_status" >&5
12905   (exit "$ac_status"); }; }; then
12906   cf_cv_default_source=no
12907 else
12908   echo "$as_me: failed program was:" >&5
12909 cat "conftest.$ac_ext" >&5
12910 cf_cv_default_source=yes
12911 fi
12912 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12913
12914 fi
12915 echo "$as_me:12915: result: $cf_cv_default_source" >&5
12916 echo "${ECHO_T}$cf_cv_default_source" >&6
12917                         if test "$cf_cv_default_source" = yes
12918                         then
12919
12920         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12921         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12922
12923                         fi
12924                 fi
12925         fi
12926
12927 fi
12928
12929         ;;
12930 (minix*)
12931         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12932         ;;
12933 (mirbsd*)
12934         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12935         cf_XOPEN_SOURCE=
12936
12937 if test "$cf_cv_posix_visible" = no; then
12938
12939 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12940
12941 cf_save_CFLAGS="$CFLAGS"
12942 cf_save_CPPFLAGS="$CPPFLAGS"
12943
12944 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12945         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12946                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12947
12948 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12949         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12950                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12951
12952 echo "$as_me:12952: checking if we should define _POSIX_C_SOURCE" >&5
12953 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12954 if test "${cf_cv_posix_c_source+set}" = set; then
12955   echo $ECHO_N "(cached) $ECHO_C" >&6
12956 else
12957
12958 echo "${as_me:-configure}:12958: testing if the symbol is already defined go no further ..." 1>&5
12959
12960         cat >"conftest.$ac_ext" <<_ACEOF
12961 #line 12961 "configure"
12962 #include "confdefs.h"
12963 #include <sys/types.h>
12964 int
12965 main (void)
12966 {
12967
12968 #ifndef _POSIX_C_SOURCE
12969 make an error
12970 #endif
12971   ;
12972   return 0;
12973 }
12974 _ACEOF
12975 rm -f "conftest.$ac_objext"
12976 if { (eval echo "$as_me:12976: \"$ac_compile\"") >&5
12977   (eval $ac_compile) 2>&5
12978   ac_status=$?
12979   echo "$as_me:12979: \$? = $ac_status" >&5
12980   (exit "$ac_status"); } &&
12981          { ac_try='test -s "conftest.$ac_objext"'
12982   { (eval echo "$as_me:12982: \"$ac_try\"") >&5
12983   (eval $ac_try) 2>&5
12984   ac_status=$?
12985   echo "$as_me:12985: \$? = $ac_status" >&5
12986   (exit "$ac_status"); }; }; then
12987   cf_cv_posix_c_source=no
12988 else
12989   echo "$as_me: failed program was:" >&5
12990 cat "conftest.$ac_ext" >&5
12991 cf_want_posix_source=no
12992          case .$cf_POSIX_C_SOURCE in
12993          (.[12]??*)
12994                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12995                 ;;
12996          (.2)
12997                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12998                 cf_want_posix_source=yes
12999                 ;;
13000          (.*)
13001                 cf_want_posix_source=yes
13002                 ;;
13003          esac
13004          if test "$cf_want_posix_source" = yes ; then
13005                 cat >"conftest.$ac_ext" <<_ACEOF
13006 #line 13006 "configure"
13007 #include "confdefs.h"
13008 #include <sys/types.h>
13009 int
13010 main (void)
13011 {
13012
13013 #ifdef _POSIX_SOURCE
13014 make an error
13015 #endif
13016   ;
13017   return 0;
13018 }
13019 _ACEOF
13020 rm -f "conftest.$ac_objext"
13021 if { (eval echo "$as_me:13021: \"$ac_compile\"") >&5
13022   (eval $ac_compile) 2>&5
13023   ac_status=$?
13024   echo "$as_me:13024: \$? = $ac_status" >&5
13025   (exit "$ac_status"); } &&
13026          { ac_try='test -s "conftest.$ac_objext"'
13027   { (eval echo "$as_me:13027: \"$ac_try\"") >&5
13028   (eval $ac_try) 2>&5
13029   ac_status=$?
13030   echo "$as_me:13030: \$? = $ac_status" >&5
13031   (exit "$ac_status"); }; }; then
13032   :
13033 else
13034   echo "$as_me: failed program was:" >&5
13035 cat "conftest.$ac_ext" >&5
13036 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13037 fi
13038 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13039          fi
13040
13041 echo "${as_me:-configure}:13041: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13042
13043          CFLAGS="$cf_trim_CFLAGS"
13044          CPPFLAGS="$cf_trim_CPPFLAGS"
13045
13046         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13047         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13048
13049 echo "${as_me:-configure}:13049: testing if the second compile does not leave our definition intact error ..." 1>&5
13050
13051          cat >"conftest.$ac_ext" <<_ACEOF
13052 #line 13052 "configure"
13053 #include "confdefs.h"
13054 #include <sys/types.h>
13055 int
13056 main (void)
13057 {
13058
13059 #ifndef _POSIX_C_SOURCE
13060 make an error
13061 #endif
13062   ;
13063   return 0;
13064 }
13065 _ACEOF
13066 rm -f "conftest.$ac_objext"
13067 if { (eval echo "$as_me:13067: \"$ac_compile\"") >&5
13068   (eval $ac_compile) 2>&5
13069   ac_status=$?
13070   echo "$as_me:13070: \$? = $ac_status" >&5
13071   (exit "$ac_status"); } &&
13072          { ac_try='test -s "conftest.$ac_objext"'
13073   { (eval echo "$as_me:13073: \"$ac_try\"") >&5
13074   (eval $ac_try) 2>&5
13075   ac_status=$?
13076   echo "$as_me:13076: \$? = $ac_status" >&5
13077   (exit "$ac_status"); }; }; then
13078   :
13079 else
13080   echo "$as_me: failed program was:" >&5
13081 cat "conftest.$ac_ext" >&5
13082 cf_cv_posix_c_source=no
13083 fi
13084 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13085          CFLAGS="$cf_save_CFLAGS"
13086          CPPFLAGS="$cf_save_CPPFLAGS"
13087
13088 fi
13089 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13090
13091 fi
13092 echo "$as_me:13092: result: $cf_cv_posix_c_source" >&5
13093 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13094
13095 if test "$cf_cv_posix_c_source" != no ; then
13096         CFLAGS="$cf_trim_CFLAGS"
13097         CPPFLAGS="$cf_trim_CPPFLAGS"
13098
13099 cf_fix_cppflags=no
13100 cf_new_cflags=
13101 cf_new_cppflags=
13102 cf_new_extra_cppflags=
13103
13104 for cf_add_cflags in $cf_cv_posix_c_source
13105 do
13106 case "$cf_fix_cppflags" in
13107 (no)
13108         case "$cf_add_cflags" in
13109         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13110                 case "$cf_add_cflags" in
13111                 (-D*)
13112                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13113
13114                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13115                                 && test -z "${cf_tst_cflags}" \
13116                                 && cf_fix_cppflags=yes
13117
13118                         if test "$cf_fix_cppflags" = yes ; then
13119
13120         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13121         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13122
13123                                 continue
13124                         elif test "${cf_tst_cflags}" = "\"'" ; then
13125
13126         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13127         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13128
13129                                 continue
13130                         fi
13131                         ;;
13132                 esac
13133                 case "$CPPFLAGS" in
13134                 (*$cf_add_cflags)
13135                         ;;
13136                 (*)
13137                         case "$cf_add_cflags" in
13138                         (-D*)
13139                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13140
13141 CPPFLAGS=`echo "$CPPFLAGS" | \
13142         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13143                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13144
13145                                 ;;
13146                         esac
13147
13148         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13149         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13150
13151                         ;;
13152                 esac
13153                 ;;
13154         (*)
13155
13156         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13157         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13158
13159                 ;;
13160         esac
13161         ;;
13162 (yes)
13163
13164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13166
13167         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13168
13169         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13170                 && test -z "${cf_tst_cflags}" \
13171                 && cf_fix_cppflags=no
13172         ;;
13173 esac
13174 done
13175
13176 if test -n "$cf_new_cflags" ; then
13177
13178         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13179         CFLAGS="${CFLAGS}$cf_new_cflags"
13180
13181 fi
13182
13183 if test -n "$cf_new_cppflags" ; then
13184
13185         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13186         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13187
13188 fi
13189
13190 if test -n "$cf_new_extra_cppflags" ; then
13191
13192         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13193         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13194
13195 fi
13196
13197 fi
13198
13199 fi # cf_cv_posix_visible
13200
13201         ;;
13202 (netbsd*)
13203         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13204         ;;
13205 (openbsd[6-9]*)
13206         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13207         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13208         # Abusing the conformance level is a workaround.
13209         { echo "$as_me:13209: WARNING: this system does not provide usable locale support" >&5
13210 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13211         cf_xopen_source="-D_BSD_SOURCE"
13212         cf_XOPEN_SOURCE=700
13213         ;;
13214 (openbsd[4-5]*)
13215         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13216         cf_xopen_source="-D_BSD_SOURCE"
13217         cf_XOPEN_SOURCE=600
13218         ;;
13219 (openbsd*)
13220         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13221         ;;
13222 (osf[45]*)
13223         cf_xopen_source="-D_OSF_SOURCE"
13224         ;;
13225 (nto-qnx*)
13226         cf_xopen_source="-D_QNX_SOURCE"
13227         ;;
13228 (sco*)
13229         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13230         ;;
13231 (solaris2.*)
13232         cf_xopen_source="-D__EXTENSIONS__"
13233         cf_cv_xopen_source=broken
13234         ;;
13235 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13236         cf_XOPEN_SOURCE=
13237         cf_POSIX_C_SOURCE=
13238         ;;
13239 (*)
13240
13241 echo "$as_me:13241: checking if we should define _XOPEN_SOURCE" >&5
13242 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13243 if test "${cf_cv_xopen_source+set}" = set; then
13244   echo $ECHO_N "(cached) $ECHO_C" >&6
13245 else
13246
13247         cat >"conftest.$ac_ext" <<_ACEOF
13248 #line 13248 "configure"
13249 #include "confdefs.h"
13250
13251 #include <stdlib.h>
13252 #include <string.h>
13253 #include <sys/types.h>
13254
13255 int
13256 main (void)
13257 {
13258
13259 #ifndef _XOPEN_SOURCE
13260 make an error
13261 #endif
13262   ;
13263   return 0;
13264 }
13265 _ACEOF
13266 rm -f "conftest.$ac_objext"
13267 if { (eval echo "$as_me:13267: \"$ac_compile\"") >&5
13268   (eval $ac_compile) 2>&5
13269   ac_status=$?
13270   echo "$as_me:13270: \$? = $ac_status" >&5
13271   (exit "$ac_status"); } &&
13272          { ac_try='test -s "conftest.$ac_objext"'
13273   { (eval echo "$as_me:13273: \"$ac_try\"") >&5
13274   (eval $ac_try) 2>&5
13275   ac_status=$?
13276   echo "$as_me:13276: \$? = $ac_status" >&5
13277   (exit "$ac_status"); }; }; then
13278   cf_cv_xopen_source=no
13279 else
13280   echo "$as_me: failed program was:" >&5
13281 cat "conftest.$ac_ext" >&5
13282 cf_save="$CPPFLAGS"
13283
13284         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13285         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13286
13287          cat >"conftest.$ac_ext" <<_ACEOF
13288 #line 13288 "configure"
13289 #include "confdefs.h"
13290
13291 #include <stdlib.h>
13292 #include <string.h>
13293 #include <sys/types.h>
13294
13295 int
13296 main (void)
13297 {
13298
13299 #ifdef _XOPEN_SOURCE
13300 make an error
13301 #endif
13302   ;
13303   return 0;
13304 }
13305 _ACEOF
13306 rm -f "conftest.$ac_objext"
13307 if { (eval echo "$as_me:13307: \"$ac_compile\"") >&5
13308   (eval $ac_compile) 2>&5
13309   ac_status=$?
13310   echo "$as_me:13310: \$? = $ac_status" >&5
13311   (exit "$ac_status"); } &&
13312          { ac_try='test -s "conftest.$ac_objext"'
13313   { (eval echo "$as_me:13313: \"$ac_try\"") >&5
13314   (eval $ac_try) 2>&5
13315   ac_status=$?
13316   echo "$as_me:13316: \$? = $ac_status" >&5
13317   (exit "$ac_status"); }; }; then
13318   cf_cv_xopen_source=no
13319 else
13320   echo "$as_me: failed program was:" >&5
13321 cat "conftest.$ac_ext" >&5
13322 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13323 fi
13324 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13325         CPPFLAGS="$cf_save"
13326
13327 fi
13328 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13329
13330 fi
13331 echo "$as_me:13331: result: $cf_cv_xopen_source" >&5
13332 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13333
13334 if test "$cf_cv_xopen_source" != no ; then
13335
13336 CFLAGS=`echo "$CFLAGS" | \
13337         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13338                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13339
13340 CPPFLAGS=`echo "$CPPFLAGS" | \
13341         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13342                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13343
13344         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13345
13346 for cf_add_cflags in $cf_temp_xopen_source
13347 do
13348         case "x$cf_add_cflags" in
13349         (x-[DU]*)
13350
13351 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13352 while true
13353 do
13354         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'`
13355         test "$CFLAGS" != "$cf_old_cflag" || break
13356
13357         CFLAGS="$cf_old_cflag"
13358 done
13359
13360 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13361 while true
13362 do
13363         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'`
13364         test "$CPPFLAGS" != "$cf_old_cflag" || break
13365
13366         CPPFLAGS="$cf_old_cflag"
13367 done
13368
13369                 ;;
13370         esac
13371
13372 cf_fix_cppflags=no
13373 cf_new_cflags=
13374 cf_new_cppflags=
13375 cf_new_extra_cppflags=
13376
13377 for cf_add_cflags in $cf_add_cflags
13378 do
13379 case "$cf_fix_cppflags" in
13380 (no)
13381         case "$cf_add_cflags" in
13382         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13383                 case "$cf_add_cflags" in
13384                 (-D*)
13385                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13386
13387                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13388                                 && test -z "${cf_tst_cflags}" \
13389                                 && cf_fix_cppflags=yes
13390
13391                         if test "$cf_fix_cppflags" = yes ; then
13392
13393         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13394         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13395
13396                                 continue
13397                         elif test "${cf_tst_cflags}" = "\"'" ; then
13398
13399         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13400         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13401
13402                                 continue
13403                         fi
13404                         ;;
13405                 esac
13406                 case "$CPPFLAGS" in
13407                 (*$cf_add_cflags)
13408                         ;;
13409                 (*)
13410                         case "$cf_add_cflags" in
13411                         (-D*)
13412                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13413
13414 CPPFLAGS=`echo "$CPPFLAGS" | \
13415         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13416                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13417
13418                                 ;;
13419                         esac
13420
13421         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13422         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13423
13424                         ;;
13425                 esac
13426                 ;;
13427         (*)
13428
13429         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13430         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13431
13432                 ;;
13433         esac
13434         ;;
13435 (yes)
13436
13437         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13438         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13439
13440         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13441
13442         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13443                 && test -z "${cf_tst_cflags}" \
13444                 && cf_fix_cppflags=no
13445         ;;
13446 esac
13447 done
13448
13449 if test -n "$cf_new_cflags" ; then
13450
13451         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13452         CFLAGS="${CFLAGS}$cf_new_cflags"
13453
13454 fi
13455
13456 if test -n "$cf_new_cppflags" ; then
13457
13458         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13459         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13460
13461 fi
13462
13463 if test -n "$cf_new_extra_cppflags" ; then
13464
13465         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13466         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13467
13468 fi
13469
13470 done
13471
13472 fi
13473
13474 if test "$cf_cv_posix_visible" = no; then
13475
13476 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13477
13478 cf_save_CFLAGS="$CFLAGS"
13479 cf_save_CPPFLAGS="$CPPFLAGS"
13480
13481 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13482         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13483                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13484
13485 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13486         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13487                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13488
13489 echo "$as_me:13489: checking if we should define _POSIX_C_SOURCE" >&5
13490 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13491 if test "${cf_cv_posix_c_source+set}" = set; then
13492   echo $ECHO_N "(cached) $ECHO_C" >&6
13493 else
13494
13495 echo "${as_me:-configure}:13495: testing if the symbol is already defined go no further ..." 1>&5
13496
13497         cat >"conftest.$ac_ext" <<_ACEOF
13498 #line 13498 "configure"
13499 #include "confdefs.h"
13500 #include <sys/types.h>
13501 int
13502 main (void)
13503 {
13504
13505 #ifndef _POSIX_C_SOURCE
13506 make an error
13507 #endif
13508   ;
13509   return 0;
13510 }
13511 _ACEOF
13512 rm -f "conftest.$ac_objext"
13513 if { (eval echo "$as_me:13513: \"$ac_compile\"") >&5
13514   (eval $ac_compile) 2>&5
13515   ac_status=$?
13516   echo "$as_me:13516: \$? = $ac_status" >&5
13517   (exit "$ac_status"); } &&
13518          { ac_try='test -s "conftest.$ac_objext"'
13519   { (eval echo "$as_me:13519: \"$ac_try\"") >&5
13520   (eval $ac_try) 2>&5
13521   ac_status=$?
13522   echo "$as_me:13522: \$? = $ac_status" >&5
13523   (exit "$ac_status"); }; }; then
13524   cf_cv_posix_c_source=no
13525 else
13526   echo "$as_me: failed program was:" >&5
13527 cat "conftest.$ac_ext" >&5
13528 cf_want_posix_source=no
13529          case .$cf_POSIX_C_SOURCE in
13530          (.[12]??*)
13531                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13532                 ;;
13533          (.2)
13534                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13535                 cf_want_posix_source=yes
13536                 ;;
13537          (.*)
13538                 cf_want_posix_source=yes
13539                 ;;
13540          esac
13541          if test "$cf_want_posix_source" = yes ; then
13542                 cat >"conftest.$ac_ext" <<_ACEOF
13543 #line 13543 "configure"
13544 #include "confdefs.h"
13545 #include <sys/types.h>
13546 int
13547 main (void)
13548 {
13549
13550 #ifdef _POSIX_SOURCE
13551 make an error
13552 #endif
13553   ;
13554   return 0;
13555 }
13556 _ACEOF
13557 rm -f "conftest.$ac_objext"
13558 if { (eval echo "$as_me:13558: \"$ac_compile\"") >&5
13559   (eval $ac_compile) 2>&5
13560   ac_status=$?
13561   echo "$as_me:13561: \$? = $ac_status" >&5
13562   (exit "$ac_status"); } &&
13563          { ac_try='test -s "conftest.$ac_objext"'
13564   { (eval echo "$as_me:13564: \"$ac_try\"") >&5
13565   (eval $ac_try) 2>&5
13566   ac_status=$?
13567   echo "$as_me:13567: \$? = $ac_status" >&5
13568   (exit "$ac_status"); }; }; then
13569   :
13570 else
13571   echo "$as_me: failed program was:" >&5
13572 cat "conftest.$ac_ext" >&5
13573 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13574 fi
13575 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13576          fi
13577
13578 echo "${as_me:-configure}:13578: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13579
13580          CFLAGS="$cf_trim_CFLAGS"
13581          CPPFLAGS="$cf_trim_CPPFLAGS"
13582
13583         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13584         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13585
13586 echo "${as_me:-configure}:13586: testing if the second compile does not leave our definition intact error ..." 1>&5
13587
13588          cat >"conftest.$ac_ext" <<_ACEOF
13589 #line 13589 "configure"
13590 #include "confdefs.h"
13591 #include <sys/types.h>
13592 int
13593 main (void)
13594 {
13595
13596 #ifndef _POSIX_C_SOURCE
13597 make an error
13598 #endif
13599   ;
13600   return 0;
13601 }
13602 _ACEOF
13603 rm -f "conftest.$ac_objext"
13604 if { (eval echo "$as_me:13604: \"$ac_compile\"") >&5
13605   (eval $ac_compile) 2>&5
13606   ac_status=$?
13607   echo "$as_me:13607: \$? = $ac_status" >&5
13608   (exit "$ac_status"); } &&
13609          { ac_try='test -s "conftest.$ac_objext"'
13610   { (eval echo "$as_me:13610: \"$ac_try\"") >&5
13611   (eval $ac_try) 2>&5
13612   ac_status=$?
13613   echo "$as_me:13613: \$? = $ac_status" >&5
13614   (exit "$ac_status"); }; }; then
13615   :
13616 else
13617   echo "$as_me: failed program was:" >&5
13618 cat "conftest.$ac_ext" >&5
13619 cf_cv_posix_c_source=no
13620 fi
13621 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13622          CFLAGS="$cf_save_CFLAGS"
13623          CPPFLAGS="$cf_save_CPPFLAGS"
13624
13625 fi
13626 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13627
13628 fi
13629 echo "$as_me:13629: result: $cf_cv_posix_c_source" >&5
13630 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13631
13632 if test "$cf_cv_posix_c_source" != no ; then
13633         CFLAGS="$cf_trim_CFLAGS"
13634         CPPFLAGS="$cf_trim_CPPFLAGS"
13635
13636 cf_fix_cppflags=no
13637 cf_new_cflags=
13638 cf_new_cppflags=
13639 cf_new_extra_cppflags=
13640
13641 for cf_add_cflags in $cf_cv_posix_c_source
13642 do
13643 case "$cf_fix_cppflags" in
13644 (no)
13645         case "$cf_add_cflags" in
13646         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13647                 case "$cf_add_cflags" in
13648                 (-D*)
13649                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13650
13651                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13652                                 && test -z "${cf_tst_cflags}" \
13653                                 && cf_fix_cppflags=yes
13654
13655                         if test "$cf_fix_cppflags" = yes ; then
13656
13657         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13658         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13659
13660                                 continue
13661                         elif test "${cf_tst_cflags}" = "\"'" ; then
13662
13663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13665
13666                                 continue
13667                         fi
13668                         ;;
13669                 esac
13670                 case "$CPPFLAGS" in
13671                 (*$cf_add_cflags)
13672                         ;;
13673                 (*)
13674                         case "$cf_add_cflags" in
13675                         (-D*)
13676                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13677
13678 CPPFLAGS=`echo "$CPPFLAGS" | \
13679         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13680                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13681
13682                                 ;;
13683                         esac
13684
13685         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13686         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13687
13688                         ;;
13689                 esac
13690                 ;;
13691         (*)
13692
13693         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13694         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13695
13696                 ;;
13697         esac
13698         ;;
13699 (yes)
13700
13701         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13702         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13703
13704         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13705
13706         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13707                 && test -z "${cf_tst_cflags}" \
13708                 && cf_fix_cppflags=no
13709         ;;
13710 esac
13711 done
13712
13713 if test -n "$cf_new_cflags" ; then
13714
13715         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13716         CFLAGS="${CFLAGS}$cf_new_cflags"
13717
13718 fi
13719
13720 if test -n "$cf_new_cppflags" ; then
13721
13722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13723         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13724
13725 fi
13726
13727 if test -n "$cf_new_extra_cppflags" ; then
13728
13729         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13730         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13731
13732 fi
13733
13734 fi
13735
13736 fi # cf_cv_posix_visible
13737
13738         ;;
13739 esac
13740
13741 if test -n "$cf_xopen_source" ; then
13742
13743 for cf_add_cflags in $cf_xopen_source
13744 do
13745         case "x$cf_add_cflags" in
13746         (x-[DU]*)
13747
13748 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13749 while true
13750 do
13751         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'`
13752         test "$CFLAGS" != "$cf_old_cflag" || break
13753         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13754
13755 echo "${as_me:-configure}:13755: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13756
13757         CFLAGS="$cf_old_cflag"
13758 done
13759
13760 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13761 while true
13762 do
13763         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'`
13764         test "$CPPFLAGS" != "$cf_old_cflag" || break
13765         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13766
13767 echo "${as_me:-configure}:13767: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13768
13769         CPPFLAGS="$cf_old_cflag"
13770 done
13771
13772                 ;;
13773         esac
13774
13775 cf_fix_cppflags=no
13776 cf_new_cflags=
13777 cf_new_cppflags=
13778 cf_new_extra_cppflags=
13779
13780 for cf_add_cflags in $cf_add_cflags
13781 do
13782 case "$cf_fix_cppflags" in
13783 (no)
13784         case "$cf_add_cflags" in
13785         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13786                 case "$cf_add_cflags" in
13787                 (-D*)
13788                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13789
13790                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13791                                 && test -z "${cf_tst_cflags}" \
13792                                 && cf_fix_cppflags=yes
13793
13794                         if test "$cf_fix_cppflags" = yes ; then
13795
13796         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13797         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13798
13799                                 continue
13800                         elif test "${cf_tst_cflags}" = "\"'" ; then
13801
13802         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13803         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13804
13805                                 continue
13806                         fi
13807                         ;;
13808                 esac
13809                 case "$CPPFLAGS" in
13810                 (*$cf_add_cflags)
13811                         ;;
13812                 (*)
13813                         case "$cf_add_cflags" in
13814                         (-D*)
13815                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13816
13817 CPPFLAGS=`echo "$CPPFLAGS" | \
13818         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13819                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13820
13821                                 ;;
13822                         esac
13823
13824         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13825         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13826
13827                         ;;
13828                 esac
13829                 ;;
13830         (*)
13831
13832         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13833         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13834
13835                 ;;
13836         esac
13837         ;;
13838 (yes)
13839
13840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13842
13843         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13844
13845         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13846                 && test -z "${cf_tst_cflags}" \
13847                 && cf_fix_cppflags=no
13848         ;;
13849 esac
13850 done
13851
13852 if test -n "$cf_new_cflags" ; then
13853         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13854
13855 echo "${as_me:-configure}:13855: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13856
13857         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13858         CFLAGS="${CFLAGS}$cf_new_cflags"
13859
13860 fi
13861
13862 if test -n "$cf_new_cppflags" ; then
13863         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13864
13865 echo "${as_me:-configure}:13865: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13866
13867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13868         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13869
13870 fi
13871
13872 if test -n "$cf_new_extra_cppflags" ; then
13873         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13874
13875 echo "${as_me:-configure}:13875: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13876
13877         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13878         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13879
13880 fi
13881
13882 done
13883
13884 fi
13885
13886 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13887         echo "$as_me:13887: checking if _XOPEN_SOURCE really is set" >&5
13888 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13889         cat >"conftest.$ac_ext" <<_ACEOF
13890 #line 13890 "configure"
13891 #include "confdefs.h"
13892 #include <stdlib.h>
13893 int
13894 main (void)
13895 {
13896
13897 #ifndef _XOPEN_SOURCE
13898 make an error
13899 #endif
13900   ;
13901   return 0;
13902 }
13903 _ACEOF
13904 rm -f "conftest.$ac_objext"
13905 if { (eval echo "$as_me:13905: \"$ac_compile\"") >&5
13906   (eval $ac_compile) 2>&5
13907   ac_status=$?
13908   echo "$as_me:13908: \$? = $ac_status" >&5
13909   (exit "$ac_status"); } &&
13910          { ac_try='test -s "conftest.$ac_objext"'
13911   { (eval echo "$as_me:13911: \"$ac_try\"") >&5
13912   (eval $ac_try) 2>&5
13913   ac_status=$?
13914   echo "$as_me:13914: \$? = $ac_status" >&5
13915   (exit "$ac_status"); }; }; then
13916   cf_XOPEN_SOURCE_set=yes
13917 else
13918   echo "$as_me: failed program was:" >&5
13919 cat "conftest.$ac_ext" >&5
13920 cf_XOPEN_SOURCE_set=no
13921 fi
13922 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13923         echo "$as_me:13923: result: $cf_XOPEN_SOURCE_set" >&5
13924 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13925         if test "$cf_XOPEN_SOURCE_set" = yes
13926         then
13927                 cat >"conftest.$ac_ext" <<_ACEOF
13928 #line 13928 "configure"
13929 #include "confdefs.h"
13930 #include <stdlib.h>
13931 int
13932 main (void)
13933 {
13934
13935 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13936 make an error
13937 #endif
13938   ;
13939   return 0;
13940 }
13941 _ACEOF
13942 rm -f "conftest.$ac_objext"
13943 if { (eval echo "$as_me:13943: \"$ac_compile\"") >&5
13944   (eval $ac_compile) 2>&5
13945   ac_status=$?
13946   echo "$as_me:13946: \$? = $ac_status" >&5
13947   (exit "$ac_status"); } &&
13948          { ac_try='test -s "conftest.$ac_objext"'
13949   { (eval echo "$as_me:13949: \"$ac_try\"") >&5
13950   (eval $ac_try) 2>&5
13951   ac_status=$?
13952   echo "$as_me:13952: \$? = $ac_status" >&5
13953   (exit "$ac_status"); }; }; then
13954   cf_XOPEN_SOURCE_set_ok=yes
13955 else
13956   echo "$as_me: failed program was:" >&5
13957 cat "conftest.$ac_ext" >&5
13958 cf_XOPEN_SOURCE_set_ok=no
13959 fi
13960 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13961                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13962                 then
13963                         { echo "$as_me:13963: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13964 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13965                 fi
13966         else
13967
13968 echo "$as_me:13968: checking if we should define _XOPEN_SOURCE" >&5
13969 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13970 if test "${cf_cv_xopen_source+set}" = set; then
13971   echo $ECHO_N "(cached) $ECHO_C" >&6
13972 else
13973
13974         cat >"conftest.$ac_ext" <<_ACEOF
13975 #line 13975 "configure"
13976 #include "confdefs.h"
13977
13978 #include <stdlib.h>
13979 #include <string.h>
13980 #include <sys/types.h>
13981
13982 int
13983 main (void)
13984 {
13985
13986 #ifndef _XOPEN_SOURCE
13987 make an error
13988 #endif
13989   ;
13990   return 0;
13991 }
13992 _ACEOF
13993 rm -f "conftest.$ac_objext"
13994 if { (eval echo "$as_me:13994: \"$ac_compile\"") >&5
13995   (eval $ac_compile) 2>&5
13996   ac_status=$?
13997   echo "$as_me:13997: \$? = $ac_status" >&5
13998   (exit "$ac_status"); } &&
13999          { ac_try='test -s "conftest.$ac_objext"'
14000   { (eval echo "$as_me:14000: \"$ac_try\"") >&5
14001   (eval $ac_try) 2>&5
14002   ac_status=$?
14003   echo "$as_me:14003: \$? = $ac_status" >&5
14004   (exit "$ac_status"); }; }; then
14005   cf_cv_xopen_source=no
14006 else
14007   echo "$as_me: failed program was:" >&5
14008 cat "conftest.$ac_ext" >&5
14009 cf_save="$CPPFLAGS"
14010
14011         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14012         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14013
14014          cat >"conftest.$ac_ext" <<_ACEOF
14015 #line 14015 "configure"
14016 #include "confdefs.h"
14017
14018 #include <stdlib.h>
14019 #include <string.h>
14020 #include <sys/types.h>
14021
14022 int
14023 main (void)
14024 {
14025
14026 #ifdef _XOPEN_SOURCE
14027 make an error
14028 #endif
14029   ;
14030   return 0;
14031 }
14032 _ACEOF
14033 rm -f "conftest.$ac_objext"
14034 if { (eval echo "$as_me:14034: \"$ac_compile\"") >&5
14035   (eval $ac_compile) 2>&5
14036   ac_status=$?
14037   echo "$as_me:14037: \$? = $ac_status" >&5
14038   (exit "$ac_status"); } &&
14039          { ac_try='test -s "conftest.$ac_objext"'
14040   { (eval echo "$as_me:14040: \"$ac_try\"") >&5
14041   (eval $ac_try) 2>&5
14042   ac_status=$?
14043   echo "$as_me:14043: \$? = $ac_status" >&5
14044   (exit "$ac_status"); }; }; then
14045   cf_cv_xopen_source=no
14046 else
14047   echo "$as_me: failed program was:" >&5
14048 cat "conftest.$ac_ext" >&5
14049 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14050 fi
14051 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14052         CPPFLAGS="$cf_save"
14053
14054 fi
14055 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14056
14057 fi
14058 echo "$as_me:14058: result: $cf_cv_xopen_source" >&5
14059 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14060
14061 if test "$cf_cv_xopen_source" != no ; then
14062
14063 CFLAGS=`echo "$CFLAGS" | \
14064         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14065                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14066
14067 CPPFLAGS=`echo "$CPPFLAGS" | \
14068         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14069                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14070
14071         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14072
14073 for cf_add_cflags in $cf_temp_xopen_source
14074 do
14075         case "x$cf_add_cflags" in
14076         (x-[DU]*)
14077
14078 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14079 while true
14080 do
14081         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'`
14082         test "$CFLAGS" != "$cf_old_cflag" || break
14083
14084         CFLAGS="$cf_old_cflag"
14085 done
14086
14087 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14088 while true
14089 do
14090         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'`
14091         test "$CPPFLAGS" != "$cf_old_cflag" || break
14092
14093         CPPFLAGS="$cf_old_cflag"
14094 done
14095
14096                 ;;
14097         esac
14098
14099 cf_fix_cppflags=no
14100 cf_new_cflags=
14101 cf_new_cppflags=
14102 cf_new_extra_cppflags=
14103
14104 for cf_add_cflags in $cf_add_cflags
14105 do
14106 case "$cf_fix_cppflags" in
14107 (no)
14108         case "$cf_add_cflags" in
14109         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14110                 case "$cf_add_cflags" in
14111                 (-D*)
14112                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14113
14114                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14115                                 && test -z "${cf_tst_cflags}" \
14116                                 && cf_fix_cppflags=yes
14117
14118                         if test "$cf_fix_cppflags" = yes ; then
14119
14120         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14121         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14122
14123                                 continue
14124                         elif test "${cf_tst_cflags}" = "\"'" ; then
14125
14126         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14127         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14128
14129                                 continue
14130                         fi
14131                         ;;
14132                 esac
14133                 case "$CPPFLAGS" in
14134                 (*$cf_add_cflags)
14135                         ;;
14136                 (*)
14137                         case "$cf_add_cflags" in
14138                         (-D*)
14139                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14140
14141 CPPFLAGS=`echo "$CPPFLAGS" | \
14142         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14143                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14144
14145                                 ;;
14146                         esac
14147
14148         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14149         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14150
14151                         ;;
14152                 esac
14153                 ;;
14154         (*)
14155
14156         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14157         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14158
14159                 ;;
14160         esac
14161         ;;
14162 (yes)
14163
14164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14166
14167         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14168
14169         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14170                 && test -z "${cf_tst_cflags}" \
14171                 && cf_fix_cppflags=no
14172         ;;
14173 esac
14174 done
14175
14176 if test -n "$cf_new_cflags" ; then
14177
14178         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14179         CFLAGS="${CFLAGS}$cf_new_cflags"
14180
14181 fi
14182
14183 if test -n "$cf_new_cppflags" ; then
14184
14185         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14186         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14187
14188 fi
14189
14190 if test -n "$cf_new_extra_cppflags" ; then
14191
14192         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14193         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14194
14195 fi
14196
14197 done
14198
14199 fi
14200
14201         fi
14202 fi
14203 fi # cf_cv_posix_visible
14204
14205 # Check whether --enable-largefile or --disable-largefile was given.
14206 if test "${enable_largefile+set}" = set; then
14207   enableval="$enable_largefile"
14208
14209 fi;
14210 if test "$enable_largefile" != no; then
14211
14212   echo "$as_me:14212: checking for special C compiler options needed for large files" >&5
14213 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14214 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14215   echo $ECHO_N "(cached) $ECHO_C" >&6
14216 else
14217   ac_cv_sys_largefile_CC=no
14218      if test "$GCC" != yes; then
14219        ac_save_CC=$CC
14220        while :; do
14221          # IRIX 6.2 and later do not support large files by default,
14222          # so use the C compiler's -n32 option if that helps.
14223          cat >"conftest.$ac_ext" <<_ACEOF
14224 #line 14224 "configure"
14225 #include "confdefs.h"
14226 #include <sys/types.h>
14227  /* Check that off_t can represent 2**63 - 1 correctly.
14228     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14229     since some C++ compilers masquerading as C compilers
14230     incorrectly reject 9223372036854775807.  */
14231 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14232   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14233                        && LARGE_OFF_T % 2147483647 == 1)
14234                       ? 1 : -1];
14235 int
14236 main (void)
14237 {
14238
14239   ;
14240   return 0;
14241 }
14242 _ACEOF
14243          rm -f "conftest.$ac_objext"
14244 if { (eval echo "$as_me:14244: \"$ac_compile\"") >&5
14245   (eval $ac_compile) 2>&5
14246   ac_status=$?
14247   echo "$as_me:14247: \$? = $ac_status" >&5
14248   (exit "$ac_status"); } &&
14249          { ac_try='test -s "conftest.$ac_objext"'
14250   { (eval echo "$as_me:14250: \"$ac_try\"") >&5
14251   (eval $ac_try) 2>&5
14252   ac_status=$?
14253   echo "$as_me:14253: \$? = $ac_status" >&5
14254   (exit "$ac_status"); }; }; then
14255   break
14256 else
14257   echo "$as_me: failed program was:" >&5
14258 cat "conftest.$ac_ext" >&5
14259 fi
14260 rm -f "conftest.$ac_objext"
14261          CC="$CC -n32"
14262          rm -f "conftest.$ac_objext"
14263 if { (eval echo "$as_me:14263: \"$ac_compile\"") >&5
14264   (eval $ac_compile) 2>&5
14265   ac_status=$?
14266   echo "$as_me:14266: \$? = $ac_status" >&5
14267   (exit "$ac_status"); } &&
14268          { ac_try='test -s "conftest.$ac_objext"'
14269   { (eval echo "$as_me:14269: \"$ac_try\"") >&5
14270   (eval $ac_try) 2>&5
14271   ac_status=$?
14272   echo "$as_me:14272: \$? = $ac_status" >&5
14273   (exit "$ac_status"); }; }; then
14274   ac_cv_sys_largefile_CC=' -n32'; break
14275 else
14276   echo "$as_me: failed program was:" >&5
14277 cat "conftest.$ac_ext" >&5
14278 fi
14279 rm -f "conftest.$ac_objext"
14280          break
14281        done
14282        CC=$ac_save_CC
14283        rm -f "conftest.$ac_ext"
14284     fi
14285 fi
14286 echo "$as_me:14286: result: $ac_cv_sys_largefile_CC" >&5
14287 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14288   if test "$ac_cv_sys_largefile_CC" != no; then
14289     CC=$CC$ac_cv_sys_largefile_CC
14290   fi
14291
14292   echo "$as_me:14292: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14293 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14294 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14295   echo $ECHO_N "(cached) $ECHO_C" >&6
14296 else
14297   while :; do
14298   ac_cv_sys_file_offset_bits=no
14299   cat >"conftest.$ac_ext" <<_ACEOF
14300 #line 14300 "configure"
14301 #include "confdefs.h"
14302 #include <sys/types.h>
14303  /* Check that off_t can represent 2**63 - 1 correctly.
14304     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14305     since some C++ compilers masquerading as C compilers
14306     incorrectly reject 9223372036854775807.  */
14307 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14308   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14309                        && LARGE_OFF_T % 2147483647 == 1)
14310                       ? 1 : -1];
14311 int
14312 main (void)
14313 {
14314
14315   ;
14316   return 0;
14317 }
14318 _ACEOF
14319 rm -f "conftest.$ac_objext"
14320 if { (eval echo "$as_me:14320: \"$ac_compile\"") >&5
14321   (eval $ac_compile) 2>&5
14322   ac_status=$?
14323   echo "$as_me:14323: \$? = $ac_status" >&5
14324   (exit "$ac_status"); } &&
14325          { ac_try='test -s "conftest.$ac_objext"'
14326   { (eval echo "$as_me:14326: \"$ac_try\"") >&5
14327   (eval $ac_try) 2>&5
14328   ac_status=$?
14329   echo "$as_me:14329: \$? = $ac_status" >&5
14330   (exit "$ac_status"); }; }; then
14331   break
14332 else
14333   echo "$as_me: failed program was:" >&5
14334 cat "conftest.$ac_ext" >&5
14335 fi
14336 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14337   cat >"conftest.$ac_ext" <<_ACEOF
14338 #line 14338 "configure"
14339 #include "confdefs.h"
14340 #define _FILE_OFFSET_BITS 64
14341 #include <sys/types.h>
14342  /* Check that off_t can represent 2**63 - 1 correctly.
14343     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14344     since some C++ compilers masquerading as C compilers
14345     incorrectly reject 9223372036854775807.  */
14346 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14347   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14348                        && LARGE_OFF_T % 2147483647 == 1)
14349                       ? 1 : -1];
14350 int
14351 main (void)
14352 {
14353
14354   ;
14355   return 0;
14356 }
14357 _ACEOF
14358 rm -f "conftest.$ac_objext"
14359 if { (eval echo "$as_me:14359: \"$ac_compile\"") >&5
14360   (eval $ac_compile) 2>&5
14361   ac_status=$?
14362   echo "$as_me:14362: \$? = $ac_status" >&5
14363   (exit "$ac_status"); } &&
14364          { ac_try='test -s "conftest.$ac_objext"'
14365   { (eval echo "$as_me:14365: \"$ac_try\"") >&5
14366   (eval $ac_try) 2>&5
14367   ac_status=$?
14368   echo "$as_me:14368: \$? = $ac_status" >&5
14369   (exit "$ac_status"); }; }; then
14370   ac_cv_sys_file_offset_bits=64; break
14371 else
14372   echo "$as_me: failed program was:" >&5
14373 cat "conftest.$ac_ext" >&5
14374 fi
14375 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14376   break
14377 done
14378 fi
14379 echo "$as_me:14379: result: $ac_cv_sys_file_offset_bits" >&5
14380 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14381 if test "$ac_cv_sys_file_offset_bits" != no; then
14382
14383 cat >>confdefs.h <<EOF
14384 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14385 EOF
14386
14387 fi
14388 rm -rf conftest*
14389   echo "$as_me:14389: checking for _LARGE_FILES value needed for large files" >&5
14390 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14391 if test "${ac_cv_sys_large_files+set}" = set; then
14392   echo $ECHO_N "(cached) $ECHO_C" >&6
14393 else
14394   while :; do
14395   ac_cv_sys_large_files=no
14396   cat >"conftest.$ac_ext" <<_ACEOF
14397 #line 14397 "configure"
14398 #include "confdefs.h"
14399 #include <sys/types.h>
14400  /* Check that off_t can represent 2**63 - 1 correctly.
14401     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14402     since some C++ compilers masquerading as C compilers
14403     incorrectly reject 9223372036854775807.  */
14404 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14405   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14406                        && LARGE_OFF_T % 2147483647 == 1)
14407                       ? 1 : -1];
14408 int
14409 main (void)
14410 {
14411
14412   ;
14413   return 0;
14414 }
14415 _ACEOF
14416 rm -f "conftest.$ac_objext"
14417 if { (eval echo "$as_me:14417: \"$ac_compile\"") >&5
14418   (eval $ac_compile) 2>&5
14419   ac_status=$?
14420   echo "$as_me:14420: \$? = $ac_status" >&5
14421   (exit "$ac_status"); } &&
14422          { ac_try='test -s "conftest.$ac_objext"'
14423   { (eval echo "$as_me:14423: \"$ac_try\"") >&5
14424   (eval $ac_try) 2>&5
14425   ac_status=$?
14426   echo "$as_me:14426: \$? = $ac_status" >&5
14427   (exit "$ac_status"); }; }; then
14428   break
14429 else
14430   echo "$as_me: failed program was:" >&5
14431 cat "conftest.$ac_ext" >&5
14432 fi
14433 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14434   cat >"conftest.$ac_ext" <<_ACEOF
14435 #line 14435 "configure"
14436 #include "confdefs.h"
14437 #define _LARGE_FILES 1
14438 #include <sys/types.h>
14439  /* Check that off_t can represent 2**63 - 1 correctly.
14440     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14441     since some C++ compilers masquerading as C compilers
14442     incorrectly reject 9223372036854775807.  */
14443 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14444   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14445                        && LARGE_OFF_T % 2147483647 == 1)
14446                       ? 1 : -1];
14447 int
14448 main (void)
14449 {
14450
14451   ;
14452   return 0;
14453 }
14454 _ACEOF
14455 rm -f "conftest.$ac_objext"
14456 if { (eval echo "$as_me:14456: \"$ac_compile\"") >&5
14457   (eval $ac_compile) 2>&5
14458   ac_status=$?
14459   echo "$as_me:14459: \$? = $ac_status" >&5
14460   (exit "$ac_status"); } &&
14461          { ac_try='test -s "conftest.$ac_objext"'
14462   { (eval echo "$as_me:14462: \"$ac_try\"") >&5
14463   (eval $ac_try) 2>&5
14464   ac_status=$?
14465   echo "$as_me:14465: \$? = $ac_status" >&5
14466   (exit "$ac_status"); }; }; then
14467   ac_cv_sys_large_files=1; break
14468 else
14469   echo "$as_me: failed program was:" >&5
14470 cat "conftest.$ac_ext" >&5
14471 fi
14472 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14473   break
14474 done
14475 fi
14476 echo "$as_me:14476: result: $ac_cv_sys_large_files" >&5
14477 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14478 if test "$ac_cv_sys_large_files" != no; then
14479
14480 cat >>confdefs.h <<EOF
14481 #define _LARGE_FILES $ac_cv_sys_large_files
14482 EOF
14483
14484 fi
14485 rm -rf conftest*
14486 fi
14487
14488         if test "$enable_largefile" != no ; then
14489         echo "$as_me:14489: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14490 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14491 if test "${ac_cv_sys_largefile_source+set}" = set; then
14492   echo $ECHO_N "(cached) $ECHO_C" >&6
14493 else
14494   while :; do
14495   ac_cv_sys_largefile_source=no
14496   cat >"conftest.$ac_ext" <<_ACEOF
14497 #line 14497 "configure"
14498 #include "confdefs.h"
14499 #include <stdio.h>
14500 int
14501 main (void)
14502 {
14503 return !fseeko;
14504   ;
14505   return 0;
14506 }
14507 _ACEOF
14508 rm -f "conftest.$ac_objext"
14509 if { (eval echo "$as_me:14509: \"$ac_compile\"") >&5
14510   (eval $ac_compile) 2>&5
14511   ac_status=$?
14512   echo "$as_me:14512: \$? = $ac_status" >&5
14513   (exit "$ac_status"); } &&
14514          { ac_try='test -s "conftest.$ac_objext"'
14515   { (eval echo "$as_me:14515: \"$ac_try\"") >&5
14516   (eval $ac_try) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit "$ac_status"); }; }; then
14520   break
14521 else
14522   echo "$as_me: failed program was:" >&5
14523 cat "conftest.$ac_ext" >&5
14524 fi
14525 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14526   cat >"conftest.$ac_ext" <<_ACEOF
14527 #line 14527 "configure"
14528 #include "confdefs.h"
14529 #define _LARGEFILE_SOURCE 1
14530 #include <stdio.h>
14531 int
14532 main (void)
14533 {
14534 return !fseeko;
14535   ;
14536   return 0;
14537 }
14538 _ACEOF
14539 rm -f "conftest.$ac_objext"
14540 if { (eval echo "$as_me:14540: \"$ac_compile\"") >&5
14541   (eval $ac_compile) 2>&5
14542   ac_status=$?
14543   echo "$as_me:14543: \$? = $ac_status" >&5
14544   (exit "$ac_status"); } &&
14545          { ac_try='test -s "conftest.$ac_objext"'
14546   { (eval echo "$as_me:14546: \"$ac_try\"") >&5
14547   (eval $ac_try) 2>&5
14548   ac_status=$?
14549   echo "$as_me:14549: \$? = $ac_status" >&5
14550   (exit "$ac_status"); }; }; then
14551   ac_cv_sys_largefile_source=1; break
14552 else
14553   echo "$as_me: failed program was:" >&5
14554 cat "conftest.$ac_ext" >&5
14555 fi
14556 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14557   break
14558 done
14559 fi
14560 echo "$as_me:14560: result: $ac_cv_sys_largefile_source" >&5
14561 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14562 if test "$ac_cv_sys_largefile_source" != no; then
14563
14564 cat >>confdefs.h <<EOF
14565 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14566 EOF
14567
14568 fi
14569 rm -rf conftest*
14570
14571 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14572 # in glibc 2.1.3, but that breaks too many other things.
14573 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14574 echo "$as_me:14574: checking for fseeko" >&5
14575 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14576 if test "${ac_cv_func_fseeko+set}" = set; then
14577   echo $ECHO_N "(cached) $ECHO_C" >&6
14578 else
14579   cat >"conftest.$ac_ext" <<_ACEOF
14580 #line 14580 "configure"
14581 #include "confdefs.h"
14582 #include <stdio.h>
14583 int
14584 main (void)
14585 {
14586 return fseeko && fseeko (stdin, 0, 0);
14587   ;
14588   return 0;
14589 }
14590 _ACEOF
14591 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14592 if { (eval echo "$as_me:14592: \"$ac_link\"") >&5
14593   (eval $ac_link) 2>&5
14594   ac_status=$?
14595   echo "$as_me:14595: \$? = $ac_status" >&5
14596   (exit "$ac_status"); } &&
14597          { ac_try='test -s "conftest$ac_exeext"'
14598   { (eval echo "$as_me:14598: \"$ac_try\"") >&5
14599   (eval $ac_try) 2>&5
14600   ac_status=$?
14601   echo "$as_me:14601: \$? = $ac_status" >&5
14602   (exit "$ac_status"); }; }; then
14603   ac_cv_func_fseeko=yes
14604 else
14605   echo "$as_me: failed program was:" >&5
14606 cat "conftest.$ac_ext" >&5
14607 ac_cv_func_fseeko=no
14608 fi
14609 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14610 fi
14611 echo "$as_me:14611: result: $ac_cv_func_fseeko" >&5
14612 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14613 if test $ac_cv_func_fseeko = yes; then
14614
14615 cat >>confdefs.h <<\EOF
14616 #define HAVE_FSEEKO 1
14617 EOF
14618
14619 fi
14620
14621         # Normally we would collect these definitions in the config.h,
14622         # but (like _XOPEN_SOURCE), some environments rely on having these
14623         # defined before any of the system headers are included.  Another
14624         # case comes up with C++, e.g., on AIX the compiler compiles the
14625         # header files by themselves before looking at the body files it is
14626         # told to compile.  For ncurses, those header files do not include
14627         # the config.h
14628         if test "$ac_cv_sys_large_files" != no
14629         then
14630
14631         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14632         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14633
14634         fi
14635         if test "$ac_cv_sys_largefile_source" != no
14636         then
14637
14638         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14639         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14640
14641         fi
14642         if test "$ac_cv_sys_file_offset_bits" != no
14643         then
14644
14645         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14646         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14647
14648         fi
14649
14650         echo "$as_me:14650: checking whether to use struct dirent64" >&5
14651 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14652 if test "${cf_cv_struct_dirent64+set}" = set; then
14653   echo $ECHO_N "(cached) $ECHO_C" >&6
14654 else
14655
14656                 cat >"conftest.$ac_ext" <<_ACEOF
14657 #line 14657 "configure"
14658 #include "confdefs.h"
14659
14660 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14661 #include <sys/types.h>
14662 #include <dirent.h>
14663
14664 int
14665 main (void)
14666 {
14667
14668                 /* if transitional largefile support is setup, this is true */
14669                 extern struct dirent64 * readdir(DIR *);
14670                 struct dirent64 *x = readdir((DIR *)0);
14671                 struct dirent *y = readdir((DIR *)0);
14672                 int z = x - y;
14673                 (void)z;
14674
14675   ;
14676   return 0;
14677 }
14678 _ACEOF
14679 rm -f "conftest.$ac_objext"
14680 if { (eval echo "$as_me:14680: \"$ac_compile\"") >&5
14681   (eval $ac_compile) 2>&5
14682   ac_status=$?
14683   echo "$as_me:14683: \$? = $ac_status" >&5
14684   (exit "$ac_status"); } &&
14685          { ac_try='test -s "conftest.$ac_objext"'
14686   { (eval echo "$as_me:14686: \"$ac_try\"") >&5
14687   (eval $ac_try) 2>&5
14688   ac_status=$?
14689   echo "$as_me:14689: \$? = $ac_status" >&5
14690   (exit "$ac_status"); }; }; then
14691   cf_cv_struct_dirent64=yes
14692 else
14693   echo "$as_me: failed program was:" >&5
14694 cat "conftest.$ac_ext" >&5
14695 cf_cv_struct_dirent64=no
14696 fi
14697 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14698
14699 fi
14700 echo "$as_me:14700: result: $cf_cv_struct_dirent64" >&5
14701 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14702         test "$cf_cv_struct_dirent64" = yes &&
14703 cat >>confdefs.h <<\EOF
14704 #define HAVE_STRUCT_DIRENT64 1
14705 EOF
14706
14707         fi
14708
14709 ### Enable compiling-in rcs id's
14710 echo "$as_me:14710: checking if RCS identifiers should be compiled-in" >&5
14711 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14712
14713 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14714 if test "${with_rcs_ids+set}" = set; then
14715   withval="$with_rcs_ids"
14716   with_rcs_ids=$withval
14717 else
14718   with_rcs_ids=no
14719 fi;
14720 echo "$as_me:14720: result: $with_rcs_ids" >&5
14721 echo "${ECHO_T}$with_rcs_ids" >&6
14722 test "$with_rcs_ids" = yes &&
14723 cat >>confdefs.h <<\EOF
14724 #define USE_RCS_IDS 1
14725 EOF
14726
14727 ###############################################################################
14728
14729 ### Note that some functions (such as const) are normally disabled anyway.
14730 echo "$as_me:14730: checking if you want to build with function extensions" >&5
14731 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14732
14733 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14734 if test "${enable_ext_funcs+set}" = set; then
14735   enableval="$enable_ext_funcs"
14736   with_ext_funcs=$enableval
14737 else
14738   with_ext_funcs=yes
14739 fi;
14740 echo "$as_me:14740: result: $with_ext_funcs" >&5
14741 echo "${ECHO_T}$with_ext_funcs" >&6
14742 if test "$with_ext_funcs" = yes ; then
14743         NCURSES_EXT_FUNCS=1
14744
14745 cat >>confdefs.h <<\EOF
14746 #define HAVE_USE_DEFAULT_COLORS 1
14747 EOF
14748
14749 cat >>confdefs.h <<\EOF
14750 #define NCURSES_EXT_FUNCS 1
14751 EOF
14752
14753 else
14754         NCURSES_EXT_FUNCS=0
14755 fi
14756
14757 ###   use option --enable-const to turn on use of const beyond that in XSI.
14758 echo "$as_me:14758: checking for extended use of const keyword" >&5
14759 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14760
14761 # Check whether --enable-const or --disable-const was given.
14762 if test "${enable_const+set}" = set; then
14763   enableval="$enable_const"
14764   with_ext_const=$enableval
14765 else
14766   with_ext_const=no
14767 fi;
14768 echo "$as_me:14768: result: $with_ext_const" >&5
14769 echo "${ECHO_T}$with_ext_const" >&6
14770 NCURSES_CONST='/*nothing*/'
14771 if test "$with_ext_const" = yes ; then
14772         NCURSES_CONST=const
14773 fi
14774
14775 ###############################################################################
14776 # These options are relatively safe to experiment with.
14777
14778 echo "$as_me:14778: checking if you want all development code" >&5
14779 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14780
14781 # Check whether --with-develop or --without-develop was given.
14782 if test "${with_develop+set}" = set; then
14783   withval="$with_develop"
14784   with_develop=$withval
14785 else
14786   with_develop=no
14787 fi;
14788 echo "$as_me:14788: result: $with_develop" >&5
14789 echo "${ECHO_T}$with_develop" >&6
14790
14791 ###############################################################################
14792 # These are just experimental, probably should not be in a package:
14793
14794 # This is still experimental (20080329), but should ultimately be moved to
14795 # the script-block --with-normal, etc.
14796
14797 echo "$as_me:14797: checking if you want to link with the pthread library" >&5
14798 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14799
14800 # Check whether --with-pthread or --without-pthread was given.
14801 if test "${with_pthread+set}" = set; then
14802   withval="$with_pthread"
14803   with_pthread=$withval
14804 else
14805   with_pthread=no
14806 fi;
14807 echo "$as_me:14807: result: $with_pthread" >&5
14808 echo "${ECHO_T}$with_pthread" >&6
14809
14810 if test "$with_pthread" != no ; then
14811         echo "$as_me:14811: checking for pthread.h" >&5
14812 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14813 if test "${ac_cv_header_pthread_h+set}" = set; then
14814   echo $ECHO_N "(cached) $ECHO_C" >&6
14815 else
14816   cat >"conftest.$ac_ext" <<_ACEOF
14817 #line 14817 "configure"
14818 #include "confdefs.h"
14819 #include <pthread.h>
14820 _ACEOF
14821 if { (eval echo "$as_me:14821: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14822   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14823   ac_status=$?
14824   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14825   rm -f conftest.er1
14826   cat conftest.err >&5
14827   echo "$as_me:14827: \$? = $ac_status" >&5
14828   (exit "$ac_status"); } >/dev/null; then
14829   if test -s conftest.err; then
14830     ac_cpp_err=$ac_c_preproc_warn_flag
14831   else
14832     ac_cpp_err=
14833   fi
14834 else
14835   ac_cpp_err=yes
14836 fi
14837 if test -z "$ac_cpp_err"; then
14838   ac_cv_header_pthread_h=yes
14839 else
14840   echo "$as_me: failed program was:" >&5
14841   cat "conftest.$ac_ext" >&5
14842   ac_cv_header_pthread_h=no
14843 fi
14844 rm -f conftest.err "conftest.$ac_ext"
14845 fi
14846 echo "$as_me:14846: result: $ac_cv_header_pthread_h" >&5
14847 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14848 if test "$ac_cv_header_pthread_h" = yes; then
14849
14850 cat >>confdefs.h <<\EOF
14851 #define HAVE_PTHREADS_H 1
14852 EOF
14853
14854         for cf_lib_pthread in pthread c_r
14855         do
14856             echo "$as_me:14856: checking if we can link with the $cf_lib_pthread library" >&5
14857 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14858             cf_save_LIBS="$LIBS"
14859
14860 cf_add_libs="$LIBS"
14861 # reverse order
14862 cf_add_0lib=
14863 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14864 # filter duplicates
14865 for cf_add_1lib in $cf_add_0lib; do
14866         for cf_add_2lib in $cf_add_libs; do
14867                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14868                         cf_add_1lib=
14869                         break
14870                 fi
14871         done
14872         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14873 done
14874 LIBS="$cf_add_libs"
14875
14876             cat >"conftest.$ac_ext" <<_ACEOF
14877 #line 14877 "configure"
14878 #include "confdefs.h"
14879
14880 #include <pthread.h>
14881
14882 int
14883 main (void)
14884 {
14885
14886                 int rc = pthread_create(0,0,0,0);
14887                 int r2 = pthread_mutexattr_settype(0, 0);
14888
14889   ;
14890   return 0;
14891 }
14892 _ACEOF
14893 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14894 if { (eval echo "$as_me:14894: \"$ac_link\"") >&5
14895   (eval $ac_link) 2>&5
14896   ac_status=$?
14897   echo "$as_me:14897: \$? = $ac_status" >&5
14898   (exit "$ac_status"); } &&
14899          { ac_try='test -s "conftest$ac_exeext"'
14900   { (eval echo "$as_me:14900: \"$ac_try\"") >&5
14901   (eval $ac_try) 2>&5
14902   ac_status=$?
14903   echo "$as_me:14903: \$? = $ac_status" >&5
14904   (exit "$ac_status"); }; }; then
14905   with_pthread=yes
14906 else
14907   echo "$as_me: failed program was:" >&5
14908 cat "conftest.$ac_ext" >&5
14909 with_pthread=no
14910 fi
14911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14912             LIBS="$cf_save_LIBS"
14913             echo "$as_me:14913: result: $with_pthread" >&5
14914 echo "${ECHO_T}$with_pthread" >&6
14915             test "$with_pthread" = yes && break
14916         done
14917
14918         if test "$with_pthread" = yes ; then
14919
14920 cf_add_libs="$LIBS"
14921 # reverse order
14922 cf_add_0lib=
14923 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14924 # filter duplicates
14925 for cf_add_1lib in $cf_add_0lib; do
14926         for cf_add_2lib in $cf_add_libs; do
14927                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14928                         cf_add_1lib=
14929                         break
14930                 fi
14931         done
14932         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14933 done
14934 LIBS="$cf_add_libs"
14935
14936 cat >>confdefs.h <<\EOF
14937 #define HAVE_LIBPTHREADS 1
14938 EOF
14939
14940         else
14941             { { echo "$as_me:14941: error: Cannot link with pthread library" >&5
14942 echo "$as_me: error: Cannot link with pthread library" >&2;}
14943    { (exit 1); exit 1; }; }
14944         fi
14945
14946 fi
14947
14948 fi
14949
14950 echo "$as_me:14950: checking if you want to use weak-symbols for pthreads" >&5
14951 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14952
14953 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14954 if test "${enable_weak_symbols+set}" = set; then
14955   enableval="$enable_weak_symbols"
14956   use_weak_symbols=$withval
14957 else
14958   use_weak_symbols=no
14959 fi;
14960 echo "$as_me:14960: result: $use_weak_symbols" >&5
14961 echo "${ECHO_T}$use_weak_symbols" >&6
14962 if test "$use_weak_symbols" = yes ; then
14963
14964 echo "$as_me:14964: checking if $CC supports weak symbols" >&5
14965 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14966 if test "${cf_cv_weak_symbols+set}" = set; then
14967   echo $ECHO_N "(cached) $ECHO_C" >&6
14968 else
14969
14970 cat >"conftest.$ac_ext" <<_ACEOF
14971 #line 14971 "configure"
14972 #include "confdefs.h"
14973
14974 #include <stdio.h>
14975 int
14976 main (void)
14977 {
14978
14979 #if defined(__GNUC__)
14980 #  if defined __USE_ISOC99
14981 #    define _cat_pragma(exp)    _Pragma(#exp)
14982 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14983 #  else
14984 #    define _weak_pragma(exp)
14985 #  endif
14986 #  define _declare(name)        __extension__ extern __typeof__(name) name
14987 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14988 #endif
14989
14990 weak_symbol(fopen);
14991
14992   ;
14993   return 0;
14994 }
14995 _ACEOF
14996 rm -f "conftest.$ac_objext"
14997 if { (eval echo "$as_me:14997: \"$ac_compile\"") >&5
14998   (eval $ac_compile) 2>&5
14999   ac_status=$?
15000   echo "$as_me:15000: \$? = $ac_status" >&5
15001   (exit "$ac_status"); } &&
15002          { ac_try='test -s "conftest.$ac_objext"'
15003   { (eval echo "$as_me:15003: \"$ac_try\"") >&5
15004   (eval $ac_try) 2>&5
15005   ac_status=$?
15006   echo "$as_me:15006: \$? = $ac_status" >&5
15007   (exit "$ac_status"); }; }; then
15008   cf_cv_weak_symbols=yes
15009 else
15010   echo "$as_me: failed program was:" >&5
15011 cat "conftest.$ac_ext" >&5
15012 cf_cv_weak_symbols=no
15013 fi
15014 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15015
15016 fi
15017 echo "$as_me:15017: result: $cf_cv_weak_symbols" >&5
15018 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15019
15020 else
15021         cf_cv_weak_symbols=no
15022 fi
15023
15024 if test $cf_cv_weak_symbols = yes ; then
15025
15026 cat >>confdefs.h <<\EOF
15027 #define USE_WEAK_SYMBOLS 1
15028 EOF
15029
15030 fi
15031
15032 PTHREAD=
15033 if test "$with_pthread" = "yes" ; then
15034
15035 cat >>confdefs.h <<\EOF
15036 #define USE_PTHREADS 1
15037 EOF
15038
15039         enable_reentrant=yes
15040         if test $cf_cv_weak_symbols = yes ; then
15041                 PTHREAD=-lpthread
15042         fi
15043 fi
15044
15045 # OpenSUSE is installing ncurses6, using reentrant option.
15046 echo "$as_me:15046: checking for _nc_TABSIZE" >&5
15047 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15048 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15049   echo $ECHO_N "(cached) $ECHO_C" >&6
15050 else
15051   cat >"conftest.$ac_ext" <<_ACEOF
15052 #line 15052 "configure"
15053 #include "confdefs.h"
15054 #define _nc_TABSIZE autoconf_temporary
15055 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15056 #undef _nc_TABSIZE
15057
15058 #ifdef __cplusplus
15059 extern "C"
15060 #endif
15061
15062 /* We use char because int might match the return type of a gcc2
15063    builtin and then its argument prototype would still apply.  */
15064 char _nc_TABSIZE (void);
15065
15066 int
15067 main (void)
15068 {
15069
15070 /* The GNU C library defines stubs for functions which it implements
15071     to always fail with ENOSYS.  Some functions are actually named
15072     something starting with __ and the normal name is an alias.  */
15073 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15074 #error found stub for _nc_TABSIZE
15075 #endif
15076
15077         return _nc_TABSIZE ();
15078   ;
15079   return 0;
15080 }
15081 _ACEOF
15082 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15083 if { (eval echo "$as_me:15083: \"$ac_link\"") >&5
15084   (eval $ac_link) 2>&5
15085   ac_status=$?
15086   echo "$as_me:15086: \$? = $ac_status" >&5
15087   (exit "$ac_status"); } &&
15088          { ac_try='test -s "conftest$ac_exeext"'
15089   { (eval echo "$as_me:15089: \"$ac_try\"") >&5
15090   (eval $ac_try) 2>&5
15091   ac_status=$?
15092   echo "$as_me:15092: \$? = $ac_status" >&5
15093   (exit "$ac_status"); }; }; then
15094   ac_cv_func__nc_TABSIZE=yes
15095 else
15096   echo "$as_me: failed program was:" >&5
15097 cat "conftest.$ac_ext" >&5
15098 ac_cv_func__nc_TABSIZE=no
15099 fi
15100 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15101 fi
15102 echo "$as_me:15102: result: $ac_cv_func__nc_TABSIZE" >&5
15103 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15104 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15105   assume_reentrant=yes
15106 else
15107   assume_reentrant=no
15108 fi
15109
15110 # Reentrant code has to be opaque; there's little advantage to making ncurses
15111 # opaque outside of that, so there is no --enable-opaque option.  We can use
15112 # this option without --with-pthreads, but this will be always set for
15113 # pthreads.
15114 echo "$as_me:15114: checking if you want experimental reentrant code" >&5
15115 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15116
15117 # Check whether --enable-reentrant or --disable-reentrant was given.
15118 if test "${enable_reentrant+set}" = set; then
15119   enableval="$enable_reentrant"
15120   with_reentrant=$enableval
15121 else
15122   with_reentrant=$assume_reentrant
15123 fi;
15124 echo "$as_me:15124: result: $with_reentrant" >&5
15125 echo "${ECHO_T}$with_reentrant" >&6
15126 if test "$with_reentrant" = yes ; then
15127         cf_cv_enable_reentrant=1
15128         if test $cf_cv_weak_symbols = yes ; then
15129
15130 # remove pthread library from $LIBS
15131 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15132
15133         elif test "$assume_reentrant" = no ; then
15134                 LIB_SUFFIX="t${LIB_SUFFIX}"
15135         fi
15136
15137 cat >>confdefs.h <<\EOF
15138 #define USE_REENTRANT 1
15139 EOF
15140
15141 else
15142         cf_cv_enable_reentrant=0
15143 fi
15144
15145 ### Allow using a different wrap-prefix
15146 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15147         echo "$as_me:15147: checking for prefix used to wrap public variables" >&5
15148 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15149
15150 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15151 if test "${with_wrap_prefix+set}" = set; then
15152   withval="$with_wrap_prefix"
15153   NCURSES_WRAP_PREFIX=$withval
15154 else
15155   NCURSES_WRAP_PREFIX=_nc_
15156 fi;
15157         echo "$as_me:15157: result: $NCURSES_WRAP_PREFIX" >&5
15158 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15159 else
15160         NCURSES_WRAP_PREFIX=_nc_
15161 fi
15162
15163 cat >>confdefs.h <<EOF
15164 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15165 EOF
15166
15167 ###############################################################################
15168
15169 ###     use option --disable-echo to suppress full display compiling commands
15170
15171 echo "$as_me:15171: checking if you want to see long compiling messages" >&5
15172 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15173
15174 # Check whether --enable-echo or --disable-echo was given.
15175 if test "${enable_echo+set}" = set; then
15176   enableval="$enable_echo"
15177   test "$enableval" != no && enableval=yes
15178         if test "$enableval" != "yes" ; then
15179
15180         ECHO_LT='--silent'
15181         ECHO_LD='@echo linking $@;'
15182         RULE_CC='@echo compiling $<'
15183         SHOW_CC='@echo compiling $@'
15184         ECHO_CC='@'
15185
15186         else
15187
15188         ECHO_LT=''
15189         ECHO_LD=''
15190         RULE_CC=''
15191         SHOW_CC=''
15192         ECHO_CC=''
15193
15194         fi
15195 else
15196   enableval=yes
15197
15198         ECHO_LT=''
15199         ECHO_LD=''
15200         RULE_CC=''
15201         SHOW_CC=''
15202         ECHO_CC=''
15203
15204 fi;
15205 echo "$as_me:15205: result: $enableval" >&5
15206 echo "${ECHO_T}$enableval" >&6
15207
15208 echo "$as_me:15208: checking if you want to use C11 _Noreturn feature" >&5
15209 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15210
15211 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15212 if test "${enable_stdnoreturn+set}" = set; then
15213   enableval="$enable_stdnoreturn"
15214   test "$enableval" != yes && enableval=no
15215         if test "$enableval" != "no" ; then
15216     enable_stdnoreturn=yes
15217         else
15218                 enable_stdnoreturn=no
15219         fi
15220 else
15221   enableval=no
15222         enable_stdnoreturn=no
15223
15224 fi;
15225 echo "$as_me:15225: result: $enable_stdnoreturn" >&5
15226 echo "${ECHO_T}$enable_stdnoreturn" >&6
15227
15228 if test $enable_stdnoreturn = yes; then
15229 echo "$as_me:15229: checking for C11 _Noreturn feature" >&5
15230 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15231 if test "${cf_cv_c11_noreturn+set}" = set; then
15232   echo $ECHO_N "(cached) $ECHO_C" >&6
15233 else
15234   cat >"conftest.$ac_ext" <<_ACEOF
15235 #line 15235 "configure"
15236 #include "confdefs.h"
15237
15238 #include <stdio.h>
15239 #include <stdlib.h>
15240 #include <stdnoreturn.h>
15241 static _Noreturn void giveup(void) { exit(0); }
15242
15243 int
15244 main (void)
15245 {
15246 if (feof(stdin)) giveup()
15247   ;
15248   return 0;
15249 }
15250 _ACEOF
15251 rm -f "conftest.$ac_objext"
15252 if { (eval echo "$as_me:15252: \"$ac_compile\"") >&5
15253   (eval $ac_compile) 2>&5
15254   ac_status=$?
15255   echo "$as_me:15255: \$? = $ac_status" >&5
15256   (exit "$ac_status"); } &&
15257          { ac_try='test -s "conftest.$ac_objext"'
15258   { (eval echo "$as_me:15258: \"$ac_try\"") >&5
15259   (eval $ac_try) 2>&5
15260   ac_status=$?
15261   echo "$as_me:15261: \$? = $ac_status" >&5
15262   (exit "$ac_status"); }; }; then
15263   cf_cv_c11_noreturn=yes
15264 else
15265   echo "$as_me: failed program was:" >&5
15266 cat "conftest.$ac_ext" >&5
15267 cf_cv_c11_noreturn=no
15268 fi
15269 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15270
15271 fi
15272 echo "$as_me:15272: result: $cf_cv_c11_noreturn" >&5
15273 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15274 else
15275         cf_cv_c11_noreturn=no,
15276 fi
15277
15278 if test "$cf_cv_c11_noreturn" = yes; then
15279
15280 cat >>confdefs.h <<\EOF
15281 #define HAVE_STDNORETURN_H 1
15282 EOF
15283
15284 cat >>confdefs.h <<EOF
15285 #define STDC_NORETURN _Noreturn
15286 EOF
15287
15288         HAVE_STDNORETURN_H=1
15289 else
15290         HAVE_STDNORETURN_H=0
15291 fi
15292
15293 if test "$GCC" = yes || test "$GXX" = yes
15294 then
15295
15296 if test "$GCC" = yes || test "$GXX" = yes
15297 then
15298         case $CFLAGS in
15299         (*-Werror=*)
15300                 cf_temp_flags=
15301                 for cf_temp_scan in $CFLAGS
15302                 do
15303                         case "x$cf_temp_scan" in
15304                         (x-Werror=format*)
15305
15306         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15307         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15308
15309                                 ;;
15310                         (x-Werror=*)
15311
15312         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15313         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15314
15315                                 ;;
15316                         (*)
15317
15318         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15319         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15320
15321                                 ;;
15322                         esac
15323                 done
15324                 if test "x$CFLAGS" != "x$cf_temp_flags"
15325                 then
15326                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15327
15328 echo "${as_me:-configure}:15328: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15329
15330                         CFLAGS="$cf_temp_flags"
15331                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15332
15333 echo "${as_me:-configure}:15333: testing ... fixed $CFLAGS ..." 1>&5
15334
15335                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15336
15337 echo "${as_me:-configure}:15337: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15338
15339                 fi
15340                 ;;
15341         esac
15342 fi
15343
15344 if test "$GCC" = yes || test "$GXX" = yes
15345 then
15346         case $CPPFLAGS in
15347         (*-Werror=*)
15348                 cf_temp_flags=
15349                 for cf_temp_scan in $CPPFLAGS
15350                 do
15351                         case "x$cf_temp_scan" in
15352                         (x-Werror=format*)
15353
15354         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15355         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15356
15357                                 ;;
15358                         (x-Werror=*)
15359
15360         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15361         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15362
15363                                 ;;
15364                         (*)
15365
15366         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15367         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15368
15369                                 ;;
15370                         esac
15371                 done
15372                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15373                 then
15374                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15375
15376 echo "${as_me:-configure}:15376: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15377
15378                         CPPFLAGS="$cf_temp_flags"
15379                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15380
15381 echo "${as_me:-configure}:15381: testing ... fixed $CPPFLAGS ..." 1>&5
15382
15383                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15384
15385 echo "${as_me:-configure}:15385: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15386
15387                 fi
15388                 ;;
15389         esac
15390 fi
15391
15392 if test "$GCC" = yes || test "$GXX" = yes
15393 then
15394         case $LDFLAGS in
15395         (*-Werror=*)
15396                 cf_temp_flags=
15397                 for cf_temp_scan in $LDFLAGS
15398                 do
15399                         case "x$cf_temp_scan" in
15400                         (x-Werror=format*)
15401
15402         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15403         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15404
15405                                 ;;
15406                         (x-Werror=*)
15407
15408         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15409         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15410
15411                                 ;;
15412                         (*)
15413
15414         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15415         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15416
15417                                 ;;
15418                         esac
15419                 done
15420                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15421                 then
15422                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15423
15424 echo "${as_me:-configure}:15424: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15425
15426                         LDFLAGS="$cf_temp_flags"
15427                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15428
15429 echo "${as_me:-configure}:15429: testing ... fixed $LDFLAGS ..." 1>&5
15430
15431                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15432
15433 echo "${as_me:-configure}:15433: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15434
15435                 fi
15436                 ;;
15437         esac
15438 fi
15439
15440 echo "$as_me:15440: checking if you want to turn on gcc warnings" >&5
15441 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15442
15443 # Check whether --enable-warnings or --disable-warnings was given.
15444 if test "${enable_warnings+set}" = set; then
15445   enableval="$enable_warnings"
15446   test "$enableval" != yes && enableval=no
15447         if test "$enableval" != "no" ; then
15448     enable_warnings=yes
15449         else
15450                 enable_warnings=no
15451         fi
15452 else
15453   enableval=no
15454         enable_warnings=no
15455
15456 fi;
15457 echo "$as_me:15457: result: $enable_warnings" >&5
15458 echo "${ECHO_T}$enable_warnings" >&6
15459 if test "$enable_warnings" = "yes"
15460 then
15461
15462 if test "x$have_x" = xyes; then
15463
15464 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15465 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15466 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15467 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15468 for cf_X_CFLAGS in $X_CFLAGS
15469 do
15470         case "x$cf_X_CFLAGS" in
15471         x-[IUD]*)
15472                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15473                 ;;
15474         *)
15475                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15476                 ;;
15477         esac
15478 done
15479
15480 cat >"conftest.$ac_ext" <<_ACEOF
15481 #line 15481 "configure"
15482 #include "confdefs.h"
15483
15484 #include <stdlib.h>
15485 #include <X11/Intrinsic.h>
15486
15487 int
15488 main (void)
15489 {
15490 String foo = malloc(1); free((void*)foo)
15491   ;
15492   return 0;
15493 }
15494 _ACEOF
15495 rm -f "conftest.$ac_objext"
15496 if { (eval echo "$as_me:15496: \"$ac_compile\"") >&5
15497   (eval $ac_compile) 2>&5
15498   ac_status=$?
15499   echo "$as_me:15499: \$? = $ac_status" >&5
15500   (exit "$ac_status"); } &&
15501          { ac_try='test -s "conftest.$ac_objext"'
15502   { (eval echo "$as_me:15502: \"$ac_try\"") >&5
15503   (eval $ac_try) 2>&5
15504   ac_status=$?
15505   echo "$as_me:15505: \$? = $ac_status" >&5
15506   (exit "$ac_status"); }; }; then
15507
15508 echo "$as_me:15508: checking for X11/Xt const-feature" >&5
15509 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15510 if test "${cf_cv_const_x_string+set}" = set; then
15511   echo $ECHO_N "(cached) $ECHO_C" >&6
15512 else
15513
15514         cat >"conftest.$ac_ext" <<_ACEOF
15515 #line 15515 "configure"
15516 #include "confdefs.h"
15517
15518 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15519 #undef  XTSTRINGDEFINES /* X11R5 and later */
15520 #include <stdlib.h>
15521 #include <X11/Intrinsic.h>
15522
15523 int
15524 main (void)
15525 {
15526 String foo = malloc(1); *foo = 0
15527   ;
15528   return 0;
15529 }
15530 _ACEOF
15531 rm -f "conftest.$ac_objext"
15532 if { (eval echo "$as_me:15532: \"$ac_compile\"") >&5
15533   (eval $ac_compile) 2>&5
15534   ac_status=$?
15535   echo "$as_me:15535: \$? = $ac_status" >&5
15536   (exit "$ac_status"); } &&
15537          { ac_try='test -s "conftest.$ac_objext"'
15538   { (eval echo "$as_me:15538: \"$ac_try\"") >&5
15539   (eval $ac_try) 2>&5
15540   ac_status=$?
15541   echo "$as_me:15541: \$? = $ac_status" >&5
15542   (exit "$ac_status"); }; }; then
15543
15544                         cf_cv_const_x_string=no
15545
15546 else
15547   echo "$as_me: failed program was:" >&5
15548 cat "conftest.$ac_ext" >&5
15549
15550                         cf_cv_const_x_string=yes
15551
15552 fi
15553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15554
15555 fi
15556 echo "$as_me:15556: result: $cf_cv_const_x_string" >&5
15557 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15558
15559 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15560 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15561 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15562
15563 case "$cf_cv_const_x_string" in
15564 (no)
15565
15566         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15567         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15568
15569         ;;
15570 (*)
15571
15572         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15573         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15574
15575         ;;
15576 esac
15577
15578 else
15579   echo "$as_me: failed program was:" >&5
15580 cat "conftest.$ac_ext" >&5
15581 fi
15582 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15583  fi
15584 cat > "conftest.$ac_ext" <<EOF
15585 #line 15585 "${as_me:-configure}"
15586 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15587 EOF
15588 if test "$INTEL_COMPILER" = yes
15589 then
15590 # The "-wdXXX" options suppress warnings:
15591 # remark #1419: external declaration in primary source file
15592 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15593 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15594 # remark #193: zero used for undefined preprocessing identifier
15595 # remark #593: variable "curs_sb_left_arrow" was set but never used
15596 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15597 # remark #869: parameter "tw" was never referenced
15598 # remark #981: operands are evaluated in unspecified order
15599 # warning #279: controlling expression is constant
15600
15601         { echo "$as_me:15601: checking for $CC warning options..." >&5
15602 echo "$as_me: checking for $CC warning options..." >&6;}
15603         cf_save_CFLAGS="$CFLAGS"
15604         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15605         for cf_opt in \
15606                 wd1419 \
15607                 wd1683 \
15608                 wd1684 \
15609                 wd193 \
15610                 wd593 \
15611                 wd279 \
15612                 wd810 \
15613                 wd869 \
15614                 wd981
15615         do
15616                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15617                 if { (eval echo "$as_me:15617: \"$ac_compile\"") >&5
15618   (eval $ac_compile) 2>&5
15619   ac_status=$?
15620   echo "$as_me:15620: \$? = $ac_status" >&5
15621   (exit "$ac_status"); }; then
15622                         test -n "$verbose" && echo "$as_me:15622: result: ... -$cf_opt" >&5
15623 echo "${ECHO_T}... -$cf_opt" >&6
15624                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15625                 fi
15626         done
15627         CFLAGS="$cf_save_CFLAGS"
15628 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15629 then
15630         { echo "$as_me:15630: checking for $CC warning options..." >&5
15631 echo "$as_me: checking for $CC warning options..." >&6;}
15632         cf_save_CFLAGS="$CFLAGS"
15633         cf_warn_CONST=""
15634         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15635         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15636         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15637         for cf_opt in W Wall \
15638                 Wbad-function-cast \
15639                 Wcast-align \
15640                 Wcast-qual \
15641                 Wdeclaration-after-statement \
15642                 Wextra \
15643                 Winline \
15644                 Wmissing-declarations \
15645                 Wmissing-prototypes \
15646                 Wnested-externs \
15647                 Wpointer-arith \
15648                 Wshadow \
15649                 Wstrict-prototypes \
15650                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15651         do
15652                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15653                 if { (eval echo "$as_me:15653: \"$ac_compile\"") >&5
15654   (eval $ac_compile) 2>&5
15655   ac_status=$?
15656   echo "$as_me:15656: \$? = $ac_status" >&5
15657   (exit "$ac_status"); }; then
15658                         test -n "$verbose" && echo "$as_me:15658: result: ... -$cf_opt" >&5
15659 echo "${ECHO_T}... -$cf_opt" >&6
15660                         case "$cf_opt" in
15661                         (Winline)
15662                                 case "$GCC_VERSION" in
15663                                 ([34].*)
15664                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15665
15666 echo "${as_me:-configure}:15666: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15667
15668                                         continue;;
15669                                 esac
15670                                 ;;
15671                         (Wpointer-arith)
15672                                 case "$GCC_VERSION" in
15673                                 ([12].*)
15674                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15675
15676 echo "${as_me:-configure}:15676: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15677
15678                                         continue;;
15679                                 esac
15680                                 ;;
15681                         esac
15682                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15683                 fi
15684         done
15685         CFLAGS="$cf_save_CFLAGS"
15686 fi
15687 rm -rf ./conftest*
15688
15689 fi
15690
15691 if test "$GCC" = yes || test "$GXX" = yes
15692 then
15693 cat > conftest.i <<EOF
15694 #ifndef GCC_PRINTF
15695 #define GCC_PRINTF 0
15696 #endif
15697 #ifndef GCC_SCANF
15698 #define GCC_SCANF 0
15699 #endif
15700 #ifndef GCC_NORETURN
15701 #define GCC_NORETURN /* nothing */
15702 #endif
15703 #ifndef GCC_UNUSED
15704 #define GCC_UNUSED /* nothing */
15705 #endif
15706 EOF
15707 if test "$GCC" = yes
15708 then
15709         { echo "$as_me:15709: checking for $CC __attribute__ directives..." >&5
15710 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15711 cat > "conftest.$ac_ext" <<EOF
15712 #line 15712 "${as_me:-configure}"
15713 #include "confdefs.h"
15714 #include "conftest.h"
15715 #include "conftest.i"
15716 #if     GCC_PRINTF
15717 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15718 #else
15719 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15720 #endif
15721 #if     GCC_SCANF
15722 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15723 #else
15724 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15725 #endif
15726 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15727 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15728 extern GCC_NORETURN void foo(void);
15729 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15730 EOF
15731         cf_printf_attribute=no
15732         cf_scanf_attribute=no
15733         for cf_attribute in scanf printf unused noreturn
15734         do
15735
15736 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15737
15738                 cf_directive="__attribute__(($cf_attribute))"
15739                 echo "checking for $CC $cf_directive" 1>&5
15740
15741                 case "$cf_attribute" in
15742                 (printf)
15743                         cf_printf_attribute=yes
15744                         cat >conftest.h <<EOF
15745 #define GCC_$cf_ATTRIBUTE 1
15746 EOF
15747                         ;;
15748                 (scanf)
15749                         cf_scanf_attribute=yes
15750                         cat >conftest.h <<EOF
15751 #define GCC_$cf_ATTRIBUTE 1
15752 EOF
15753                         ;;
15754                 (*)
15755                         cat >conftest.h <<EOF
15756 #define GCC_$cf_ATTRIBUTE $cf_directive
15757 EOF
15758                         ;;
15759                 esac
15760
15761                 if { (eval echo "$as_me:15761: \"$ac_compile\"") >&5
15762   (eval $ac_compile) 2>&5
15763   ac_status=$?
15764   echo "$as_me:15764: \$? = $ac_status" >&5
15765   (exit "$ac_status"); }; then
15766                         test -n "$verbose" && echo "$as_me:15766: result: ... $cf_attribute" >&5
15767 echo "${ECHO_T}... $cf_attribute" >&6
15768                         cat conftest.h >>confdefs.h
15769                         case "$cf_attribute" in
15770                         (noreturn)
15771
15772 cat >>confdefs.h <<EOF
15773 #define GCC_NORETURN $cf_directive
15774 EOF
15775
15776                                 ;;
15777                         (printf)
15778                                 cf_value='/* nothing */'
15779                                 if test "$cf_printf_attribute" != no ; then
15780                                         cf_value='__attribute__((format(printf,fmt,var)))'
15781
15782 cat >>confdefs.h <<\EOF
15783 #define GCC_PRINTF 1
15784 EOF
15785
15786                                 fi
15787
15788 cat >>confdefs.h <<EOF
15789 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15790 EOF
15791
15792                                 ;;
15793                         (scanf)
15794                                 cf_value='/* nothing */'
15795                                 if test "$cf_scanf_attribute" != no ; then
15796                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15797
15798 cat >>confdefs.h <<\EOF
15799 #define GCC_SCANF 1
15800 EOF
15801
15802                                 fi
15803
15804 cat >>confdefs.h <<EOF
15805 #define GCC_SCANFLIKE(fmt,var) $cf_value
15806 EOF
15807
15808                                 ;;
15809                         (unused)
15810
15811 cat >>confdefs.h <<EOF
15812 #define GCC_UNUSED $cf_directive
15813 EOF
15814
15815                                 ;;
15816                         esac
15817                 fi
15818         done
15819 else
15820         ${FGREP-fgrep} define conftest.i >>confdefs.h
15821 fi
15822 rm -rf ./conftest*
15823 fi
15824
15825 fi
15826
15827 if test "x$enable_warnings" = "xyes"; then
15828
15829         ADAFLAGS="$ADAFLAGS -gnatg"
15830
15831 fi
15832
15833 ###     use option --enable-assertions to turn on generation of assertion code
15834 echo "$as_me:15834: checking if you want to enable runtime assertions" >&5
15835 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15836
15837 # Check whether --enable-assertions or --disable-assertions was given.
15838 if test "${enable_assertions+set}" = set; then
15839   enableval="$enable_assertions"
15840   with_assertions=$enableval
15841 else
15842   with_assertions=no
15843 fi;
15844 echo "$as_me:15844: result: $with_assertions" >&5
15845 echo "${ECHO_T}$with_assertions" >&6
15846 if test -n "$GCC"
15847 then
15848         if test "$with_assertions" = no
15849         then
15850                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15851         else
15852
15853         ADAFLAGS="$ADAFLAGS -gnata"
15854
15855         fi
15856 fi
15857
15858 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15859
15860 cat >>confdefs.h <<\EOF
15861 #define HAVE_NC_ALLOC_H 1
15862 EOF
15863
15864 ###     use option --enable-expanded to generate certain macros as functions
15865
15866 # Check whether --enable-expanded or --disable-expanded was given.
15867 if test "${enable_expanded+set}" = set; then
15868   enableval="$enable_expanded"
15869   test "$enableval" = yes &&
15870 cat >>confdefs.h <<\EOF
15871 #define NCURSES_EXPANDED 1
15872 EOF
15873
15874 fi;
15875
15876 ###     use option --disable-macros to suppress macros in favor of functions
15877
15878 # Check whether --enable-macros or --disable-macros was given.
15879 if test "${enable_macros+set}" = set; then
15880   enableval="$enable_macros"
15881   test "$enableval" = no &&
15882 cat >>confdefs.h <<\EOF
15883 #define NCURSES_NOMACROS 1
15884 EOF
15885
15886 fi;
15887
15888 # Normally we only add trace() to the debug-library.  Allow this to be
15889 # extended to all models of the ncurses library:
15890 cf_all_traces=no
15891 case "$CFLAGS $CPPFLAGS" in
15892 (*-DTRACE*)
15893         cf_all_traces=yes
15894         ;;
15895 esac
15896
15897 echo "$as_me:15897: checking whether to add trace feature to all models" >&5
15898 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15899
15900 # Check whether --with-trace or --without-trace was given.
15901 if test "${with_trace+set}" = set; then
15902   withval="$with_trace"
15903   cf_with_trace=$withval
15904 else
15905   cf_with_trace=$cf_all_traces
15906 fi;
15907 echo "$as_me:15907: result: $cf_with_trace" >&5
15908 echo "${ECHO_T}$cf_with_trace" >&6
15909
15910 if test "$cf_with_trace" = yes ; then
15911         ADA_TRACE=TRUE
15912
15913 cf_fix_cppflags=no
15914 cf_new_cflags=
15915 cf_new_cppflags=
15916 cf_new_extra_cppflags=
15917
15918 for cf_add_cflags in -DTRACE
15919 do
15920 case "$cf_fix_cppflags" in
15921 (no)
15922         case "$cf_add_cflags" in
15923         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15924                 case "$cf_add_cflags" in
15925                 (-D*)
15926                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15927
15928                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15929                                 && test -z "${cf_tst_cflags}" \
15930                                 && cf_fix_cppflags=yes
15931
15932                         if test "$cf_fix_cppflags" = yes ; then
15933
15934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15936
15937                                 continue
15938                         elif test "${cf_tst_cflags}" = "\"'" ; then
15939
15940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15942
15943                                 continue
15944                         fi
15945                         ;;
15946                 esac
15947                 case "$CPPFLAGS" in
15948                 (*$cf_add_cflags)
15949                         ;;
15950                 (*)
15951                         case "$cf_add_cflags" in
15952                         (-D*)
15953                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15954
15955 CPPFLAGS=`echo "$CPPFLAGS" | \
15956         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15957                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15958
15959                                 ;;
15960                         esac
15961
15962         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15963         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15964
15965                         ;;
15966                 esac
15967                 ;;
15968         (*)
15969
15970         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15971         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15972
15973                 ;;
15974         esac
15975         ;;
15976 (yes)
15977
15978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15980
15981         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15982
15983         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15984                 && test -z "${cf_tst_cflags}" \
15985                 && cf_fix_cppflags=no
15986         ;;
15987 esac
15988 done
15989
15990 if test -n "$cf_new_cflags" ; then
15991
15992         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15993         CFLAGS="${CFLAGS}$cf_new_cflags"
15994
15995 fi
15996
15997 if test -n "$cf_new_cppflags" ; then
15998
15999         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16000         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16001
16002 fi
16003
16004 if test -n "$cf_new_extra_cppflags" ; then
16005
16006         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16007         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16008
16009 fi
16010
16011 else
16012         ADA_TRACE=FALSE
16013 fi
16014
16015 echo "$as_me:16015: checking if we want to use GNAT projects" >&5
16016 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16017
16018 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16019 if test "${enable_gnat_projects+set}" = set; then
16020   enableval="$enable_gnat_projects"
16021   test "$enableval" != no && enableval=yes
16022         if test "$enableval" != "yes" ; then
16023     enable_gnat_projects=no
16024         else
16025                 enable_gnat_projects=yes
16026         fi
16027 else
16028   enableval=yes
16029         enable_gnat_projects=yes
16030
16031 fi;
16032 echo "$as_me:16032: result: $enable_gnat_projects" >&5
16033 echo "${ECHO_T}$enable_gnat_projects" >&6
16034
16035 ###     Checks for libraries.
16036 case $cf_cv_system_name in
16037 (*mingw32*)
16038
16039 echo "$as_me:16039: checking if ssp library is needed" >&5
16040 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16041 if test "${cf_cv_need_libssp+set}" = set; then
16042   echo $ECHO_N "(cached) $ECHO_C" >&6
16043 else
16044
16045 cat >"conftest.$ac_ext" <<_ACEOF
16046 #line 16046 "configure"
16047 #include "confdefs.h"
16048
16049 #include <sys/types.h>
16050 #include <dirent.h>
16051
16052 int
16053 main (void)
16054 {
16055
16056        DIR *dp = opendir(".");
16057
16058   ;
16059   return 0;
16060 }
16061 _ACEOF
16062 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16063 if { (eval echo "$as_me:16063: \"$ac_link\"") >&5
16064   (eval $ac_link) 2>&5
16065   ac_status=$?
16066   echo "$as_me:16066: \$? = $ac_status" >&5
16067   (exit "$ac_status"); } &&
16068          { ac_try='test -s "conftest$ac_exeext"'
16069   { (eval echo "$as_me:16069: \"$ac_try\"") >&5
16070   (eval $ac_try) 2>&5
16071   ac_status=$?
16072   echo "$as_me:16072: \$? = $ac_status" >&5
16073   (exit "$ac_status"); }; }; then
16074   cf_cv_need_libssp=no
16075 else
16076   echo "$as_me: failed program was:" >&5
16077 cat "conftest.$ac_ext" >&5
16078
16079         cf_save_LIBS="$LIBS"
16080         LIBS="$LIBS -lssp"
16081         cat >"conftest.$ac_ext" <<_ACEOF
16082 #line 16082 "configure"
16083 #include "confdefs.h"
16084
16085 #include <sys/types.h>
16086 #include <dirent.h>
16087
16088 int
16089 main (void)
16090 {
16091
16092                    DIR *dp = opendir(".");
16093
16094   ;
16095   return 0;
16096 }
16097 _ACEOF
16098 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16099 if { (eval echo "$as_me:16099: \"$ac_link\"") >&5
16100   (eval $ac_link) 2>&5
16101   ac_status=$?
16102   echo "$as_me:16102: \$? = $ac_status" >&5
16103   (exit "$ac_status"); } &&
16104          { ac_try='test -s "conftest$ac_exeext"'
16105   { (eval echo "$as_me:16105: \"$ac_try\"") >&5
16106   (eval $ac_try) 2>&5
16107   ac_status=$?
16108   echo "$as_me:16108: \$? = $ac_status" >&5
16109   (exit "$ac_status"); }; }; then
16110   cf_cv_need_libssp=yes
16111 else
16112   echo "$as_me: failed program was:" >&5
16113 cat "conftest.$ac_ext" >&5
16114 cf_cv_need_libssp=maybe
16115 fi
16116 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16117         LIBS="$cf_save_LIBS"
16118
16119 fi
16120 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16121 fi
16122 echo "$as_me:16122: result: $cf_cv_need_libssp" >&5
16123 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16124
16125 if test "x$cf_cv_need_libssp" = xyes
16126 then
16127
16128 cf_add_libs="$LIBS"
16129 # reverse order
16130 cf_add_0lib=
16131 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16132 # filter duplicates
16133 for cf_add_1lib in $cf_add_0lib; do
16134         for cf_add_2lib in $cf_add_libs; do
16135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16136                         cf_add_1lib=
16137                         break
16138                 fi
16139         done
16140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16141 done
16142 LIBS="$cf_add_libs"
16143
16144 fi
16145
16146         ;;
16147 (*)
16148 echo "$as_me:16148: checking for gettimeofday" >&5
16149 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16150 if test "${ac_cv_func_gettimeofday+set}" = set; then
16151   echo $ECHO_N "(cached) $ECHO_C" >&6
16152 else
16153   cat >"conftest.$ac_ext" <<_ACEOF
16154 #line 16154 "configure"
16155 #include "confdefs.h"
16156 #define gettimeofday autoconf_temporary
16157 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16158 #undef gettimeofday
16159
16160 #ifdef __cplusplus
16161 extern "C"
16162 #endif
16163
16164 /* We use char because int might match the return type of a gcc2
16165    builtin and then its argument prototype would still apply.  */
16166 char gettimeofday (void);
16167
16168 int
16169 main (void)
16170 {
16171
16172 /* The GNU C library defines stubs for functions which it implements
16173     to always fail with ENOSYS.  Some functions are actually named
16174     something starting with __ and the normal name is an alias.  */
16175 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16176 #error found stub for gettimeofday
16177 #endif
16178
16179         return gettimeofday ();
16180   ;
16181   return 0;
16182 }
16183 _ACEOF
16184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16185 if { (eval echo "$as_me:16185: \"$ac_link\"") >&5
16186   (eval $ac_link) 2>&5
16187   ac_status=$?
16188   echo "$as_me:16188: \$? = $ac_status" >&5
16189   (exit "$ac_status"); } &&
16190          { ac_try='test -s "conftest$ac_exeext"'
16191   { (eval echo "$as_me:16191: \"$ac_try\"") >&5
16192   (eval $ac_try) 2>&5
16193   ac_status=$?
16194   echo "$as_me:16194: \$? = $ac_status" >&5
16195   (exit "$ac_status"); }; }; then
16196   ac_cv_func_gettimeofday=yes
16197 else
16198   echo "$as_me: failed program was:" >&5
16199 cat "conftest.$ac_ext" >&5
16200 ac_cv_func_gettimeofday=no
16201 fi
16202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16203 fi
16204 echo "$as_me:16204: result: $ac_cv_func_gettimeofday" >&5
16205 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16206 if test "$ac_cv_func_gettimeofday" = yes; then
16207   cat >>confdefs.h <<\EOF
16208 #define HAVE_GETTIMEOFDAY 1
16209 EOF
16210
16211 else
16212
16213 echo "$as_me:16213: checking for gettimeofday in -lbsd" >&5
16214 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16215 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16216   echo $ECHO_N "(cached) $ECHO_C" >&6
16217 else
16218   ac_check_lib_save_LIBS=$LIBS
16219 LIBS="-lbsd  $LIBS"
16220 cat >"conftest.$ac_ext" <<_ACEOF
16221 #line 16221 "configure"
16222 #include "confdefs.h"
16223
16224 /* Override any gcc2 internal prototype to avoid an error.  */
16225 #ifdef __cplusplus
16226 extern "C"
16227 #endif
16228 /* We use char because int might match the return type of a gcc2
16229    builtin and then its argument prototype would still apply.  */
16230 char gettimeofday ();
16231 int
16232 main (void)
16233 {
16234 gettimeofday ();
16235   ;
16236   return 0;
16237 }
16238 _ACEOF
16239 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16240 if { (eval echo "$as_me:16240: \"$ac_link\"") >&5
16241   (eval $ac_link) 2>&5
16242   ac_status=$?
16243   echo "$as_me:16243: \$? = $ac_status" >&5
16244   (exit "$ac_status"); } &&
16245          { ac_try='test -s "conftest$ac_exeext"'
16246   { (eval echo "$as_me:16246: \"$ac_try\"") >&5
16247   (eval $ac_try) 2>&5
16248   ac_status=$?
16249   echo "$as_me:16249: \$? = $ac_status" >&5
16250   (exit "$ac_status"); }; }; then
16251   ac_cv_lib_bsd_gettimeofday=yes
16252 else
16253   echo "$as_me: failed program was:" >&5
16254 cat "conftest.$ac_ext" >&5
16255 ac_cv_lib_bsd_gettimeofday=no
16256 fi
16257 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16258 LIBS=$ac_check_lib_save_LIBS
16259 fi
16260 echo "$as_me:16260: result: $ac_cv_lib_bsd_gettimeofday" >&5
16261 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16262 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16263
16264 cat >>confdefs.h <<\EOF
16265 #define HAVE_GETTIMEOFDAY 1
16266 EOF
16267
16268         LIBS="$LIBS -lbsd"
16269 fi
16270
16271 fi
16272         ;;
16273 esac
16274
16275 ###     Checks for header files.
16276 echo "$as_me:16276: checking for ANSI C header files" >&5
16277 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16278 if test "${ac_cv_header_stdc+set}" = set; then
16279   echo $ECHO_N "(cached) $ECHO_C" >&6
16280 else
16281   cat >"conftest.$ac_ext" <<_ACEOF
16282 #line 16282 "configure"
16283 #include "confdefs.h"
16284 #include <stdlib.h>
16285 #include <stdarg.h>
16286 #include <string.h>
16287 #include <float.h>
16288
16289 _ACEOF
16290 if { (eval echo "$as_me:16290: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16291   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16292   ac_status=$?
16293   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16294   rm -f conftest.er1
16295   cat conftest.err >&5
16296   echo "$as_me:16296: \$? = $ac_status" >&5
16297   (exit "$ac_status"); } >/dev/null; then
16298   if test -s conftest.err; then
16299     ac_cpp_err=$ac_c_preproc_warn_flag
16300   else
16301     ac_cpp_err=
16302   fi
16303 else
16304   ac_cpp_err=yes
16305 fi
16306 if test -z "$ac_cpp_err"; then
16307   ac_cv_header_stdc=yes
16308 else
16309   echo "$as_me: failed program was:" >&5
16310   cat "conftest.$ac_ext" >&5
16311   ac_cv_header_stdc=no
16312 fi
16313 rm -f conftest.err "conftest.$ac_ext"
16314
16315 if test $ac_cv_header_stdc = yes; then
16316   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16317   cat >"conftest.$ac_ext" <<_ACEOF
16318 #line 16318 "configure"
16319 #include "confdefs.h"
16320 #include <string.h>
16321
16322 _ACEOF
16323 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16324   $EGREP "memchr" >/dev/null 2>&1; then
16325   :
16326 else
16327   ac_cv_header_stdc=no
16328 fi
16329 rm -rf conftest*
16330
16331 fi
16332
16333 if test $ac_cv_header_stdc = yes; then
16334   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16335   cat >"conftest.$ac_ext" <<_ACEOF
16336 #line 16336 "configure"
16337 #include "confdefs.h"
16338 #include <stdlib.h>
16339
16340 _ACEOF
16341 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16342   $EGREP "free" >/dev/null 2>&1; then
16343   :
16344 else
16345   ac_cv_header_stdc=no
16346 fi
16347 rm -rf conftest*
16348
16349 fi
16350
16351 if test $ac_cv_header_stdc = yes; then
16352   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16353   if test "$cross_compiling" = yes; then
16354   :
16355 else
16356   cat >"conftest.$ac_ext" <<_ACEOF
16357 #line 16357 "configure"
16358 #include "confdefs.h"
16359 #include <ctype.h>
16360 #if ((' ' & 0x0FF) == 0x020)
16361 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16362 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16363 #else
16364 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16365                      || ('j' <= (c) && (c) <= 'r') \
16366                      || ('s' <= (c) && (c) <= 'z'))
16367 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16368 #endif
16369
16370 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16371 int
16372 main (void)
16373 {
16374   int i;
16375   for (i = 0; i < 256; i++)
16376     if (XOR (islower (i), ISLOWER (i))
16377         || toupper (i) != TOUPPER (i))
16378       $ac_main_return(2);
16379   $ac_main_return (0);
16380 }
16381 _ACEOF
16382 rm -f "conftest$ac_exeext"
16383 if { (eval echo "$as_me:16383: \"$ac_link\"") >&5
16384   (eval $ac_link) 2>&5
16385   ac_status=$?
16386   echo "$as_me:16386: \$? = $ac_status" >&5
16387   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16388   { (eval echo "$as_me:16388: \"$ac_try\"") >&5
16389   (eval $ac_try) 2>&5
16390   ac_status=$?
16391   echo "$as_me:16391: \$? = $ac_status" >&5
16392   (exit "$ac_status"); }; }; then
16393   :
16394 else
16395   echo "$as_me: program exited with status $ac_status" >&5
16396 echo "$as_me: failed program was:" >&5
16397 cat "conftest.$ac_ext" >&5
16398 ac_cv_header_stdc=no
16399 fi
16400 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16401 fi
16402 fi
16403 fi
16404 echo "$as_me:16404: result: $ac_cv_header_stdc" >&5
16405 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16406 if test $ac_cv_header_stdc = yes; then
16407
16408 cat >>confdefs.h <<\EOF
16409 #define STDC_HEADERS 1
16410 EOF
16411
16412 fi
16413
16414 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16415
16416 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16417                   inttypes.h stdint.h unistd.h
16418 do
16419 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16420 echo "$as_me:16420: checking for $ac_header" >&5
16421 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16422 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16423   echo $ECHO_N "(cached) $ECHO_C" >&6
16424 else
16425   cat >"conftest.$ac_ext" <<_ACEOF
16426 #line 16426 "configure"
16427 #include "confdefs.h"
16428 $ac_includes_default
16429 #include <$ac_header>
16430 _ACEOF
16431 rm -f "conftest.$ac_objext"
16432 if { (eval echo "$as_me:16432: \"$ac_compile\"") >&5
16433   (eval $ac_compile) 2>&5
16434   ac_status=$?
16435   echo "$as_me:16435: \$? = $ac_status" >&5
16436   (exit "$ac_status"); } &&
16437          { ac_try='test -s "conftest.$ac_objext"'
16438   { (eval echo "$as_me:16438: \"$ac_try\"") >&5
16439   (eval $ac_try) 2>&5
16440   ac_status=$?
16441   echo "$as_me:16441: \$? = $ac_status" >&5
16442   (exit "$ac_status"); }; }; then
16443   eval "$as_ac_Header=yes"
16444 else
16445   echo "$as_me: failed program was:" >&5
16446 cat "conftest.$ac_ext" >&5
16447 eval "$as_ac_Header=no"
16448 fi
16449 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16450 fi
16451 echo "$as_me:16451: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16452 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16453 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16454   cat >>confdefs.h <<EOF
16455 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16456 EOF
16457
16458 fi
16459 done
16460
16461 echo "$as_me:16461: checking for signed char" >&5
16462 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16463 if test "${ac_cv_type_signed_char+set}" = set; then
16464   echo $ECHO_N "(cached) $ECHO_C" >&6
16465 else
16466   cat >"conftest.$ac_ext" <<_ACEOF
16467 #line 16467 "configure"
16468 #include "confdefs.h"
16469 $ac_includes_default
16470 int
16471 main (void)
16472 {
16473 if ((signed char *) 0)
16474   return 0;
16475 if (sizeof (signed char))
16476   return 0;
16477   ;
16478   return 0;
16479 }
16480 _ACEOF
16481 rm -f "conftest.$ac_objext"
16482 if { (eval echo "$as_me:16482: \"$ac_compile\"") >&5
16483   (eval $ac_compile) 2>&5
16484   ac_status=$?
16485   echo "$as_me:16485: \$? = $ac_status" >&5
16486   (exit "$ac_status"); } &&
16487          { ac_try='test -s "conftest.$ac_objext"'
16488   { (eval echo "$as_me:16488: \"$ac_try\"") >&5
16489   (eval $ac_try) 2>&5
16490   ac_status=$?
16491   echo "$as_me:16491: \$? = $ac_status" >&5
16492   (exit "$ac_status"); }; }; then
16493   ac_cv_type_signed_char=yes
16494 else
16495   echo "$as_me: failed program was:" >&5
16496 cat "conftest.$ac_ext" >&5
16497 ac_cv_type_signed_char=no
16498 fi
16499 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16500 fi
16501 echo "$as_me:16501: result: $ac_cv_type_signed_char" >&5
16502 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16503
16504 echo "$as_me:16504: checking size of signed char" >&5
16505 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16506 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16507   echo $ECHO_N "(cached) $ECHO_C" >&6
16508 else
16509   if test "$ac_cv_type_signed_char" = yes; then
16510   if test "$cross_compiling" = yes; then
16511   # Depending upon the size, compute the lo and hi bounds.
16512 cat >"conftest.$ac_ext" <<_ACEOF
16513 #line 16513 "configure"
16514 #include "confdefs.h"
16515 $ac_includes_default
16516 int
16517 main (void)
16518 {
16519 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16520   ;
16521   return 0;
16522 }
16523 _ACEOF
16524 rm -f "conftest.$ac_objext"
16525 if { (eval echo "$as_me:16525: \"$ac_compile\"") >&5
16526   (eval $ac_compile) 2>&5
16527   ac_status=$?
16528   echo "$as_me:16528: \$? = $ac_status" >&5
16529   (exit "$ac_status"); } &&
16530          { ac_try='test -s "conftest.$ac_objext"'
16531   { (eval echo "$as_me:16531: \"$ac_try\"") >&5
16532   (eval $ac_try) 2>&5
16533   ac_status=$?
16534   echo "$as_me:16534: \$? = $ac_status" >&5
16535   (exit "$ac_status"); }; }; then
16536   ac_lo=0 ac_mid=0
16537   while :; do
16538     cat >"conftest.$ac_ext" <<_ACEOF
16539 #line 16539 "configure"
16540 #include "confdefs.h"
16541 $ac_includes_default
16542 int
16543 main (void)
16544 {
16545 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16546   ;
16547   return 0;
16548 }
16549 _ACEOF
16550 rm -f "conftest.$ac_objext"
16551 if { (eval echo "$as_me:16551: \"$ac_compile\"") >&5
16552   (eval $ac_compile) 2>&5
16553   ac_status=$?
16554   echo "$as_me:16554: \$? = $ac_status" >&5
16555   (exit "$ac_status"); } &&
16556          { ac_try='test -s "conftest.$ac_objext"'
16557   { (eval echo "$as_me:16557: \"$ac_try\"") >&5
16558   (eval $ac_try) 2>&5
16559   ac_status=$?
16560   echo "$as_me:16560: \$? = $ac_status" >&5
16561   (exit "$ac_status"); }; }; then
16562   ac_hi=$ac_mid; break
16563 else
16564   echo "$as_me: failed program was:" >&5
16565 cat "conftest.$ac_ext" >&5
16566 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16567 fi
16568 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16569   done
16570 else
16571   echo "$as_me: failed program was:" >&5
16572 cat "conftest.$ac_ext" >&5
16573 ac_hi=-1 ac_mid=-1
16574   while :; do
16575     cat >"conftest.$ac_ext" <<_ACEOF
16576 #line 16576 "configure"
16577 #include "confdefs.h"
16578 $ac_includes_default
16579 int
16580 main (void)
16581 {
16582 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16583   ;
16584   return 0;
16585 }
16586 _ACEOF
16587 rm -f "conftest.$ac_objext"
16588 if { (eval echo "$as_me:16588: \"$ac_compile\"") >&5
16589   (eval $ac_compile) 2>&5
16590   ac_status=$?
16591   echo "$as_me:16591: \$? = $ac_status" >&5
16592   (exit "$ac_status"); } &&
16593          { ac_try='test -s "conftest.$ac_objext"'
16594   { (eval echo "$as_me:16594: \"$ac_try\"") >&5
16595   (eval $ac_try) 2>&5
16596   ac_status=$?
16597   echo "$as_me:16597: \$? = $ac_status" >&5
16598   (exit "$ac_status"); }; }; then
16599   ac_lo=$ac_mid; break
16600 else
16601   echo "$as_me: failed program was:" >&5
16602 cat "conftest.$ac_ext" >&5
16603 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16604 fi
16605 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16606   done
16607 fi
16608 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16609 # Binary search between lo and hi bounds.
16610 while test "x$ac_lo" != "x$ac_hi"; do
16611   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16612   cat >"conftest.$ac_ext" <<_ACEOF
16613 #line 16613 "configure"
16614 #include "confdefs.h"
16615 $ac_includes_default
16616 int
16617 main (void)
16618 {
16619 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16620   ;
16621   return 0;
16622 }
16623 _ACEOF
16624 rm -f "conftest.$ac_objext"
16625 if { (eval echo "$as_me:16625: \"$ac_compile\"") >&5
16626   (eval $ac_compile) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit "$ac_status"); } &&
16630          { ac_try='test -s "conftest.$ac_objext"'
16631   { (eval echo "$as_me:16631: \"$ac_try\"") >&5
16632   (eval $ac_try) 2>&5
16633   ac_status=$?
16634   echo "$as_me:16634: \$? = $ac_status" >&5
16635   (exit "$ac_status"); }; }; then
16636   ac_hi=$ac_mid
16637 else
16638   echo "$as_me: failed program was:" >&5
16639 cat "conftest.$ac_ext" >&5
16640 ac_lo=`expr "$ac_mid" + 1`
16641 fi
16642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16643 done
16644 ac_cv_sizeof_signed_char=$ac_lo
16645 else
16646   if test "$cross_compiling" = yes; then
16647   { { echo "$as_me:16647: error: cannot run test program while cross compiling" >&5
16648 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16649    { (exit 1); exit 1; }; }
16650 else
16651   cat >"conftest.$ac_ext" <<_ACEOF
16652 #line 16652 "configure"
16653 #include "confdefs.h"
16654 $ac_includes_default
16655 int
16656 main (void)
16657 {
16658 FILE *f = fopen ("conftest.val", "w");
16659 if (!f)
16660   $ac_main_return (1);
16661 fprintf (f, "%ld", (long)(sizeof (signed char)));
16662 fclose (f);
16663   ;
16664   return 0;
16665 }
16666 _ACEOF
16667 rm -f "conftest$ac_exeext"
16668 if { (eval echo "$as_me:16668: \"$ac_link\"") >&5
16669   (eval $ac_link) 2>&5
16670   ac_status=$?
16671   echo "$as_me:16671: \$? = $ac_status" >&5
16672   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16673   { (eval echo "$as_me:16673: \"$ac_try\"") >&5
16674   (eval $ac_try) 2>&5
16675   ac_status=$?
16676   echo "$as_me:16676: \$? = $ac_status" >&5
16677   (exit "$ac_status"); }; }; then
16678   ac_cv_sizeof_signed_char=`cat conftest.val`
16679 else
16680   echo "$as_me: program exited with status $ac_status" >&5
16681 echo "$as_me: failed program was:" >&5
16682 cat "conftest.$ac_ext" >&5
16683 fi
16684 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16685 fi
16686 fi
16687 rm -f conftest.val
16688 else
16689   ac_cv_sizeof_signed_char=0
16690 fi
16691 fi
16692 echo "$as_me:16692: result: $ac_cv_sizeof_signed_char" >&5
16693 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16694 cat >>confdefs.h <<EOF
16695 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16696 EOF
16697
16698 echo "$as_me:16698: checking for ANSI C header files" >&5
16699 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16700 if test "${ac_cv_header_stdc+set}" = set; then
16701   echo $ECHO_N "(cached) $ECHO_C" >&6
16702 else
16703   cat >"conftest.$ac_ext" <<_ACEOF
16704 #line 16704 "configure"
16705 #include "confdefs.h"
16706 #include <stdlib.h>
16707 #include <stdarg.h>
16708 #include <string.h>
16709 #include <float.h>
16710
16711 _ACEOF
16712 if { (eval echo "$as_me:16712: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16713   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16714   ac_status=$?
16715   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16716   rm -f conftest.er1
16717   cat conftest.err >&5
16718   echo "$as_me:16718: \$? = $ac_status" >&5
16719   (exit "$ac_status"); } >/dev/null; then
16720   if test -s conftest.err; then
16721     ac_cpp_err=$ac_c_preproc_warn_flag
16722   else
16723     ac_cpp_err=
16724   fi
16725 else
16726   ac_cpp_err=yes
16727 fi
16728 if test -z "$ac_cpp_err"; then
16729   ac_cv_header_stdc=yes
16730 else
16731   echo "$as_me: failed program was:" >&5
16732   cat "conftest.$ac_ext" >&5
16733   ac_cv_header_stdc=no
16734 fi
16735 rm -f conftest.err "conftest.$ac_ext"
16736
16737 if test $ac_cv_header_stdc = yes; then
16738   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16739   cat >"conftest.$ac_ext" <<_ACEOF
16740 #line 16740 "configure"
16741 #include "confdefs.h"
16742 #include <string.h>
16743
16744 _ACEOF
16745 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16746   $EGREP "memchr" >/dev/null 2>&1; then
16747   :
16748 else
16749   ac_cv_header_stdc=no
16750 fi
16751 rm -rf conftest*
16752
16753 fi
16754
16755 if test $ac_cv_header_stdc = yes; then
16756   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16757   cat >"conftest.$ac_ext" <<_ACEOF
16758 #line 16758 "configure"
16759 #include "confdefs.h"
16760 #include <stdlib.h>
16761
16762 _ACEOF
16763 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16764   $EGREP "free" >/dev/null 2>&1; then
16765   :
16766 else
16767   ac_cv_header_stdc=no
16768 fi
16769 rm -rf conftest*
16770
16771 fi
16772
16773 if test $ac_cv_header_stdc = yes; then
16774   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16775   if test "$cross_compiling" = yes; then
16776   :
16777 else
16778   cat >"conftest.$ac_ext" <<_ACEOF
16779 #line 16779 "configure"
16780 #include "confdefs.h"
16781 #include <ctype.h>
16782 #if ((' ' & 0x0FF) == 0x020)
16783 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16784 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16785 #else
16786 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16787                      || ('j' <= (c) && (c) <= 'r') \
16788                      || ('s' <= (c) && (c) <= 'z'))
16789 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16790 #endif
16791
16792 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16793 int
16794 main (void)
16795 {
16796   int i;
16797   for (i = 0; i < 256; i++)
16798     if (XOR (islower (i), ISLOWER (i))
16799         || toupper (i) != TOUPPER (i))
16800       $ac_main_return(2);
16801   $ac_main_return (0);
16802 }
16803 _ACEOF
16804 rm -f "conftest$ac_exeext"
16805 if { (eval echo "$as_me:16805: \"$ac_link\"") >&5
16806   (eval $ac_link) 2>&5
16807   ac_status=$?
16808   echo "$as_me:16808: \$? = $ac_status" >&5
16809   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16810   { (eval echo "$as_me:16810: \"$ac_try\"") >&5
16811   (eval $ac_try) 2>&5
16812   ac_status=$?
16813   echo "$as_me:16813: \$? = $ac_status" >&5
16814   (exit "$ac_status"); }; }; then
16815   :
16816 else
16817   echo "$as_me: program exited with status $ac_status" >&5
16818 echo "$as_me: failed program was:" >&5
16819 cat "conftest.$ac_ext" >&5
16820 ac_cv_header_stdc=no
16821 fi
16822 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16823 fi
16824 fi
16825 fi
16826 echo "$as_me:16826: result: $ac_cv_header_stdc" >&5
16827 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16828 if test $ac_cv_header_stdc = yes; then
16829
16830 cat >>confdefs.h <<\EOF
16831 #define STDC_HEADERS 1
16832 EOF
16833
16834 fi
16835
16836 ac_header_dirent=no
16837 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16838   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16839 echo "$as_me:16839: checking for $ac_hdr that defines DIR" >&5
16840 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16841 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16842   echo $ECHO_N "(cached) $ECHO_C" >&6
16843 else
16844   cat >"conftest.$ac_ext" <<_ACEOF
16845 #line 16845 "configure"
16846 #include "confdefs.h"
16847 #include <sys/types.h>
16848 #include <$ac_hdr>
16849
16850 int
16851 main (void)
16852 {
16853 if ((DIR *) 0)
16854 return 0;
16855   ;
16856   return 0;
16857 }
16858 _ACEOF
16859 rm -f "conftest.$ac_objext"
16860 if { (eval echo "$as_me:16860: \"$ac_compile\"") >&5
16861   (eval $ac_compile) 2>&5
16862   ac_status=$?
16863   echo "$as_me:16863: \$? = $ac_status" >&5
16864   (exit "$ac_status"); } &&
16865          { ac_try='test -s "conftest.$ac_objext"'
16866   { (eval echo "$as_me:16866: \"$ac_try\"") >&5
16867   (eval $ac_try) 2>&5
16868   ac_status=$?
16869   echo "$as_me:16869: \$? = $ac_status" >&5
16870   (exit "$ac_status"); }; }; then
16871   eval "$as_ac_Header=yes"
16872 else
16873   echo "$as_me: failed program was:" >&5
16874 cat "conftest.$ac_ext" >&5
16875 eval "$as_ac_Header=no"
16876 fi
16877 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16878 fi
16879 echo "$as_me:16879: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16880 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16881 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16882   cat >>confdefs.h <<EOF
16883 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16884 EOF
16885
16886 ac_header_dirent=$ac_hdr; break
16887 fi
16888
16889 done
16890 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16891 if test $ac_header_dirent = dirent.h; then
16892   echo "$as_me:16892: checking for opendir in -ldir" >&5
16893 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16894 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16895   echo $ECHO_N "(cached) $ECHO_C" >&6
16896 else
16897   ac_check_lib_save_LIBS=$LIBS
16898 LIBS="-ldir  $LIBS"
16899 cat >"conftest.$ac_ext" <<_ACEOF
16900 #line 16900 "configure"
16901 #include "confdefs.h"
16902
16903 /* Override any gcc2 internal prototype to avoid an error.  */
16904 #ifdef __cplusplus
16905 extern "C"
16906 #endif
16907 /* We use char because int might match the return type of a gcc2
16908    builtin and then its argument prototype would still apply.  */
16909 char opendir ();
16910 int
16911 main (void)
16912 {
16913 opendir ();
16914   ;
16915   return 0;
16916 }
16917 _ACEOF
16918 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16919 if { (eval echo "$as_me:16919: \"$ac_link\"") >&5
16920   (eval $ac_link) 2>&5
16921   ac_status=$?
16922   echo "$as_me:16922: \$? = $ac_status" >&5
16923   (exit "$ac_status"); } &&
16924          { ac_try='test -s "conftest$ac_exeext"'
16925   { (eval echo "$as_me:16925: \"$ac_try\"") >&5
16926   (eval $ac_try) 2>&5
16927   ac_status=$?
16928   echo "$as_me:16928: \$? = $ac_status" >&5
16929   (exit "$ac_status"); }; }; then
16930   ac_cv_lib_dir_opendir=yes
16931 else
16932   echo "$as_me: failed program was:" >&5
16933 cat "conftest.$ac_ext" >&5
16934 ac_cv_lib_dir_opendir=no
16935 fi
16936 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16937 LIBS=$ac_check_lib_save_LIBS
16938 fi
16939 echo "$as_me:16939: result: $ac_cv_lib_dir_opendir" >&5
16940 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16941 if test "$ac_cv_lib_dir_opendir" = yes; then
16942   LIBS="$LIBS -ldir"
16943 fi
16944
16945 else
16946   echo "$as_me:16946: checking for opendir in -lx" >&5
16947 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16948 if test "${ac_cv_lib_x_opendir+set}" = set; then
16949   echo $ECHO_N "(cached) $ECHO_C" >&6
16950 else
16951   ac_check_lib_save_LIBS=$LIBS
16952 LIBS="-lx  $LIBS"
16953 cat >"conftest.$ac_ext" <<_ACEOF
16954 #line 16954 "configure"
16955 #include "confdefs.h"
16956
16957 /* Override any gcc2 internal prototype to avoid an error.  */
16958 #ifdef __cplusplus
16959 extern "C"
16960 #endif
16961 /* We use char because int might match the return type of a gcc2
16962    builtin and then its argument prototype would still apply.  */
16963 char opendir ();
16964 int
16965 main (void)
16966 {
16967 opendir ();
16968   ;
16969   return 0;
16970 }
16971 _ACEOF
16972 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16973 if { (eval echo "$as_me:16973: \"$ac_link\"") >&5
16974   (eval $ac_link) 2>&5
16975   ac_status=$?
16976   echo "$as_me:16976: \$? = $ac_status" >&5
16977   (exit "$ac_status"); } &&
16978          { ac_try='test -s "conftest$ac_exeext"'
16979   { (eval echo "$as_me:16979: \"$ac_try\"") >&5
16980   (eval $ac_try) 2>&5
16981   ac_status=$?
16982   echo "$as_me:16982: \$? = $ac_status" >&5
16983   (exit "$ac_status"); }; }; then
16984   ac_cv_lib_x_opendir=yes
16985 else
16986   echo "$as_me: failed program was:" >&5
16987 cat "conftest.$ac_ext" >&5
16988 ac_cv_lib_x_opendir=no
16989 fi
16990 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16991 LIBS=$ac_check_lib_save_LIBS
16992 fi
16993 echo "$as_me:16993: result: $ac_cv_lib_x_opendir" >&5
16994 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16995 if test "$ac_cv_lib_x_opendir" = yes; then
16996   LIBS="$LIBS -lx"
16997 fi
16998
16999 fi
17000
17001 echo "$as_me:17001: checking whether time.h and sys/time.h may both be included" >&5
17002 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17003 if test "${ac_cv_header_time+set}" = set; then
17004   echo $ECHO_N "(cached) $ECHO_C" >&6
17005 else
17006   cat >"conftest.$ac_ext" <<_ACEOF
17007 #line 17007 "configure"
17008 #include "confdefs.h"
17009 #include <sys/types.h>
17010 #include <sys/time.h>
17011 #include <time.h>
17012
17013 int
17014 main (void)
17015 {
17016 if ((struct tm *) 0)
17017 return 0;
17018   ;
17019   return 0;
17020 }
17021 _ACEOF
17022 rm -f "conftest.$ac_objext"
17023 if { (eval echo "$as_me:17023: \"$ac_compile\"") >&5
17024   (eval $ac_compile) 2>&5
17025   ac_status=$?
17026   echo "$as_me:17026: \$? = $ac_status" >&5
17027   (exit "$ac_status"); } &&
17028          { ac_try='test -s "conftest.$ac_objext"'
17029   { (eval echo "$as_me:17029: \"$ac_try\"") >&5
17030   (eval $ac_try) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit "$ac_status"); }; }; then
17034   ac_cv_header_time=yes
17035 else
17036   echo "$as_me: failed program was:" >&5
17037 cat "conftest.$ac_ext" >&5
17038 ac_cv_header_time=no
17039 fi
17040 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17041 fi
17042 echo "$as_me:17042: result: $ac_cv_header_time" >&5
17043 echo "${ECHO_T}$ac_cv_header_time" >&6
17044 if test $ac_cv_header_time = yes; then
17045
17046 cat >>confdefs.h <<\EOF
17047 #define TIME_WITH_SYS_TIME 1
17048 EOF
17049
17050 fi
17051
17052 ###     checks for compiler characteristics
17053 ac_ext=c
17054 ac_cpp='$CPP $CPPFLAGS'
17055 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17056 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17057 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17058 ac_main_return="return"
17059
17060 echo "$as_me:17060: checking for an ANSI C-conforming const" >&5
17061 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17062 if test "${ac_cv_c_const+set}" = set; then
17063   echo $ECHO_N "(cached) $ECHO_C" >&6
17064 else
17065   cat >"conftest.$ac_ext" <<_ACEOF
17066 #line 17066 "configure"
17067 #include "confdefs.h"
17068
17069 int
17070 main (void)
17071 {
17072 /* FIXME: Include the comments suggested by Paul. */
17073 #ifndef __cplusplus
17074   /* Ultrix mips cc rejects this.  */
17075   typedef int charset[2];
17076   const charset x;
17077   /* SunOS 4.1.1 cc rejects this.  */
17078   char const *const *ccp;
17079   char **p;
17080   /* NEC SVR4.0.2 mips cc rejects this.  */
17081   struct point {int x, y;};
17082   static struct point const zero = {0,0};
17083   /* AIX XL C 1.02.0.0 rejects this.
17084      It does not let you subtract one const X* pointer from another in
17085      an arm of an if-expression whose if-part is not a constant
17086      expression */
17087   const char *g = "string";
17088   ccp = &g + (g ? g-g : 0);
17089   /* HPUX 7.0 cc rejects these. */
17090   ++ccp;
17091   p = (char**) ccp;
17092   ccp = (char const *const *) p;
17093   { /* SCO 3.2v4 cc rejects this.  */
17094     char *t;
17095     char const *s = 0 ? (char *) 0 : (char const *) 0;
17096
17097     *t++ = 0;
17098   }
17099   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17100     int x[] = {25, 17};
17101     const int *foo = &x[0];
17102     ++foo;
17103   }
17104   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17105     typedef const int *iptr;
17106     iptr p = 0;
17107     ++p;
17108   }
17109   { /* AIX XL C 1.02.0.0 rejects this saying
17110        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17111     struct s { int j; const int *ap[3]; };
17112     struct s *b; b->j = 5;
17113   }
17114   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17115     const int foo = 10;
17116   }
17117 #endif
17118
17119   ;
17120   return 0;
17121 }
17122 _ACEOF
17123 rm -f "conftest.$ac_objext"
17124 if { (eval echo "$as_me:17124: \"$ac_compile\"") >&5
17125   (eval $ac_compile) 2>&5
17126   ac_status=$?
17127   echo "$as_me:17127: \$? = $ac_status" >&5
17128   (exit "$ac_status"); } &&
17129          { ac_try='test -s "conftest.$ac_objext"'
17130   { (eval echo "$as_me:17130: \"$ac_try\"") >&5
17131   (eval $ac_try) 2>&5
17132   ac_status=$?
17133   echo "$as_me:17133: \$? = $ac_status" >&5
17134   (exit "$ac_status"); }; }; then
17135   ac_cv_c_const=yes
17136 else
17137   echo "$as_me: failed program was:" >&5
17138 cat "conftest.$ac_ext" >&5
17139 ac_cv_c_const=no
17140 fi
17141 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17142 fi
17143 echo "$as_me:17143: result: $ac_cv_c_const" >&5
17144 echo "${ECHO_T}$ac_cv_c_const" >&6
17145 if test $ac_cv_c_const = no; then
17146
17147 cat >>confdefs.h <<\EOF
17148 #define const
17149 EOF
17150
17151 fi
17152
17153 ###     Checks for external-data
17154
17155 echo "$as_me:17155: checking if data-only library module links" >&5
17156 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17157 if test "${cf_cv_link_dataonly+set}" = set; then
17158   echo $ECHO_N "(cached) $ECHO_C" >&6
17159 else
17160
17161         rm -f conftest.a
17162         cat >conftest.$ac_ext <<EOF
17163 #line 17163 "configure"
17164 int     testdata[3] = { 123, 456, 789 };
17165 EOF
17166         if { (eval echo "$as_me:17166: \"$ac_compile\"") >&5
17167   (eval $ac_compile) 2>&5
17168   ac_status=$?
17169   echo "$as_me:17169: \$? = $ac_status" >&5
17170   (exit "$ac_status"); } ; then
17171                 mv conftest.o data.o && \
17172                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17173         fi
17174         rm -f conftest.$ac_ext data.o
17175         cat >conftest.$ac_ext <<EOF
17176 #line 17176 "configure"
17177 int     testfunc(void)
17178 {
17179 #if defined(NeXT)
17180         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17181 #else
17182         extern int testdata[3];
17183         return testdata[0] == 123
17184            &&  testdata[1] == 456
17185            &&  testdata[2] == 789;
17186 #endif
17187 }
17188 EOF
17189         if { (eval echo "$as_me:17189: \"$ac_compile\"") >&5
17190   (eval $ac_compile) 2>&5
17191   ac_status=$?
17192   echo "$as_me:17192: \$? = $ac_status" >&5
17193   (exit "$ac_status"); }; then
17194                 mv conftest.o func.o && \
17195                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17196         fi
17197         rm -f conftest.$ac_ext func.o
17198         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17199         cf_saveLIBS="$LIBS"
17200         LIBS="conftest.a $LIBS"
17201         if test "$cross_compiling" = yes; then
17202   cf_cv_link_dataonly=unknown
17203 else
17204   cat >"conftest.$ac_ext" <<_ACEOF
17205 #line 17205 "configure"
17206 #include "confdefs.h"
17207
17208         int main(void)
17209         {
17210                 extern int testfunc();
17211                 ${cf_cv_main_return:-return} (!testfunc());
17212         }
17213
17214 _ACEOF
17215 rm -f "conftest$ac_exeext"
17216 if { (eval echo "$as_me:17216: \"$ac_link\"") >&5
17217   (eval $ac_link) 2>&5
17218   ac_status=$?
17219   echo "$as_me:17219: \$? = $ac_status" >&5
17220   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17221   { (eval echo "$as_me:17221: \"$ac_try\"") >&5
17222   (eval $ac_try) 2>&5
17223   ac_status=$?
17224   echo "$as_me:17224: \$? = $ac_status" >&5
17225   (exit "$ac_status"); }; }; then
17226   cf_cv_link_dataonly=yes
17227 else
17228   echo "$as_me: program exited with status $ac_status" >&5
17229 echo "$as_me: failed program was:" >&5
17230 cat "conftest.$ac_ext" >&5
17231 cf_cv_link_dataonly=no
17232 fi
17233 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17234 fi
17235         LIBS="$cf_saveLIBS"
17236
17237 fi
17238
17239 echo "$as_me:17239: result: $cf_cv_link_dataonly" >&5
17240 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17241
17242 if test "$cf_cv_link_dataonly" = no ; then
17243
17244 cat >>confdefs.h <<\EOF
17245 #define BROKEN_LINKER 1
17246 EOF
17247
17248         BROKEN_LINKER=1
17249 fi
17250
17251 ###     Checks for library functions.
17252
17253 for ac_header in \
17254 unistd.h \
17255
17256 do
17257 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17258 echo "$as_me:17258: checking for $ac_header" >&5
17259 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17260 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17261   echo $ECHO_N "(cached) $ECHO_C" >&6
17262 else
17263   cat >"conftest.$ac_ext" <<_ACEOF
17264 #line 17264 "configure"
17265 #include "confdefs.h"
17266 #include <$ac_header>
17267 _ACEOF
17268 if { (eval echo "$as_me:17268: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17269   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17270   ac_status=$?
17271   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17272   rm -f conftest.er1
17273   cat conftest.err >&5
17274   echo "$as_me:17274: \$? = $ac_status" >&5
17275   (exit "$ac_status"); } >/dev/null; then
17276   if test -s conftest.err; then
17277     ac_cpp_err=$ac_c_preproc_warn_flag
17278   else
17279     ac_cpp_err=
17280   fi
17281 else
17282   ac_cpp_err=yes
17283 fi
17284 if test -z "$ac_cpp_err"; then
17285   eval "$as_ac_Header=yes"
17286 else
17287   echo "$as_me: failed program was:" >&5
17288   cat "conftest.$ac_ext" >&5
17289   eval "$as_ac_Header=no"
17290 fi
17291 rm -f conftest.err "conftest.$ac_ext"
17292 fi
17293 echo "$as_me:17293: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17294 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17295 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17296   cat >>confdefs.h <<EOF
17297 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17298 EOF
17299
17300 fi
17301 done
17302
17303 echo "$as_me:17303: checking for working mkstemp" >&5
17304 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17305 if test "${cf_cv_func_mkstemp+set}" = set; then
17306   echo $ECHO_N "(cached) $ECHO_C" >&6
17307 else
17308
17309 rm -rf ./conftest*
17310 if test "$cross_compiling" = yes; then
17311   cf_cv_func_mkstemp=maybe
17312 else
17313   cat >"conftest.$ac_ext" <<_ACEOF
17314 #line 17314 "configure"
17315 #include "confdefs.h"
17316
17317 #include <sys/types.h>
17318 #ifdef HAVE_UNISTD_H
17319 #include <unistd.h>
17320 #endif
17321 #include <stdlib.h>
17322 #include <stdio.h>
17323 #include <string.h>
17324 #include <sys/stat.h>
17325 int main(void)
17326 {
17327         char *tmpl = "conftestXXXXXX";
17328         char name[2][80];
17329         int n;
17330         int result = 0;
17331         int fd;
17332         struct stat sb;
17333
17334         umask(077);
17335         for (n = 0; n < 2; ++n) {
17336                 strcpy(name[n], tmpl);
17337                 if ((fd = mkstemp(name[n])) >= 0) {
17338                         if (!strcmp(name[n], tmpl)
17339                          || stat(name[n], &sb) != 0
17340                          || (sb.st_mode & S_IFMT) != S_IFREG
17341                          || (sb.st_mode & 077) != 0) {
17342                                 result = 1;
17343                         }
17344                         close(fd);
17345                 }
17346         }
17347         if (result == 0
17348          && !strcmp(name[0], name[1]))
17349                 result = 1;
17350         ${cf_cv_main_return:-return}(result);
17351 }
17352
17353 _ACEOF
17354 rm -f "conftest$ac_exeext"
17355 if { (eval echo "$as_me:17355: \"$ac_link\"") >&5
17356   (eval $ac_link) 2>&5
17357   ac_status=$?
17358   echo "$as_me:17358: \$? = $ac_status" >&5
17359   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17360   { (eval echo "$as_me:17360: \"$ac_try\"") >&5
17361   (eval $ac_try) 2>&5
17362   ac_status=$?
17363   echo "$as_me:17363: \$? = $ac_status" >&5
17364   (exit "$ac_status"); }; }; then
17365   cf_cv_func_mkstemp=yes
17366
17367 else
17368   echo "$as_me: program exited with status $ac_status" >&5
17369 echo "$as_me: failed program was:" >&5
17370 cat "conftest.$ac_ext" >&5
17371 cf_cv_func_mkstemp=no
17372
17373 fi
17374 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17375 fi
17376
17377 fi
17378 echo "$as_me:17378: result: $cf_cv_func_mkstemp" >&5
17379 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17380 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17381         echo "$as_me:17381: checking for mkstemp" >&5
17382 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17383 if test "${ac_cv_func_mkstemp+set}" = set; then
17384   echo $ECHO_N "(cached) $ECHO_C" >&6
17385 else
17386   cat >"conftest.$ac_ext" <<_ACEOF
17387 #line 17387 "configure"
17388 #include "confdefs.h"
17389 #define mkstemp autoconf_temporary
17390 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17391 #undef mkstemp
17392
17393 #ifdef __cplusplus
17394 extern "C"
17395 #endif
17396
17397 /* We use char because int might match the return type of a gcc2
17398    builtin and then its argument prototype would still apply.  */
17399 char mkstemp (void);
17400
17401 int
17402 main (void)
17403 {
17404
17405 /* The GNU C library defines stubs for functions which it implements
17406     to always fail with ENOSYS.  Some functions are actually named
17407     something starting with __ and the normal name is an alias.  */
17408 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17409 #error found stub for mkstemp
17410 #endif
17411
17412         return mkstemp ();
17413   ;
17414   return 0;
17415 }
17416 _ACEOF
17417 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17418 if { (eval echo "$as_me:17418: \"$ac_link\"") >&5
17419   (eval $ac_link) 2>&5
17420   ac_status=$?
17421   echo "$as_me:17421: \$? = $ac_status" >&5
17422   (exit "$ac_status"); } &&
17423          { ac_try='test -s "conftest$ac_exeext"'
17424   { (eval echo "$as_me:17424: \"$ac_try\"") >&5
17425   (eval $ac_try) 2>&5
17426   ac_status=$?
17427   echo "$as_me:17427: \$? = $ac_status" >&5
17428   (exit "$ac_status"); }; }; then
17429   ac_cv_func_mkstemp=yes
17430 else
17431   echo "$as_me: failed program was:" >&5
17432 cat "conftest.$ac_ext" >&5
17433 ac_cv_func_mkstemp=no
17434 fi
17435 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17436 fi
17437 echo "$as_me:17437: result: $ac_cv_func_mkstemp" >&5
17438 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17439
17440 fi
17441 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17442
17443 cat >>confdefs.h <<\EOF
17444 #define HAVE_MKSTEMP 1
17445 EOF
17446
17447 fi
17448
17449 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17450         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17451         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17452 fi
17453
17454 cf_with_ada=yes
17455 if test "$cf_with_ada" != "no" ; then
17456
17457 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17458 do
17459
17460 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17461
17462         unset ac_cv_path_cf_TEMP_gnat
17463         unset cf_TEMP_gnat
17464         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17465 set dummy $cf_prog_gnat; ac_word=$2
17466 echo "$as_me:17466: checking for $ac_word" >&5
17467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17468 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17469   echo $ECHO_N "(cached) $ECHO_C" >&6
17470 else
17471   case $cf_TEMP_gnat in
17472   [\\/]* | ?:[\\/]*)
17473   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17474   ;;
17475   *)
17476   ac_save_IFS=$IFS; IFS=$ac_path_separator
17477 ac_dummy="$PATH"
17478 for ac_dir in $ac_dummy; do
17479   IFS=$ac_save_IFS
17480   test -z "$ac_dir" && ac_dir=.
17481   if $as_executable_p "$ac_dir/$ac_word"; then
17482    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17483    echo "$as_me:17483: found $ac_dir/$ac_word" >&5
17484    break
17485 fi
17486 done
17487
17488   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17489   ;;
17490 esac
17491 fi
17492 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17493
17494 if test -n "$cf_TEMP_gnat"; then
17495   echo "$as_me:17495: result: $cf_TEMP_gnat" >&5
17496 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17497 else
17498   echo "$as_me:17498: result: no" >&5
17499 echo "${ECHO_T}no" >&6
17500 fi
17501
17502         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17503
17504         if test "x$cf_TEMP_gnat" != xno; then
17505                 unset cf_cv_gnat_version
17506                 unset cf_TEMP_gnat
17507
17508 echo "$as_me:17508: checking for $cf_prog_gnat version" >&5
17509 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17510 if test "${cf_cv_gnat_version+set}" = set; then
17511   echo $ECHO_N "(cached) $ECHO_C" >&6
17512 else
17513
17514 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17515         grep '[0-9].[0-9][0-9]*' |\
17516         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17517
17518 fi
17519 echo "$as_me:17519: result: $cf_cv_gnat_version" >&5
17520 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17521 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17522 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17523
17524         fi
17525         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17526
17527         unset cf_TEMP_gnat
17528         unset cf_cv_gnat_version
17529         unset ac_cv_path_cf_TEMP_gnat
17530 done
17531
17532 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17533         cf_ada_make=
17534         cf_cv_prog_gnat_correct=no
17535 else
17536         cf_ada_make=gnatmake
17537         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17538                 # gprconfig is newer than gnatmake; we can continue...
17539                 cf_ada_config="##"
17540         else
17541                 rm -rf ./conftest* ./*~conftest*
17542                 if mkdir conftest.src
17543                 then
17544                         cf_ada_config=""
17545                         cd conftest.src
17546                         for cf_gprconfig in Ada C
17547                         do
17548                                 echo "$as_me:17548: checking for gprconfig name for $cf_gprconfig" >&5
17549 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17550                                 if test "$cf_gprconfig" = C
17551                                 then
17552                                         for cf_gprconfig_param in \
17553                                                 "$cf_gprconfig,,,,GNATGCC" \
17554                                                 "$cf_gprconfig,,,,GCC" \
17555                                                 "$cf_gprconfig"
17556                                         do
17557                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17558                                                 test -n "$cf_gprconfig_value" && break
17559                                         done
17560                                 else
17561                                         cf_gprconfig_param=$cf_gprconfig
17562                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17563                                 fi
17564                                 if test -n "$cf_gprconfig_value"
17565                                 then
17566                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17567                                         echo "$as_me:17567: result: $cf_gprconfig_value" >&5
17568 echo "${ECHO_T}$cf_gprconfig_value" >&6
17569                                 else
17570                                         echo "$as_me:17570: result: missing" >&5
17571 echo "${ECHO_T}missing" >&6
17572                                         cf_ada_config="#"
17573                                         break
17574                                 fi
17575                         done
17576                         cd ..
17577                         rm -rf ./conftest* ./*~conftest*
17578                 fi
17579         fi
17580         if test "x$cf_ada_config" != "x#"
17581         then
17582
17583 echo "$as_me:17583: checking for gnat version" >&5
17584 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17585 if test "${cf_cv_gnat_version+set}" = set; then
17586   echo $ECHO_N "(cached) $ECHO_C" >&6
17587 else
17588
17589 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17590         grep '[0-9].[0-9][0-9]*' |\
17591         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17592
17593 fi
17594 echo "$as_me:17594: result: $cf_cv_gnat_version" >&5
17595 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17596 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17597
17598 case "$cf_cv_gnat_version" in
17599 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17600         cf_cv_prog_gnat_correct=yes
17601         ;;
17602 (*)
17603         { echo "$as_me:17603: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17604 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17605         cf_cv_prog_gnat_correct=no
17606         ;;
17607 esac
17608
17609                 # Extract the first word of "m4", so it can be a program name with args.
17610 set dummy m4; ac_word=$2
17611 echo "$as_me:17611: checking for $ac_word" >&5
17612 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17613 if test "${ac_cv_prog_M4_exists+set}" = set; then
17614   echo $ECHO_N "(cached) $ECHO_C" >&6
17615 else
17616   if test -n "$M4_exists"; then
17617   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17618 else
17619   ac_save_IFS=$IFS; IFS=$ac_path_separator
17620 ac_dummy="$PATH"
17621 for ac_dir in $ac_dummy; do
17622   IFS=$ac_save_IFS
17623   test -z "$ac_dir" && ac_dir=.
17624   $as_executable_p "$ac_dir/$ac_word" || continue
17625 ac_cv_prog_M4_exists="yes"
17626 echo "$as_me:17626: found $ac_dir/$ac_word" >&5
17627 break
17628 done
17629
17630   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17631 fi
17632 fi
17633 M4_exists=$ac_cv_prog_M4_exists
17634 if test -n "$M4_exists"; then
17635   echo "$as_me:17635: result: $M4_exists" >&5
17636 echo "${ECHO_T}$M4_exists" >&6
17637 else
17638   echo "$as_me:17638: result: no" >&5
17639 echo "${ECHO_T}no" >&6
17640 fi
17641
17642                 if test "$ac_cv_prog_M4_exists" = no; then
17643                         cf_cv_prog_gnat_correct=no
17644                         { echo "$as_me:17644: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17645 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17646                 fi
17647                 if test "$cf_cv_prog_gnat_correct" = yes; then
17648                         echo "$as_me:17648: checking if GNAT works" >&5
17649 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17650
17651 rm -rf ./conftest* ./*~conftest*
17652 cat >>conftest.ads <<CF_EOF
17653 procedure conftest;
17654 CF_EOF
17655 cat >>conftest.adb <<CF_EOF
17656 with Text_IO;
17657 with GNAT.OS_Lib;
17658 procedure conftest is
17659 begin
17660    Text_IO.Put ("Hello World");
17661    Text_IO.New_Line;
17662    GNAT.OS_Lib.OS_Exit (0);
17663 end conftest;
17664 CF_EOF
17665 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17666    if ( ./conftest 1>&5 2>&1 ) ; then
17667       cf_cv_prog_gnat_correct=yes
17668    else
17669       cf_cv_prog_gnat_correct=no
17670    fi
17671 else
17672    cf_cv_prog_gnat_correct=no
17673 fi
17674 rm -rf ./conftest* ./*~conftest*
17675
17676                         echo "$as_me:17676: result: $cf_cv_prog_gnat_correct" >&5
17677 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17678                 fi
17679         else
17680                 cf_cv_prog_gnat_correct=no
17681         fi
17682 fi
17683
17684         if test "$cf_cv_prog_gnat_correct" = yes; then
17685
17686         echo "$as_me:17686: checking optimization options for ADAFLAGS" >&5
17687 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17688         case "$CFLAGS" in
17689         (*-g*)
17690
17691         ADAFLAGS="$ADAFLAGS -g"
17692
17693                 ;;
17694         esac
17695         case "$CFLAGS" in
17696         (*-O*)
17697                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17698
17699         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17700
17701                 ;;
17702         esac
17703         echo "$as_me:17703: result: $ADAFLAGS" >&5
17704 echo "${ECHO_T}$ADAFLAGS" >&6
17705
17706 echo "$as_me:17706: checking if GNATPREP supports -T option" >&5
17707 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17708 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17709   echo $ECHO_N "(cached) $ECHO_C" >&6
17710 else
17711
17712 cf_cv_gnatprep_opt_t=no
17713 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17714
17715 fi
17716 echo "$as_me:17716: result: $cf_cv_gnatprep_opt_t" >&5
17717 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17718 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17719
17720 echo "$as_me:17720: checking if GNAT supports generics" >&5
17721 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17722 case "$cf_cv_gnat_version" in
17723 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17724         cf_gnat_generics=yes
17725         ;;
17726 (*)
17727         cf_gnat_generics=no
17728         ;;
17729 esac
17730 echo "$as_me:17730: result: $cf_gnat_generics" >&5
17731 echo "${ECHO_T}$cf_gnat_generics" >&6
17732
17733 if test "$cf_gnat_generics" = yes
17734 then
17735         cf_compile_generics=generics
17736         cf_generic_objects="\${GENOBJS}"
17737 else
17738         cf_compile_generics=
17739         cf_generic_objects=
17740 fi
17741
17742 echo "$as_me:17742: checking if GNAT supports SIGINT" >&5
17743 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17744 if test "${cf_cv_gnat_sigint+set}" = set; then
17745   echo $ECHO_N "(cached) $ECHO_C" >&6
17746 else
17747
17748 rm -rf ./conftest* ./*~conftest*
17749 cat >>conftest.ads <<CF_EOF
17750 with Ada.Interrupts.Names;
17751
17752 package ConfTest is
17753
17754    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17755    pragma Unreserve_All_Interrupts;
17756    pragma Warnings (On);
17757
17758    protected Process is
17759       procedure Stop;
17760       function Continue return Boolean;
17761       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17762    private
17763       Done : Boolean := False;
17764    end Process;
17765
17766 end ConfTest;
17767 CF_EOF
17768 cat >>conftest.adb <<CF_EOF
17769 package body ConfTest is
17770    protected body Process is
17771       procedure Stop is
17772       begin
17773          Done := True;
17774       end Stop;
17775       function Continue return Boolean is
17776       begin
17777          return not Done;
17778       end Continue;
17779    end Process;
17780 end ConfTest;
17781 CF_EOF
17782 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17783       cf_cv_gnat_sigint=yes
17784 else
17785    cf_cv_gnat_sigint=no
17786 fi
17787 rm -rf ./conftest* ./*~conftest*
17788
17789 fi
17790 echo "$as_me:17790: result: $cf_cv_gnat_sigint" >&5
17791 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17792
17793 if test "$cf_cv_gnat_sigint" = yes ; then
17794         USE_GNAT_SIGINT=""
17795 else
17796         USE_GNAT_SIGINT="#"
17797 fi
17798
17799 cf_gnat_libraries=no
17800 cf_gnat_projects=no
17801
17802 if test "$enable_gnat_projects" != no ; then
17803 echo "$as_me:17803: checking if GNAT supports project files" >&5
17804 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17805 case "$cf_cv_gnat_version" in
17806 (3.[0-9]*)
17807         ;;
17808 (*)
17809         case "$cf_cv_system_name" in
17810         (cygwin*|msys*)
17811                 ;;
17812         (*)
17813                 rm -rf ./conftest* ./*~conftest*
17814                 if mkdir conftest.src conftest.bin conftest.lib
17815                 then
17816                         cd conftest.src
17817                         rm -rf ./conftest* ./*~conftest*
17818                         cat >>library.gpr <<CF_EOF
17819 project Library is
17820   Kind := External ("LIB_KIND");
17821   for Library_Name use "ConfTest";
17822   for Object_Dir use ".";
17823   for Library_ALI_Dir use External("LIBRARY_DIR");
17824   for Library_Version use External ("SONAME");
17825   for Library_Kind use Kind;
17826   for Library_Dir use External("BUILD_DIR");
17827   Source_Dir := External ("SOURCE_DIR");
17828   for Source_Dirs use (Source_Dir);
17829 end Library;
17830 CF_EOF
17831                         cat >>confpackage.ads <<CF_EOF
17832 package ConfPackage is
17833    procedure conftest;
17834 end ConfPackage;
17835 CF_EOF
17836                         cat >>confpackage.adb <<CF_EOF
17837 with Text_IO;
17838 package body ConfPackage is
17839    procedure conftest is
17840    begin
17841       Text_IO.Put ("Hello World");
17842       Text_IO.New_Line;
17843    end conftest;
17844 end ConfPackage;
17845 CF_EOF
17846                         if ( "$cf_ada_make" $ADAFLAGS \
17847                                         -Plibrary.gpr \
17848                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17849                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17850                                         -XSOURCE_DIR="`pwd`" \
17851                                         -XSONAME=libConfTest.so.1 \
17852                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17853                                 cf_gnat_projects=yes
17854                         fi
17855                         cd ..
17856                 fi
17857                 if test -f conftest.lib/confpackage.ali
17858                 then
17859                         cf_gnat_libraries=yes
17860                 fi
17861                 rm -rf ./conftest* ./*~conftest*
17862                 ;;
17863         esac
17864         ;;
17865 esac
17866 echo "$as_me:17866: result: $cf_gnat_projects" >&5
17867 echo "${ECHO_T}$cf_gnat_projects" >&6
17868 fi # enable_gnat_projects
17869
17870 if test "$cf_gnat_projects" = yes
17871 then
17872         echo "$as_me:17872: checking if GNAT supports libraries" >&5
17873 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17874         echo "$as_me:17874: result: $cf_gnat_libraries" >&5
17875 echo "${ECHO_T}$cf_gnat_libraries" >&6
17876 fi
17877
17878 USE_OLD_MAKERULES=""
17879 USE_GNAT_PROJECTS="#"
17880 USE_GNAT_MAKE_GPR="#"
17881 USE_GNAT_GPRBUILD="#"
17882
17883 if test "$cf_gnat_projects" = yes
17884 then
17885         USE_OLD_MAKERULES="#"
17886         USE_GNAT_PROJECTS=""
17887         if test "$cf_cv_VERSION_GPRBUILD" != no
17888         then
17889                 USE_GNAT_GPRBUILD=""
17890         elif test "$cf_cv_VERSION_GNATMAKE" != no
17891         then
17892                 USE_GNAT_MAKE_GPR=""
17893         else
17894                 { echo "$as_me:17894: WARNING: use old makefile rules since tools are missing" >&5
17895 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17896         fi
17897 fi
17898
17899 if test "$cf_gnat_libraries" = yes
17900 then
17901         USE_GNAT_LIBRARIES=""
17902 else
17903         USE_GNAT_LIBRARIES="#"
17904 fi
17905
17906 echo "$as_me:17906: checking for ada-compiler" >&5
17907 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17908
17909 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17910 if test "${with_ada_compiler+set}" = set; then
17911   withval="$with_ada_compiler"
17912   cf_ada_compiler=$withval
17913 else
17914   cf_ada_compiler=gnatmake
17915 fi;
17916
17917 echo "$as_me:17917: result: $cf_ada_compiler" >&5
17918 echo "${ECHO_T}$cf_ada_compiler" >&6
17919
17920                 cf_ada_package=terminal_interface
17921
17922 echo "$as_me:17922: checking for ada-include" >&5
17923 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17924
17925 # Check whether --with-ada-include or --without-ada-include was given.
17926 if test "${with_ada_include+set}" = set; then
17927   withval="$with_ada_include"
17928
17929 else
17930   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17931 fi; if test -n "$prefix/share/ada/adainclude" ; then
17932
17933 if test "x$prefix" != xNONE; then
17934         cf_path_syntax="$prefix"
17935 else
17936         cf_path_syntax="$ac_default_prefix"
17937 fi
17938
17939 case ".$withval" in
17940 (.\$\(*\)*|.\'*\'*)
17941         ;;
17942 (..|./*|.\\*)
17943         ;;
17944 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17945         ;;
17946 (.\$\{*prefix\}*|.\$\{*dir\}*)
17947         eval withval="$withval"
17948         case ".$withval" in
17949         (.NONE/*)
17950                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17951                 ;;
17952         esac
17953         ;;
17954 (.no|.NONE/*)
17955         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17956         ;;
17957 (*)
17958         { { echo "$as_me:17958: error: expected a pathname, not \"$withval\"" >&5
17959 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17960    { (exit 1); exit 1; }; }
17961         ;;
17962 esac
17963
17964 fi
17965 eval ADA_INCLUDE="$withval"
17966
17967 echo "$as_me:17967: result: $ADA_INCLUDE" >&5
17968 echo "${ECHO_T}$ADA_INCLUDE" >&6
17969
17970 echo "$as_me:17970: checking for ada-objects" >&5
17971 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17972
17973 # Check whether --with-ada-objects or --without-ada-objects was given.
17974 if test "${with_ada_objects+set}" = set; then
17975   withval="$with_ada_objects"
17976
17977 else
17978   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17979 fi; if test -n "$prefix/lib/ada/adalib" ; then
17980
17981 if test "x$prefix" != xNONE; then
17982         cf_path_syntax="$prefix"
17983 else
17984         cf_path_syntax="$ac_default_prefix"
17985 fi
17986
17987 case ".$withval" in
17988 (.\$\(*\)*|.\'*\'*)
17989         ;;
17990 (..|./*|.\\*)
17991         ;;
17992 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17993         ;;
17994 (.\$\{*prefix\}*|.\$\{*dir\}*)
17995         eval withval="$withval"
17996         case ".$withval" in
17997         (.NONE/*)
17998                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17999                 ;;
18000         esac
18001         ;;
18002 (.no|.NONE/*)
18003         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18004         ;;
18005 (*)
18006         { { echo "$as_me:18006: error: expected a pathname, not \"$withval\"" >&5
18007 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18008    { (exit 1); exit 1; }; }
18009         ;;
18010 esac
18011
18012 fi
18013 eval ADA_OBJECTS="$withval"
18014
18015 echo "$as_me:18015: result: $ADA_OBJECTS" >&5
18016 echo "${ECHO_T}$ADA_OBJECTS" >&6
18017
18018 echo "$as_me:18018: checking if an Ada95 shared-library should be built" >&5
18019 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18020
18021 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18022 if test "${with_ada_sharedlib+set}" = set; then
18023   withval="$with_ada_sharedlib"
18024   with_ada_sharedlib=$withval
18025 else
18026   with_ada_sharedlib=no
18027 fi;
18028 echo "$as_me:18028: result: $with_ada_sharedlib" >&5
18029 echo "${ECHO_T}$with_ada_sharedlib" >&6
18030
18031 if test "x$with_ada_sharedlib" != xno
18032 then
18033         if test "x$cf_gnat_projects" != xyes
18034         then
18035                 { echo "$as_me:18035: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18036 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18037                 with_ada_sharedlib=no
18038         fi
18039 fi
18040
18041 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18042 MAKE_ADA_SHAREDLIB="#"
18043
18044 if test "x$with_ada_sharedlib" != xno
18045 then
18046         MAKE_ADA_SHAREDLIB=
18047         if test "x$with_ada_sharedlib" != xyes
18048         then
18049                 ADA_SHAREDLIB="$with_ada_sharedlib"
18050         fi
18051 fi
18052
18053                 # allow the Ada binding to be renamed
18054
18055 echo "$as_me:18055: checking for ada-libname" >&5
18056 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18057
18058 # Check whether --with-ada-libname or --without-ada-libname was given.
18059 if test "${with_ada_libname+set}" = set; then
18060   withval="$with_ada_libname"
18061   ADA_LIBNAME=$withval
18062 else
18063   ADA_LIBNAME=AdaCurses
18064 fi;
18065 case "x$ADA_LIBNAME" in
18066 (x|xyes|xno)
18067         ADA_LIBNAME=AdaCurses
18068         ;;
18069 esac
18070
18071 echo "$as_me:18071: result: $ADA_LIBNAME" >&5
18072 echo "${ECHO_T}$ADA_LIBNAME" >&6
18073
18074         else
18075                 { { echo "$as_me:18075: error: No usable Ada compiler found" >&5
18076 echo "$as_me: error: No usable Ada compiler found" >&2;}
18077    { (exit 1); exit 1; }; }
18078         fi
18079 else
18080         { { echo "$as_me:18080: error: The Ada compiler is needed for this package" >&5
18081 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18082    { (exit 1); exit 1; }; }
18083 fi
18084
18085 ################################################################################
18086
18087 # not needed
18088 TINFO_LDFLAGS2=
18089
18090 TINFO_LIBS=
18091
18092 ### Construct the list of include-directories to be generated
18093
18094 if test "$srcdir" != "."; then
18095         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18096 fi
18097 CPPFLAGS="-I../include $CPPFLAGS"
18098 if test "$srcdir" != "."; then
18099         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18100 fi
18101 CPPFLAGS="-I. $CPPFLAGS"
18102
18103 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18104 if test "$srcdir" != "."; then
18105         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18106 fi
18107 if test "$GCC" != yes; then
18108         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18109 elif test "$includedir" != "/usr/include"; then
18110         if test "$includedir" = '${prefix}/include' ; then
18111                 if test x$prefix != x/usr ; then
18112                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18113                 fi
18114         else
18115                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18116         fi
18117 fi
18118
18119 ### Build up pieces for makefile rules
18120 echo "$as_me:18120: checking default library suffix" >&5
18121 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18122
18123         case $DFT_LWR_MODEL in
18124         (libtool) DFT_ARG_SUFFIX=''   ;;
18125         (normal)  DFT_ARG_SUFFIX=''   ;;
18126         (debug)   DFT_ARG_SUFFIX='_g' ;;
18127         (profile) DFT_ARG_SUFFIX='_p' ;;
18128         (shared)  DFT_ARG_SUFFIX=''   ;;
18129         esac
18130         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18131 echo "$as_me:18131: result: $DFT_ARG_SUFFIX" >&5
18132 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18133
18134 echo "$as_me:18134: checking default library-dependency suffix" >&5
18135 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18136
18137         case X$DFT_LWR_MODEL in
18138         (Xlibtool)
18139                 DFT_LIB_SUFFIX='.la'
18140                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18141                 ;;
18142         (Xdebug)
18143                 case "$cf_cv_system_name" in
18144                 (*-msvc*)
18145                         DFT_LIB_SUFFIX='_g.lib'
18146                         ;;
18147                 (*)
18148                         DFT_LIB_SUFFIX='_g.a'
18149                         ;;
18150                 esac
18151                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18152                 ;;
18153         (Xprofile)
18154                 case "$cf_cv_system_name" in
18155                 (*-msvc*)
18156                         DFT_LIB_SUFFIX='_p.lib'
18157                         ;;
18158                 (*)
18159                         DFT_LIB_SUFFIX='_p.a'
18160                         ;;
18161                 esac
18162                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18163                 ;;
18164         (Xshared)
18165                 case "$cf_cv_system_name" in
18166                 (aix[5-7]*)
18167                         DFT_LIB_SUFFIX='.so'
18168                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18169                         ;;
18170                 (*-msvc*)
18171                         DFT_LIB_SUFFIX='.dll'
18172                         DFT_DEP_SUFFIX='.dll.lib'
18173                         ;;
18174                 (cygwin*|msys*|mingw*)
18175                         DFT_LIB_SUFFIX='.dll'
18176                         DFT_DEP_SUFFIX='.dll.a'
18177                         ;;
18178                 (darwin*)
18179                         DFT_LIB_SUFFIX='.dylib'
18180                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18181                         ;;
18182                 (hpux*)
18183                         case "$target" in
18184                         (ia64*)
18185                                 DFT_LIB_SUFFIX='.so'
18186                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18187                                 ;;
18188                         (*)
18189                                 DFT_LIB_SUFFIX='.sl'
18190                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18191                                 ;;
18192                         esac
18193                         ;;
18194                 (*)
18195                         DFT_LIB_SUFFIX='.so'
18196                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18197                         ;;
18198                 esac
18199                 ;;
18200         (*)
18201                 case "$target" in
18202                 (*-msvc*)
18203                         DFT_LIB_SUFFIX='.lib'
18204                         ;;
18205                 (*)
18206                         DFT_LIB_SUFFIX='.a'
18207                         ;;
18208                 esac
18209                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18210                 ;;
18211         esac
18212         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18213         then
18214                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18215                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18216         fi
18217 echo "$as_me:18217: result: $DFT_DEP_SUFFIX" >&5
18218 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18219
18220 echo "$as_me:18220: checking default object directory" >&5
18221 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18222
18223         case $DFT_LWR_MODEL in
18224         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18225         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18226         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18227         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18228         (shared)
18229                 case "$cf_cv_system_name" in
18230                 (cygwin|msys)
18231                         DFT_OBJ_SUBDIR='objects' ;;
18232                 (*)
18233                         DFT_OBJ_SUBDIR='obj_s' ;;
18234                 esac
18235         esac
18236 echo "$as_me:18236: result: $DFT_OBJ_SUBDIR" >&5
18237 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18238
18239 ### Set up low-level terminfo dependencies for makefiles.
18240
18241 if test "$DFT_LWR_MODEL" = shared ; then
18242         case $cf_cv_system_name in
18243         (cygwin*)
18244                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18245                 ;;
18246         (msys*)
18247                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18248                 ;;
18249         esac
18250 fi
18251
18252 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18253
18254 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18255
18256 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18257
18258 ### Construct the list of subdirectories for which we'll customize makefiles
18259 ### with the appropriate compile-rules.
18260
18261 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18262
18263 cat >>confdefs.h <<EOF
18264 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18265 EOF
18266
18267 ################################################################################
18268
18269 TEST_ARG2=
18270
18271 TEST_LIBS2=
18272
18273 NCURSES_SHLIB2="sh -c"
18274
18275 ADA_SUBDIRS="include gen src doc"
18276 if test "x$cf_with_tests" != "xno" ; then
18277         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18278 fi
18279 for cf_dir in $ADA_SUBDIRS
18280 do
18281         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18282 done
18283
18284 NCURSES_TREE="#"
18285
18286 EXTERNAL_TREE=
18287
18288 # match layout used by make-tar.sh
18289 ADAHTML_DIR=../doc/ada
18290
18291 if test "x$cross_compiling" = xyes ; then
18292         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18293 else
18294         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18295 fi
18296
18297 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"
18298 ac_config_commands="$ac_config_commands default"
18299 cat >confcache <<\_ACEOF
18300 # This file is a shell script that caches the results of configure
18301 # tests run on this system so they can be shared between configure
18302 # scripts and configure runs, see configure's option --config-cache.
18303 # It is not useful on other systems.  If it contains results you don't
18304 # want to keep, you may remove or edit it.
18305 #
18306 # config.status only pays attention to the cache file if you give it
18307 # the --recheck option to rerun configure.
18308 #
18309 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18310 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18311 # following values.
18312
18313 _ACEOF
18314
18315 # The following way of writing the cache mishandles newlines in values,
18316 # but we know of no workaround that is simple, portable, and efficient.
18317 # So, don't put newlines in cache variables' values.
18318 # Ultrix sh set writes to stderr and can't be redirected directly,
18319 # and sets the high bit in the cache file unless we assign to the vars.
18320 {
18321   (set) 2>&1 |
18322     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18323     *ac_space=\ *)
18324       # `set' does not quote correctly, so add quotes (double-quote
18325       # substitution turns \\\\ into \\, and sed turns \\ into \).
18326       sed -n \
18327         "s/'/'\\\\''/g;
18328           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18329       ;;
18330     *)
18331       # `set' quotes correctly as required by POSIX, so do not add quotes.
18332       sed -n \
18333         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18334       ;;
18335     esac;
18336 } |
18337   sed '
18338      t clear
18339      : clear
18340      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18341      t end
18342      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18343      : end' >>confcache
18344 if cmp -s $cache_file confcache; then :; else
18345   if test -w $cache_file; then
18346     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18347     cat confcache >$cache_file
18348   else
18349     echo "not updating unwritable cache $cache_file"
18350   fi
18351 fi
18352 rm -f confcache
18353
18354 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18355 # Let make expand exec_prefix.
18356 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18357
18358 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18359 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18360 # trailing colons and then remove the whole line if VPATH becomes empty
18361 # (actually we leave an empty line to preserve line numbers).
18362 if test "x$srcdir" = x.; then
18363   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18364 s/:*\$(srcdir):*/:/;
18365 s/:*\${srcdir}:*/:/;
18366 s/:*@srcdir@:*/:/;
18367 s/^\([^=]*=[    ]*\):*/\1/;
18368 s/:*$//;
18369 s/^[^=]*=[      ]*$//;
18370 }'
18371 fi
18372
18373 DEFS=-DHAVE_CONFIG_H
18374
18375 : "${CONFIG_STATUS=./config.status}"
18376 ac_clean_files_save=$ac_clean_files
18377 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18378 { echo "$as_me:18378: creating $CONFIG_STATUS" >&5
18379 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18380 cat >"$CONFIG_STATUS" <<_ACEOF
18381 #! $SHELL
18382 # Generated automatically by configure.
18383 # Run this file to recreate the current configuration.
18384 # Compiler output produced by configure, useful for debugging
18385 # configure, is in config.log if it exists.
18386
18387 debug=false
18388 SHELL=\${CONFIG_SHELL-$SHELL}
18389 ac_cs_invocation="\$0 \$@"
18390
18391 CLICOLOR_FORCE= GREP_OPTIONS=
18392 unset CLICOLOR_FORCE GREP_OPTIONS
18393 _ACEOF
18394
18395 cat >>"$CONFIG_STATUS" <<\_ACEOF
18396 # Be Bourne compatible
18397 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18398   emulate sh
18399   NULLCMD=:
18400 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18401   set -o posix
18402 fi
18403
18404 # Name of the executable.
18405 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18406
18407 if expr a : '\(a\)' >/dev/null 2>&1; then
18408   as_expr=expr
18409 else
18410   as_expr=false
18411 fi
18412
18413 rm -f conf$$ conf$$.exe conf$$.file
18414 echo >conf$$.file
18415 if ln -s conf$$.file conf$$ 2>/dev/null; then
18416   # We could just check for DJGPP; but this test a) works b) is more generic
18417   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18418   if test -f conf$$.exe; then
18419     # Don't use ln at all; we don't have any links
18420     as_ln_s='cp -p'
18421   else
18422     as_ln_s='ln -s'
18423   fi
18424 elif ln conf$$.file conf$$ 2>/dev/null; then
18425   as_ln_s=ln
18426 else
18427   as_ln_s='cp -p'
18428 fi
18429 rm -f conf$$ conf$$.exe conf$$.file
18430
18431 as_executable_p="test -f"
18432
18433 # Support unset when possible.
18434 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18435   as_unset="unset"
18436 else
18437   as_unset="false"
18438 fi
18439
18440 # NLS nuisances.
18441 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18442 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18443 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18444 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18445 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18446 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18447 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18448 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18449
18450 # IFS
18451 # We need space, tab and new line, in precisely that order.
18452 as_nl='
18453 '
18454 IFS="   $as_nl"
18455
18456 # CDPATH.
18457 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18458
18459 exec 6>&1
18460
18461 _ACEOF
18462
18463 # Files that config.status was made for.
18464 if test -n "$ac_config_files"; then
18465   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18466 fi
18467
18468 if test -n "$ac_config_headers"; then
18469   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18470 fi
18471
18472 if test -n "$ac_config_links"; then
18473   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18474 fi
18475
18476 if test -n "$ac_config_commands"; then
18477   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18478 fi
18479
18480 cat >>"$CONFIG_STATUS" <<\EOF
18481
18482 ac_cs_usage="\
18483 \`$as_me' instantiates files from templates according to the
18484 current configuration.
18485
18486 Usage: $0 [OPTIONS] [FILE]...
18487
18488   -h, --help       print this help, then exit
18489   -V, --version    print version number, then exit
18490   -d, --debug      don't remove temporary files
18491       --recheck    update $as_me by reconfiguring in the same conditions
18492   --file=FILE[:TEMPLATE]
18493                    instantiate the configuration file FILE
18494   --header=FILE[:TEMPLATE]
18495                    instantiate the configuration header FILE
18496
18497 Configuration files:
18498 $config_files
18499
18500 Configuration headers:
18501 $config_headers
18502
18503 Configuration commands:
18504 $config_commands
18505
18506 Report bugs to <dickey@invisible-island.net>."
18507 EOF
18508
18509 cat >>"$CONFIG_STATUS" <<EOF
18510 ac_cs_version="\\
18511 config.status
18512 configured by $0, generated by GNU Autoconf 2.52.20210509,
18513   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18514
18515 Copyright 2003-2020,2021        Thomas E. Dickey
18516 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18517 Free Software Foundation, Inc.
18518 This config.status script is free software; the Free Software Foundation
18519 gives unlimited permission to copy, distribute and modify it."
18520 srcdir="$srcdir"
18521 INSTALL="$INSTALL"
18522 EOF
18523
18524 cat >>"$CONFIG_STATUS" <<\EOF
18525 # If no file are specified by the user, then we need to provide default
18526 # value.  By we need to know if files were specified by the user.
18527 ac_need_defaults=:
18528 while test $# != 0
18529 do
18530   case $1 in
18531   --*=*)
18532     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18533     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18534     shift
18535     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18536     shift
18537     ;;
18538   -*);;
18539   *) # This is not an option, so the user has probably given explicit
18540      # arguments.
18541      ac_need_defaults=false;;
18542   esac
18543
18544   case $1 in
18545   # Handling of the options.
18546 EOF
18547 cat >>"$CONFIG_STATUS" <<EOF
18548   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18549     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18550     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18551 EOF
18552 cat >>"$CONFIG_STATUS" <<\EOF
18553   --version | --vers* | -V )
18554     echo "$ac_cs_version"; exit 0 ;;
18555   --he | --h)
18556     # Conflict between --help and --header
18557     { { echo "$as_me:18557: error: ambiguous option: $1
18558 Try \`$0 --help' for more information." >&5
18559 echo "$as_me: error: ambiguous option: $1
18560 Try \`$0 --help' for more information." >&2;}
18561    { (exit 1); exit 1; }; };;
18562   --help | --hel | -h )
18563     echo "$ac_cs_usage"; exit 0 ;;
18564   --debug | --d* | -d )
18565     debug=: ;;
18566   --file | --fil | --fi | --f )
18567     shift
18568     CONFIG_FILES="$CONFIG_FILES $1"
18569     ac_need_defaults=false;;
18570   --header | --heade | --head | --hea )
18571     shift
18572     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18573     ac_need_defaults=false;;
18574
18575   # This is an error.
18576   -*) { { echo "$as_me:18576: error: unrecognized option: $1
18577 Try \`$0 --help' for more information." >&5
18578 echo "$as_me: error: unrecognized option: $1
18579 Try \`$0 --help' for more information." >&2;}
18580    { (exit 1); exit 1; }; } ;;
18581
18582   *) ac_config_targets="$ac_config_targets $1" ;;
18583
18584   esac
18585   shift
18586 done
18587
18588 exec 5>>config.log
18589 cat >&5 << _ACEOF
18590
18591 ## ----------------------- ##
18592 ## Running config.status.  ##
18593 ## ----------------------- ##
18594
18595 This file was extended by $as_me 2.52.20210509, executed with
18596   CONFIG_FILES    = $CONFIG_FILES
18597   CONFIG_HEADERS  = $CONFIG_HEADERS
18598   CONFIG_LINKS    = $CONFIG_LINKS
18599   CONFIG_COMMANDS = $CONFIG_COMMANDS
18600   > "$ac_cs_invocation"
18601 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18602
18603 _ACEOF
18604 EOF
18605
18606 cat >>"$CONFIG_STATUS" <<EOF
18607 #
18608 # INIT-COMMANDS section.
18609 #
18610
18611 ### Special initialization commands, used to pass information from the
18612 ### configuration-run into config.status
18613
18614 AWK="$AWK"
18615 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18616 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18617 LIB_NAME="$LIB_NAME"
18618 LIB_PREFIX="$LIB_PREFIX"
18619 LIB_SUFFIX="$LIB_SUFFIX"
18620 LN_S="$LN_S"
18621 NCURSES_MAJOR="$NCURSES_MAJOR"
18622 NCURSES_MINOR="$NCURSES_MINOR"
18623 NCURSES_PATCH="$NCURSES_PATCH"
18624 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18625 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18626 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18627 cf_cv_abi_version="$cf_cv_abi_version"
18628 cf_cv_rel_version="$cf_cv_rel_version"
18629 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18630 cf_cv_shared_soname='$cf_cv_shared_soname'
18631 cf_cv_shlib_version="$cf_cv_shlib_version"
18632 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18633 cf_cv_system_name="$cf_cv_system_name"
18634 host="$host"
18635 target="$target"
18636
18637 EOF
18638
18639 cat >>"$CONFIG_STATUS" <<\EOF
18640 for ac_config_target in $ac_config_targets
18641 do
18642   case "$ac_config_target" in
18643   # Handling of arguments.
18644   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18645   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18646   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18647   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18648   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18649   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18650   *) { { echo "$as_me:18650: error: invalid argument: $ac_config_target" >&5
18651 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18652    { (exit 1); exit 1; }; };;
18653   esac
18654 done
18655
18656 # If the user did not use the arguments to specify the items to instantiate,
18657 # then the envvar interface is used.  Set only those that are not.
18658 # We use the long form for the default assignment because of an extremely
18659 # bizarre bug on SunOS 4.1.3.
18660 if "$ac_need_defaults"; then
18661   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18662   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18663   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18664 fi
18665
18666 # Create a temporary directory, and hook for its removal unless debugging.
18667 $debug ||
18668 {
18669   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18670   trap '{ (exit 1); exit 1; }' 1 2 13 15
18671 }
18672
18673 # Create a (secure) tmp directory for tmp files.
18674 : ${TMPDIR=/tmp}
18675 {
18676   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18677   test -n "$tmp" && test -d "$tmp"
18678 }  ||
18679 {
18680   tmp=$TMPDIR/cs$$-$RANDOM
18681   (umask 077 && mkdir $tmp)
18682 } ||
18683 {
18684    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18685    { (exit 1); exit 1; }
18686 }
18687
18688 EOF
18689
18690 cat >>"$CONFIG_STATUS" <<EOF
18691
18692 #
18693 # CONFIG_FILES section.
18694 #
18695
18696 # No need to generate the scripts if there are no CONFIG_FILES.
18697 # This happens for instance when ./config.status config.h
18698 if test -n "\$CONFIG_FILES"; then
18699   # Protect against being on the right side of a sed subst in config.status.
18700   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18701    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18702 s,@SHELL@,$SHELL,;t t
18703 s,@exec_prefix@,$exec_prefix,;t t
18704 s,@prefix@,$prefix,;t t
18705 s,@program_transform_name@,$program_transform_name,;t t
18706 s,@bindir@,$bindir,;t t
18707 s,@sbindir@,$sbindir,;t t
18708 s,@libexecdir@,$libexecdir,;t t
18709 s,@datarootdir@,$datarootdir,;t t
18710 s,@datadir@,$datadir,;t t
18711 s,@sysconfdir@,$sysconfdir,;t t
18712 s,@sharedstatedir@,$sharedstatedir,;t t
18713 s,@localstatedir@,$localstatedir,;t t
18714 s,@runstatedir@,$runstatedir,;t t
18715 s,@libdir@,$libdir,;t t
18716 s,@includedir@,$includedir,;t t
18717 s,@oldincludedir@,$oldincludedir,;t t
18718 s,@infodir@,$infodir,;t t
18719 s,@mandir@,$mandir,;t t
18720 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18721 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18722 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18723 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18724 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18725 s,@build_alias@,$build_alias,;t t
18726 s,@host_alias@,$host_alias,;t t
18727 s,@target_alias@,$target_alias,;t t
18728 s,@ECHO_C@,$ECHO_C,;t t
18729 s,@ECHO_N@,$ECHO_N,;t t
18730 s,@ECHO_T@,$ECHO_T,;t t
18731 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18732 s,@DEFS@,$DEFS,;t t
18733 s,@LIBS@,$LIBS,;t t
18734 s,@top_builddir@,$top_builddir,;t t
18735 s,@build@,$build,;t t
18736 s,@build_cpu@,$build_cpu,;t t
18737 s,@build_vendor@,$build_vendor,;t t
18738 s,@build_os@,$build_os,;t t
18739 s,@host@,$host,;t t
18740 s,@host_cpu@,$host_cpu,;t t
18741 s,@host_vendor@,$host_vendor,;t t
18742 s,@host_os@,$host_os,;t t
18743 s,@target@,$target,;t t
18744 s,@target_cpu@,$target_cpu,;t t
18745 s,@target_vendor@,$target_vendor,;t t
18746 s,@target_os@,$target_os,;t t
18747 s,@GREP@,$GREP,;t t
18748 s,@FGREP@,$FGREP,;t t
18749 s,@CC@,$CC,;t t
18750 s,@CFLAGS@,$CFLAGS,;t t
18751 s,@LDFLAGS@,$LDFLAGS,;t t
18752 s,@CPPFLAGS@,$CPPFLAGS,;t t
18753 s,@ac_ct_CC@,$ac_ct_CC,;t t
18754 s,@EXEEXT@,$EXEEXT,;t t
18755 s,@OBJEXT@,$OBJEXT,;t t
18756 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18757 s,@CPP@,$CPP,;t t
18758 s,@EGREP@,$EGREP,;t t
18759 s,@AWK@,$AWK,;t t
18760 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18761 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18762 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18763 s,@LN_S@,$LN_S,;t t
18764 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18765 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18766 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18767 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18768 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18769 s,@SET_MAKE@,$SET_MAKE,;t t
18770 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18771 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18772 s,@CTAGS@,$CTAGS,;t t
18773 s,@ETAGS@,$ETAGS,;t t
18774 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18775 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18776 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18777 s,@RANLIB@,$RANLIB,;t t
18778 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18779 s,@LD@,$LD,;t t
18780 s,@ac_ct_LD@,$ac_ct_LD,;t t
18781 s,@AR@,$AR,;t t
18782 s,@ac_ct_AR@,$ac_ct_AR,;t t
18783 s,@ARFLAGS@,$ARFLAGS,;t t
18784 s,@DESTDIR@,$DESTDIR,;t t
18785 s,@BUILD_CC@,$BUILD_CC,;t t
18786 s,@BUILD_CPP@,$BUILD_CPP,;t t
18787 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18788 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18789 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18790 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18791 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18792 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18793 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18794 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18795 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18796 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18797 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18798 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18799 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18800 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18801 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18802 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18803 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18804 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18805 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18806 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18807 s,@CC_G_OPT@,$CC_G_OPT,;t t
18808 s,@LD_MODEL@,$LD_MODEL,;t t
18809 s,@shlibdir@,$shlibdir,;t t
18810 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18811 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18812 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18813 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18814 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18815 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18816 s,@LINK_PROGS@,$LINK_PROGS,;t t
18817 s,@LINK_TESTS@,$LINK_TESTS,;t t
18818 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18819 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18820 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18821 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18822 s,@RPATH_LIST@,$RPATH_LIST,;t t
18823 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18824 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18825 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18826 s,@PTHREAD@,$PTHREAD,;t t
18827 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18828 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18829 s,@ECHO_LT@,$ECHO_LT,;t t
18830 s,@ECHO_LD@,$ECHO_LD,;t t
18831 s,@RULE_CC@,$RULE_CC,;t t
18832 s,@SHOW_CC@,$SHOW_CC,;t t
18833 s,@ECHO_CC@,$ECHO_CC,;t t
18834 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18835 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18836 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18837 s,@ADAFLAGS@,$ADAFLAGS,;t t
18838 s,@ADA_TRACE@,$ADA_TRACE,;t t
18839 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18840 s,@M4_exists@,$M4_exists,;t t
18841 s,@cf_ada_make@,$cf_ada_make,;t t
18842 s,@cf_ada_config@,$cf_ada_config,;t t
18843 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18844 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18845 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18846 s,@cf_compile_generics@,$cf_compile_generics,;t t
18847 s,@cf_generic_objects@,$cf_generic_objects,;t t
18848 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18849 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18850 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18851 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18852 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18853 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18854 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18855 s,@cf_ada_package@,$cf_ada_package,;t t
18856 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18857 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18858 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18859 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18860 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18861 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18862 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18863 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18864 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18865 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18866 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18867 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18868 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18869 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18870 s,@TEST_ARG2@,$TEST_ARG2,;t t
18871 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18872 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18873 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18874 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18875 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18876 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18877 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18878 CEOF
18879
18880 EOF
18881
18882   cat >>"$CONFIG_STATUS" <<\EOF
18883   # Split the substitutions into bite-sized pieces for seds with
18884   # small command number limits, like on Digital OSF/1 and HP-UX.
18885   ac_max_sed_lines=48
18886   ac_sed_frag=1 # Number of current file.
18887   ac_beg=1 # First line for current file.
18888   ac_end=$ac_max_sed_lines # Line after last line for current file.
18889   ac_more_lines=:
18890   ac_sed_cmds=
18891   while "$ac_more_lines"; do
18892     if test "$ac_beg" -gt 1; then
18893       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18894     else
18895       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18896     fi
18897     if test ! -s $tmp/subs.frag; then
18898       ac_more_lines=false
18899     else
18900       # The purpose of the label and of the branching condition is to
18901       # speed up the sed processing (if there are no `@' at all, there
18902       # is no need to browse any of the substitutions).
18903       # These are the two extra sed commands mentioned above.
18904       (echo ':t
18905   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18906       # It is possible to make a multiline substitution using escaped newlines.
18907       # Ensure that we do not split the substitution between script fragments.
18908       ac_BEG=$ac_end
18909       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18910       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18911       if test -s $tmp/subs.next; then
18912         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18913         if test ! -s $tmp/subs.edit; then
18914           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18915           if test ! -s $tmp/subs.edit; then
18916             if test "$ac_beg" -gt 1; then
18917               ac_end=`expr "$ac_end" - 1`
18918               continue
18919             fi
18920           fi
18921         fi
18922       fi
18923
18924       if test -z "$ac_sed_cmds"; then
18925         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18926       else
18927         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18928       fi
18929       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18930       ac_beg=$ac_end
18931       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18932     fi
18933   done
18934   if test -z "$ac_sed_cmds"; then
18935     ac_sed_cmds=cat
18936   fi
18937 fi # test -n "$CONFIG_FILES"
18938
18939 EOF
18940 cat >>"$CONFIG_STATUS" <<\EOF
18941 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18942   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18943   case "$ac_file" in
18944   - | *:- | *:-:* ) # input from stdin
18945         cat >$tmp/stdin
18946         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18947         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18948   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18949         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18950   * )   ac_file_in=$ac_file.in ;;
18951   esac
18952
18953   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18954   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18955          X"$ac_file" : 'X\(//\)[^/]' \| \
18956          X"$ac_file" : 'X\(//\)$' \| \
18957          X"$ac_file" : 'X\(/\)' \| \
18958          .     : '\(.\)' 2>/dev/null ||
18959 echo X"$ac_file" |
18960     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18961           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18962           /^X\(\/\/\)$/{ s//\1/; q; }
18963           /^X\(\/\).*/{ s//\1/; q; }
18964           s/.*/./; q'`
18965   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18966     { case "$ac_dir" in
18967   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18968   *)                      as_incr_dir=.;;
18969 esac
18970 as_dummy="$ac_dir"
18971 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18972   case $as_mkdir_dir in
18973     # Skip DOS drivespec
18974     ?:) as_incr_dir=$as_mkdir_dir ;;
18975     *)
18976       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18977       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18978     ;;
18979   esac
18980 done; }
18981
18982     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18983     # A "../" for each directory in $ac_dir_suffix.
18984     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18985   else
18986     ac_dir_suffix= ac_dots=
18987   fi
18988
18989   case "$srcdir" in
18990   .)  ac_srcdir=.
18991       if test -z "$ac_dots"; then
18992          ac_top_srcdir=.
18993       else
18994          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18995       fi ;;
18996   [\\/]* | ?:[\\/]* )
18997       ac_srcdir="$srcdir$ac_dir_suffix";
18998       ac_top_srcdir="$srcdir" ;;
18999   *) # Relative path.
19000     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19001     ac_top_srcdir="$ac_dots$srcdir" ;;
19002   esac
19003
19004   case $INSTALL in
19005   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19006   *) ac_INSTALL=$ac_dots$INSTALL ;;
19007   esac
19008
19009   if test x"$ac_file" != x-; then
19010     { echo "$as_me:19010: creating $ac_file" >&5
19011 echo "$as_me: creating $ac_file" >&6;}
19012     rm -f "$ac_file"
19013   fi
19014   # Let's still pretend it is `configure' which instantiates (i.e., don't
19015   # use $as_me), people would be surprised to read:
19016   #    /* config.h.  Generated automatically by config.status.  */
19017   configure_input="Generated automatically from `echo $ac_file_in |
19018                                                  sed 's,.*/,,'` by configure."
19019
19020   # First look for the input files in the build tree, otherwise in the
19021   # src tree.
19022   ac_file_inputs=`IFS=:
19023     for f in $ac_file_in; do
19024       case $f in
19025       -) echo $tmp/stdin ;;
19026       [\\/$]*)
19027          # Absolute (can't be DOS-style, as IFS=:)
19028          test -f "$f" || { { echo "$as_me:19028: error: cannot find input file: $f" >&5
19029 echo "$as_me: error: cannot find input file: $f" >&2;}
19030    { (exit 1); exit 1; }; }
19031          echo $f;;
19032       *) # Relative
19033          if test -f "$f"; then
19034            # Build tree
19035            echo $f
19036          elif test -f "$srcdir/$f"; then
19037            # Source tree
19038            echo "$srcdir/$f"
19039          else
19040            # /dev/null tree
19041            { { echo "$as_me:19041: error: cannot find input file: $f" >&5
19042 echo "$as_me: error: cannot find input file: $f" >&2;}
19043    { (exit 1); exit 1; }; }
19044          fi;;
19045       esac
19046     done` || { (exit 1); exit 1; }
19047 EOF
19048 cat >>"$CONFIG_STATUS" <<\EOF
19049   ac_warn_datarootdir=no
19050   if test x"$ac_file" != x-; then
19051     for ac_item in $ac_file_inputs
19052     do
19053       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19054       if test -n "$ac_seen"; then
19055         ac_used=`grep '@datarootdir@' "$ac_item"`
19056         if test -z "$ac_used"; then
19057           { echo "$as_me:19057: WARNING: datarootdir was used implicitly but not set:
19058 $ac_seen" >&5
19059 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19060 $ac_seen" >&2;}
19061           ac_warn_datarootdir=yes
19062         fi
19063       fi
19064       ac_seen=`grep '${datarootdir}' "$ac_item"`
19065       if test -n "$ac_seen"; then
19066         { echo "$as_me:19066: WARNING: datarootdir was used explicitly but not set:
19067 $ac_seen" >&5
19068 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19069 $ac_seen" >&2;}
19070         ac_warn_datarootdir=yes
19071       fi
19072     done
19073   fi
19074
19075 if test "x$ac_warn_datarootdir" = xyes; then
19076   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19077 fi
19078
19079 EOF
19080 cat >>"$CONFIG_STATUS" <<EOF
19081   sed "$ac_vpsub
19082 $extrasub
19083 EOF
19084 cat >>"$CONFIG_STATUS" <<\EOF
19085 :t
19086 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19087 s,@configure_input@,$configure_input,;t t
19088 s,@srcdir@,$ac_srcdir,;t t
19089 s,@top_srcdir@,$ac_top_srcdir,;t t
19090 s,@INSTALL@,$ac_INSTALL,;t t
19091 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19092   rm -f $tmp/stdin
19093   if test x"$ac_file" != x-; then
19094     cp "$tmp/out" "$ac_file"
19095
19096     for ac_name in prefix exec_prefix datarootdir
19097     do
19098         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
19099         if test -n "$ac_seen"; then
19100             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19101             if test -z "$ac_init"; then
19102               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19103               { echo "$as_me:19103: WARNING: Variable $ac_name is used but was not set:
19104 $ac_seen" >&5
19105 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19106 $ac_seen" >&2;}
19107             fi
19108         fi
19109     done
19110     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
19111     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
19112     if test -s $tmp/out; then
19113       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19114       { echo "$as_me:19114: WARNING: Some variables may not be substituted:
19115 $ac_seen" >&5
19116 echo "$as_me: WARNING: Some variables may not be substituted:
19117 $ac_seen" >&2;}
19118     fi
19119   else
19120     cat $tmp/out
19121   fi
19122   rm -f $tmp/out
19123
19124 done
19125 EOF
19126 cat >>"$CONFIG_STATUS" <<\EOF
19127
19128 #
19129 # CONFIG_HEADER section.
19130 #
19131
19132 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19133 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19134 #
19135 # ac_d sets the value in "#define NAME VALUE" lines.
19136 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19137 ac_dB='[        ].*$,\1#\2'
19138 ac_dC=' '
19139 ac_dD=',;t'
19140 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19141 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19142 ac_iB='\([      ]\),\1#\2define\3'
19143 ac_iC=' '
19144 ac_iD='\4,;t'
19145 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19146 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19147 ac_uB='$,\1#\2define\3'
19148 ac_uC=' '
19149 ac_uD=',;t'
19150
19151 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19152   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19153   case "$ac_file" in
19154   - | *:- | *:-:* ) # input from stdin
19155         cat >$tmp/stdin
19156         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19157         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19158   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19159         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19160   * )   ac_file_in=$ac_file.in ;;
19161   esac
19162
19163   test x"$ac_file" != x- && { echo "$as_me:19163: creating $ac_file" >&5
19164 echo "$as_me: creating $ac_file" >&6;}
19165
19166   # First look for the input files in the build tree, otherwise in the
19167   # src tree.
19168   ac_file_inputs=`IFS=:
19169     for f in $ac_file_in; do
19170       case $f in
19171       -) echo $tmp/stdin ;;
19172       [\\/$]*)
19173          # Absolute (can't be DOS-style, as IFS=:)
19174          test -f "$f" || { { echo "$as_me:19174: error: cannot find input file: $f" >&5
19175 echo "$as_me: error: cannot find input file: $f" >&2;}
19176    { (exit 1); exit 1; }; }
19177          echo $f;;
19178       *) # Relative
19179          if test -f "$f"; then
19180            # Build tree
19181            echo $f
19182          elif test -f "$srcdir/$f"; then
19183            # Source tree
19184            echo "$srcdir/$f"
19185          else
19186            # /dev/null tree
19187            { { echo "$as_me:19187: error: cannot find input file: $f" >&5
19188 echo "$as_me: error: cannot find input file: $f" >&2;}
19189    { (exit 1); exit 1; }; }
19190          fi;;
19191       esac
19192     done` || { (exit 1); exit 1; }
19193   # Remove the trailing spaces.
19194   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19195
19196 EOF
19197
19198 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19199 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19200 # be either 'cat' or 'sort'.
19201 cat confdefs.h | uniq >conftest.vals
19202
19203 # Break up conftest.vals because some shells have a limit on
19204 # the size of here documents, and old seds have small limits too.
19205
19206 rm -f conftest.tail
19207 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19208 while grep . conftest.vals >/dev/null
19209 do
19210   # Write chunks of a limited-size here document to conftest.frag.
19211   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19212   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19213   echo 'CEOF' >> "$CONFIG_STATUS"
19214   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19215   rm -f conftest.vals
19216   mv conftest.tail conftest.vals
19217 done
19218 rm -f conftest.vals
19219
19220 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19221 # marker @DEFS@.
19222 echo '  cat >> conftest.edit <<CEOF
19223 /@DEFS@/r conftest.frag
19224 /@DEFS@/d
19225 CEOF
19226 sed -f conftest.edit $tmp/in > $tmp/out
19227 rm -f $tmp/in
19228 mv $tmp/out $tmp/in
19229 rm -f conftest.edit conftest.frag
19230 ' >> "$CONFIG_STATUS"
19231
19232 cat >>"$CONFIG_STATUS" <<\EOF
19233   # Let's still pretend it is `configure' which instantiates (i.e., don't
19234   # use $as_me), people would be surprised to read:
19235   #    /* config.h.  Generated automatically by config.status.  */
19236   if test x"$ac_file" = x-; then
19237     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19238   else
19239     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19240   fi
19241   cat $tmp/in >>$tmp/config.h
19242   rm -f $tmp/in
19243   if test x"$ac_file" != x-; then
19244     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19245       { echo "$as_me:19245: $ac_file is unchanged" >&5
19246 echo "$as_me: $ac_file is unchanged" >&6;}
19247     else
19248       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19249          X"$ac_file" : 'X\(//\)[^/]' \| \
19250          X"$ac_file" : 'X\(//\)$' \| \
19251          X"$ac_file" : 'X\(/\)' \| \
19252          .     : '\(.\)' 2>/dev/null ||
19253 echo X"$ac_file" |
19254     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19255           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19256           /^X\(\/\/\)$/{ s//\1/; q; }
19257           /^X\(\/\).*/{ s//\1/; q; }
19258           s/.*/./; q'`
19259       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19260         { case "$ac_dir" in
19261   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19262   *)                      as_incr_dir=.;;
19263 esac
19264 as_dummy="$ac_dir"
19265 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19266   case $as_mkdir_dir in
19267     # Skip DOS drivespec
19268     ?:) as_incr_dir=$as_mkdir_dir ;;
19269     *)
19270       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19271       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19272     ;;
19273   esac
19274 done; }
19275
19276       fi
19277       rm -f "$ac_file"
19278       mv "$tmp/config.h" "$ac_file"
19279     fi
19280   else
19281     cat $tmp/config.h
19282     rm -f $tmp/config.h
19283   fi
19284 done
19285 EOF
19286 cat >>"$CONFIG_STATUS" <<\EOF
19287 #
19288 # CONFIG_COMMANDS section.
19289 #
19290 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19291   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19292   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19293
19294   case "$ac_dest" in
19295     default )
19296 if test -z "$USE_OLD_MAKERULES" ; then
19297         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19298 fi
19299  ;;
19300   esac
19301 done
19302 EOF
19303
19304 cat >>"$CONFIG_STATUS" <<\EOF
19305
19306 { (exit 0); exit 0; }
19307 EOF
19308 chmod +x "$CONFIG_STATUS"
19309 ac_clean_files=$ac_clean_files_save
19310
19311 # configure is writing to config.log, and then calls config.status.
19312 # config.status does its own redirection, appending to config.log.
19313 # Unfortunately, on DOS this fails, as config.log is still kept open
19314 # by configure, so config.status won't be able to write to it; its
19315 # output is simply discarded.  So we exec the FD to /dev/null,
19316 # effectively closing config.log, so it can be properly (re)opened and
19317 # appended to by config.status.  When coming back to configure, we
19318 # need to make the FD available again.
19319 if test "$no_create" != yes; then
19320   ac_cs_success=:
19321   exec 5>/dev/null
19322   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19323   exec 5>>config.log
19324   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19325   # would make configure fail if this is the last instruction.
19326   "$ac_cs_success" || { (exit 1); exit 1; }
19327 fi
19328 ${MAKE:-make} preinstall