]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.1 - patch 20200118
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.74 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20200111.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 runstatedir='${localstatedir}/run'
180 libdir='${exec_prefix}/lib'
181 includedir='${prefix}/include'
182 oldincludedir='/usr/include'
183 infodir='${datarootdir}/info'
184 mandir='${datarootdir}/man'
185
186 # Identity of this package.
187 PACKAGE_NAME=
188 PACKAGE_TARNAME=
189 PACKAGE_VERSION=
190 PACKAGE_STRING=
191 PACKAGE_BUGREPORT=
192
193 ac_prev=
194 for ac_option
195 do
196   # If the previous option needs an argument, assign it.
197   if test -n "$ac_prev"; then
198     eval "$ac_prev=\$ac_option"
199     ac_prev=
200     continue
201   fi
202
203   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
204
205   # Accept the important Cygnus configure options, so we can diagnose typos.
206
207   case $ac_option in
208
209   -bindir | --bindir | --bindi | --bind | --bin | --bi)
210     ac_prev=bindir ;;
211   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
212     bindir=$ac_optarg ;;
213
214   -build | --build | --buil | --bui | --bu)
215     ac_prev=build_alias ;;
216   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
217     build_alias=$ac_optarg ;;
218
219   -cache-file | --cache-file | --cache-fil | --cache-fi \
220   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
221     ac_prev=cache_file ;;
222   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
223   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
224     cache_file=$ac_optarg ;;
225
226   --config-cache | -C)
227     cache_file=config.cache ;;
228
229   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
230     ac_prev=datadir ;;
231   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
232   | --da=*)
233     datadir=$ac_optarg ;;
234
235   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
236   | --dataroo | --dataro | --datar)
237     ac_prev=datarootdir ;;
238   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
239   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
240     datarootdir=$ac_optarg ;;
241
242   -disable-* | --disable-*)
243     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
244     # Reject names that are not valid shell variable names.
245     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
246       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
247    { (exit 1); exit 1; }; }
248     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
249     eval "enable_$ac_feature=no" ;;
250
251   -enable-* | --enable-*)
252     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
253     # Reject names that are not valid shell variable names.
254     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
255       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
256    { (exit 1); exit 1; }; }
257     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
258     case $ac_option in
259       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
260       *) ac_optarg=yes ;;
261     esac
262     eval "enable_$ac_feature='$ac_optarg'" ;;
263
264   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
265   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
266   | --exec | --exe | --ex)
267     ac_prev=exec_prefix ;;
268   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
269   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
270   | --exec=* | --exe=* | --ex=*)
271     exec_prefix=$ac_optarg ;;
272
273   -gas | --gas | --ga | --g)
274     # Obsolete; use --with-gas.
275     with_gas=yes ;;
276
277   -help | --help | --hel | --he | -h)
278     ac_init_help=long ;;
279   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
280     ac_init_help=recursive ;;
281   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
282     ac_init_help=short ;;
283
284   -host | --host | --hos | --ho)
285     ac_prev=host_alias ;;
286   -host=* | --host=* | --hos=* | --ho=*)
287     host_alias=$ac_optarg ;;
288
289   -includedir | --includedir | --includedi | --included | --include \
290   | --includ | --inclu | --incl | --inc)
291     ac_prev=includedir ;;
292   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
293   | --includ=* | --inclu=* | --incl=* | --inc=*)
294     includedir=$ac_optarg ;;
295
296   -infodir | --infodir | --infodi | --infod | --info | --inf)
297     ac_prev=infodir ;;
298   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
299     infodir=$ac_optarg ;;
300
301   -libdir | --libdir | --libdi | --libd)
302     ac_prev=libdir ;;
303   -libdir=* | --libdir=* | --libdi=* | --libd=*)
304     libdir=$ac_optarg ;;
305
306   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
307   | --libexe | --libex | --libe)
308     ac_prev=libexecdir ;;
309   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
310   | --libexe=* | --libex=* | --libe=*)
311     libexecdir=$ac_optarg ;;
312
313   -localstatedir | --localstatedir | --localstatedi | --localstated \
314   | --localstate | --localstat | --localsta | --localst \
315   | --locals | --local | --loca | --loc | --lo)
316     ac_prev=localstatedir ;;
317   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
318   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
319   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
320     localstatedir=$ac_optarg ;;
321
322   -runstatedir | --runstatedir | --runstatedi | --runstated \
323   | --runstate | --runstat | --runsta | --runst \
324   | --runs | --run | --ru)
325     ac_prev=runstatedir ;;
326   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
327   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
328   | --runs=* | --run=* | --ru=*)
329     runstatedir=$ac_optarg ;;
330
331   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
332     ac_prev=mandir ;;
333   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
334     mandir=$ac_optarg ;;
335
336   -nfp | --nfp | --nf)
337     # Obsolete; use --without-fp.
338     with_fp=no ;;
339
340   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
341   | --no-cr | --no-c)
342     no_create=yes ;;
343
344   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
345   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
346     no_recursion=yes ;;
347
348   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
349   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
350   | --oldin | --oldi | --old | --ol | --o)
351     ac_prev=oldincludedir ;;
352   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
353   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
354   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
355     oldincludedir=$ac_optarg ;;
356
357   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
358     ac_prev=prefix ;;
359   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
360     prefix=$ac_optarg ;;
361
362   -program-prefix | --program-prefix | --program-prefi | --program-pref \
363   | --program-pre | --program-pr | --program-p)
364     ac_prev=program_prefix ;;
365   -program-prefix=* | --program-prefix=* | --program-prefi=* \
366   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
367     program_prefix=$ac_optarg ;;
368
369   -program-suffix | --program-suffix | --program-suffi | --program-suff \
370   | --program-suf | --program-su | --program-s)
371     ac_prev=program_suffix ;;
372   -program-suffix=* | --program-suffix=* | --program-suffi=* \
373   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
374     program_suffix=$ac_optarg ;;
375
376   -program-transform-name | --program-transform-name \
377   | --program-transform-nam | --program-transform-na \
378   | --program-transform-n | --program-transform- \
379   | --program-transform | --program-transfor \
380   | --program-transfo | --program-transf \
381   | --program-trans | --program-tran \
382   | --progr-tra | --program-tr | --program-t)
383     ac_prev=program_transform_name ;;
384   -program-transform-name=* | --program-transform-name=* \
385   | --program-transform-nam=* | --program-transform-na=* \
386   | --program-transform-n=* | --program-transform-=* \
387   | --program-transform=* | --program-transfor=* \
388   | --program-transfo=* | --program-transf=* \
389   | --program-trans=* | --program-tran=* \
390   | --progr-tra=* | --program-tr=* | --program-t=*)
391     program_transform_name=$ac_optarg ;;
392
393   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
394   | -silent | --silent | --silen | --sile | --sil)
395     silent=yes ;;
396
397   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
398     ac_prev=sbindir ;;
399   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
400   | --sbi=* | --sb=*)
401     sbindir=$ac_optarg ;;
402
403   -sharedstatedir | --sharedstatedir | --sharedstatedi \
404   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
405   | --sharedst | --shareds | --shared | --share | --shar \
406   | --sha | --sh)
407     ac_prev=sharedstatedir ;;
408   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
409   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
410   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
411   | --sha=* | --sh=*)
412     sharedstatedir=$ac_optarg ;;
413
414   -site | --site | --sit)
415     ac_prev=site ;;
416   -site=* | --site=* | --sit=*)
417     site=$ac_optarg ;;
418
419   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
420     ac_prev=srcdir ;;
421   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
422     srcdir=$ac_optarg ;;
423
424   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
425   | --syscon | --sysco | --sysc | --sys | --sy)
426     ac_prev=sysconfdir ;;
427   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
428   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
429     sysconfdir=$ac_optarg ;;
430
431   -target | --target | --targe | --targ | --tar | --ta | --t)
432     ac_prev=target_alias ;;
433   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
434     target_alias=$ac_optarg ;;
435
436   -v | -verbose | --verbose | --verbos | --verbo | --verb)
437     verbose=yes ;;
438
439   -version | --version | --versio | --versi | --vers | -V)
440     ac_init_version=: ;;
441
442   -with-* | --with-*)
443     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
444     # Reject names that are not valid shell variable names.
445     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
446       { echo "$as_me: error: invalid package name: $ac_package" >&2
447    { (exit 1); exit 1; }; }
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     case $ac_option in
450       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
451       *) ac_optarg=yes ;;
452     esac
453     eval "with_$ac_package='$ac_optarg'" ;;
454
455   -without-* | --without-*)
456     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
457     # Reject names that are not valid shell variable names.
458     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
459       { echo "$as_me: error: invalid package name: $ac_package" >&2
460    { (exit 1); exit 1; }; }
461     ac_package=`echo $ac_package | sed 's/-/_/g'`
462     eval "with_$ac_package=no" ;;
463
464   --x)
465     # Obsolete; use --with-x.
466     with_x=yes ;;
467
468   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
469   | --x-incl | --x-inc | --x-in | --x-i)
470     ac_prev=x_includes ;;
471   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
472   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
473     x_includes=$ac_optarg ;;
474
475   -x-libraries | --x-libraries | --x-librarie | --x-librari \
476   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
477     ac_prev=x_libraries ;;
478   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
479   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
480     x_libraries=$ac_optarg ;;
481
482   -*) { echo "$as_me: error: unrecognized option: $ac_option
483 Try \`$0 --help' for more information." >&2
484    { (exit 1); exit 1; }; }
485     ;;
486
487   *=*)
488     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
489     # Reject names that are not valid shell variable names.
490     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
491       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
492    { (exit 1); exit 1; }; }
493     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
494     eval "$ac_envvar='$ac_optarg'"
495     export $ac_envvar ;;
496
497   *)
498     # FIXME: should be removed in autoconf 3.0.
499     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
500     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
501       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
502     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
503     ;;
504
505   esac
506 done
507
508 if test -n "$ac_prev"; then
509   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
510   { echo "$as_me: error: missing argument to $ac_option" >&2
511    { (exit 1); exit 1; }; }
512 fi
513
514 # Be sure to have absolute paths.
515 for ac_var in exec_prefix prefix
516 do
517   eval ac_val=$`echo $ac_var`
518   case $ac_val in
519     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
520     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
521    { (exit 1); exit 1; }; };;
522   esac
523 done
524
525 # Be sure to have absolute paths.
526 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
527               localstatedir libdir includedir oldincludedir infodir mandir
528 do
529   eval ac_val=$`echo $ac_var`
530   case $ac_val in
531     [\\/$]* | ?:[\\/]* ) ;;
532     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
533    { (exit 1); exit 1; }; };;
534   esac
535 done
536
537 # There might be people who depend on the old broken behavior: `$host'
538 # used to hold the argument of --host etc.
539 build=$build_alias
540 host=$host_alias
541 target=$target_alias
542
543 # FIXME: should be removed in autoconf 3.0.
544 if test "x$host_alias" != x; then
545   if test "x$build_alias" = x; then
546     cross_compiling=maybe
547     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
548     If a cross compiler is detected then cross compile mode will be used." >&2
549   elif test "x$build_alias" != "x$host_alias"; then
550     cross_compiling=yes
551   fi
552 fi
553
554 ac_tool_prefix=
555 test -n "$host_alias" && ac_tool_prefix=$host_alias-
556
557 test "$silent" = yes && exec 6>/dev/null
558
559 # Find the source files, if location was not specified.
560 if test -z "$srcdir"; then
561   ac_srcdir_defaulted=yes
562   # Try the directory containing this script, then its parent.
563   ac_prog=$0
564   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
565   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
566   srcdir=$ac_confdir
567   if test ! -r $srcdir/$ac_unique_file; then
568     srcdir=..
569   fi
570 else
571   ac_srcdir_defaulted=no
572 fi
573 if test ! -r $srcdir/$ac_unique_file; then
574   if test "$ac_srcdir_defaulted" = yes; then
575     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
576    { (exit 1); exit 1; }; }
577   else
578     { echo "$as_me: error: cannot find sources in $srcdir" >&2
579    { (exit 1); exit 1; }; }
580   fi
581 fi
582 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
583 ac_env_build_alias_set=${build_alias+set}
584 ac_env_build_alias_value=$build_alias
585 ac_cv_env_build_alias_set=${build_alias+set}
586 ac_cv_env_build_alias_value=$build_alias
587 ac_env_host_alias_set=${host_alias+set}
588 ac_env_host_alias_value=$host_alias
589 ac_cv_env_host_alias_set=${host_alias+set}
590 ac_cv_env_host_alias_value=$host_alias
591 ac_env_target_alias_set=${target_alias+set}
592 ac_env_target_alias_value=$target_alias
593 ac_cv_env_target_alias_set=${target_alias+set}
594 ac_cv_env_target_alias_value=$target_alias
595 ac_env_CC_set=${CC+set}
596 ac_env_CC_value=$CC
597 ac_cv_env_CC_set=${CC+set}
598 ac_cv_env_CC_value=$CC
599 ac_env_CFLAGS_set=${CFLAGS+set}
600 ac_env_CFLAGS_value=$CFLAGS
601 ac_cv_env_CFLAGS_set=${CFLAGS+set}
602 ac_cv_env_CFLAGS_value=$CFLAGS
603 ac_env_LDFLAGS_set=${LDFLAGS+set}
604 ac_env_LDFLAGS_value=$LDFLAGS
605 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_cv_env_LDFLAGS_value=$LDFLAGS
607 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
608 ac_env_CPPFLAGS_value=$CPPFLAGS
609 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
611 ac_env_CPP_set=${CPP+set}
612 ac_env_CPP_value=$CPP
613 ac_cv_env_CPP_set=${CPP+set}
614 ac_cv_env_CPP_value=$CPP
615
616 #
617 # Report the --help message.
618 #
619 if test "$ac_init_help" = "long"; then
620   # Omit some internal or obsolete options to make the list less imposing.
621   # This message is too long to be a string in the A/UX 3.1 sh.
622   cat <<EOF
623 \`configure' configures this package to adapt to many kinds of systems.
624
625 Usage: $0 [OPTION]... [VAR=VALUE]...
626
627 To assign environment variables (e.g., CC, CFLAGS...), specify them as
628 VAR=VALUE.  See below for descriptions of some of the useful variables.
629
630 Defaults for the options are specified in brackets.
631
632 Configuration:
633   -h, --help              display this help and exit
634       --help=short        display options specific to this package
635       --help=recursive    display the short help of all the included packages
636   -V, --version           display version information and exit
637   -q, --quiet, --silent   do not print \`checking...' messages
638       --cache-file=FILE   cache test results in FILE [disabled]
639   -C, --config-cache      alias for \`--cache-file=config.cache'
640   -n, --no-create         do not create output files
641       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
642
643 EOF
644
645   cat <<EOF
646 Installation directories:
647   --prefix=PREFIX         install architecture-independent files in PREFIX
648                           [$ac_default_prefix]
649   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
650                           [PREFIX]
651
652 By default, \`make install' will install all the files in
653 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
654 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
655 for instance \`--prefix=\$HOME'.
656
657 For better control, use the options below.
658
659 Fine tuning of the installation directories:
660   --bindir=DIR            user executables [EPREFIX/bin]
661   --sbindir=DIR           system admin executables [EPREFIX/sbin]
662   --libexecdir=DIR        program executables [EPREFIX/libexec]
663   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
664   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
665   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
666   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
667   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
668   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
669   --libdir=DIR            object code libraries [EPREFIX/lib]
670   --includedir=DIR        C header files [PREFIX/include]
671   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
672   --infodir=DIR           info documentation [DATAROOTDIR/info]
673   --mandir=DIR            man documentation [DATAROOTDIR/man]
674 EOF
675
676   cat <<\EOF
677
678 Program names:
679   --program-prefix=PREFIX            prepend PREFIX to installed program names
680   --program-suffix=SUFFIX            append SUFFIX to installed program names
681   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
682
683 System types:
684   --build=BUILD           configure for building on BUILD [guessed]
685   --host=HOST       build programs to run on HOST [BUILD]
686   --target=TARGET   configure for building compilers for TARGET [HOST]
687 EOF
688 fi
689
690 if test -n "$ac_init_help"; then
691
692   cat <<\EOF
693
694 Optional Packages:
695   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
696   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
697
698 Optional Features:
699   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
700   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
701
702 General Options:
703   --with-system-type=XXX  test: override derived host system-type
704   --disable-stripping     do not strip (debug info) installed executables
705   --with-pkg-config{=path} enable/disable use of pkg-config
706   --with-pkg-config-libdir=XXX use given directory for installing pc-files
707   --without-tests         suppress build with test-programs
708   --enable-mixed-case     tic should assume mixed-case filenames
709   --with-install-prefix   prefixes actual install-location ($DESTDIR)
710 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
711   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
712   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
713   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
714   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
715   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
716   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
717 Options to Specify the Libraries Built/Used:
718   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
719   --with-curses-dir=DIR   directory in which (n)curses is installed
720   --enable-widec          compile with wide-char/UTF-8 code
721   --with-lib-prefix       override library-prefix
722   --with-shlib-version=X  Specify rel or abi version for shared libs
723   --enable-rpath-link     link sample programs with rpath option
724 Fine-Tuning Your Configuration:
725   --enable-broken_linker  compile with broken-linker support code
726   --disable-largefile     omit support for large files
727   --with-rcs-ids          compile-in RCS identifiers
728 Extensions:
729   --disable-ext-funcs     disable function-extensions
730   --enable-const          compile with extra/non-standard const
731 Development Code:
732   --without-develop       disable development options
733 Experimental Code:
734   --with-pthread          use POSIX thread library
735   --enable-weak-symbols   enable weak-symbols for pthreads
736   --enable-reentrant      compile with experimental reentrant code
737   --with-wrap-prefix=XXX  override prefix used for public variables
738 Testing/development Options:
739   --disable-echo          do not display "compiling" commands
740   --enable-warnings       build: turn on GCC compiler warnings
741   --enable-assertions     test: turn on generation of assertion code
742   --enable-expanded       test: generate functions for certain macros
743   --disable-macros        test: use functions rather than macros
744   --with-trace            test: add trace() function to all models of ncurses
745   --disable-gnat-projects test: disable GNAT projects even if usable
746 Ada95 Binding Options:
747   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
748   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
749   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
750   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
751   --with-ada-libname=XXX  override default Ada library-name
752
753 Some influential environment variables:
754   CC          C compiler command
755   CFLAGS      C compiler flags
756   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
757               nonstandard directory <lib dir>
758   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
759               headers in a nonstandard directory <include dir>
760   CPP         C preprocessor
761
762 Use these variables to override the choices made by `configure' or to help
763 it to find libraries and programs with nonstandard names/locations.
764
765 EOF
766 fi
767
768 if test "$ac_init_help" = "recursive"; then
769   # If there are subdirs, report their specific --help.
770   ac_popdir=`pwd`
771   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
772     cd $ac_subdir
773     # A "../" for each directory in /$ac_subdir.
774     ac_dots=`echo $ac_subdir |
775              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
776
777     case $srcdir in
778     .) # No --srcdir option.  We are building in place.
779       ac_sub_srcdir=$srcdir ;;
780     [\\/]* | ?:[\\/]* ) # Absolute path.
781       ac_sub_srcdir=$srcdir/$ac_subdir ;;
782     *) # Relative path.
783       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
784     esac
785
786     # Check for guested configure; otherwise get Cygnus style configure.
787     if test -f $ac_sub_srcdir/configure.gnu; then
788       echo
789       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
790     elif test -f $ac_sub_srcdir/configure; then
791       echo
792       $SHELL $ac_sub_srcdir/configure  --help=recursive
793     elif test -f $ac_sub_srcdir/configure.ac ||
794            test -f $ac_sub_srcdir/configure.in; then
795       echo
796       $ac_configure --help
797     else
798       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
799     fi
800     cd $ac_popdir
801   done
802 fi
803
804 test -n "$ac_init_help" && exit 0
805 if $ac_init_version; then
806   cat <<\EOF
807
808 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
809 Free Software Foundation, Inc.
810 This configure script is free software; the Free Software Foundation
811 gives unlimited permission to copy, distribute and modify it.
812 EOF
813   exit 0
814 fi
815 exec 5>config.log
816 cat >&5 <<EOF
817 This file contains any messages produced by compilers while
818 running configure, to aid debugging if configure makes a mistake.
819
820 It was created by $as_me, which was
821 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
822
823   $ $0 $@
824
825 EOF
826 {
827 cat <<_ASUNAME
828 ## ---------- ##
829 ## Platform.  ##
830 ## ---------- ##
831
832 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
833 uname -m = `(uname -m) 2>/dev/null || echo unknown`
834 uname -r = `(uname -r) 2>/dev/null || echo unknown`
835 uname -s = `(uname -s) 2>/dev/null || echo unknown`
836 uname -v = `(uname -v) 2>/dev/null || echo unknown`
837
838 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
839 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
840
841 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
842 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
843 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
844 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
845 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
846 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
847 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
848
849 PATH = $PATH
850
851 _ASUNAME
852 } >&5
853
854 cat >&5 <<EOF
855 ## ------------ ##
856 ## Core tests.  ##
857 ## ------------ ##
858
859 EOF
860
861 # Keep a trace of the command line.
862 # Strip out --no-create and --no-recursion so they do not pile up.
863 # Also quote any args containing shell meta-characters.
864 ac_configure_args=
865 ac_sep=
866 for ac_arg
867 do
868   case $ac_arg in
869   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
870   | --no-cr | --no-c) ;;
871   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
872   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
873   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
874     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
875     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
876     ac_sep=" " ;;
877   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
878      ac_sep=" " ;;
879   esac
880   # Get rid of the leading space.
881 done
882
883 # When interrupted or exit'd, cleanup temporary files, and complete
884 # config.log.  We remove comments because anyway the quotes in there
885 # would cause problems or look ugly.
886 trap 'exit_status=$?
887   # Save into config.log some information that might help in debugging.
888   echo >&5
889   echo "## ----------------- ##" >&5
890   echo "## Cache variables.  ##" >&5
891   echo "## ----------------- ##" >&5
892   echo >&5
893   # The following way of writing the cache mishandles newlines in values,
894 {
895   (set) 2>&1 |
896     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
897     *ac_space=\ *)
898       sed -n \
899         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
900           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
901       ;;
902     *)
903       sed -n \
904         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
905       ;;
906     esac;
907 } >&5
908   sed "/^$/d" confdefs.h >conftest.log
909   if test -s conftest.log; then
910     echo >&5
911     echo "## ------------ ##" >&5
912     echo "## confdefs.h.  ##" >&5
913     echo "## ------------ ##" >&5
914     echo >&5
915     cat conftest.log >&5
916   fi
917   (echo; echo) >&5
918   test "$ac_signal" != 0 &&
919     echo "$as_me: caught signal $ac_signal" >&5
920   echo "$as_me: exit $exit_status" >&5
921   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
922     exit $exit_status
923      ' 0
924 for ac_signal in 1 2 13 15; do
925   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
926 done
927 ac_signal=0
928
929 # confdefs.h avoids OS command line length limits that DEFS can exceed.
930 rm -rf conftest* confdefs.h
931 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
932 echo >confdefs.h
933
934 # Let the site file select an alternate cache file if it wants to.
935 # Prefer explicitly selected file to automatically selected ones.
936 if test -z "$CONFIG_SITE"; then
937   if test "x$prefix" != xNONE; then
938     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
939   else
940     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
941   fi
942 fi
943 for ac_site_file in $CONFIG_SITE; do
944   if test -r "$ac_site_file"; then
945     { echo "$as_me:945: loading site script $ac_site_file" >&5
946 echo "$as_me: loading site script $ac_site_file" >&6;}
947     cat "$ac_site_file" >&5
948     . "$ac_site_file"
949   fi
950 done
951
952 if test -r "$cache_file"; then
953   # Some versions of bash will fail to source /dev/null (special
954   # files actually), so we avoid doing that.
955   if test -f "$cache_file"; then
956     { echo "$as_me:956: loading cache $cache_file" >&5
957 echo "$as_me: loading cache $cache_file" >&6;}
958     case $cache_file in
959       [\\/]* | ?:[\\/]* ) . $cache_file;;
960       *)                      . ./$cache_file;;
961     esac
962   fi
963 else
964   { echo "$as_me:964: creating cache $cache_file" >&5
965 echo "$as_me: creating cache $cache_file" >&6;}
966   >$cache_file
967 fi
968
969 # Check that the precious variables saved in the cache have kept the same
970 # value.
971 ac_cache_corrupted=false
972 for ac_var in `(set) 2>&1 |
973                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
974   eval ac_old_set=\$ac_cv_env_${ac_var}_set
975   eval ac_new_set=\$ac_env_${ac_var}_set
976   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
977   eval ac_new_val="\$ac_env_${ac_var}_value"
978   case $ac_old_set,$ac_new_set in
979     set,)
980       { echo "$as_me:980: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
981 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
982       ac_cache_corrupted=: ;;
983     ,set)
984       { echo "$as_me:984: error: \`$ac_var' was not set in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,);;
988     *)
989       if test "x$ac_old_val" != "x$ac_new_val"; then
990         { echo "$as_me:990: error: \`$ac_var' has changed since the previous run:" >&5
991 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
992         { echo "$as_me:992:   former value:  $ac_old_val" >&5
993 echo "$as_me:   former value:  $ac_old_val" >&2;}
994         { echo "$as_me:994:   current value: $ac_new_val" >&5
995 echo "$as_me:   current value: $ac_new_val" >&2;}
996         ac_cache_corrupted=:
997       fi;;
998   esac
999   # Pass precious variables to config.status.  It doesn't matter if
1000   # we pass some twice (in addition to the command line arguments).
1001   if test "$ac_new_set" = set; then
1002     case $ac_new_val in
1003     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1004       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1005       ac_configure_args="$ac_configure_args '$ac_arg'"
1006       ;;
1007     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1008        ;;
1009     esac
1010   fi
1011 done
1012 if $ac_cache_corrupted; then
1013   { echo "$as_me:1013: error: changes in the environment can compromise the build" >&5
1014 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1015   { { echo "$as_me:1015: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1016 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1017    { (exit 1); exit 1; }; }
1018 fi
1019
1020 ac_ext=c
1021 ac_cpp='$CPP $CPPFLAGS'
1022 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1023 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1024 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1025 ac_main_return=return
1026
1027 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1028   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1029                    ECHO_T='     ' ;;
1030   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1031   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1032 esac
1033 echo "#! $SHELL" >conftest.sh
1034 echo  "exit 0"   >>conftest.sh
1035 chmod +x conftest.sh
1036 if { (echo "$as_me:1036: PATH=\".;.\"; conftest.sh") >&5
1037   (PATH=".;."; conftest.sh) 2>&5
1038   ac_status=$?
1039   echo "$as_me:1039: \$? = $ac_status" >&5
1040   (exit $ac_status); }; then
1041   ac_path_separator=';'
1042 else
1043   ac_path_separator=:
1044 fi
1045 PATH_SEPARATOR="$ac_path_separator"
1046 rm -f conftest.sh
1047
1048 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1049
1050 top_builddir=`pwd`
1051
1052 ac_aux_dir=
1053 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1054   if test -f $ac_dir/install-sh; then
1055     ac_aux_dir=$ac_dir
1056     ac_install_sh="$ac_aux_dir/install-sh -c"
1057     break
1058   elif test -f $ac_dir/install.sh; then
1059     ac_aux_dir=$ac_dir
1060     ac_install_sh="$ac_aux_dir/install.sh -c"
1061     break
1062   elif test -f $ac_dir/shtool; then
1063     ac_aux_dir=$ac_dir
1064     ac_install_sh="$ac_aux_dir/shtool install -c"
1065     break
1066   fi
1067 done
1068 if test -z "$ac_aux_dir"; then
1069   { { echo "$as_me:1069: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1070 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1071    { (exit 1); exit 1; }; }
1072 fi
1073 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1074 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1075 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1076
1077 # Make sure we can run config.sub.
1078 $ac_config_sub sun4 >/dev/null 2>&1 ||
1079   { { echo "$as_me:1079: error: cannot run $ac_config_sub" >&5
1080 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1081    { (exit 1); exit 1; }; }
1082
1083 echo "$as_me:1083: checking build system type" >&5
1084 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1085 if test "${ac_cv_build+set}" = set; then
1086   echo $ECHO_N "(cached) $ECHO_C" >&6
1087 else
1088   ac_cv_build_alias=$build_alias
1089 test -z "$ac_cv_build_alias" &&
1090   ac_cv_build_alias=`$ac_config_guess`
1091 test -z "$ac_cv_build_alias" &&
1092   { { echo "$as_me:1092: error: cannot guess build type; you must specify one" >&5
1093 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1094    { (exit 1); exit 1; }; }
1095 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1096   { { echo "$as_me:1096: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1097 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1098    { (exit 1); exit 1; }; }
1099
1100 fi
1101 echo "$as_me:1101: result: $ac_cv_build" >&5
1102 echo "${ECHO_T}$ac_cv_build" >&6
1103 build=$ac_cv_build
1104 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1105 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1106 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1107
1108 echo "$as_me:1108: checking host system type" >&5
1109 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1110 if test "${ac_cv_host+set}" = set; then
1111   echo $ECHO_N "(cached) $ECHO_C" >&6
1112 else
1113   ac_cv_host_alias=$host_alias
1114 test -z "$ac_cv_host_alias" &&
1115   ac_cv_host_alias=$ac_cv_build_alias
1116 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1117   { { echo "$as_me:1117: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1118 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1119    { (exit 1); exit 1; }; }
1120
1121 fi
1122 echo "$as_me:1122: result: $ac_cv_host" >&5
1123 echo "${ECHO_T}$ac_cv_host" >&6
1124 host=$ac_cv_host
1125 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1126 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1127 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1128
1129 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1130         echo "$as_me:1130: checking target system type" >&5
1131 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1132 if test "${ac_cv_target+set}" = set; then
1133   echo $ECHO_N "(cached) $ECHO_C" >&6
1134 else
1135   ac_cv_target_alias=$target_alias
1136 test "x$ac_cv_target_alias" = "x" &&
1137   ac_cv_target_alias=$ac_cv_host_alias
1138 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1139   { { echo "$as_me:1139: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1140 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1141    { (exit 1); exit 1; }; }
1142
1143 fi
1144 echo "$as_me:1144: result: $ac_cv_target" >&5
1145 echo "${ECHO_T}$ac_cv_target" >&6
1146 target=$ac_cv_target
1147 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1148 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1149 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1150
1151 # The aliases save the names the user supplied, while $host etc.
1152 # will get canonicalized.
1153 test -n "$target_alias" &&
1154   test "$program_prefix$program_suffix$program_transform_name" = \
1155     NONENONEs,x,x, &&
1156   program_prefix=${target_alias}-
1157         system_name="$host_os"
1158 else
1159         system_name="`(uname -s -r) 2>/dev/null`"
1160         if test -z "$system_name" ; then
1161                 system_name="`(hostname) 2>/dev/null`"
1162         fi
1163 fi
1164 test -n "$system_name" &&
1165 cat >>confdefs.h <<EOF
1166 #define SYSTEM_NAME "$system_name"
1167 EOF
1168
1169 if test "${cf_cv_system_name+set}" = set; then
1170   echo $ECHO_N "(cached) $ECHO_C" >&6
1171 else
1172   cf_cv_system_name="$system_name"
1173 fi
1174
1175 test -z "$system_name" && system_name="$cf_cv_system_name"
1176 test -n "$cf_cv_system_name" && echo "$as_me:1176: result: Configuring for $cf_cv_system_name" >&5
1177 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1178
1179 if test ".$system_name" != ".$cf_cv_system_name" ; then
1180         echo "$as_me:1180: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1181 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1182         { { echo "$as_me:1182: error: \"Please remove config.cache and try again.\"" >&5
1183 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1184    { (exit 1); exit 1; }; }
1185 fi
1186
1187 # Check whether --with-system-type or --without-system-type was given.
1188 if test "${with_system_type+set}" = set; then
1189   withval="$with_system_type"
1190   { echo "$as_me:1190: WARNING: overriding system type to $withval" >&5
1191 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1192         cf_cv_system_name=$withval
1193         host_os=$withval
1194
1195 fi;
1196
1197 ###     Save the given $CFLAGS to allow user-override.
1198 cf_user_CFLAGS="$CFLAGS"
1199
1200 ###     Default install-location
1201
1202 echo "$as_me:1202: checking for prefix" >&5
1203 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1204 if test "x$prefix" = "xNONE" ; then
1205         case "$cf_cv_system_name" in
1206                 # non-vendor systems don't have a conflict
1207         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1208                 prefix=/usr
1209                 ;;
1210         (*)     prefix=$ac_default_prefix
1211                 ;;
1212         esac
1213 fi
1214 echo "$as_me:1214: result: $prefix" >&5
1215 echo "${ECHO_T}$prefix" >&6
1216
1217 if test "x$prefix" = "xNONE" ; then
1218 echo "$as_me:1218: checking for default include-directory" >&5
1219 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1220 test -n "$verbose" && echo 1>&6
1221 for cf_symbol in \
1222         $includedir \
1223         $includedir/ncurses \
1224         $prefix/include \
1225         $prefix/include/ncurses \
1226         /usr/local/include \
1227         /usr/local/include/ncurses \
1228         /usr/include \
1229         /usr/include/ncurses
1230 do
1231         cf_dir=`eval echo $cf_symbol`
1232         if test -f $cf_dir/curses.h ; then
1233         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1234                 includedir="$cf_symbol"
1235                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1236                 break
1237         fi
1238         fi
1239         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1240 done
1241 echo "$as_me:1241: result: $includedir" >&5
1242 echo "${ECHO_T}$includedir" >&6
1243 fi
1244
1245 ###     Checks for programs.
1246
1247 ac_ext=c
1248 ac_cpp='$CPP $CPPFLAGS'
1249 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1250 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1251 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1252 ac_main_return=return
1253 if test -n "$ac_tool_prefix"; then
1254   for ac_prog in gnatgcc gcc cc
1255   do
1256     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1257 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1258 echo "$as_me:1258: checking for $ac_word" >&5
1259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1260 if test "${ac_cv_prog_CC+set}" = set; then
1261   echo $ECHO_N "(cached) $ECHO_C" >&6
1262 else
1263   if test -n "$CC"; then
1264   ac_cv_prog_CC="$CC" # Let the user override the test.
1265 else
1266   ac_save_IFS=$IFS; IFS=$ac_path_separator
1267 ac_dummy="$PATH"
1268 for ac_dir in $ac_dummy; do
1269   IFS=$ac_save_IFS
1270   test -z "$ac_dir" && ac_dir=.
1271   $as_executable_p "$ac_dir/$ac_word" || continue
1272 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1273 echo "$as_me:1273: found $ac_dir/$ac_word" >&5
1274 break
1275 done
1276
1277 fi
1278 fi
1279 CC=$ac_cv_prog_CC
1280 if test -n "$CC"; then
1281   echo "$as_me:1281: result: $CC" >&5
1282 echo "${ECHO_T}$CC" >&6
1283 else
1284   echo "$as_me:1284: result: no" >&5
1285 echo "${ECHO_T}no" >&6
1286 fi
1287
1288     test -n "$CC" && break
1289   done
1290 fi
1291 if test -z "$CC"; then
1292   ac_ct_CC=$CC
1293   for ac_prog in gnatgcc gcc cc
1294 do
1295   # Extract the first word of "$ac_prog", so it can be a program name with args.
1296 set dummy $ac_prog; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$ac_ct_CC"; then
1303   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1304 else
1305   ac_save_IFS=$IFS; IFS=$ac_path_separator
1306 ac_dummy="$PATH"
1307 for ac_dir in $ac_dummy; do
1308   IFS=$ac_save_IFS
1309   test -z "$ac_dir" && ac_dir=.
1310   $as_executable_p "$ac_dir/$ac_word" || continue
1311 ac_cv_prog_ac_ct_CC="$ac_prog"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 fi
1317 fi
1318 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1319 if test -n "$ac_ct_CC"; then
1320   echo "$as_me:1320: result: $ac_ct_CC" >&5
1321 echo "${ECHO_T}$ac_ct_CC" >&6
1322 else
1323   echo "$as_me:1323: result: no" >&5
1324 echo "${ECHO_T}no" >&6
1325 fi
1326
1327   test -n "$ac_ct_CC" && break
1328 done
1329
1330   CC=$ac_ct_CC
1331 fi
1332
1333 test -z "$CC" && { { echo "$as_me:1333: error: no acceptable cc found in \$PATH" >&5
1334 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1335    { (exit 1); exit 1; }; }
1336
1337 # Provide some information about the compiler.
1338 echo "$as_me:1338:" \
1339      "checking for C compiler version" >&5
1340 ac_compiler=`set X $ac_compile; echo $2`
1341 { (eval echo "$as_me:1341: \"$ac_compiler --version </dev/null >&5\"") >&5
1342   (eval $ac_compiler --version </dev/null >&5) 2>&5
1343   ac_status=$?
1344   echo "$as_me:1344: \$? = $ac_status" >&5
1345   (exit $ac_status); }
1346 { (eval echo "$as_me:1346: \"$ac_compiler -v </dev/null >&5\"") >&5
1347   (eval $ac_compiler -v </dev/null >&5) 2>&5
1348   ac_status=$?
1349   echo "$as_me:1349: \$? = $ac_status" >&5
1350   (exit $ac_status); }
1351 { (eval echo "$as_me:1351: \"$ac_compiler -V </dev/null >&5\"") >&5
1352   (eval $ac_compiler -V </dev/null >&5) 2>&5
1353   ac_status=$?
1354   echo "$as_me:1354: \$? = $ac_status" >&5
1355   (exit $ac_status); }
1356
1357 cat >conftest.$ac_ext <<_ACEOF
1358 #line 1358 "configure"
1359 #include "confdefs.h"
1360
1361 int
1362 main (void)
1363 {
1364
1365   ;
1366   return 0;
1367 }
1368 _ACEOF
1369 ac_clean_files_save=$ac_clean_files
1370 ac_clean_files="$ac_clean_files a.out a.exe"
1371 # Try to create an executable without -o first, disregard a.out.
1372 # It will help us diagnose broken compilers, and finding out an intuition
1373 # of exeext.
1374 echo "$as_me:1374: checking for C compiler default output" >&5
1375 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1376 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1377 if { (eval echo "$as_me:1377: \"$ac_link_default\"") >&5
1378   (eval $ac_link_default) 2>&5
1379   ac_status=$?
1380   echo "$as_me:1380: \$? = $ac_status" >&5
1381   (exit $ac_status); }; then
1382   # Find the output, starting from the most likely.  This scheme is
1383 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1384 # resort.
1385 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1386                 ls a.out conftest 2>/dev/null;
1387                 ls a.* conftest.* 2>/dev/null`; do
1388   case $ac_file in
1389     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1390     a.out ) # We found the default executable, but exeext='' is most
1391             # certainly right.
1392             break;;
1393     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1394           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1395           export ac_cv_exeext
1396           break;;
1397     * ) break;;
1398   esac
1399 done
1400 else
1401   echo "$as_me: failed program was:" >&5
1402 cat conftest.$ac_ext >&5
1403 { { echo "$as_me:1403: error: C compiler cannot create executables" >&5
1404 echo "$as_me: error: C compiler cannot create executables" >&2;}
1405    { (exit 77); exit 77; }; }
1406 fi
1407
1408 ac_exeext=$ac_cv_exeext
1409 echo "$as_me:1409: result: $ac_file" >&5
1410 echo "${ECHO_T}$ac_file" >&6
1411
1412 # Check the compiler produces executables we can run.  If not, either
1413 # the compiler is broken, or we cross compile.
1414 echo "$as_me:1414: checking whether the C compiler works" >&5
1415 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1416 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1417 # If not cross compiling, check that we can run a simple program.
1418 if test "$cross_compiling" != yes; then
1419   if { ac_try='./$ac_file'
1420   { (eval echo "$as_me:1420: \"$ac_try\"") >&5
1421   (eval $ac_try) 2>&5
1422   ac_status=$?
1423   echo "$as_me:1423: \$? = $ac_status" >&5
1424   (exit $ac_status); }; }; then
1425     cross_compiling=no
1426   else
1427     if test "$cross_compiling" = maybe; then
1428         cross_compiling=yes
1429     else
1430         { { echo "$as_me:1430: error: cannot run C compiled programs.
1431 If you meant to cross compile, use \`--host'." >&5
1432 echo "$as_me: error: cannot run C compiled programs.
1433 If you meant to cross compile, use \`--host'." >&2;}
1434    { (exit 1); exit 1; }; }
1435     fi
1436   fi
1437 fi
1438 echo "$as_me:1438: result: yes" >&5
1439 echo "${ECHO_T}yes" >&6
1440
1441 rm -f a.out a.exe conftest$ac_cv_exeext
1442 ac_clean_files=$ac_clean_files_save
1443 # Check the compiler produces executables we can run.  If not, either
1444 # the compiler is broken, or we cross compile.
1445 echo "$as_me:1445: checking whether we are cross compiling" >&5
1446 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1447 echo "$as_me:1447: result: $cross_compiling" >&5
1448 echo "${ECHO_T}$cross_compiling" >&6
1449
1450 echo "$as_me:1450: checking for executable suffix" >&5
1451 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1452 if { (eval echo "$as_me:1452: \"$ac_link\"") >&5
1453   (eval $ac_link) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }; then
1457   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1458 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1459 # work properly (i.e., refer to `conftest.exe'), while it won't with
1460 # `rm'.
1461 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1462   case $ac_file in
1463     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1464     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1465           export ac_cv_exeext
1466           break;;
1467     * ) break;;
1468   esac
1469 done
1470 else
1471   { { echo "$as_me:1471: error: cannot compute EXEEXT: cannot compile and link" >&5
1472 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1473    { (exit 1); exit 1; }; }
1474 fi
1475
1476 rm -f conftest$ac_cv_exeext
1477 echo "$as_me:1477: result: $ac_cv_exeext" >&5
1478 echo "${ECHO_T}$ac_cv_exeext" >&6
1479
1480 rm -f conftest.$ac_ext
1481 EXEEXT=$ac_cv_exeext
1482 ac_exeext=$EXEEXT
1483 echo "$as_me:1483: checking for object suffix" >&5
1484 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1485 if test "${ac_cv_objext+set}" = set; then
1486   echo $ECHO_N "(cached) $ECHO_C" >&6
1487 else
1488   cat >conftest.$ac_ext <<_ACEOF
1489 #line 1489 "configure"
1490 #include "confdefs.h"
1491
1492 int
1493 main (void)
1494 {
1495
1496   ;
1497   return 0;
1498 }
1499 _ACEOF
1500 rm -f conftest.o conftest.obj
1501 if { (eval echo "$as_me:1501: \"$ac_compile\"") >&5
1502   (eval $ac_compile) 2>&5
1503   ac_status=$?
1504   echo "$as_me:1504: \$? = $ac_status" >&5
1505   (exit $ac_status); }; then
1506   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1507   case $ac_file in
1508     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1509     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1510        break;;
1511   esac
1512 done
1513 else
1514   echo "$as_me: failed program was:" >&5
1515 cat conftest.$ac_ext >&5
1516 { { echo "$as_me:1516: error: cannot compute OBJEXT: cannot compile" >&5
1517 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1518    { (exit 1); exit 1; }; }
1519 fi
1520
1521 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1522 fi
1523 echo "$as_me:1523: result: $ac_cv_objext" >&5
1524 echo "${ECHO_T}$ac_cv_objext" >&6
1525 OBJEXT=$ac_cv_objext
1526 ac_objext=$OBJEXT
1527 echo "$as_me:1527: checking whether we are using the GNU C compiler" >&5
1528 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1529 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1530   echo $ECHO_N "(cached) $ECHO_C" >&6
1531 else
1532   cat >conftest.$ac_ext <<_ACEOF
1533 #line 1533 "configure"
1534 #include "confdefs.h"
1535
1536 int
1537 main (void)
1538 {
1539 #ifndef __GNUC__
1540        choke me
1541 #endif
1542
1543   ;
1544   return 0;
1545 }
1546 _ACEOF
1547 rm -f conftest.$ac_objext
1548 if { (eval echo "$as_me:1548: \"$ac_compile\"") >&5
1549   (eval $ac_compile) 2>&5
1550   ac_status=$?
1551   echo "$as_me:1551: \$? = $ac_status" >&5
1552   (exit $ac_status); } &&
1553          { ac_try='test -s conftest.$ac_objext'
1554   { (eval echo "$as_me:1554: \"$ac_try\"") >&5
1555   (eval $ac_try) 2>&5
1556   ac_status=$?
1557   echo "$as_me:1557: \$? = $ac_status" >&5
1558   (exit $ac_status); }; }; then
1559   ac_compiler_gnu=yes
1560 else
1561   echo "$as_me: failed program was:" >&5
1562 cat conftest.$ac_ext >&5
1563 ac_compiler_gnu=no
1564 fi
1565 rm -f conftest.$ac_objext conftest.$ac_ext
1566 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1567
1568 fi
1569 echo "$as_me:1569: result: $ac_cv_c_compiler_gnu" >&5
1570 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1571 GCC=`test $ac_compiler_gnu = yes && echo yes`
1572 ac_test_CFLAGS=${CFLAGS+set}
1573 ac_save_CFLAGS=$CFLAGS
1574 CFLAGS="-g"
1575 echo "$as_me:1575: checking whether $CC accepts -g" >&5
1576 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1577 if test "${ac_cv_prog_cc_g+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main (void)
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.$ac_objext
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); } &&
1598          { ac_try='test -s conftest.$ac_objext'
1599   { (eval echo "$as_me:1599: \"$ac_try\"") >&5
1600   (eval $ac_try) 2>&5
1601   ac_status=$?
1602   echo "$as_me:1602: \$? = $ac_status" >&5
1603   (exit $ac_status); }; }; then
1604   ac_cv_prog_cc_g=yes
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 ac_cv_prog_cc_g=no
1609 fi
1610 rm -f conftest.$ac_objext conftest.$ac_ext
1611 fi
1612 echo "$as_me:1612: result: $ac_cv_prog_cc_g" >&5
1613 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1614 if test "$ac_test_CFLAGS" = set; then
1615   CFLAGS=$ac_save_CFLAGS
1616 elif test $ac_cv_prog_cc_g = yes; then
1617   if test "$GCC" = yes; then
1618     CFLAGS="-g -O2"
1619   else
1620     CFLAGS="-g"
1621   fi
1622 else
1623   if test "$GCC" = yes; then
1624     CFLAGS="-O2"
1625   else
1626     CFLAGS=
1627   fi
1628 fi
1629 # Some people use a C++ compiler to compile C.  Since we use `exit',
1630 # in C++ we need to declare it.  In case someone uses the same compiler
1631 # for both compiling C and C++ we need to have the C++ compiler decide
1632 # the declaration of exit, since it's the most demanding environment.
1633 cat >conftest.$ac_ext <<_ACEOF
1634 #ifndef __cplusplus
1635   choke me
1636 #endif
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   for ac_declaration in \
1651    ''\
1652    '#include <stdlib.h>' \
1653    'extern "C" void std::exit (int) throw (); using std::exit;' \
1654    'extern "C" void std::exit (int); using std::exit;' \
1655    'extern "C" void exit (int) throw ();' \
1656    'extern "C" void exit (int);' \
1657    'void exit (int);'
1658 do
1659   cat >conftest.$ac_ext <<_ACEOF
1660 #line 1660 "configure"
1661 #include "confdefs.h"
1662 #include <stdlib.h>
1663 $ac_declaration
1664 int
1665 main (void)
1666 {
1667 exit (42);
1668   ;
1669   return 0;
1670 }
1671 _ACEOF
1672 rm -f conftest.$ac_objext
1673 if { (eval echo "$as_me:1673: \"$ac_compile\"") >&5
1674   (eval $ac_compile) 2>&5
1675   ac_status=$?
1676   echo "$as_me:1676: \$? = $ac_status" >&5
1677   (exit $ac_status); } &&
1678          { ac_try='test -s conftest.$ac_objext'
1679   { (eval echo "$as_me:1679: \"$ac_try\"") >&5
1680   (eval $ac_try) 2>&5
1681   ac_status=$?
1682   echo "$as_me:1682: \$? = $ac_status" >&5
1683   (exit $ac_status); }; }; then
1684   :
1685 else
1686   echo "$as_me: failed program was:" >&5
1687 cat conftest.$ac_ext >&5
1688 continue
1689 fi
1690 rm -f conftest.$ac_objext conftest.$ac_ext
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694 $ac_declaration
1695 int
1696 main (void)
1697 {
1698 exit (42);
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   break
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 fi
1720 rm -f conftest.$ac_objext conftest.$ac_ext
1721 done
1722 rm -rf conftest*
1723 if test -n "$ac_declaration"; then
1724   echo '#ifdef __cplusplus' >>confdefs.h
1725   echo $ac_declaration      >>confdefs.h
1726   echo '#endif'             >>confdefs.h
1727 fi
1728
1729 else
1730   echo "$as_me: failed program was:" >&5
1731 cat conftest.$ac_ext >&5
1732 fi
1733 rm -f conftest.$ac_objext conftest.$ac_ext
1734 ac_ext=c
1735 ac_cpp='$CPP $CPPFLAGS'
1736 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1737 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1738 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1739 ac_main_return=return
1740
1741 GCC_VERSION=none
1742 if test "$GCC" = yes ; then
1743         echo "$as_me:1743: checking version of $CC" >&5
1744 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1745         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.].*//'`"
1746         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1747         echo "$as_me:1747: result: $GCC_VERSION" >&5
1748 echo "${ECHO_T}$GCC_VERSION" >&6
1749 fi
1750
1751 INTEL_COMPILER=no
1752
1753 if test "$GCC" = yes ; then
1754         case $host_os in
1755         (linux*|gnu*)
1756                 echo "$as_me:1756: checking if this is really Intel C compiler" >&5
1757 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1758                 cf_save_CFLAGS="$CFLAGS"
1759                 CFLAGS="$CFLAGS -no-gcc"
1760                 cat >conftest.$ac_ext <<_ACEOF
1761 #line 1761 "configure"
1762 #include "confdefs.h"
1763
1764 int
1765 main (void)
1766 {
1767
1768 #ifdef __INTEL_COMPILER
1769 #else
1770 make an error
1771 #endif
1772
1773   ;
1774   return 0;
1775 }
1776 _ACEOF
1777 rm -f conftest.$ac_objext
1778 if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5
1779   (eval $ac_compile) 2>&5
1780   ac_status=$?
1781   echo "$as_me:1781: \$? = $ac_status" >&5
1782   (exit $ac_status); } &&
1783          { ac_try='test -s conftest.$ac_objext'
1784   { (eval echo "$as_me:1784: \"$ac_try\"") >&5
1785   (eval $ac_try) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); }; }; then
1789   INTEL_COMPILER=yes
1790 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1791
1792 else
1793   echo "$as_me: failed program was:" >&5
1794 cat conftest.$ac_ext >&5
1795 fi
1796 rm -f conftest.$ac_objext conftest.$ac_ext
1797                 CFLAGS="$cf_save_CFLAGS"
1798                 echo "$as_me:1798: result: $INTEL_COMPILER" >&5
1799 echo "${ECHO_T}$INTEL_COMPILER" >&6
1800                 ;;
1801         esac
1802 fi
1803
1804 CLANG_COMPILER=no
1805
1806 if test "$GCC" = yes ; then
1807         echo "$as_me:1807: checking if this is really Clang C compiler" >&5
1808 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1809         cf_save_CFLAGS="$CFLAGS"
1810         CFLAGS="$CFLAGS -Qunused-arguments"
1811         cat >conftest.$ac_ext <<_ACEOF
1812 #line 1812 "configure"
1813 #include "confdefs.h"
1814
1815 int
1816 main (void)
1817 {
1818
1819 #ifdef __clang__
1820 #else
1821 make an error
1822 #endif
1823
1824   ;
1825   return 0;
1826 }
1827 _ACEOF
1828 rm -f conftest.$ac_objext
1829 if { (eval echo "$as_me:1829: \"$ac_compile\"") >&5
1830   (eval $ac_compile) 2>&5
1831   ac_status=$?
1832   echo "$as_me:1832: \$? = $ac_status" >&5
1833   (exit $ac_status); } &&
1834          { ac_try='test -s conftest.$ac_objext'
1835   { (eval echo "$as_me:1835: \"$ac_try\"") >&5
1836   (eval $ac_try) 2>&5
1837   ac_status=$?
1838   echo "$as_me:1838: \$? = $ac_status" >&5
1839   (exit $ac_status); }; }; then
1840   CLANG_COMPILER=yes
1841 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1842
1843 else
1844   echo "$as_me: failed program was:" >&5
1845 cat conftest.$ac_ext >&5
1846 fi
1847 rm -f conftest.$ac_objext conftest.$ac_ext
1848         CFLAGS="$cf_save_CFLAGS"
1849         echo "$as_me:1849: result: $CLANG_COMPILER" >&5
1850 echo "${ECHO_T}$CLANG_COMPILER" >&6
1851 fi
1852
1853 echo "$as_me:1853: checking for $CC option to accept ANSI C" >&5
1854 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1855 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1856   echo $ECHO_N "(cached) $ECHO_C" >&6
1857 else
1858   ac_cv_prog_cc_stdc=no
1859 ac_save_CC=$CC
1860 cat >conftest.$ac_ext <<_ACEOF
1861 #line 1861 "configure"
1862 #include "confdefs.h"
1863 #include <stdarg.h>
1864 #include <stdio.h>
1865 #include <sys/types.h>
1866 #include <sys/stat.h>
1867 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1868 struct buf { int x; };
1869 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1870 static char *e (p, i)
1871      char **p;
1872      int i;
1873 {
1874   return p[i];
1875 }
1876 static char *f (char * (*g) (char **, int), char **p, ...)
1877 {
1878   char *s;
1879   va_list v;
1880   va_start (v,p);
1881   s = g (p, va_arg (v,int));
1882   va_end (v);
1883   return s;
1884 }
1885 int test (int i, double x);
1886 struct s1 {int (*f) (int a);};
1887 struct s2 {int (*f) (double a);};
1888 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1889 int argc;
1890 char **argv;
1891 int
1892 main (void)
1893 {
1894 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1895   ;
1896   return 0;
1897 }
1898 _ACEOF
1899 # Don't try gcc -ansi; that turns off useful extensions and
1900 # breaks some systems' header files.
1901 # AIX                   -qlanglvl=ansi
1902 # Ultrix and OSF/1      -std1
1903 # HP-UX 10.20 and later -Ae
1904 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1905 # SVR4                  -Xc -D__EXTENSIONS__
1906 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1907 do
1908   CC="$ac_save_CC $ac_arg"
1909   rm -f conftest.$ac_objext
1910 if { (eval echo "$as_me:1910: \"$ac_compile\"") >&5
1911   (eval $ac_compile) 2>&5
1912   ac_status=$?
1913   echo "$as_me:1913: \$? = $ac_status" >&5
1914   (exit $ac_status); } &&
1915          { ac_try='test -s conftest.$ac_objext'
1916   { (eval echo "$as_me:1916: \"$ac_try\"") >&5
1917   (eval $ac_try) 2>&5
1918   ac_status=$?
1919   echo "$as_me:1919: \$? = $ac_status" >&5
1920   (exit $ac_status); }; }; then
1921   ac_cv_prog_cc_stdc=$ac_arg
1922 break
1923 else
1924   echo "$as_me: failed program was:" >&5
1925 cat conftest.$ac_ext >&5
1926 fi
1927 rm -f conftest.$ac_objext
1928 done
1929 rm -f conftest.$ac_ext conftest.$ac_objext
1930 CC=$ac_save_CC
1931
1932 fi
1933
1934 case "x$ac_cv_prog_cc_stdc" in
1935   x|xno)
1936     echo "$as_me:1936: result: none needed" >&5
1937 echo "${ECHO_T}none needed" >&6 ;;
1938   *)
1939     echo "$as_me:1939: result: $ac_cv_prog_cc_stdc" >&5
1940 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1941     CC="$CC $ac_cv_prog_cc_stdc" ;;
1942 esac
1943
1944 # This should have been defined by AC_PROG_CC
1945 : ${CC:=cc}
1946
1947 echo "$as_me:1947: checking \$CFLAGS variable" >&5
1948 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1949 case "x$CFLAGS" in
1950 (*-[IUD]*)
1951         echo "$as_me:1951: result: broken" >&5
1952 echo "${ECHO_T}broken" >&6
1953         { echo "$as_me:1953: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1954 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1955         cf_flags="$CFLAGS"
1956         CFLAGS=
1957         for cf_arg in $cf_flags
1958         do
1959
1960 cf_fix_cppflags=no
1961 cf_new_cflags=
1962 cf_new_cppflags=
1963 cf_new_extra_cppflags=
1964
1965 for cf_add_cflags in $cf_arg
1966 do
1967 case $cf_fix_cppflags in
1968 (no)
1969         case $cf_add_cflags in
1970         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1971                 case $cf_add_cflags in
1972                 (-D*)
1973                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1974
1975                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1976                                 && test -z "${cf_tst_cflags}" \
1977                                 && cf_fix_cppflags=yes
1978
1979                         if test $cf_fix_cppflags = yes ; then
1980
1981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1983
1984                                 continue
1985                         elif test "${cf_tst_cflags}" = "\"'" ; then
1986
1987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1989
1990                                 continue
1991                         fi
1992                         ;;
1993                 esac
1994                 case "$CPPFLAGS" in
1995                 (*$cf_add_cflags)
1996                         ;;
1997                 (*)
1998                         case $cf_add_cflags in
1999                         (-D*)
2000                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2001
2002 CPPFLAGS=`echo "$CPPFLAGS" | \
2003         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2004                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2005
2006                                 ;;
2007                         esac
2008
2009         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2010         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2011
2012                         ;;
2013                 esac
2014                 ;;
2015         (*)
2016
2017         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2018         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2019
2020                 ;;
2021         esac
2022         ;;
2023 (yes)
2024
2025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2027
2028         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2029
2030         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2031                 && test -z "${cf_tst_cflags}" \
2032                 && cf_fix_cppflags=no
2033         ;;
2034 esac
2035 done
2036
2037 if test -n "$cf_new_cflags" ; then
2038
2039         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2040         CFLAGS="${CFLAGS}$cf_new_cflags"
2041
2042 fi
2043
2044 if test -n "$cf_new_cppflags" ; then
2045
2046         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2047         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2048
2049 fi
2050
2051 if test -n "$cf_new_extra_cppflags" ; then
2052
2053         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2054         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2055
2056 fi
2057
2058         done
2059         ;;
2060 (*)
2061         echo "$as_me:2061: result: ok" >&5
2062 echo "${ECHO_T}ok" >&6
2063         ;;
2064 esac
2065
2066 echo "$as_me:2066: checking \$CC variable" >&5
2067 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2068 case "$CC" in
2069 (*[\ \  ]-*)
2070         echo "$as_me:2070: result: broken" >&5
2071 echo "${ECHO_T}broken" >&6
2072         { echo "$as_me:2072: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2073 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2074         # humor him...
2075         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2076         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2077         CC="$cf_prog"
2078         for cf_arg in $cf_flags
2079         do
2080                 case "x$cf_arg" in
2081                 (x-[IUDfgOW]*)
2082
2083 cf_fix_cppflags=no
2084 cf_new_cflags=
2085 cf_new_cppflags=
2086 cf_new_extra_cppflags=
2087
2088 for cf_add_cflags in $cf_arg
2089 do
2090 case $cf_fix_cppflags in
2091 (no)
2092         case $cf_add_cflags in
2093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2094                 case $cf_add_cflags in
2095                 (-D*)
2096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2097
2098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2099                                 && test -z "${cf_tst_cflags}" \
2100                                 && cf_fix_cppflags=yes
2101
2102                         if test $cf_fix_cppflags = yes ; then
2103
2104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2106
2107                                 continue
2108                         elif test "${cf_tst_cflags}" = "\"'" ; then
2109
2110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2112
2113                                 continue
2114                         fi
2115                         ;;
2116                 esac
2117                 case "$CPPFLAGS" in
2118                 (*$cf_add_cflags)
2119                         ;;
2120                 (*)
2121                         case $cf_add_cflags in
2122                         (-D*)
2123                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2124
2125 CPPFLAGS=`echo "$CPPFLAGS" | \
2126         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2127                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2128
2129                                 ;;
2130                         esac
2131
2132         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2133         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2134
2135                         ;;
2136                 esac
2137                 ;;
2138         (*)
2139
2140         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2141         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2142
2143                 ;;
2144         esac
2145         ;;
2146 (yes)
2147
2148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2150
2151         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2152
2153         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2154                 && test -z "${cf_tst_cflags}" \
2155                 && cf_fix_cppflags=no
2156         ;;
2157 esac
2158 done
2159
2160 if test -n "$cf_new_cflags" ; then
2161
2162         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2163         CFLAGS="${CFLAGS}$cf_new_cflags"
2164
2165 fi
2166
2167 if test -n "$cf_new_cppflags" ; then
2168
2169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2170         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2171
2172 fi
2173
2174 if test -n "$cf_new_extra_cppflags" ; then
2175
2176         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2177         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2178
2179 fi
2180
2181                         ;;
2182                 (*)
2183                         CC="$CC $cf_arg"
2184                         ;;
2185                 esac
2186         done
2187         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2188
2189 echo "${as_me:-configure}:2189: testing resulting CC: '$CC' ..." 1>&5
2190
2191         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2192
2193 echo "${as_me:-configure}:2193: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2194
2195         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2196
2197 echo "${as_me:-configure}:2197: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2198
2199         ;;
2200 (*)
2201         echo "$as_me:2201: result: ok" >&5
2202 echo "${ECHO_T}ok" >&6
2203         ;;
2204 esac
2205
2206 ac_ext=c
2207 ac_cpp='$CPP $CPPFLAGS'
2208 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2209 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2210 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2211 ac_main_return=return
2212 echo "$as_me:2212: checking how to run the C preprocessor" >&5
2213 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2214 # On Suns, sometimes $CPP names a directory.
2215 if test -n "$CPP" && test -d "$CPP"; then
2216   CPP=
2217 fi
2218 if test -z "$CPP"; then
2219   if test "${ac_cv_prog_CPP+set}" = set; then
2220   echo $ECHO_N "(cached) $ECHO_C" >&6
2221 else
2222       # Double quotes because CPP needs to be expanded
2223     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2224     do
2225       ac_preproc_ok=false
2226 for ac_c_preproc_warn_flag in '' yes
2227 do
2228   # Use a header file that comes with gcc, so configuring glibc
2229   # with a fresh cross-compiler works.
2230   # On the NeXT, cc -E runs the code through the compiler's parser,
2231   # not just through cpp. "Syntax error" is here to catch this case.
2232   cat >conftest.$ac_ext <<_ACEOF
2233 #line 2233 "configure"
2234 #include "confdefs.h"
2235 #include <assert.h>
2236                      Syntax error
2237 _ACEOF
2238 if { (eval echo "$as_me:2238: \"$ac_cpp conftest.$ac_ext\"") >&5
2239   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2240   ac_status=$?
2241   egrep -v '^ *\+' conftest.er1 >conftest.err
2242   rm -f conftest.er1
2243   cat conftest.err >&5
2244   echo "$as_me:2244: \$? = $ac_status" >&5
2245   (exit $ac_status); } >/dev/null; then
2246   if test -s conftest.err; then
2247     ac_cpp_err=$ac_c_preproc_warn_flag
2248   else
2249     ac_cpp_err=
2250   fi
2251 else
2252   ac_cpp_err=yes
2253 fi
2254 if test -z "$ac_cpp_err"; then
2255   :
2256 else
2257   echo "$as_me: failed program was:" >&5
2258   cat conftest.$ac_ext >&5
2259   # Broken: fails on valid input.
2260 continue
2261 fi
2262 rm -f conftest.err conftest.$ac_ext
2263
2264   # OK, works on sane cases.  Now check whether non-existent headers
2265   # can be detected and how.
2266   cat >conftest.$ac_ext <<_ACEOF
2267 #line 2267 "configure"
2268 #include "confdefs.h"
2269 #include <ac_nonexistent.h>
2270 _ACEOF
2271 if { (eval echo "$as_me:2271: \"$ac_cpp conftest.$ac_ext\"") >&5
2272   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2273   ac_status=$?
2274   egrep -v '^ *\+' conftest.er1 >conftest.err
2275   rm -f conftest.er1
2276   cat conftest.err >&5
2277   echo "$as_me:2277: \$? = $ac_status" >&5
2278   (exit $ac_status); } >/dev/null; then
2279   if test -s conftest.err; then
2280     ac_cpp_err=$ac_c_preproc_warn_flag
2281   else
2282     ac_cpp_err=
2283   fi
2284 else
2285   ac_cpp_err=yes
2286 fi
2287 if test -z "$ac_cpp_err"; then
2288   # Broken: success on invalid input.
2289 continue
2290 else
2291   echo "$as_me: failed program was:" >&5
2292   cat conftest.$ac_ext >&5
2293   # Passes both tests.
2294 ac_preproc_ok=:
2295 break
2296 fi
2297 rm -f conftest.err conftest.$ac_ext
2298
2299 done
2300 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2301 rm -f conftest.err conftest.$ac_ext
2302 if $ac_preproc_ok; then
2303   break
2304 fi
2305
2306     done
2307     ac_cv_prog_CPP=$CPP
2308
2309 fi
2310   CPP=$ac_cv_prog_CPP
2311 else
2312   ac_cv_prog_CPP=$CPP
2313 fi
2314 echo "$as_me:2314: result: $CPP" >&5
2315 echo "${ECHO_T}$CPP" >&6
2316 ac_preproc_ok=false
2317 for ac_c_preproc_warn_flag in '' yes
2318 do
2319   # Use a header file that comes with gcc, so configuring glibc
2320   # with a fresh cross-compiler works.
2321   # On the NeXT, cc -E runs the code through the compiler's parser,
2322   # not just through cpp. "Syntax error" is here to catch this case.
2323   cat >conftest.$ac_ext <<_ACEOF
2324 #line 2324 "configure"
2325 #include "confdefs.h"
2326 #include <assert.h>
2327                      Syntax error
2328 _ACEOF
2329 if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
2330   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2331   ac_status=$?
2332   egrep -v '^ *\+' conftest.er1 >conftest.err
2333   rm -f conftest.er1
2334   cat conftest.err >&5
2335   echo "$as_me:2335: \$? = $ac_status" >&5
2336   (exit $ac_status); } >/dev/null; then
2337   if test -s conftest.err; then
2338     ac_cpp_err=$ac_c_preproc_warn_flag
2339   else
2340     ac_cpp_err=
2341   fi
2342 else
2343   ac_cpp_err=yes
2344 fi
2345 if test -z "$ac_cpp_err"; then
2346   :
2347 else
2348   echo "$as_me: failed program was:" >&5
2349   cat conftest.$ac_ext >&5
2350   # Broken: fails on valid input.
2351 continue
2352 fi
2353 rm -f conftest.err conftest.$ac_ext
2354
2355   # OK, works on sane cases.  Now check whether non-existent headers
2356   # can be detected and how.
2357   cat >conftest.$ac_ext <<_ACEOF
2358 #line 2358 "configure"
2359 #include "confdefs.h"
2360 #include <ac_nonexistent.h>
2361 _ACEOF
2362 if { (eval echo "$as_me:2362: \"$ac_cpp conftest.$ac_ext\"") >&5
2363   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2364   ac_status=$?
2365   egrep -v '^ *\+' conftest.er1 >conftest.err
2366   rm -f conftest.er1
2367   cat conftest.err >&5
2368   echo "$as_me:2368: \$? = $ac_status" >&5
2369   (exit $ac_status); } >/dev/null; then
2370   if test -s conftest.err; then
2371     ac_cpp_err=$ac_c_preproc_warn_flag
2372   else
2373     ac_cpp_err=
2374   fi
2375 else
2376   ac_cpp_err=yes
2377 fi
2378 if test -z "$ac_cpp_err"; then
2379   # Broken: success on invalid input.
2380 continue
2381 else
2382   echo "$as_me: failed program was:" >&5
2383   cat conftest.$ac_ext >&5
2384   # Passes both tests.
2385 ac_preproc_ok=:
2386 break
2387 fi
2388 rm -f conftest.err conftest.$ac_ext
2389
2390 done
2391 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2392 rm -f conftest.err conftest.$ac_ext
2393 if $ac_preproc_ok; then
2394   :
2395 else
2396   { { echo "$as_me:2396: error: C preprocessor \"$CPP\" fails sanity check" >&5
2397 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2398    { (exit 1); exit 1; }; }
2399 fi
2400
2401 ac_ext=c
2402 ac_cpp='$CPP $CPPFLAGS'
2403 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2404 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2405 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2406 ac_main_return=return
2407
2408 if test $ac_cv_c_compiler_gnu = yes; then
2409     echo "$as_me:2409: checking whether $CC needs -traditional" >&5
2410 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2411 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2412   echo $ECHO_N "(cached) $ECHO_C" >&6
2413 else
2414     ac_pattern="Autoconf.*'x'"
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <sgtty.h>
2419 int Autoconf = TIOCGETP;
2420 _ACEOF
2421 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2422   egrep "$ac_pattern" >/dev/null 2>&1; then
2423   ac_cv_prog_gcc_traditional=yes
2424 else
2425   ac_cv_prog_gcc_traditional=no
2426 fi
2427 rm -rf conftest*
2428
2429   if test $ac_cv_prog_gcc_traditional = no; then
2430     cat >conftest.$ac_ext <<_ACEOF
2431 #line 2431 "configure"
2432 #include "confdefs.h"
2433 #include <termio.h>
2434 int Autoconf = TCGETA;
2435 _ACEOF
2436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2437   egrep "$ac_pattern" >/dev/null 2>&1; then
2438   ac_cv_prog_gcc_traditional=yes
2439 fi
2440 rm -rf conftest*
2441
2442   fi
2443 fi
2444 echo "$as_me:2444: result: $ac_cv_prog_gcc_traditional" >&5
2445 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2446   if test $ac_cv_prog_gcc_traditional = yes; then
2447     CC="$CC -traditional"
2448   fi
2449 fi
2450
2451 echo "$as_me:2451: checking whether $CC understands -c and -o together" >&5
2452 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2453 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2454   echo $ECHO_N "(cached) $ECHO_C" >&6
2455 else
2456
2457 cat > conftest.$ac_ext <<CF_EOF
2458 int main(void)
2459 {
2460         ${cf_cv_main_return:-return}(0);
2461 }
2462 CF_EOF
2463 # We do the test twice because some compilers refuse to overwrite an
2464 # existing .o file with -o, though they will create one.
2465 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2466 if { (eval echo "$as_me:2466: \"$ac_try\"") >&5
2467   (eval $ac_try) 2>&5
2468   ac_status=$?
2469   echo "$as_me:2469: \$? = $ac_status" >&5
2470   (exit $ac_status); } &&
2471   test -f conftest2.$ac_objext && { (eval echo "$as_me:2471: \"$ac_try\"") >&5
2472   (eval $ac_try) 2>&5
2473   ac_status=$?
2474   echo "$as_me:2474: \$? = $ac_status" >&5
2475   (exit $ac_status); };
2476 then
2477   eval cf_cv_prog_CC_c_o=yes
2478 else
2479   eval cf_cv_prog_CC_c_o=no
2480 fi
2481 rm -rf conftest*
2482
2483 fi
2484 if test $cf_cv_prog_CC_c_o = yes; then
2485   echo "$as_me:2485: result: yes" >&5
2486 echo "${ECHO_T}yes" >&6
2487 else
2488   echo "$as_me:2488: result: no" >&5
2489 echo "${ECHO_T}no" >&6
2490 fi
2491
2492 test "$program_prefix" != NONE &&
2493   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2494 # Use a double $ so make ignores it.
2495 test "$program_suffix" != NONE &&
2496   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2497 # Double any \ or $.  echo might interpret backslashes.
2498 # By default was `s,x,x', remove it if useless.
2499 cat <<\_ACEOF >conftest.sed
2500 s/[\\$]/&&/g;s/;s,x,x,$//
2501 _ACEOF
2502 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2503 rm conftest.sed
2504
2505 for ac_prog in mawk gawk nawk awk
2506 do
2507   # Extract the first word of "$ac_prog", so it can be a program name with args.
2508 set dummy $ac_prog; ac_word=$2
2509 echo "$as_me:2509: checking for $ac_word" >&5
2510 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2511 if test "${ac_cv_prog_AWK+set}" = set; then
2512   echo $ECHO_N "(cached) $ECHO_C" >&6
2513 else
2514   if test -n "$AWK"; then
2515   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2516 else
2517   ac_save_IFS=$IFS; IFS=$ac_path_separator
2518 ac_dummy="$PATH"
2519 for ac_dir in $ac_dummy; do
2520   IFS=$ac_save_IFS
2521   test -z "$ac_dir" && ac_dir=.
2522   $as_executable_p "$ac_dir/$ac_word" || continue
2523 ac_cv_prog_AWK="$ac_prog"
2524 echo "$as_me:2524: found $ac_dir/$ac_word" >&5
2525 break
2526 done
2527
2528 fi
2529 fi
2530 AWK=$ac_cv_prog_AWK
2531 if test -n "$AWK"; then
2532   echo "$as_me:2532: result: $AWK" >&5
2533 echo "${ECHO_T}$AWK" >&6
2534 else
2535   echo "$as_me:2535: result: no" >&5
2536 echo "${ECHO_T}no" >&6
2537 fi
2538
2539   test -n "$AWK" && break
2540 done
2541
2542 test -z "$AWK" && { { echo "$as_me:2542: error: No awk program found" >&5
2543 echo "$as_me: error: No awk program found" >&2;}
2544    { (exit 1); exit 1; }; }
2545
2546 echo "$as_me:2546: checking for egrep" >&5
2547 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2548 if test "${ac_cv_prog_egrep+set}" = set; then
2549   echo $ECHO_N "(cached) $ECHO_C" >&6
2550 else
2551   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2552                 then ac_cv_prog_egrep='grep -E'
2553                 else ac_cv_prog_egrep='egrep'
2554         fi
2555 fi
2556 echo "$as_me:2556: result: $ac_cv_prog_egrep" >&5
2557 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2558         EGREP=$ac_cv_prog_egrep
2559
2560         test -z "$EGREP" && { { echo "$as_me:2560: error: No egrep program found" >&5
2561 echo "$as_me: error: No egrep program found" >&2;}
2562    { (exit 1); exit 1; }; }
2563
2564 # Find a good install program.  We prefer a C program (faster),
2565 # so one script is as good as another.  But avoid the broken or
2566 # incompatible versions:
2567 # SysV /etc/install, /usr/sbin/install
2568 # SunOS /usr/etc/install
2569 # IRIX /sbin/install
2570 # AIX /bin/install
2571 # AmigaOS /C/install, which installs bootblocks on floppy discs
2572 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2573 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2574 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2575 # ./install, which can be erroneously created by make from ./install.sh.
2576 echo "$as_me:2576: checking for a BSD compatible install" >&5
2577 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2578 if test -z "$INSTALL"; then
2579 if test "${ac_cv_path_install+set}" = set; then
2580   echo $ECHO_N "(cached) $ECHO_C" >&6
2581 else
2582     ac_save_IFS=$IFS; IFS=$ac_path_separator
2583   for ac_dir in $PATH; do
2584     IFS=$ac_save_IFS
2585     # Account for people who put trailing slashes in PATH elements.
2586     case $ac_dir/ in
2587     / | ./ | .// | /cC/* \
2588     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2589     | /usr/ucb/* ) ;;
2590     *)
2591       # OSF1 and SCO ODT 3.0 have their own names for install.
2592       # Don't use installbsd from OSF since it installs stuff as root
2593       # by default.
2594       for ac_prog in ginstall scoinst install; do
2595         if $as_executable_p "$ac_dir/$ac_prog"; then
2596           if test $ac_prog = install &&
2597             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2598             # AIX install.  It has an incompatible calling convention.
2599             :
2600           elif test $ac_prog = install &&
2601             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2602             # program-specific install script used by HP pwplus--don't use.
2603             :
2604           else
2605             ac_cv_path_install="$ac_dir/$ac_prog -c"
2606             break 2
2607           fi
2608         fi
2609       done
2610       ;;
2611     esac
2612   done
2613
2614 fi
2615   if test "${ac_cv_path_install+set}" = set; then
2616     INSTALL=$ac_cv_path_install
2617   else
2618     # As a last resort, use the slow shell script.  We don't cache a
2619     # path for INSTALL within a source directory, because that will
2620     # break other packages using the cache if that directory is
2621     # removed, or if the path is relative.
2622     INSTALL=$ac_install_sh
2623   fi
2624 fi
2625 echo "$as_me:2625: result: $INSTALL" >&5
2626 echo "${ECHO_T}$INSTALL" >&6
2627
2628 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2629 # It thinks the first close brace ends the variable substitution.
2630 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2631
2632 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2633
2634 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2635
2636 echo "$as_me:2636: checking whether ln -s works" >&5
2637 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2638 LN_S=$as_ln_s
2639 if test "$LN_S" = "ln -s"; then
2640   echo "$as_me:2640: result: yes" >&5
2641 echo "${ECHO_T}yes" >&6
2642 else
2643   echo "$as_me:2643: result: no, using $LN_S" >&5
2644 echo "${ECHO_T}no, using $LN_S" >&6
2645 fi
2646
2647 echo "$as_me:2647: checking if $LN_S -f options work" >&5
2648 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2649
2650 rm -f conf$$.src conf$$dst
2651 echo >conf$$.dst
2652 echo first >conf$$.src
2653 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2654         cf_prog_ln_sf=yes
2655 else
2656         cf_prog_ln_sf=no
2657 fi
2658 rm -f conf$$.dst conf$$src
2659 echo "$as_me:2659: result: $cf_prog_ln_sf" >&5
2660 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2661
2662 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2663
2664 # Find a good install program.  We prefer a C program (faster),
2665 # so one script is as good as another.  But avoid the broken or
2666 # incompatible versions:
2667 # SysV /etc/install, /usr/sbin/install
2668 # SunOS /usr/etc/install
2669 # IRIX /sbin/install
2670 # AIX /bin/install
2671 # AmigaOS /C/install, which installs bootblocks on floppy discs
2672 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2673 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2674 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2675 # ./install, which can be erroneously created by make from ./install.sh.
2676 echo "$as_me:2676: checking for a BSD compatible install" >&5
2677 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2678 if test -z "$INSTALL"; then
2679 if test "${ac_cv_path_install+set}" = set; then
2680   echo $ECHO_N "(cached) $ECHO_C" >&6
2681 else
2682     ac_save_IFS=$IFS; IFS=$ac_path_separator
2683   for ac_dir in $PATH; do
2684     IFS=$ac_save_IFS
2685     # Account for people who put trailing slashes in PATH elements.
2686     case $ac_dir/ in
2687     / | ./ | .// | /cC/* \
2688     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2689     | /usr/ucb/* ) ;;
2690     *)
2691       # OSF1 and SCO ODT 3.0 have their own names for install.
2692       # Don't use installbsd from OSF since it installs stuff as root
2693       # by default.
2694       for ac_prog in ginstall scoinst install; do
2695         if $as_executable_p "$ac_dir/$ac_prog"; then
2696           if test $ac_prog = install &&
2697             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2698             # AIX install.  It has an incompatible calling convention.
2699             :
2700           elif test $ac_prog = install &&
2701             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2702             # program-specific install script used by HP pwplus--don't use.
2703             :
2704           else
2705             ac_cv_path_install="$ac_dir/$ac_prog -c"
2706             break 2
2707           fi
2708         fi
2709       done
2710       ;;
2711     esac
2712   done
2713
2714 fi
2715   if test "${ac_cv_path_install+set}" = set; then
2716     INSTALL=$ac_cv_path_install
2717   else
2718     # As a last resort, use the slow shell script.  We don't cache a
2719     # path for INSTALL within a source directory, because that will
2720     # break other packages using the cache if that directory is
2721     # removed, or if the path is relative.
2722     INSTALL=$ac_install_sh
2723   fi
2724 fi
2725 echo "$as_me:2725: result: $INSTALL" >&5
2726 echo "${ECHO_T}$INSTALL" >&6
2727
2728 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2729 # It thinks the first close brace ends the variable substitution.
2730 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2731
2732 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2733
2734 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2735
2736 case $INSTALL in
2737 (/*)
2738         ;;
2739 (*)
2740         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2741         test -z "$cf_dir" && cf_dir=.
2742         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2743         ;;
2744 esac
2745
2746 echo "$as_me:2746: checking if you want to install stripped executables" >&5
2747 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2748
2749 # Check whether --enable-stripping or --disable-stripping was given.
2750 if test "${enable_stripping+set}" = set; then
2751   enableval="$enable_stripping"
2752   test "$enableval" != no && enableval=yes
2753         if test "$enableval" != "yes" ; then
2754     with_stripping=no
2755         else
2756                 with_stripping=yes
2757         fi
2758 else
2759   enableval=yes
2760         with_stripping=yes
2761
2762 fi;
2763 echo "$as_me:2763: result: $with_stripping" >&5
2764 echo "${ECHO_T}$with_stripping" >&6
2765
2766 if test "$with_stripping" = yes
2767 then
2768         INSTALL_OPT_S="-s"
2769 else
2770         INSTALL_OPT_S=
2771 fi
2772
2773 : ${INSTALL:=install}
2774 echo "$as_me:2774: checking if install accepts -p option" >&5
2775 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2776 if test "${cf_cv_install_p+set}" = set; then
2777   echo $ECHO_N "(cached) $ECHO_C" >&6
2778 else
2779
2780         rm -rf conftest*
2781         date >conftest.in
2782         mkdir conftest.out
2783         sleep 3
2784         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2785         then
2786                 if test -f conftest.out/conftest.in
2787                 then
2788                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2789                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2790                         if test -s conftest.err
2791                         then
2792                                 cf_cv_install_p=no
2793                         else
2794                                 cf_cv_install_p=yes
2795                         fi
2796                 else
2797                         cf_cv_install_p=no
2798                 fi
2799         else
2800                 cf_cv_install_p=no
2801         fi
2802         rm -rf conftest*
2803
2804 fi
2805 echo "$as_me:2805: result: $cf_cv_install_p" >&5
2806 echo "${ECHO_T}$cf_cv_install_p" >&6
2807
2808 echo "$as_me:2808: checking if install needs to be told about ownership" >&5
2809 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2810 case `$ac_config_guess` in
2811 (*minix)
2812         with_install_o=yes
2813         ;;
2814 (*)
2815         with_install_o=no
2816         ;;
2817 esac
2818
2819 echo "$as_me:2819: result: $with_install_o" >&5
2820 echo "${ECHO_T}$with_install_o" >&6
2821 if test "x$with_install_o" = xyes
2822 then
2823         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'`
2824 else
2825         INSTALL_OPT_O=
2826 fi
2827
2828 echo "$as_me:2828: checking for long file names" >&5
2829 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2830 if test "${ac_cv_sys_long_file_names+set}" = set; then
2831   echo $ECHO_N "(cached) $ECHO_C" >&6
2832 else
2833   ac_cv_sys_long_file_names=yes
2834 # Test for long file names in all the places we know might matter:
2835 #      .                the current directory, where building will happen
2836 #      $prefix/lib      where we will be installing things
2837 #      $exec_prefix/lib likewise
2838 # eval it to expand exec_prefix.
2839 #      $TMPDIR          if set, where it might want to write temporary files
2840 # if $TMPDIR is not set:
2841 #      /tmp             where it might want to write temporary files
2842 #      /var/tmp         likewise
2843 #      /usr/tmp         likewise
2844 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2845   ac_tmpdirs=$TMPDIR
2846 else
2847   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2848 fi
2849 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2850   test -d $ac_dir || continue
2851   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2852   ac_xdir=$ac_dir/cf$$
2853   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2854   ac_tf1=$ac_xdir/conftest9012345
2855   ac_tf2=$ac_xdir/conftest9012346
2856   (echo 1 >$ac_tf1) 2>/dev/null
2857   (echo 2 >$ac_tf2) 2>/dev/null
2858   ac_val=`cat $ac_tf1 2>/dev/null`
2859   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2860     ac_cv_sys_long_file_names=no
2861     rm -rf $ac_xdir 2>/dev/null
2862     break
2863   fi
2864   rm -rf $ac_xdir 2>/dev/null
2865 done
2866 fi
2867 echo "$as_me:2867: result: $ac_cv_sys_long_file_names" >&5
2868 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2869 if test $ac_cv_sys_long_file_names = yes; then
2870
2871 cat >>confdefs.h <<\EOF
2872 #define HAVE_LONG_FILE_NAMES 1
2873 EOF
2874
2875 fi
2876
2877 # if we find pkg-config, check if we should install the ".pc" files.
2878
2879 echo "$as_me:2879: checking if you want to use pkg-config" >&5
2880 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2881
2882 # Check whether --with-pkg-config or --without-pkg-config was given.
2883 if test "${with_pkg_config+set}" = set; then
2884   withval="$with_pkg_config"
2885   cf_pkg_config=$withval
2886 else
2887   cf_pkg_config=yes
2888 fi;
2889 echo "$as_me:2889: result: $cf_pkg_config" >&5
2890 echo "${ECHO_T}$cf_pkg_config" >&6
2891
2892 case $cf_pkg_config in
2893 (no)
2894         PKG_CONFIG=none
2895         ;;
2896 (yes)
2897
2898 if test -n "$ac_tool_prefix"; then
2899   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2900 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2901 echo "$as_me:2901: checking for $ac_word" >&5
2902 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2903 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2904   echo $ECHO_N "(cached) $ECHO_C" >&6
2905 else
2906   case $PKG_CONFIG in
2907   [\\/]* | ?:[\\/]*)
2908   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2909   ;;
2910   *)
2911   ac_save_IFS=$IFS; IFS=$ac_path_separator
2912 ac_dummy="$PATH"
2913 for ac_dir in $ac_dummy; do
2914   IFS=$ac_save_IFS
2915   test -z "$ac_dir" && ac_dir=.
2916   if $as_executable_p "$ac_dir/$ac_word"; then
2917    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2918    echo "$as_me:2918: found $ac_dir/$ac_word" >&5
2919    break
2920 fi
2921 done
2922
2923   ;;
2924 esac
2925 fi
2926 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2927
2928 if test -n "$PKG_CONFIG"; then
2929   echo "$as_me:2929: result: $PKG_CONFIG" >&5
2930 echo "${ECHO_T}$PKG_CONFIG" >&6
2931 else
2932   echo "$as_me:2932: result: no" >&5
2933 echo "${ECHO_T}no" >&6
2934 fi
2935
2936 fi
2937 if test -z "$ac_cv_path_PKG_CONFIG"; then
2938   ac_pt_PKG_CONFIG=$PKG_CONFIG
2939   # Extract the first word of "pkg-config", so it can be a program name with args.
2940 set dummy pkg-config; ac_word=$2
2941 echo "$as_me:2941: checking for $ac_word" >&5
2942 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2943 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2944   echo $ECHO_N "(cached) $ECHO_C" >&6
2945 else
2946   case $ac_pt_PKG_CONFIG in
2947   [\\/]* | ?:[\\/]*)
2948   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2949   ;;
2950   *)
2951   ac_save_IFS=$IFS; IFS=$ac_path_separator
2952 ac_dummy="$PATH"
2953 for ac_dir in $ac_dummy; do
2954   IFS=$ac_save_IFS
2955   test -z "$ac_dir" && ac_dir=.
2956   if $as_executable_p "$ac_dir/$ac_word"; then
2957    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2958    echo "$as_me:2958: found $ac_dir/$ac_word" >&5
2959    break
2960 fi
2961 done
2962
2963   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2964   ;;
2965 esac
2966 fi
2967 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2968
2969 if test -n "$ac_pt_PKG_CONFIG"; then
2970   echo "$as_me:2970: result: $ac_pt_PKG_CONFIG" >&5
2971 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2972 else
2973   echo "$as_me:2973: result: no" >&5
2974 echo "${ECHO_T}no" >&6
2975 fi
2976
2977   PKG_CONFIG=$ac_pt_PKG_CONFIG
2978 else
2979   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2980 fi
2981
2982         ;;
2983 (*)
2984         PKG_CONFIG=$withval
2985         ;;
2986 esac
2987
2988 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2989 if test "$PKG_CONFIG" != none ; then
2990
2991 if test "x$prefix" != xNONE; then
2992         cf_path_syntax="$prefix"
2993 else
2994         cf_path_syntax="$ac_default_prefix"
2995 fi
2996
2997 case ".$PKG_CONFIG" in
2998 (.\$\(*\)*|.\'*\'*)
2999         ;;
3000 (..|./*|.\\*)
3001         ;;
3002 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3003         ;;
3004 (.\${*prefix}*|.\${*dir}*)
3005         eval PKG_CONFIG="$PKG_CONFIG"
3006         case ".$PKG_CONFIG" in
3007         (.NONE/*)
3008                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3009                 ;;
3010         esac
3011         ;;
3012 (.no|.NONE/*)
3013         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3014         ;;
3015 (*)
3016         { { echo "$as_me:3016: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3017 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3018    { (exit 1); exit 1; }; }
3019         ;;
3020 esac
3021
3022 elif test "x$cf_pkg_config" != xno ; then
3023         { echo "$as_me:3023: WARNING: pkg-config is not installed" >&5
3024 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3025 fi
3026
3027 case $PKG_CONFIG in
3028 (no|none|yes)
3029         echo "$as_me:3029: checking for pkg-config library directory" >&5
3030 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3031         ;;
3032 (*)
3033         echo "$as_me:3033: checking for $PKG_CONFIG library directory" >&5
3034 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3035         ;;
3036 esac
3037
3038 PKG_CONFIG_LIBDIR=no
3039
3040 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3041 if test "${with_pkg_config_libdir+set}" = set; then
3042   withval="$with_pkg_config_libdir"
3043   PKG_CONFIG_LIBDIR=$withval
3044 else
3045   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3046 fi;
3047
3048 case x$PKG_CONFIG_LIBDIR in
3049 (x/*)
3050         ;;
3051 (xyes)
3052         # Look for the library directory using the same prefix as the executable
3053         if test "x$PKG_CONFIG" = xnone
3054         then
3055                 cf_path=$prefix
3056         else
3057                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3058         fi
3059
3060         # If you don't like using the default architecture, you have to specify the
3061         # intended library directory and corresponding compiler/linker options.
3062         #
3063         # This case allows for Debian's 2014-flavor of multiarch, along with the
3064         # most common variations before that point.  Some other variants spell the
3065         # directory differently, e.g., "pkg-config", and put it in unusual places.
3066         # pkg-config has always been poorly standardized, which is ironic...
3067         case x`(arch) 2>/dev/null` in
3068         (*64)
3069                 cf_search_path="\
3070                         $cf_path/lib/*64-linux-gnu \
3071                         $cf_path/share \
3072                         $cf_path/lib64 \
3073                         $cf_path/lib32 \
3074                         $cf_path/lib"
3075                 ;;
3076         (*)
3077                 cf_search_path="\
3078                         $cf_path/lib/*-linux-gnu \
3079                         $cf_path/share \
3080                         $cf_path/lib32 \
3081                         $cf_path/lib \
3082                         $cf_path/libdata"
3083                 ;;
3084         esac
3085
3086         test -n "$verbose" && echo "    list..." 1>&6
3087
3088 echo "${as_me:-configure}:3088: testing list... ..." 1>&5
3089
3090         for cf_config in $cf_search_path
3091         do
3092                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3093
3094 echo "${as_me:-configure}:3094: testing checking $cf_config/pkgconfig ..." 1>&5
3095
3096                 if test -d $cf_config/pkgconfig
3097                 then
3098                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3099                         echo "$as_me:3099: checking done" >&5
3100 echo $ECHO_N "checking done... $ECHO_C" >&6
3101                         break
3102                 fi
3103         done
3104         ;;
3105 (*)
3106         ;;
3107 esac
3108
3109 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3110         echo "$as_me:3110: result: $PKG_CONFIG_LIBDIR" >&5
3111 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3112 fi
3113
3114 echo "$as_me:3114: checking if you want to build test-programs" >&5
3115 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3116
3117 # Check whether --with-tests or --without-tests was given.
3118 if test "${with_tests+set}" = set; then
3119   withval="$with_tests"
3120   cf_with_tests=$withval
3121 else
3122   cf_with_tests=yes
3123 fi;
3124 echo "$as_me:3124: result: $cf_with_tests" >&5
3125 echo "${ECHO_T}$cf_with_tests" >&6
3126
3127 echo "$as_me:3127: checking if we should assume mixed-case filenames" >&5
3128 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3129
3130 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3131 if test "${enable_mixed_case+set}" = set; then
3132   enableval="$enable_mixed_case"
3133   enable_mixedcase=$enableval
3134 else
3135   enable_mixedcase=auto
3136 fi;
3137 echo "$as_me:3137: result: $enable_mixedcase" >&5
3138 echo "${ECHO_T}$enable_mixedcase" >&6
3139 if test "$enable_mixedcase" = "auto" ; then
3140
3141 echo "$as_me:3141: checking if filesystem supports mixed-case filenames" >&5
3142 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3143 if test "${cf_cv_mixedcase+set}" = set; then
3144   echo $ECHO_N "(cached) $ECHO_C" >&6
3145 else
3146
3147 if test "$cross_compiling" = yes ; then
3148         case $target_alias in
3149         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3150                 cf_cv_mixedcase=no
3151                 ;;
3152         (*)
3153                 cf_cv_mixedcase=yes
3154                 ;;
3155         esac
3156 else
3157         rm -f conftest CONFTEST
3158         echo test >conftest
3159         if test -f CONFTEST ; then
3160                 cf_cv_mixedcase=no
3161         else
3162                 cf_cv_mixedcase=yes
3163         fi
3164         rm -f conftest CONFTEST
3165 fi
3166
3167 fi
3168 echo "$as_me:3168: result: $cf_cv_mixedcase" >&5
3169 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3170 test "$cf_cv_mixedcase" = yes &&
3171 cat >>confdefs.h <<\EOF
3172 #define MIXEDCASE_FILENAMES 1
3173 EOF
3174
3175 else
3176         cf_cv_mixedcase=$enable_mixedcase
3177         if test "$enable_mixedcase" = "yes" ; then
3178                 cat >>confdefs.h <<\EOF
3179 #define MIXEDCASE_FILENAMES 1
3180 EOF
3181
3182         fi
3183 fi
3184
3185 # do this after mixed-case option (tags/TAGS is not as important as tic).
3186 echo "$as_me:3186: checking whether ${MAKE-make} sets \${MAKE}" >&5
3187 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3188 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3189 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3190   echo $ECHO_N "(cached) $ECHO_C" >&6
3191 else
3192   cat >conftest.make <<\EOF
3193 all:
3194         @echo 'ac_maketemp="${MAKE}"'
3195 EOF
3196 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3197 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3198 if test -n "$ac_maketemp"; then
3199   eval ac_cv_prog_make_${ac_make}_set=yes
3200 else
3201   eval ac_cv_prog_make_${ac_make}_set=no
3202 fi
3203 rm -f conftest.make
3204 fi
3205 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3206   echo "$as_me:3206: result: yes" >&5
3207 echo "${ECHO_T}yes" >&6
3208   SET_MAKE=
3209 else
3210   echo "$as_me:3210: result: no" >&5
3211 echo "${ECHO_T}no" >&6
3212   SET_MAKE="MAKE=${MAKE-make}"
3213 fi
3214
3215 for ac_prog in exctags ctags
3216 do
3217   # Extract the first word of "$ac_prog", so it can be a program name with args.
3218 set dummy $ac_prog; ac_word=$2
3219 echo "$as_me:3219: checking for $ac_word" >&5
3220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3221 if test "${ac_cv_prog_CTAGS+set}" = set; then
3222   echo $ECHO_N "(cached) $ECHO_C" >&6
3223 else
3224   if test -n "$CTAGS"; then
3225   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3226 else
3227   ac_save_IFS=$IFS; IFS=$ac_path_separator
3228 ac_dummy="$PATH"
3229 for ac_dir in $ac_dummy; do
3230   IFS=$ac_save_IFS
3231   test -z "$ac_dir" && ac_dir=.
3232   $as_executable_p "$ac_dir/$ac_word" || continue
3233 ac_cv_prog_CTAGS="$ac_prog"
3234 echo "$as_me:3234: found $ac_dir/$ac_word" >&5
3235 break
3236 done
3237
3238 fi
3239 fi
3240 CTAGS=$ac_cv_prog_CTAGS
3241 if test -n "$CTAGS"; then
3242   echo "$as_me:3242: result: $CTAGS" >&5
3243 echo "${ECHO_T}$CTAGS" >&6
3244 else
3245   echo "$as_me:3245: result: no" >&5
3246 echo "${ECHO_T}no" >&6
3247 fi
3248
3249   test -n "$CTAGS" && break
3250 done
3251
3252 for ac_prog in exetags etags
3253 do
3254   # Extract the first word of "$ac_prog", so it can be a program name with args.
3255 set dummy $ac_prog; ac_word=$2
3256 echo "$as_me:3256: checking for $ac_word" >&5
3257 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3258 if test "${ac_cv_prog_ETAGS+set}" = set; then
3259   echo $ECHO_N "(cached) $ECHO_C" >&6
3260 else
3261   if test -n "$ETAGS"; then
3262   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3263 else
3264   ac_save_IFS=$IFS; IFS=$ac_path_separator
3265 ac_dummy="$PATH"
3266 for ac_dir in $ac_dummy; do
3267   IFS=$ac_save_IFS
3268   test -z "$ac_dir" && ac_dir=.
3269   $as_executable_p "$ac_dir/$ac_word" || continue
3270 ac_cv_prog_ETAGS="$ac_prog"
3271 echo "$as_me:3271: found $ac_dir/$ac_word" >&5
3272 break
3273 done
3274
3275 fi
3276 fi
3277 ETAGS=$ac_cv_prog_ETAGS
3278 if test -n "$ETAGS"; then
3279   echo "$as_me:3279: result: $ETAGS" >&5
3280 echo "${ECHO_T}$ETAGS" >&6
3281 else
3282   echo "$as_me:3282: result: no" >&5
3283 echo "${ECHO_T}no" >&6
3284 fi
3285
3286   test -n "$ETAGS" && break
3287 done
3288
3289 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3290 set dummy ${CTAGS:-ctags}; ac_word=$2
3291 echo "$as_me:3291: checking for $ac_word" >&5
3292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3293 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3294   echo $ECHO_N "(cached) $ECHO_C" >&6
3295 else
3296   if test -n "$MAKE_LOWER_TAGS"; then
3297   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3298 else
3299   ac_save_IFS=$IFS; IFS=$ac_path_separator
3300 ac_dummy="$PATH"
3301 for ac_dir in $ac_dummy; do
3302   IFS=$ac_save_IFS
3303   test -z "$ac_dir" && ac_dir=.
3304   $as_executable_p "$ac_dir/$ac_word" || continue
3305 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3306 echo "$as_me:3306: found $ac_dir/$ac_word" >&5
3307 break
3308 done
3309
3310   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3311 fi
3312 fi
3313 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3314 if test -n "$MAKE_LOWER_TAGS"; then
3315   echo "$as_me:3315: result: $MAKE_LOWER_TAGS" >&5
3316 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3317 else
3318   echo "$as_me:3318: result: no" >&5
3319 echo "${ECHO_T}no" >&6
3320 fi
3321
3322 if test "$cf_cv_mixedcase" = yes ; then
3323         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3324 set dummy ${ETAGS:-etags}; ac_word=$2
3325 echo "$as_me:3325: checking for $ac_word" >&5
3326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3327 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   if test -n "$MAKE_UPPER_TAGS"; then
3331   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3332 else
3333   ac_save_IFS=$IFS; IFS=$ac_path_separator
3334 ac_dummy="$PATH"
3335 for ac_dir in $ac_dummy; do
3336   IFS=$ac_save_IFS
3337   test -z "$ac_dir" && ac_dir=.
3338   $as_executable_p "$ac_dir/$ac_word" || continue
3339 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3340 echo "$as_me:3340: found $ac_dir/$ac_word" >&5
3341 break
3342 done
3343
3344   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3345 fi
3346 fi
3347 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3348 if test -n "$MAKE_UPPER_TAGS"; then
3349   echo "$as_me:3349: result: $MAKE_UPPER_TAGS" >&5
3350 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3351 else
3352   echo "$as_me:3352: result: no" >&5
3353 echo "${ECHO_T}no" >&6
3354 fi
3355
3356 else
3357         MAKE_UPPER_TAGS=no
3358 fi
3359
3360 if test "$MAKE_UPPER_TAGS" = yes ; then
3361         MAKE_UPPER_TAGS=
3362 else
3363         MAKE_UPPER_TAGS="#"
3364 fi
3365
3366 if test "$MAKE_LOWER_TAGS" = yes ; then
3367         MAKE_LOWER_TAGS=
3368 else
3369         MAKE_LOWER_TAGS="#"
3370 fi
3371
3372 echo "$as_me:3372: checking for makeflags variable" >&5
3373 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3374 if test "${cf_cv_makeflags+set}" = set; then
3375   echo $ECHO_N "(cached) $ECHO_C" >&6
3376 else
3377
3378         cf_cv_makeflags=''
3379         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3380         do
3381                 cat >cf_makeflags.tmp <<CF_EOF
3382 SHELL = $SHELL
3383 all :
3384         @ echo '.$cf_option'
3385 CF_EOF
3386                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3387                 case "$cf_result" in
3388                 (.*k|.*kw)
3389                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3390                         case "$cf_result" in
3391                         (.*CC=*)        cf_cv_makeflags=
3392                                 ;;
3393                         (*)     cf_cv_makeflags=$cf_option
3394                                 ;;
3395                         esac
3396                         break
3397                         ;;
3398                 (.-)
3399                         ;;
3400                 (*)
3401
3402 echo "${as_me:-configure}:3402: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3403
3404                         ;;
3405                 esac
3406         done
3407         rm -f cf_makeflags.tmp
3408
3409 fi
3410 echo "$as_me:3410: result: $cf_cv_makeflags" >&5
3411 echo "${ECHO_T}$cf_cv_makeflags" >&6
3412
3413 if test -n "$ac_tool_prefix"; then
3414   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3415 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3416 echo "$as_me:3416: checking for $ac_word" >&5
3417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3418 if test "${ac_cv_prog_RANLIB+set}" = set; then
3419   echo $ECHO_N "(cached) $ECHO_C" >&6
3420 else
3421   if test -n "$RANLIB"; then
3422   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3423 else
3424   ac_save_IFS=$IFS; IFS=$ac_path_separator
3425 ac_dummy="$PATH"
3426 for ac_dir in $ac_dummy; do
3427   IFS=$ac_save_IFS
3428   test -z "$ac_dir" && ac_dir=.
3429   $as_executable_p "$ac_dir/$ac_word" || continue
3430 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3431 echo "$as_me:3431: found $ac_dir/$ac_word" >&5
3432 break
3433 done
3434
3435 fi
3436 fi
3437 RANLIB=$ac_cv_prog_RANLIB
3438 if test -n "$RANLIB"; then
3439   echo "$as_me:3439: result: $RANLIB" >&5
3440 echo "${ECHO_T}$RANLIB" >&6
3441 else
3442   echo "$as_me:3442: result: no" >&5
3443 echo "${ECHO_T}no" >&6
3444 fi
3445
3446 fi
3447 if test -z "$ac_cv_prog_RANLIB"; then
3448   ac_ct_RANLIB=$RANLIB
3449   # Extract the first word of "ranlib", so it can be a program name with args.
3450 set dummy ranlib; ac_word=$2
3451 echo "$as_me:3451: checking for $ac_word" >&5
3452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3453 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3454   echo $ECHO_N "(cached) $ECHO_C" >&6
3455 else
3456   if test -n "$ac_ct_RANLIB"; then
3457   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3458 else
3459   ac_save_IFS=$IFS; IFS=$ac_path_separator
3460 ac_dummy="$PATH"
3461 for ac_dir in $ac_dummy; do
3462   IFS=$ac_save_IFS
3463   test -z "$ac_dir" && ac_dir=.
3464   $as_executable_p "$ac_dir/$ac_word" || continue
3465 ac_cv_prog_ac_ct_RANLIB="ranlib"
3466 echo "$as_me:3466: found $ac_dir/$ac_word" >&5
3467 break
3468 done
3469
3470   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3471 fi
3472 fi
3473 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3474 if test -n "$ac_ct_RANLIB"; then
3475   echo "$as_me:3475: result: $ac_ct_RANLIB" >&5
3476 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3477 else
3478   echo "$as_me:3478: result: no" >&5
3479 echo "${ECHO_T}no" >&6
3480 fi
3481
3482   RANLIB=$ac_ct_RANLIB
3483 else
3484   RANLIB="$ac_cv_prog_RANLIB"
3485 fi
3486
3487 if test -n "$ac_tool_prefix"; then
3488   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3489 set dummy ${ac_tool_prefix}ld; ac_word=$2
3490 echo "$as_me:3490: checking for $ac_word" >&5
3491 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3492 if test "${ac_cv_prog_LD+set}" = set; then
3493   echo $ECHO_N "(cached) $ECHO_C" >&6
3494 else
3495   if test -n "$LD"; then
3496   ac_cv_prog_LD="$LD" # Let the user override the test.
3497 else
3498   ac_save_IFS=$IFS; IFS=$ac_path_separator
3499 ac_dummy="$PATH"
3500 for ac_dir in $ac_dummy; do
3501   IFS=$ac_save_IFS
3502   test -z "$ac_dir" && ac_dir=.
3503   $as_executable_p "$ac_dir/$ac_word" || continue
3504 ac_cv_prog_LD="${ac_tool_prefix}ld"
3505 echo "$as_me:3505: found $ac_dir/$ac_word" >&5
3506 break
3507 done
3508
3509 fi
3510 fi
3511 LD=$ac_cv_prog_LD
3512 if test -n "$LD"; then
3513   echo "$as_me:3513: result: $LD" >&5
3514 echo "${ECHO_T}$LD" >&6
3515 else
3516   echo "$as_me:3516: result: no" >&5
3517 echo "${ECHO_T}no" >&6
3518 fi
3519
3520 fi
3521 if test -z "$ac_cv_prog_LD"; then
3522   ac_ct_LD=$LD
3523   # Extract the first word of "ld", so it can be a program name with args.
3524 set dummy ld; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$ac_ct_LD"; then
3531   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_ac_ct_LD="ld"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3545 fi
3546 fi
3547 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3548 if test -n "$ac_ct_LD"; then
3549   echo "$as_me:3549: result: $ac_ct_LD" >&5
3550 echo "${ECHO_T}$ac_ct_LD" >&6
3551 else
3552   echo "$as_me:3552: result: no" >&5
3553 echo "${ECHO_T}no" >&6
3554 fi
3555
3556   LD=$ac_ct_LD
3557 else
3558   LD="$ac_cv_prog_LD"
3559 fi
3560
3561 if test -n "$ac_tool_prefix"; then
3562   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3563 set dummy ${ac_tool_prefix}ar; ac_word=$2
3564 echo "$as_me:3564: checking for $ac_word" >&5
3565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3566 if test "${ac_cv_prog_AR+set}" = set; then
3567   echo $ECHO_N "(cached) $ECHO_C" >&6
3568 else
3569   if test -n "$AR"; then
3570   ac_cv_prog_AR="$AR" # Let the user override the test.
3571 else
3572   ac_save_IFS=$IFS; IFS=$ac_path_separator
3573 ac_dummy="$PATH"
3574 for ac_dir in $ac_dummy; do
3575   IFS=$ac_save_IFS
3576   test -z "$ac_dir" && ac_dir=.
3577   $as_executable_p "$ac_dir/$ac_word" || continue
3578 ac_cv_prog_AR="${ac_tool_prefix}ar"
3579 echo "$as_me:3579: found $ac_dir/$ac_word" >&5
3580 break
3581 done
3582
3583 fi
3584 fi
3585 AR=$ac_cv_prog_AR
3586 if test -n "$AR"; then
3587   echo "$as_me:3587: result: $AR" >&5
3588 echo "${ECHO_T}$AR" >&6
3589 else
3590   echo "$as_me:3590: result: no" >&5
3591 echo "${ECHO_T}no" >&6
3592 fi
3593
3594 fi
3595 if test -z "$ac_cv_prog_AR"; then
3596   ac_ct_AR=$AR
3597   # Extract the first word of "ar", so it can be a program name with args.
3598 set dummy ar; ac_word=$2
3599 echo "$as_me:3599: checking for $ac_word" >&5
3600 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3601 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3602   echo $ECHO_N "(cached) $ECHO_C" >&6
3603 else
3604   if test -n "$ac_ct_AR"; then
3605   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3606 else
3607   ac_save_IFS=$IFS; IFS=$ac_path_separator
3608 ac_dummy="$PATH"
3609 for ac_dir in $ac_dummy; do
3610   IFS=$ac_save_IFS
3611   test -z "$ac_dir" && ac_dir=.
3612   $as_executable_p "$ac_dir/$ac_word" || continue
3613 ac_cv_prog_ac_ct_AR="ar"
3614 echo "$as_me:3614: found $ac_dir/$ac_word" >&5
3615 break
3616 done
3617
3618   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3619 fi
3620 fi
3621 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3622 if test -n "$ac_ct_AR"; then
3623   echo "$as_me:3623: result: $ac_ct_AR" >&5
3624 echo "${ECHO_T}$ac_ct_AR" >&6
3625 else
3626   echo "$as_me:3626: result: no" >&5
3627 echo "${ECHO_T}no" >&6
3628 fi
3629
3630   AR=$ac_ct_AR
3631 else
3632   AR="$ac_cv_prog_AR"
3633 fi
3634
3635 if test -n "$ac_tool_prefix"; then
3636   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3637 set dummy ${ac_tool_prefix}ar; ac_word=$2
3638 echo "$as_me:3638: checking for $ac_word" >&5
3639 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3640 if test "${ac_cv_prog_AR+set}" = set; then
3641   echo $ECHO_N "(cached) $ECHO_C" >&6
3642 else
3643   if test -n "$AR"; then
3644   ac_cv_prog_AR="$AR" # Let the user override the test.
3645 else
3646   ac_save_IFS=$IFS; IFS=$ac_path_separator
3647 ac_dummy="$PATH"
3648 for ac_dir in $ac_dummy; do
3649   IFS=$ac_save_IFS
3650   test -z "$ac_dir" && ac_dir=.
3651   $as_executable_p "$ac_dir/$ac_word" || continue
3652 ac_cv_prog_AR="${ac_tool_prefix}ar"
3653 echo "$as_me:3653: found $ac_dir/$ac_word" >&5
3654 break
3655 done
3656
3657 fi
3658 fi
3659 AR=$ac_cv_prog_AR
3660 if test -n "$AR"; then
3661   echo "$as_me:3661: result: $AR" >&5
3662 echo "${ECHO_T}$AR" >&6
3663 else
3664   echo "$as_me:3664: result: no" >&5
3665 echo "${ECHO_T}no" >&6
3666 fi
3667
3668 fi
3669 if test -z "$ac_cv_prog_AR"; then
3670   ac_ct_AR=$AR
3671   # Extract the first word of "ar", so it can be a program name with args.
3672 set dummy ar; ac_word=$2
3673 echo "$as_me:3673: checking for $ac_word" >&5
3674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3675 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3676   echo $ECHO_N "(cached) $ECHO_C" >&6
3677 else
3678   if test -n "$ac_ct_AR"; then
3679   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3680 else
3681   ac_save_IFS=$IFS; IFS=$ac_path_separator
3682 ac_dummy="$PATH"
3683 for ac_dir in $ac_dummy; do
3684   IFS=$ac_save_IFS
3685   test -z "$ac_dir" && ac_dir=.
3686   $as_executable_p "$ac_dir/$ac_word" || continue
3687 ac_cv_prog_ac_ct_AR="ar"
3688 echo "$as_me:3688: found $ac_dir/$ac_word" >&5
3689 break
3690 done
3691
3692   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3693 fi
3694 fi
3695 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3696 if test -n "$ac_ct_AR"; then
3697   echo "$as_me:3697: result: $ac_ct_AR" >&5
3698 echo "${ECHO_T}$ac_ct_AR" >&6
3699 else
3700   echo "$as_me:3700: result: no" >&5
3701 echo "${ECHO_T}no" >&6
3702 fi
3703
3704   AR=$ac_ct_AR
3705 else
3706   AR="$ac_cv_prog_AR"
3707 fi
3708
3709 echo "$as_me:3709: checking for options to update archives" >&5
3710 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3711 if test "${cf_cv_ar_flags+set}" = set; then
3712   echo $ECHO_N "(cached) $ECHO_C" >&6
3713 else
3714
3715         cf_cv_ar_flags=unknown
3716         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3717         do
3718
3719                 # check if $ARFLAGS already contains this choice
3720                 if test "x$ARFLAGS" != "x" ; then
3721                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3722                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3723                                 cf_cv_ar_flags=
3724                                 break
3725                         fi
3726                 fi
3727
3728                 rm -f conftest.$ac_cv_objext
3729                 rm -f conftest.a
3730
3731                 cat >conftest.$ac_ext <<EOF
3732 #line 3732 "configure"
3733 int     testdata[3] = { 123, 456, 789 };
3734 EOF
3735                 if { (eval echo "$as_me:3735: \"$ac_compile\"") >&5
3736   (eval $ac_compile) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit $ac_status); } ; then
3740                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3741                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3742                         if test -f conftest.a ; then
3743                                 cf_cv_ar_flags=$cf_ar_flags
3744                                 break
3745                         fi
3746                 else
3747                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3748
3749 echo "${as_me:-configure}:3749: testing cannot compile test-program ..." 1>&5
3750
3751                         break
3752                 fi
3753         done
3754         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3755
3756 fi
3757 echo "$as_me:3757: result: $cf_cv_ar_flags" >&5
3758 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3759
3760 if test -n "$ARFLAGS" ; then
3761         if test -n "$cf_cv_ar_flags" ; then
3762                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3763         fi
3764 else
3765         ARFLAGS=$cf_cv_ar_flags
3766 fi
3767
3768         echo "$as_me:3768: checking for PATH separator" >&5
3769 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3770         case $cf_cv_system_name in
3771         (os2*)  PATH_SEPARATOR=';'  ;;
3772         (*)     ${PATH_SEPARATOR:=':'}  ;;
3773         esac
3774
3775         echo "$as_me:3775: result: $PATH_SEPARATOR" >&5
3776 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3777
3778 echo "$as_me:3778: checking if you have specified an install-prefix" >&5
3779 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3780
3781 # Check whether --with-install-prefix or --without-install-prefix was given.
3782 if test "${with_install_prefix+set}" = set; then
3783   withval="$with_install_prefix"
3784   case "$withval" in
3785         (yes|no)
3786                 ;;
3787         (*)     DESTDIR="$withval"
3788                 ;;
3789         esac
3790 fi;
3791 echo "$as_me:3791: result: $DESTDIR" >&5
3792 echo "${ECHO_T}$DESTDIR" >&6
3793
3794 ###############################################################################
3795
3796 # If we're cross-compiling, allow the user to override the tools and their
3797 # options.  The configure script is oriented toward identifying the host
3798 # compiler, etc., but we need a build compiler to generate parts of the source.
3799
3800 if test "$cross_compiling" = yes ; then
3801
3802         # defaults that we might want to override
3803         : ${BUILD_CFLAGS:=''}
3804         : ${BUILD_CPPFLAGS:=''}
3805         : ${BUILD_LDFLAGS:=''}
3806         : ${BUILD_LIBS:=''}
3807         : ${BUILD_EXEEXT:='$x'}
3808         : ${BUILD_OBJEXT:='o'}
3809
3810 # Check whether --with-build-cc or --without-build-cc was given.
3811 if test "${with_build_cc+set}" = set; then
3812   withval="$with_build_cc"
3813   BUILD_CC="$withval"
3814 else
3815   for ac_prog in gcc clang c99 c89 cc cl
3816 do
3817   # Extract the first word of "$ac_prog", so it can be a program name with args.
3818 set dummy $ac_prog; ac_word=$2
3819 echo "$as_me:3819: checking for $ac_word" >&5
3820 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3821 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3822   echo $ECHO_N "(cached) $ECHO_C" >&6
3823 else
3824   if test -n "$BUILD_CC"; then
3825   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3826 else
3827   ac_save_IFS=$IFS; IFS=$ac_path_separator
3828 ac_dummy="$PATH"
3829 for ac_dir in $ac_dummy; do
3830   IFS=$ac_save_IFS
3831   test -z "$ac_dir" && ac_dir=.
3832   $as_executable_p "$ac_dir/$ac_word" || continue
3833 ac_cv_prog_BUILD_CC="$ac_prog"
3834 echo "$as_me:3834: found $ac_dir/$ac_word" >&5
3835 break
3836 done
3837
3838 fi
3839 fi
3840 BUILD_CC=$ac_cv_prog_BUILD_CC
3841 if test -n "$BUILD_CC"; then
3842   echo "$as_me:3842: result: $BUILD_CC" >&5
3843 echo "${ECHO_T}$BUILD_CC" >&6
3844 else
3845   echo "$as_me:3845: result: no" >&5
3846 echo "${ECHO_T}no" >&6
3847 fi
3848
3849   test -n "$BUILD_CC" && break
3850 done
3851 test -n "$BUILD_CC" || BUILD_CC="none"
3852
3853 fi;
3854         echo "$as_me:3854: checking for native build C compiler" >&5
3855 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3856         echo "$as_me:3856: result: $BUILD_CC" >&5
3857 echo "${ECHO_T}$BUILD_CC" >&6
3858
3859         echo "$as_me:3859: checking for native build C preprocessor" >&5
3860 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3861
3862 # Check whether --with-build-cpp or --without-build-cpp was given.
3863 if test "${with_build_cpp+set}" = set; then
3864   withval="$with_build_cpp"
3865   BUILD_CPP="$withval"
3866 else
3867   BUILD_CPP='${BUILD_CC} -E'
3868 fi;
3869         echo "$as_me:3869: result: $BUILD_CPP" >&5
3870 echo "${ECHO_T}$BUILD_CPP" >&6
3871
3872         echo "$as_me:3872: checking for native build C flags" >&5
3873 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3874
3875 # Check whether --with-build-cflags or --without-build-cflags was given.
3876 if test "${with_build_cflags+set}" = set; then
3877   withval="$with_build_cflags"
3878   BUILD_CFLAGS="$withval"
3879 fi;
3880         echo "$as_me:3880: result: $BUILD_CFLAGS" >&5
3881 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3882
3883         echo "$as_me:3883: checking for native build C preprocessor-flags" >&5
3884 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3885
3886 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3887 if test "${with_build_cppflags+set}" = set; then
3888   withval="$with_build_cppflags"
3889   BUILD_CPPFLAGS="$withval"
3890 fi;
3891         echo "$as_me:3891: result: $BUILD_CPPFLAGS" >&5
3892 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3893
3894         echo "$as_me:3894: checking for native build linker-flags" >&5
3895 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3896
3897 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3898 if test "${with_build_ldflags+set}" = set; then
3899   withval="$with_build_ldflags"
3900   BUILD_LDFLAGS="$withval"
3901 fi;
3902         echo "$as_me:3902: result: $BUILD_LDFLAGS" >&5
3903 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3904
3905         echo "$as_me:3905: checking for native build linker-libraries" >&5
3906 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3907
3908 # Check whether --with-build-libs or --without-build-libs was given.
3909 if test "${with_build_libs+set}" = set; then
3910   withval="$with_build_libs"
3911   BUILD_LIBS="$withval"
3912 fi;
3913         echo "$as_me:3913: result: $BUILD_LIBS" >&5
3914 echo "${ECHO_T}$BUILD_LIBS" >&6
3915
3916         # this assumes we're on Unix.
3917         BUILD_EXEEXT=
3918         BUILD_OBJEXT=o
3919
3920         : ${BUILD_CC:='${CC}'}
3921
3922         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3923                 { { echo "$as_me:3923: error: Cross-build requires two compilers.
3924 Use --with-build-cc to specify the native compiler." >&5
3925 echo "$as_me: error: Cross-build requires two compilers.
3926 Use --with-build-cc to specify the native compiler." >&2;}
3927    { (exit 1); exit 1; }; }
3928         fi
3929
3930 else
3931         : ${BUILD_CC:='${CC}'}
3932         : ${BUILD_CPP:='${CPP}'}
3933         : ${BUILD_CFLAGS:='${CFLAGS}'}
3934         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3935         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3936         : ${BUILD_LIBS:='${LIBS}'}
3937         : ${BUILD_EXEEXT:='$x'}
3938         : ${BUILD_OBJEXT:='o'}
3939 fi
3940
3941 ###############################################################################
3942
3943 ### Options to allow the user to specify the set of libraries which are used.
3944 ### Use "--without-normal --with-shared" to allow the default model to be
3945 ### shared, for example.
3946 cf_list_models=""
3947
3948 echo "$as_me:3948: checking if you want to build shared C-objects" >&5
3949 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3950
3951 # Check whether --with-shared or --without-shared was given.
3952 if test "${with_shared+set}" = set; then
3953   withval="$with_shared"
3954   with_shared=$withval
3955 else
3956   with_shared=no
3957 fi;
3958 echo "$as_me:3958: result: $with_shared" >&5
3959 echo "${ECHO_T}$with_shared" >&6
3960 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3961
3962 echo "$as_me:3962: checking for specified models" >&5
3963 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3964 test -z "$cf_list_models" && cf_list_models=normal
3965 echo "$as_me:3965: result: $cf_list_models" >&5
3966 echo "${ECHO_T}$cf_list_models" >&6
3967
3968 ### Use the first model as the default, and save its suffix for use in building
3969 ### up test-applications.
3970 echo "$as_me:3970: checking for default model" >&5
3971 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3972 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3973 echo "$as_me:3973: result: $DFT_LWR_MODEL" >&5
3974 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3975
3976 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3977
3978 echo "$as_me:3978: checking for specific curses-directory" >&5
3979 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3980
3981 # Check whether --with-curses-dir or --without-curses-dir was given.
3982 if test "${with_curses_dir+set}" = set; then
3983   withval="$with_curses_dir"
3984   cf_cv_curses_dir=$withval
3985 else
3986   cf_cv_curses_dir=no
3987 fi;
3988 echo "$as_me:3988: result: $cf_cv_curses_dir" >&5
3989 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3990
3991 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3992 then
3993
3994 if test "x$prefix" != xNONE; then
3995         cf_path_syntax="$prefix"
3996 else
3997         cf_path_syntax="$ac_default_prefix"
3998 fi
3999
4000 case ".$withval" in
4001 (.\$\(*\)*|.\'*\'*)
4002         ;;
4003 (..|./*|.\\*)
4004         ;;
4005 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4006         ;;
4007 (.\${*prefix}*|.\${*dir}*)
4008         eval withval="$withval"
4009         case ".$withval" in
4010         (.NONE/*)
4011                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4012                 ;;
4013         esac
4014         ;;
4015 (.no|.NONE/*)
4016         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4017         ;;
4018 (*)
4019         { { echo "$as_me:4019: error: expected a pathname, not \"$withval\"" >&5
4020 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4021    { (exit 1); exit 1; }; }
4022         ;;
4023 esac
4024
4025         if test -d "$cf_cv_curses_dir"
4026         then
4027
4028 if test -n "$cf_cv_curses_dir/include" ; then
4029   for cf_add_incdir in $cf_cv_curses_dir/include
4030   do
4031         while test $cf_add_incdir != /usr/include
4032         do
4033           if test -d $cf_add_incdir
4034           then
4035                 cf_have_incdir=no
4036                 if test -n "$CFLAGS$CPPFLAGS" ; then
4037                   # a loop is needed to ensure we can add subdirs of existing dirs
4038                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4039                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4040                           cf_have_incdir=yes; break
4041                         fi
4042                   done
4043                 fi
4044
4045                 if test "$cf_have_incdir" = no ; then
4046                   if test "$cf_add_incdir" = /usr/local/include ; then
4047                         if test "$GCC" = yes
4048                         then
4049                           cf_save_CPPFLAGS=$CPPFLAGS
4050
4051         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4052         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4053
4054                           cat >conftest.$ac_ext <<_ACEOF
4055 #line 4055 "configure"
4056 #include "confdefs.h"
4057 #include <stdio.h>
4058 int
4059 main (void)
4060 {
4061 printf("Hello")
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.$ac_objext
4067 if { (eval echo "$as_me:4067: \"$ac_compile\"") >&5
4068   (eval $ac_compile) 2>&5
4069   ac_status=$?
4070   echo "$as_me:4070: \$? = $ac_status" >&5
4071   (exit $ac_status); } &&
4072          { ac_try='test -s conftest.$ac_objext'
4073   { (eval echo "$as_me:4073: \"$ac_try\"") >&5
4074   (eval $ac_try) 2>&5
4075   ac_status=$?
4076   echo "$as_me:4076: \$? = $ac_status" >&5
4077   (exit $ac_status); }; }; then
4078   :
4079 else
4080   echo "$as_me: failed program was:" >&5
4081 cat conftest.$ac_ext >&5
4082 cf_have_incdir=yes
4083 fi
4084 rm -f conftest.$ac_objext conftest.$ac_ext
4085                           CPPFLAGS=$cf_save_CPPFLAGS
4086                         fi
4087                   fi
4088                 fi
4089
4090                 if test "$cf_have_incdir" = no ; then
4091                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4092
4093 echo "${as_me:-configure}:4093: testing adding $cf_add_incdir to include-path ..." 1>&5
4094
4095                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4096
4097                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4098                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4099                   cf_add_incdir="$cf_top_incdir"
4100                 else
4101                   break
4102                 fi
4103           else
4104                 break
4105           fi
4106         done
4107   done
4108 fi
4109
4110 if test -n "$cf_cv_curses_dir/lib" ; then
4111         for cf_add_libdir in $cf_cv_curses_dir/lib
4112         do
4113                 if test $cf_add_libdir = /usr/lib ; then
4114                         :
4115                 elif test -d $cf_add_libdir
4116                 then
4117                         cf_have_libdir=no
4118                         if test -n "$LDFLAGS$LIBS" ; then
4119                                 # a loop is needed to ensure we can add subdirs of existing dirs
4120                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4121                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4122                                                 cf_have_libdir=yes; break
4123                                         fi
4124                                 done
4125                         fi
4126                         if test "$cf_have_libdir" = no ; then
4127                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4128
4129 echo "${as_me:-configure}:4129: testing adding $cf_add_libdir to library-path ..." 1>&5
4130
4131                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4132                         fi
4133                 fi
4134         done
4135 fi
4136
4137         fi
4138 fi
4139
4140 cf_ncuconfig_root=ncurses
4141 cf_have_ncuconfig=no
4142
4143 if test "x${PKG_CONFIG:=none}" != xnone; then
4144         echo "$as_me:4144: checking pkg-config for $cf_ncuconfig_root" >&5
4145 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4146         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4147                 echo "$as_me:4147: result: yes" >&5
4148 echo "${ECHO_T}yes" >&6
4149
4150                 echo "$as_me:4150: checking if the $cf_ncuconfig_root package files work" >&5
4151 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4152                 cf_have_ncuconfig=unknown
4153
4154                 cf_save_CPPFLAGS="$CPPFLAGS"
4155                 cf_save_LIBS="$LIBS"
4156
4157 cf_fix_cppflags=no
4158 cf_new_cflags=
4159 cf_new_cppflags=
4160 cf_new_extra_cppflags=
4161
4162 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
4163 do
4164 case $cf_fix_cppflags in
4165 (no)
4166         case $cf_add_cflags in
4167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4168                 case $cf_add_cflags in
4169                 (-D*)
4170                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4171
4172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4173                                 && test -z "${cf_tst_cflags}" \
4174                                 && cf_fix_cppflags=yes
4175
4176                         if test $cf_fix_cppflags = yes ; then
4177
4178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4180
4181                                 continue
4182                         elif test "${cf_tst_cflags}" = "\"'" ; then
4183
4184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4186
4187                                 continue
4188                         fi
4189                         ;;
4190                 esac
4191                 case "$CPPFLAGS" in
4192                 (*$cf_add_cflags)
4193                         ;;
4194                 (*)
4195                         case $cf_add_cflags in
4196                         (-D*)
4197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4198
4199 CPPFLAGS=`echo "$CPPFLAGS" | \
4200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4202
4203                                 ;;
4204                         esac
4205
4206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4208
4209                         ;;
4210                 esac
4211                 ;;
4212         (*)
4213
4214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4216
4217                 ;;
4218         esac
4219         ;;
4220 (yes)
4221
4222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4224
4225         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4226
4227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4228                 && test -z "${cf_tst_cflags}" \
4229                 && cf_fix_cppflags=no
4230         ;;
4231 esac
4232 done
4233
4234 if test -n "$cf_new_cflags" ; then
4235
4236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4237         CFLAGS="${CFLAGS}$cf_new_cflags"
4238
4239 fi
4240
4241 if test -n "$cf_new_cppflags" ; then
4242
4243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4245
4246 fi
4247
4248 if test -n "$cf_new_extra_cppflags" ; then
4249
4250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4252
4253 fi
4254
4255 cf_add_libs="$LIBS"
4256 # reverse order
4257 cf_add_0lib=
4258 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4259 # filter duplicates
4260 for cf_add_1lib in $cf_add_0lib; do
4261         for cf_add_2lib in $cf_add_libs; do
4262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4263                         cf_add_1lib=
4264                         break
4265                 fi
4266         done
4267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4268 done
4269 LIBS="$cf_add_libs"
4270
4271                 cat >conftest.$ac_ext <<_ACEOF
4272 #line 4272 "configure"
4273 #include "confdefs.h"
4274 #include <${cf_cv_ncurses_header:-curses.h}>
4275 int
4276 main (void)
4277 {
4278 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4279   ;
4280   return 0;
4281 }
4282 _ACEOF
4283 rm -f conftest.$ac_objext conftest$ac_exeext
4284 if { (eval echo "$as_me:4284: \"$ac_link\"") >&5
4285   (eval $ac_link) 2>&5
4286   ac_status=$?
4287   echo "$as_me:4287: \$? = $ac_status" >&5
4288   (exit $ac_status); } &&
4289          { ac_try='test -s conftest$ac_exeext'
4290   { (eval echo "$as_me:4290: \"$ac_try\"") >&5
4291   (eval $ac_try) 2>&5
4292   ac_status=$?
4293   echo "$as_me:4293: \$? = $ac_status" >&5
4294   (exit $ac_status); }; }; then
4295   if test "$cross_compiling" = yes; then
4296   cf_have_ncuconfig=maybe
4297 else
4298   cat >conftest.$ac_ext <<_ACEOF
4299 #line 4299 "configure"
4300 #include "confdefs.h"
4301 #include <${cf_cv_ncurses_header:-curses.h}>
4302                                 int main(void)
4303                                 { char *xx = curses_version(); return (xx == 0); }
4304 _ACEOF
4305 rm -f conftest$ac_exeext
4306 if { (eval echo "$as_me:4306: \"$ac_link\"") >&5
4307   (eval $ac_link) 2>&5
4308   ac_status=$?
4309   echo "$as_me:4309: \$? = $ac_status" >&5
4310   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4311   { (eval echo "$as_me:4311: \"$ac_try\"") >&5
4312   (eval $ac_try) 2>&5
4313   ac_status=$?
4314   echo "$as_me:4314: \$? = $ac_status" >&5
4315   (exit $ac_status); }; }; then
4316   cf_have_ncuconfig=yes
4317 else
4318   echo "$as_me: program exited with status $ac_status" >&5
4319 echo "$as_me: failed program was:" >&5
4320 cat conftest.$ac_ext >&5
4321 cf_have_ncuconfig=no
4322 fi
4323 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4324 fi
4325 else
4326   echo "$as_me: failed program was:" >&5
4327 cat conftest.$ac_ext >&5
4328 cf_have_ncuconfig=no
4329 fi
4330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4331                 echo "$as_me:4331: result: $cf_have_ncuconfig" >&5
4332 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4333                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4334                 if test "$cf_have_ncuconfig" != "yes"
4335                 then
4336                         CPPFLAGS="$cf_save_CPPFLAGS"
4337                         LIBS="$cf_save_LIBS"
4338                         NCURSES_CONFIG_PKG=none
4339                 else
4340
4341 cat >>confdefs.h <<\EOF
4342 #define NCURSES 1
4343 EOF
4344
4345                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4346
4347 echo "$as_me:4347: checking for terminfo header" >&5
4348 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4349 if test "${cf_cv_term_header+set}" = set; then
4350   echo $ECHO_N "(cached) $ECHO_C" >&6
4351 else
4352
4353 case ${cf_cv_ncurses_header} in
4354 (*/ncurses.h|*/ncursesw.h)
4355         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4356         ;;
4357 (*)
4358         cf_term_header=term.h
4359         ;;
4360 esac
4361
4362 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4363 do
4364 cat >conftest.$ac_ext <<_ACEOF
4365 #line 4365 "configure"
4366 #include "confdefs.h"
4367 #include <stdio.h>
4368 #include <${cf_cv_ncurses_header:-curses.h}>
4369 #include <$cf_test>
4370
4371 int
4372 main (void)
4373 {
4374 int x = auto_left_margin
4375   ;
4376   return 0;
4377 }
4378 _ACEOF
4379 rm -f conftest.$ac_objext
4380 if { (eval echo "$as_me:4380: \"$ac_compile\"") >&5
4381   (eval $ac_compile) 2>&5
4382   ac_status=$?
4383   echo "$as_me:4383: \$? = $ac_status" >&5
4384   (exit $ac_status); } &&
4385          { ac_try='test -s conftest.$ac_objext'
4386   { (eval echo "$as_me:4386: \"$ac_try\"") >&5
4387   (eval $ac_try) 2>&5
4388   ac_status=$?
4389   echo "$as_me:4389: \$? = $ac_status" >&5
4390   (exit $ac_status); }; }; then
4391
4392         cf_cv_term_header="$cf_test"
4393 else
4394   echo "$as_me: failed program was:" >&5
4395 cat conftest.$ac_ext >&5
4396
4397         cf_cv_term_header=unknown
4398
4399 fi
4400 rm -f conftest.$ac_objext conftest.$ac_ext
4401         test "$cf_cv_term_header" != unknown && break
4402 done
4403
4404 fi
4405 echo "$as_me:4405: result: $cf_cv_term_header" >&5
4406 echo "${ECHO_T}$cf_cv_term_header" >&6
4407
4408 # Set definitions to allow ifdef'ing to accommodate subdirectories
4409
4410 case $cf_cv_term_header in
4411 (*term.h)
4412
4413 cat >>confdefs.h <<\EOF
4414 #define HAVE_TERM_H 1
4415 EOF
4416
4417         ;;
4418 esac
4419
4420 case $cf_cv_term_header in
4421 (ncurses/term.h)
4422
4423 cat >>confdefs.h <<\EOF
4424 #define HAVE_NCURSES_TERM_H 1
4425 EOF
4426
4427         ;;
4428 (ncursesw/term.h)
4429
4430 cat >>confdefs.h <<\EOF
4431 #define HAVE_NCURSESW_TERM_H 1
4432 EOF
4433
4434         ;;
4435 esac
4436
4437                 fi
4438
4439         else
4440                 echo "$as_me:4440: result: no" >&5
4441 echo "${ECHO_T}no" >&6
4442                 NCURSES_CONFIG_PKG=none
4443         fi
4444 else
4445         NCURSES_CONFIG_PKG=none
4446 fi
4447
4448 if test "x$cf_have_ncuconfig" = "xno"; then
4449         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4450
4451 if test -n "$ac_tool_prefix"; then
4452   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4453   do
4454     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4455 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4456 echo "$as_me:4456: checking for $ac_word" >&5
4457 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4458 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4459   echo $ECHO_N "(cached) $ECHO_C" >&6
4460 else
4461   if test -n "$NCURSES_CONFIG"; then
4462   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4463 else
4464   ac_save_IFS=$IFS; IFS=$ac_path_separator
4465 ac_dummy="$PATH"
4466 for ac_dir in $ac_dummy; do
4467   IFS=$ac_save_IFS
4468   test -z "$ac_dir" && ac_dir=.
4469   $as_executable_p "$ac_dir/$ac_word" || continue
4470 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4471 echo "$as_me:4471: found $ac_dir/$ac_word" >&5
4472 break
4473 done
4474
4475 fi
4476 fi
4477 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4478 if test -n "$NCURSES_CONFIG"; then
4479   echo "$as_me:4479: result: $NCURSES_CONFIG" >&5
4480 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4481 else
4482   echo "$as_me:4482: result: no" >&5
4483 echo "${ECHO_T}no" >&6
4484 fi
4485
4486     test -n "$NCURSES_CONFIG" && break
4487   done
4488 fi
4489 if test -z "$NCURSES_CONFIG"; then
4490   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4491   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4492 do
4493   # Extract the first word of "$ac_prog", so it can be a program name with args.
4494 set dummy $ac_prog; ac_word=$2
4495 echo "$as_me:4495: checking for $ac_word" >&5
4496 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4497 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4498   echo $ECHO_N "(cached) $ECHO_C" >&6
4499 else
4500   if test -n "$ac_ct_NCURSES_CONFIG"; then
4501   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4502 else
4503   ac_save_IFS=$IFS; IFS=$ac_path_separator
4504 ac_dummy="$PATH"
4505 for ac_dir in $ac_dummy; do
4506   IFS=$ac_save_IFS
4507   test -z "$ac_dir" && ac_dir=.
4508   $as_executable_p "$ac_dir/$ac_word" || continue
4509 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4510 echo "$as_me:4510: found $ac_dir/$ac_word" >&5
4511 break
4512 done
4513
4514 fi
4515 fi
4516 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4517 if test -n "$ac_ct_NCURSES_CONFIG"; then
4518   echo "$as_me:4518: result: $ac_ct_NCURSES_CONFIG" >&5
4519 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4520 else
4521   echo "$as_me:4521: result: no" >&5
4522 echo "${ECHO_T}no" >&6
4523 fi
4524
4525   test -n "$ac_ct_NCURSES_CONFIG" && break
4526 done
4527 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4528
4529   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4530 fi
4531
4532         if test "$NCURSES_CONFIG" != none ; then
4533
4534 cf_fix_cppflags=no
4535 cf_new_cflags=
4536 cf_new_cppflags=
4537 cf_new_extra_cppflags=
4538
4539 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4540 do
4541 case $cf_fix_cppflags in
4542 (no)
4543         case $cf_add_cflags in
4544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4545                 case $cf_add_cflags in
4546                 (-D*)
4547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4548
4549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4550                                 && test -z "${cf_tst_cflags}" \
4551                                 && cf_fix_cppflags=yes
4552
4553                         if test $cf_fix_cppflags = yes ; then
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558                                 continue
4559                         elif test "${cf_tst_cflags}" = "\"'" ; then
4560
4561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4563
4564                                 continue
4565                         fi
4566                         ;;
4567                 esac
4568                 case "$CPPFLAGS" in
4569                 (*$cf_add_cflags)
4570                         ;;
4571                 (*)
4572                         case $cf_add_cflags in
4573                         (-D*)
4574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4575
4576 CPPFLAGS=`echo "$CPPFLAGS" | \
4577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4579
4580                                 ;;
4581                         esac
4582
4583         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4584         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4585
4586                         ;;
4587                 esac
4588                 ;;
4589         (*)
4590
4591         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4592         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4593
4594                 ;;
4595         esac
4596         ;;
4597 (yes)
4598
4599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4601
4602         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4603
4604         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4605                 && test -z "${cf_tst_cflags}" \
4606                 && cf_fix_cppflags=no
4607         ;;
4608 esac
4609 done
4610
4611 if test -n "$cf_new_cflags" ; then
4612
4613         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4614         CFLAGS="${CFLAGS}$cf_new_cflags"
4615
4616 fi
4617
4618 if test -n "$cf_new_cppflags" ; then
4619
4620         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4621         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4622
4623 fi
4624
4625 if test -n "$cf_new_extra_cppflags" ; then
4626
4627         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4628         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4629
4630 fi
4631
4632 cf_add_libs="$LIBS"
4633 # reverse order
4634 cf_add_0lib=
4635 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4636 # filter duplicates
4637 for cf_add_1lib in $cf_add_0lib; do
4638         for cf_add_2lib in $cf_add_libs; do
4639                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4640                         cf_add_1lib=
4641                         break
4642                 fi
4643         done
4644         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4645 done
4646 LIBS="$cf_add_libs"
4647
4648                 # even with config script, some packages use no-override for curses.h
4649
4650 echo "$as_me:4650: checking if we have identified curses headers" >&5
4651 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4652 if test "${cf_cv_ncurses_header+set}" = set; then
4653   echo $ECHO_N "(cached) $ECHO_C" >&6
4654 else
4655
4656 cf_cv_ncurses_header=none
4657 for cf_header in \
4658         ncurses.h ncurses/ncurses.h \
4659         curses.h ncurses/curses.h
4660 do
4661 cat >conftest.$ac_ext <<_ACEOF
4662 #line 4662 "configure"
4663 #include "confdefs.h"
4664 #include <${cf_header}>
4665 int
4666 main (void)
4667 {
4668 initscr(); tgoto("?", 0,0)
4669   ;
4670   return 0;
4671 }
4672 _ACEOF
4673 rm -f conftest.$ac_objext
4674 if { (eval echo "$as_me:4674: \"$ac_compile\"") >&5
4675   (eval $ac_compile) 2>&5
4676   ac_status=$?
4677   echo "$as_me:4677: \$? = $ac_status" >&5
4678   (exit $ac_status); } &&
4679          { ac_try='test -s conftest.$ac_objext'
4680   { (eval echo "$as_me:4680: \"$ac_try\"") >&5
4681   (eval $ac_try) 2>&5
4682   ac_status=$?
4683   echo "$as_me:4683: \$? = $ac_status" >&5
4684   (exit $ac_status); }; }; then
4685   cf_cv_ncurses_header=$cf_header; break
4686 else
4687   echo "$as_me: failed program was:" >&5
4688 cat conftest.$ac_ext >&5
4689 fi
4690 rm -f conftest.$ac_objext conftest.$ac_ext
4691 done
4692
4693 fi
4694 echo "$as_me:4694: result: $cf_cv_ncurses_header" >&5
4695 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4696
4697 if test "$cf_cv_ncurses_header" = none ; then
4698         { { echo "$as_me:4698: error: No curses header-files found" >&5
4699 echo "$as_me: error: No curses header-files found" >&2;}
4700    { (exit 1); exit 1; }; }
4701 fi
4702
4703 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4704
4705 for ac_header in $cf_cv_ncurses_header
4706 do
4707 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4708 echo "$as_me:4708: checking for $ac_header" >&5
4709 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4710 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4711   echo $ECHO_N "(cached) $ECHO_C" >&6
4712 else
4713   cat >conftest.$ac_ext <<_ACEOF
4714 #line 4714 "configure"
4715 #include "confdefs.h"
4716 #include <$ac_header>
4717 _ACEOF
4718 if { (eval echo "$as_me:4718: \"$ac_cpp conftest.$ac_ext\"") >&5
4719   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4720   ac_status=$?
4721   egrep -v '^ *\+' conftest.er1 >conftest.err
4722   rm -f conftest.er1
4723   cat conftest.err >&5
4724   echo "$as_me:4724: \$? = $ac_status" >&5
4725   (exit $ac_status); } >/dev/null; then
4726   if test -s conftest.err; then
4727     ac_cpp_err=$ac_c_preproc_warn_flag
4728   else
4729     ac_cpp_err=
4730   fi
4731 else
4732   ac_cpp_err=yes
4733 fi
4734 if test -z "$ac_cpp_err"; then
4735   eval "$as_ac_Header=yes"
4736 else
4737   echo "$as_me: failed program was:" >&5
4738   cat conftest.$ac_ext >&5
4739   eval "$as_ac_Header=no"
4740 fi
4741 rm -f conftest.err conftest.$ac_ext
4742 fi
4743 echo "$as_me:4743: result: `eval echo '${'$as_ac_Header'}'`" >&5
4744 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4745 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4746   cat >>confdefs.h <<EOF
4747 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4748 EOF
4749
4750 fi
4751 done
4752
4753 cat >>confdefs.h <<\EOF
4754 #define NCURSES 1
4755 EOF
4756
4757 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4758
4759                 cat >>confdefs.h <<EOF
4760 #define $cf_nculib_ROOT 1
4761 EOF
4762
4763                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4764
4765         else
4766
4767 cf_ncuhdr_root=ncurses
4768
4769 test -n "$cf_cv_curses_dir" && \
4770 test "$cf_cv_curses_dir" != "no" && { \
4771
4772 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4773   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4774   do
4775         while test $cf_add_incdir != /usr/include
4776         do
4777           if test -d $cf_add_incdir
4778           then
4779                 cf_have_incdir=no
4780                 if test -n "$CFLAGS$CPPFLAGS" ; then
4781                   # a loop is needed to ensure we can add subdirs of existing dirs
4782                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4783                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4784                           cf_have_incdir=yes; break
4785                         fi
4786                   done
4787                 fi
4788
4789                 if test "$cf_have_incdir" = no ; then
4790                   if test "$cf_add_incdir" = /usr/local/include ; then
4791                         if test "$GCC" = yes
4792                         then
4793                           cf_save_CPPFLAGS=$CPPFLAGS
4794
4795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4796         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4797
4798                           cat >conftest.$ac_ext <<_ACEOF
4799 #line 4799 "configure"
4800 #include "confdefs.h"
4801 #include <stdio.h>
4802 int
4803 main (void)
4804 {
4805 printf("Hello")
4806   ;
4807   return 0;
4808 }
4809 _ACEOF
4810 rm -f conftest.$ac_objext
4811 if { (eval echo "$as_me:4811: \"$ac_compile\"") >&5
4812   (eval $ac_compile) 2>&5
4813   ac_status=$?
4814   echo "$as_me:4814: \$? = $ac_status" >&5
4815   (exit $ac_status); } &&
4816          { ac_try='test -s conftest.$ac_objext'
4817   { (eval echo "$as_me:4817: \"$ac_try\"") >&5
4818   (eval $ac_try) 2>&5
4819   ac_status=$?
4820   echo "$as_me:4820: \$? = $ac_status" >&5
4821   (exit $ac_status); }; }; then
4822   :
4823 else
4824   echo "$as_me: failed program was:" >&5
4825 cat conftest.$ac_ext >&5
4826 cf_have_incdir=yes
4827 fi
4828 rm -f conftest.$ac_objext conftest.$ac_ext
4829                           CPPFLAGS=$cf_save_CPPFLAGS
4830                         fi
4831                   fi
4832                 fi
4833
4834                 if test "$cf_have_incdir" = no ; then
4835                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4836
4837 echo "${as_me:-configure}:4837: testing adding $cf_add_incdir to include-path ..." 1>&5
4838
4839                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4840
4841                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4842                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4843                   cf_add_incdir="$cf_top_incdir"
4844                 else
4845                   break
4846                 fi
4847           else
4848                 break
4849           fi
4850         done
4851   done
4852 fi
4853
4854 }
4855
4856 echo "$as_me:4856: checking for $cf_ncuhdr_root header in include-path" >&5
4857 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4858 if test "${cf_cv_ncurses_h+set}" = set; then
4859   echo $ECHO_N "(cached) $ECHO_C" >&6
4860 else
4861
4862         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4863         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4864         for cf_header in $cf_header_list
4865         do
4866
4867         cat >conftest.$ac_ext <<_ACEOF
4868 #line 4868 "configure"
4869 #include "confdefs.h"
4870
4871 #include <$cf_header>
4872 int
4873 main (void)
4874 {
4875
4876 #ifdef NCURSES_VERSION
4877
4878 printf("%s\n", NCURSES_VERSION);
4879 #else
4880 #ifdef __NCURSES_H
4881 printf("old\n");
4882 #else
4883         make an error
4884 #endif
4885 #endif
4886
4887   ;
4888   return 0;
4889 }
4890 _ACEOF
4891 rm -f conftest.$ac_objext
4892 if { (eval echo "$as_me:4892: \"$ac_compile\"") >&5
4893   (eval $ac_compile) 2>&5
4894   ac_status=$?
4895   echo "$as_me:4895: \$? = $ac_status" >&5
4896   (exit $ac_status); } &&
4897          { ac_try='test -s conftest.$ac_objext'
4898   { (eval echo "$as_me:4898: \"$ac_try\"") >&5
4899   (eval $ac_try) 2>&5
4900   ac_status=$?
4901   echo "$as_me:4901: \$? = $ac_status" >&5
4902   (exit $ac_status); }; }; then
4903   cf_cv_ncurses_h=$cf_header
4904
4905 else
4906   echo "$as_me: failed program was:" >&5
4907 cat conftest.$ac_ext >&5
4908 cf_cv_ncurses_h=no
4909 fi
4910 rm -f conftest.$ac_objext conftest.$ac_ext
4911
4912                 test "$cf_cv_ncurses_h" != no && break
4913         done
4914
4915 fi
4916 echo "$as_me:4916: result: $cf_cv_ncurses_h" >&5
4917 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4918
4919 if test "$cf_cv_ncurses_h" != no ; then
4920         cf_cv_ncurses_header=$cf_cv_ncurses_h
4921 else
4922
4923 echo "$as_me:4923: checking for $cf_ncuhdr_root include-path" >&5
4924 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4925 if test "${cf_cv_ncurses_h2+set}" = set; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928
4929         test -n "$verbose" && echo
4930
4931 cf_search=
4932
4933 # collect the current set of include-directories from compiler flags
4934 cf_header_path_list=""
4935 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4936         for cf_header_path in $CPPFLAGS $CFLAGS
4937         do
4938                 case $cf_header_path in
4939                 (-I*)
4940                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4941
4942 test "x$cf_header_path" != "xNONE" && \
4943 test -d "$cf_header_path" && \
4944  {
4945         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4946         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4947         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4948         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4949         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4950         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"
4951 }
4952
4953                         cf_header_path_list="$cf_header_path_list $cf_search"
4954                         ;;
4955                 esac
4956         done
4957 fi
4958
4959 # add the variations for the package we are looking for
4960
4961 cf_search=
4962
4963 test "x$prefix" != "xNONE" && \
4964 test -d "$prefix" && \
4965  {
4966         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4967         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4968         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4969         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4970         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4971         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4972 }
4973
4974 for cf_subdir_prefix in \
4975         /usr \
4976         /usr/local \
4977         /usr/pkg \
4978         /opt \
4979         /opt/local \
4980         $HOME
4981 do
4982
4983 test "x$cf_subdir_prefix" != "x$prefix" && \
4984 test -d "$cf_subdir_prefix" && \
4985 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4986         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4987         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4988         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4989         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4990         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4991         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"
4992 }
4993
4994 done
4995
4996 test "$includedir" != NONE && \
4997 test "$includedir" != "/usr/include" && \
4998 test -d "$includedir" && {
4999         test -d $includedir &&    cf_search="$cf_search $includedir"
5000         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5001 }
5002
5003 test "$oldincludedir" != NONE && \
5004 test "$oldincludedir" != "/usr/include" && \
5005 test -d "$oldincludedir" && {
5006         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5007         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5008 }
5009
5010 cf_search="$cf_search $cf_header_path_list"
5011
5012         test -n "$verbose" && echo search path $cf_search
5013         cf_save2_CPPFLAGS="$CPPFLAGS"
5014         for cf_incdir in $cf_search
5015         do
5016
5017 if test -n "$cf_incdir" ; then
5018   for cf_add_incdir in $cf_incdir
5019   do
5020         while test $cf_add_incdir != /usr/include
5021         do
5022           if test -d $cf_add_incdir
5023           then
5024                 cf_have_incdir=no
5025                 if test -n "$CFLAGS$CPPFLAGS" ; then
5026                   # a loop is needed to ensure we can add subdirs of existing dirs
5027                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5028                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5029                           cf_have_incdir=yes; break
5030                         fi
5031                   done
5032                 fi
5033
5034                 if test "$cf_have_incdir" = no ; then
5035                   if test "$cf_add_incdir" = /usr/local/include ; then
5036                         if test "$GCC" = yes
5037                         then
5038                           cf_save_CPPFLAGS=$CPPFLAGS
5039
5040         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5041         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5042
5043                           cat >conftest.$ac_ext <<_ACEOF
5044 #line 5044 "configure"
5045 #include "confdefs.h"
5046 #include <stdio.h>
5047 int
5048 main (void)
5049 {
5050 printf("Hello")
5051   ;
5052   return 0;
5053 }
5054 _ACEOF
5055 rm -f conftest.$ac_objext
5056 if { (eval echo "$as_me:5056: \"$ac_compile\"") >&5
5057   (eval $ac_compile) 2>&5
5058   ac_status=$?
5059   echo "$as_me:5059: \$? = $ac_status" >&5
5060   (exit $ac_status); } &&
5061          { ac_try='test -s conftest.$ac_objext'
5062   { (eval echo "$as_me:5062: \"$ac_try\"") >&5
5063   (eval $ac_try) 2>&5
5064   ac_status=$?
5065   echo "$as_me:5065: \$? = $ac_status" >&5
5066   (exit $ac_status); }; }; then
5067   :
5068 else
5069   echo "$as_me: failed program was:" >&5
5070 cat conftest.$ac_ext >&5
5071 cf_have_incdir=yes
5072 fi
5073 rm -f conftest.$ac_objext conftest.$ac_ext
5074                           CPPFLAGS=$cf_save_CPPFLAGS
5075                         fi
5076                   fi
5077                 fi
5078
5079                 if test "$cf_have_incdir" = no ; then
5080                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5081
5082 echo "${as_me:-configure}:5082: testing adding $cf_add_incdir to include-path ..." 1>&5
5083
5084                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5085
5086                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5087                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5088                   cf_add_incdir="$cf_top_incdir"
5089                 else
5090                   break
5091                 fi
5092           else
5093                 break
5094           fi
5095         done
5096   done
5097 fi
5098
5099                 for cf_header in \
5100                         ncurses.h \
5101                         curses.h
5102                 do
5103
5104         cat >conftest.$ac_ext <<_ACEOF
5105 #line 5105 "configure"
5106 #include "confdefs.h"
5107
5108 #include <$cf_header>
5109 int
5110 main (void)
5111 {
5112
5113 #ifdef NCURSES_VERSION
5114
5115 printf("%s\n", NCURSES_VERSION);
5116 #else
5117 #ifdef __NCURSES_H
5118 printf("old\n");
5119 #else
5120         make an error
5121 #endif
5122 #endif
5123
5124   ;
5125   return 0;
5126 }
5127 _ACEOF
5128 rm -f conftest.$ac_objext
5129 if { (eval echo "$as_me:5129: \"$ac_compile\"") >&5
5130   (eval $ac_compile) 2>&5
5131   ac_status=$?
5132   echo "$as_me:5132: \$? = $ac_status" >&5
5133   (exit $ac_status); } &&
5134          { ac_try='test -s conftest.$ac_objext'
5135   { (eval echo "$as_me:5135: \"$ac_try\"") >&5
5136   (eval $ac_try) 2>&5
5137   ac_status=$?
5138   echo "$as_me:5138: \$? = $ac_status" >&5
5139   (exit $ac_status); }; }; then
5140   cf_cv_ncurses_h2=$cf_header
5141
5142 else
5143   echo "$as_me: failed program was:" >&5
5144 cat conftest.$ac_ext >&5
5145 cf_cv_ncurses_h2=no
5146 fi
5147 rm -f conftest.$ac_objext conftest.$ac_ext
5148
5149                         if test "$cf_cv_ncurses_h2" != no ; then
5150                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5151                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5152                                 break
5153                         fi
5154                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5155                 done
5156                 CPPFLAGS="$cf_save2_CPPFLAGS"
5157                 test "$cf_cv_ncurses_h2" != no && break
5158         done
5159         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5159: error: not found" >&5
5160 echo "$as_me: error: not found" >&2;}
5161    { (exit 1); exit 1; }; }
5162
5163 fi
5164 echo "$as_me:5164: result: $cf_cv_ncurses_h2" >&5
5165 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5166
5167         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5168         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5169         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5170                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5171         fi
5172
5173 if test -n "$cf_1st_incdir" ; then
5174   for cf_add_incdir in $cf_1st_incdir
5175   do
5176         while test $cf_add_incdir != /usr/include
5177         do
5178           if test -d $cf_add_incdir
5179           then
5180                 cf_have_incdir=no
5181                 if test -n "$CFLAGS$CPPFLAGS" ; then
5182                   # a loop is needed to ensure we can add subdirs of existing dirs
5183                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5184                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5185                           cf_have_incdir=yes; break
5186                         fi
5187                   done
5188                 fi
5189
5190                 if test "$cf_have_incdir" = no ; then
5191                   if test "$cf_add_incdir" = /usr/local/include ; then
5192                         if test "$GCC" = yes
5193                         then
5194                           cf_save_CPPFLAGS=$CPPFLAGS
5195
5196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5197         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5198
5199                           cat >conftest.$ac_ext <<_ACEOF
5200 #line 5200 "configure"
5201 #include "confdefs.h"
5202 #include <stdio.h>
5203 int
5204 main (void)
5205 {
5206 printf("Hello")
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext
5212 if { (eval echo "$as_me:5212: \"$ac_compile\"") >&5
5213   (eval $ac_compile) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest.$ac_objext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   :
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 cf_have_incdir=yes
5228 fi
5229 rm -f conftest.$ac_objext conftest.$ac_ext
5230                           CPPFLAGS=$cf_save_CPPFLAGS
5231                         fi
5232                   fi
5233                 fi
5234
5235                 if test "$cf_have_incdir" = no ; then
5236                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5237
5238 echo "${as_me:-configure}:5238: testing adding $cf_add_incdir to include-path ..." 1>&5
5239
5240                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5241
5242                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5243                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5244                   cf_add_incdir="$cf_top_incdir"
5245                 else
5246                   break
5247                 fi
5248           else
5249                 break
5250           fi
5251         done
5252   done
5253 fi
5254
5255 fi
5256
5257 # Set definitions to allow ifdef'ing for ncurses.h
5258
5259 case $cf_cv_ncurses_header in
5260 (*ncurses.h)
5261
5262 cat >>confdefs.h <<\EOF
5263 #define HAVE_NCURSES_H 1
5264 EOF
5265
5266         ;;
5267 esac
5268
5269 case $cf_cv_ncurses_header in
5270 (ncurses/curses.h|ncurses/ncurses.h)
5271
5272 cat >>confdefs.h <<\EOF
5273 #define HAVE_NCURSES_NCURSES_H 1
5274 EOF
5275
5276         ;;
5277 (ncursesw/curses.h|ncursesw/ncurses.h)
5278
5279 cat >>confdefs.h <<\EOF
5280 #define HAVE_NCURSESW_NCURSES_H 1
5281 EOF
5282
5283         ;;
5284 esac
5285
5286 echo "$as_me:5286: checking for terminfo header" >&5
5287 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5288 if test "${cf_cv_term_header+set}" = set; then
5289   echo $ECHO_N "(cached) $ECHO_C" >&6
5290 else
5291
5292 case ${cf_cv_ncurses_header} in
5293 (*/ncurses.h|*/ncursesw.h)
5294         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5295         ;;
5296 (*)
5297         cf_term_header=term.h
5298         ;;
5299 esac
5300
5301 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5302 do
5303 cat >conftest.$ac_ext <<_ACEOF
5304 #line 5304 "configure"
5305 #include "confdefs.h"
5306 #include <stdio.h>
5307 #include <${cf_cv_ncurses_header:-curses.h}>
5308 #include <$cf_test>
5309
5310 int
5311 main (void)
5312 {
5313 int x = auto_left_margin
5314   ;
5315   return 0;
5316 }
5317 _ACEOF
5318 rm -f conftest.$ac_objext
5319 if { (eval echo "$as_me:5319: \"$ac_compile\"") >&5
5320   (eval $ac_compile) 2>&5
5321   ac_status=$?
5322   echo "$as_me:5322: \$? = $ac_status" >&5
5323   (exit $ac_status); } &&
5324          { ac_try='test -s conftest.$ac_objext'
5325   { (eval echo "$as_me:5325: \"$ac_try\"") >&5
5326   (eval $ac_try) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit $ac_status); }; }; then
5330
5331         cf_cv_term_header="$cf_test"
5332 else
5333   echo "$as_me: failed program was:" >&5
5334 cat conftest.$ac_ext >&5
5335
5336         cf_cv_term_header=unknown
5337
5338 fi
5339 rm -f conftest.$ac_objext conftest.$ac_ext
5340         test "$cf_cv_term_header" != unknown && break
5341 done
5342
5343 fi
5344 echo "$as_me:5344: result: $cf_cv_term_header" >&5
5345 echo "${ECHO_T}$cf_cv_term_header" >&6
5346
5347 # Set definitions to allow ifdef'ing to accommodate subdirectories
5348
5349 case $cf_cv_term_header in
5350 (*term.h)
5351
5352 cat >>confdefs.h <<\EOF
5353 #define HAVE_TERM_H 1
5354 EOF
5355
5356         ;;
5357 esac
5358
5359 case $cf_cv_term_header in
5360 (ncurses/term.h)
5361
5362 cat >>confdefs.h <<\EOF
5363 #define HAVE_NCURSES_TERM_H 1
5364 EOF
5365
5366         ;;
5367 (ncursesw/term.h)
5368
5369 cat >>confdefs.h <<\EOF
5370 #define HAVE_NCURSESW_TERM_H 1
5371 EOF
5372
5373         ;;
5374 esac
5375
5376 # some applications need this, but should check for NCURSES_VERSION
5377
5378 cat >>confdefs.h <<\EOF
5379 #define NCURSES 1
5380 EOF
5381
5382 echo "$as_me:5382: checking for ncurses version" >&5
5383 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5384 if test "${cf_cv_ncurses_version+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388         cf_cv_ncurses_version=no
5389         cf_tempfile=out$$
5390         rm -f $cf_tempfile
5391         if test "$cross_compiling" = yes; then
5392
5393         # This will not work if the preprocessor splits the line after the
5394         # Autoconf token.  The 'unproto' program does that.
5395         cat > conftest.$ac_ext <<EOF
5396 #include <${cf_cv_ncurses_header:-curses.h}>
5397 #undef Autoconf
5398 #ifdef NCURSES_VERSION
5399 Autoconf NCURSES_VERSION
5400 #else
5401 #ifdef __NCURSES_H
5402 Autoconf "old"
5403 #endif
5404 ;
5405 #endif
5406 EOF
5407         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5408         { (eval echo "$as_me:5408: \"$cf_try\"") >&5
5409   (eval $cf_try) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); }
5413         if test -f conftest.out ; then
5414                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5415                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5416                 rm -f conftest.out
5417         fi
5418
5419 else
5420   cat >conftest.$ac_ext <<_ACEOF
5421 #line 5421 "configure"
5422 #include "confdefs.h"
5423
5424 #include <${cf_cv_ncurses_header:-curses.h}>
5425 #include <stdio.h>
5426 int main(void)
5427 {
5428         FILE *fp = fopen("$cf_tempfile", "w");
5429 #ifdef NCURSES_VERSION
5430 # ifdef NCURSES_VERSION_PATCH
5431         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5432 # else
5433         fprintf(fp, "%s\n", NCURSES_VERSION);
5434 # endif
5435 #else
5436 # ifdef __NCURSES_H
5437         fprintf(fp, "old\n");
5438 # else
5439         make an error
5440 # endif
5441 #endif
5442         ${cf_cv_main_return:-return}(0);
5443 }
5444 _ACEOF
5445 rm -f conftest$ac_exeext
5446 if { (eval echo "$as_me:5446: \"$ac_link\"") >&5
5447   (eval $ac_link) 2>&5
5448   ac_status=$?
5449   echo "$as_me:5449: \$? = $ac_status" >&5
5450   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5451   { (eval echo "$as_me:5451: \"$ac_try\"") >&5
5452   (eval $ac_try) 2>&5
5453   ac_status=$?
5454   echo "$as_me:5454: \$? = $ac_status" >&5
5455   (exit $ac_status); }; }; then
5456
5457         cf_cv_ncurses_version=`cat $cf_tempfile`
5458 else
5459   echo "$as_me: program exited with status $ac_status" >&5
5460 echo "$as_me: failed program was:" >&5
5461 cat conftest.$ac_ext >&5
5462 fi
5463 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5464 fi
5465         rm -f $cf_tempfile
5466
5467 fi
5468 echo "$as_me:5468: result: $cf_cv_ncurses_version" >&5
5469 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5470 test "$cf_cv_ncurses_version" = no ||
5471 cat >>confdefs.h <<\EOF
5472 #define NCURSES 1
5473 EOF
5474
5475 cf_nculib_root=ncurses
5476         # This works, except for the special case where we find gpm, but
5477         # ncurses is in a nonstandard location via $LIBS, and we really want
5478         # to link gpm.
5479 cf_ncurses_LIBS=""
5480 cf_ncurses_SAVE="$LIBS"
5481 echo "$as_me:5481: checking for Gpm_Open in -lgpm" >&5
5482 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5483 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5484   echo $ECHO_N "(cached) $ECHO_C" >&6
5485 else
5486   ac_check_lib_save_LIBS=$LIBS
5487 LIBS="-lgpm  $LIBS"
5488 cat >conftest.$ac_ext <<_ACEOF
5489 #line 5489 "configure"
5490 #include "confdefs.h"
5491
5492 /* Override any gcc2 internal prototype to avoid an error.  */
5493 #ifdef __cplusplus
5494 extern "C"
5495 #endif
5496 /* We use char because int might match the return type of a gcc2
5497    builtin and then its argument prototype would still apply.  */
5498 char Gpm_Open ();
5499 int
5500 main (void)
5501 {
5502 Gpm_Open ();
5503   ;
5504   return 0;
5505 }
5506 _ACEOF
5507 rm -f conftest.$ac_objext conftest$ac_exeext
5508 if { (eval echo "$as_me:5508: \"$ac_link\"") >&5
5509   (eval $ac_link) 2>&5
5510   ac_status=$?
5511   echo "$as_me:5511: \$? = $ac_status" >&5
5512   (exit $ac_status); } &&
5513          { ac_try='test -s conftest$ac_exeext'
5514   { (eval echo "$as_me:5514: \"$ac_try\"") >&5
5515   (eval $ac_try) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); }; }; then
5519   ac_cv_lib_gpm_Gpm_Open=yes
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat conftest.$ac_ext >&5
5523 ac_cv_lib_gpm_Gpm_Open=no
5524 fi
5525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5526 LIBS=$ac_check_lib_save_LIBS
5527 fi
5528 echo "$as_me:5528: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5529 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5530 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5531   echo "$as_me:5531: checking for initscr in -lgpm" >&5
5532 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5533 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5534   echo $ECHO_N "(cached) $ECHO_C" >&6
5535 else
5536   ac_check_lib_save_LIBS=$LIBS
5537 LIBS="-lgpm  $LIBS"
5538 cat >conftest.$ac_ext <<_ACEOF
5539 #line 5539 "configure"
5540 #include "confdefs.h"
5541
5542 /* Override any gcc2 internal prototype to avoid an error.  */
5543 #ifdef __cplusplus
5544 extern "C"
5545 #endif
5546 /* We use char because int might match the return type of a gcc2
5547    builtin and then its argument prototype would still apply.  */
5548 char initscr ();
5549 int
5550 main (void)
5551 {
5552 initscr ();
5553   ;
5554   return 0;
5555 }
5556 _ACEOF
5557 rm -f conftest.$ac_objext conftest$ac_exeext
5558 if { (eval echo "$as_me:5558: \"$ac_link\"") >&5
5559   (eval $ac_link) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit $ac_status); } &&
5563          { ac_try='test -s conftest$ac_exeext'
5564   { (eval echo "$as_me:5564: \"$ac_try\"") >&5
5565   (eval $ac_try) 2>&5
5566   ac_status=$?
5567   echo "$as_me:5567: \$? = $ac_status" >&5
5568   (exit $ac_status); }; }; then
5569   ac_cv_lib_gpm_initscr=yes
5570 else
5571   echo "$as_me: failed program was:" >&5
5572 cat conftest.$ac_ext >&5
5573 ac_cv_lib_gpm_initscr=no
5574 fi
5575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5576 LIBS=$ac_check_lib_save_LIBS
5577 fi
5578 echo "$as_me:5578: result: $ac_cv_lib_gpm_initscr" >&5
5579 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5580 if test $ac_cv_lib_gpm_initscr = yes; then
5581   LIBS="$cf_ncurses_SAVE"
5582 else
5583   cf_ncurses_LIBS="-lgpm"
5584 fi
5585
5586 fi
5587
5588 case $host_os in
5589 (freebsd*)
5590         # This is only necessary if you are linking against an obsolete
5591         # version of ncurses (but it should do no harm, since it's static).
5592         if test "$cf_nculib_root" = ncurses ; then
5593                 echo "$as_me:5593: checking for tgoto in -lmytinfo" >&5
5594 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5595 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5596   echo $ECHO_N "(cached) $ECHO_C" >&6
5597 else
5598   ac_check_lib_save_LIBS=$LIBS
5599 LIBS="-lmytinfo  $LIBS"
5600 cat >conftest.$ac_ext <<_ACEOF
5601 #line 5601 "configure"
5602 #include "confdefs.h"
5603
5604 /* Override any gcc2 internal prototype to avoid an error.  */
5605 #ifdef __cplusplus
5606 extern "C"
5607 #endif
5608 /* We use char because int might match the return type of a gcc2
5609    builtin and then its argument prototype would still apply.  */
5610 char tgoto ();
5611 int
5612 main (void)
5613 {
5614 tgoto ();
5615   ;
5616   return 0;
5617 }
5618 _ACEOF
5619 rm -f conftest.$ac_objext conftest$ac_exeext
5620 if { (eval echo "$as_me:5620: \"$ac_link\"") >&5
5621   (eval $ac_link) 2>&5
5622   ac_status=$?
5623   echo "$as_me:5623: \$? = $ac_status" >&5
5624   (exit $ac_status); } &&
5625          { ac_try='test -s conftest$ac_exeext'
5626   { (eval echo "$as_me:5626: \"$ac_try\"") >&5
5627   (eval $ac_try) 2>&5
5628   ac_status=$?
5629   echo "$as_me:5629: \$? = $ac_status" >&5
5630   (exit $ac_status); }; }; then
5631   ac_cv_lib_mytinfo_tgoto=yes
5632 else
5633   echo "$as_me: failed program was:" >&5
5634 cat conftest.$ac_ext >&5
5635 ac_cv_lib_mytinfo_tgoto=no
5636 fi
5637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5638 LIBS=$ac_check_lib_save_LIBS
5639 fi
5640 echo "$as_me:5640: result: $ac_cv_lib_mytinfo_tgoto" >&5
5641 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5642 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5643   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5644 fi
5645
5646         fi
5647         ;;
5648 esac
5649
5650 cf_add_libs="$LIBS"
5651 # reverse order
5652 cf_add_0lib=
5653 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5654 # filter duplicates
5655 for cf_add_1lib in $cf_add_0lib; do
5656         for cf_add_2lib in $cf_add_libs; do
5657                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5658                         cf_add_1lib=
5659                         break
5660                 fi
5661         done
5662         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5663 done
5664 LIBS="$cf_add_libs"
5665
5666 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5667 then
5668
5669 cf_add_libs="$LIBS"
5670 # reverse order
5671 cf_add_0lib=
5672 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5673 # filter duplicates
5674 for cf_add_1lib in $cf_add_0lib; do
5675         for cf_add_2lib in $cf_add_libs; do
5676                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5677                         cf_add_1lib=
5678                         break
5679                 fi
5680         done
5681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5682 done
5683 LIBS="$cf_add_libs"
5684
5685 else
5686
5687         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5688         cf_libdir=""
5689         echo "$as_me:5689: checking for initscr" >&5
5690 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5691 if test "${ac_cv_func_initscr+set}" = set; then
5692   echo $ECHO_N "(cached) $ECHO_C" >&6
5693 else
5694   cat >conftest.$ac_ext <<_ACEOF
5695 #line 5695 "configure"
5696 #include "confdefs.h"
5697 #define initscr autoconf_temporary
5698 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5699 #undef initscr
5700
5701 #ifdef __cplusplus
5702 extern "C"
5703 #endif
5704
5705 /* We use char because int might match the return type of a gcc2
5706    builtin and then its argument prototype would still apply.  */
5707 char initscr (void);
5708
5709 int
5710 main (void)
5711 {
5712
5713 /* The GNU C library defines stubs for functions which it implements
5714     to always fail with ENOSYS.  Some functions are actually named
5715     something starting with __ and the normal name is an alias.  */
5716 #if defined (__stub_initscr) || defined (__stub___initscr)
5717 #error found stub for initscr
5718 #endif
5719
5720         return initscr ();
5721   ;
5722   return 0;
5723 }
5724 _ACEOF
5725 rm -f conftest.$ac_objext conftest$ac_exeext
5726 if { (eval echo "$as_me:5726: \"$ac_link\"") >&5
5727   (eval $ac_link) 2>&5
5728   ac_status=$?
5729   echo "$as_me:5729: \$? = $ac_status" >&5
5730   (exit $ac_status); } &&
5731          { ac_try='test -s conftest$ac_exeext'
5732   { (eval echo "$as_me:5732: \"$ac_try\"") >&5
5733   (eval $ac_try) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit $ac_status); }; }; then
5737   ac_cv_func_initscr=yes
5738 else
5739   echo "$as_me: failed program was:" >&5
5740 cat conftest.$ac_ext >&5
5741 ac_cv_func_initscr=no
5742 fi
5743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5744 fi
5745 echo "$as_me:5745: result: $ac_cv_func_initscr" >&5
5746 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5747 if test $ac_cv_func_initscr = yes; then
5748   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5749 else
5750
5751                 cf_save_LIBS="$LIBS"
5752                 echo "$as_me:5752: checking for initscr in -l$cf_nculib_root" >&5
5753 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5754                 LIBS="-l$cf_nculib_root $LIBS"
5755                 cat >conftest.$ac_ext <<_ACEOF
5756 #line 5756 "configure"
5757 #include "confdefs.h"
5758 #include <${cf_cv_ncurses_header:-curses.h}>
5759 int
5760 main (void)
5761 {
5762 initscr()
5763   ;
5764   return 0;
5765 }
5766 _ACEOF
5767 rm -f conftest.$ac_objext conftest$ac_exeext
5768 if { (eval echo "$as_me:5768: \"$ac_link\"") >&5
5769   (eval $ac_link) 2>&5
5770   ac_status=$?
5771   echo "$as_me:5771: \$? = $ac_status" >&5
5772   (exit $ac_status); } &&
5773          { ac_try='test -s conftest$ac_exeext'
5774   { (eval echo "$as_me:5774: \"$ac_try\"") >&5
5775   (eval $ac_try) 2>&5
5776   ac_status=$?
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); }; }; then
5779   echo "$as_me:5779: result: yes" >&5
5780 echo "${ECHO_T}yes" >&6
5781                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5782
5783 else
5784   echo "$as_me: failed program was:" >&5
5785 cat conftest.$ac_ext >&5
5786 echo "$as_me:5786: result: no" >&5
5787 echo "${ECHO_T}no" >&6
5788
5789 cf_search=
5790 cf_library_path_list=""
5791 if test -n "${LDFLAGS}${LIBS}" ; then
5792         for cf_library_path in $LDFLAGS $LIBS
5793         do
5794                 case $cf_library_path in
5795                 (-L*)
5796                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5797
5798 test "x$cf_library_path" != "xNONE" && \
5799 test -d "$cf_library_path" && \
5800  {
5801         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5802         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5803         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5804         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5805         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5806         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"
5807 }
5808
5809                         cf_library_path_list="$cf_library_path_list $cf_search"
5810                         ;;
5811                 esac
5812         done
5813 fi
5814
5815 cf_search=
5816
5817 test "x$prefix" != "xNONE" && \
5818 test -d "$prefix" && \
5819  {
5820         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5821         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5822         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5823         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5824         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5825         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5826 }
5827
5828 for cf_subdir_prefix in \
5829         /usr \
5830         /usr/local \
5831         /usr/pkg \
5832         /opt \
5833         /opt/local \
5834         $HOME
5835 do
5836
5837 test "x$cf_subdir_prefix" != "x$prefix" && \
5838 test -d "$cf_subdir_prefix" && \
5839 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5840         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5841         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5842         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5843         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5844         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5845         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"
5846 }
5847
5848 done
5849
5850 cf_search="$cf_library_path_list $cf_search"
5851
5852                         for cf_libdir in $cf_search
5853                         do
5854                                 echo "$as_me:5854: checking for -l$cf_nculib_root in $cf_libdir" >&5
5855 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5856                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5857                                 cat >conftest.$ac_ext <<_ACEOF
5858 #line 5858 "configure"
5859 #include "confdefs.h"
5860 #include <${cf_cv_ncurses_header:-curses.h}>
5861 int
5862 main (void)
5863 {
5864 initscr()
5865   ;
5866   return 0;
5867 }
5868 _ACEOF
5869 rm -f conftest.$ac_objext conftest$ac_exeext
5870 if { (eval echo "$as_me:5870: \"$ac_link\"") >&5
5871   (eval $ac_link) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); } &&
5875          { ac_try='test -s conftest$ac_exeext'
5876   { (eval echo "$as_me:5876: \"$ac_try\"") >&5
5877   (eval $ac_try) 2>&5
5878   ac_status=$?
5879   echo "$as_me:5879: \$? = $ac_status" >&5
5880   (exit $ac_status); }; }; then
5881   echo "$as_me:5881: result: yes" >&5
5882 echo "${ECHO_T}yes" >&6
5883                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5884                                          break
5885 else
5886   echo "$as_me: failed program was:" >&5
5887 cat conftest.$ac_ext >&5
5888 echo "$as_me:5888: result: no" >&5
5889 echo "${ECHO_T}no" >&6
5890                                          LIBS="$cf_save_LIBS"
5891 fi
5892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5893                         done
5894
5895 fi
5896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5897
5898 fi
5899
5900 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5901
5902 if test $cf_found_library = no ; then
5903         { { echo "$as_me:5903: error: Cannot link $cf_nculib_root library" >&5
5904 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5905    { (exit 1); exit 1; }; }
5906 fi
5907
5908 fi
5909
5910 if test -n "$cf_ncurses_LIBS" ; then
5911         echo "$as_me:5911: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5912 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5913         cf_ncurses_SAVE="$LIBS"
5914         for p in $cf_ncurses_LIBS ; do
5915                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5916                 if test "$q" != "$LIBS" ; then
5917                         LIBS="$q"
5918                 fi
5919         done
5920         cat >conftest.$ac_ext <<_ACEOF
5921 #line 5921 "configure"
5922 #include "confdefs.h"
5923 #include <${cf_cv_ncurses_header:-curses.h}>
5924 int
5925 main (void)
5926 {
5927 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5928   ;
5929   return 0;
5930 }
5931 _ACEOF
5932 rm -f conftest.$ac_objext conftest$ac_exeext
5933 if { (eval echo "$as_me:5933: \"$ac_link\"") >&5
5934   (eval $ac_link) 2>&5
5935   ac_status=$?
5936   echo "$as_me:5936: \$? = $ac_status" >&5
5937   (exit $ac_status); } &&
5938          { ac_try='test -s conftest$ac_exeext'
5939   { (eval echo "$as_me:5939: \"$ac_try\"") >&5
5940   (eval $ac_try) 2>&5
5941   ac_status=$?
5942   echo "$as_me:5942: \$? = $ac_status" >&5
5943   (exit $ac_status); }; }; then
5944   echo "$as_me:5944: result: yes" >&5
5945 echo "${ECHO_T}yes" >&6
5946 else
5947   echo "$as_me: failed program was:" >&5
5948 cat conftest.$ac_ext >&5
5949 echo "$as_me:5949: result: no" >&5
5950 echo "${ECHO_T}no" >&6
5951                  LIBS="$cf_ncurses_SAVE"
5952 fi
5953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5954 fi
5955
5956 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5957
5958 cat >>confdefs.h <<EOF
5959 #define $cf_nculib_ROOT 1
5960 EOF
5961
5962         fi
5963 else
5964         NCURSES_CONFIG=none
5965 fi
5966
5967 echo "$as_me:5967: checking if you want wide-character code" >&5
5968 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5969
5970 # Check whether --enable-widec or --disable-widec was given.
5971 if test "${enable_widec+set}" = set; then
5972   enableval="$enable_widec"
5973   with_widec=$enableval
5974 else
5975   with_widec=no
5976 fi;
5977 echo "$as_me:5977: result: $with_widec" >&5
5978 echo "${ECHO_T}$with_widec" >&6
5979 if test "$with_widec" = yes ; then
5980
5981 echo "$as_me:5981: checking for multibyte character support" >&5
5982 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5983 if test "${cf_cv_utf8_lib+set}" = set; then
5984   echo $ECHO_N "(cached) $ECHO_C" >&6
5985 else
5986
5987         cf_save_LIBS="$LIBS"
5988         cat >conftest.$ac_ext <<_ACEOF
5989 #line 5989 "configure"
5990 #include "confdefs.h"
5991
5992 #include <stdlib.h>
5993 int
5994 main (void)
5995 {
5996 putwc(0,0);
5997   ;
5998   return 0;
5999 }
6000 _ACEOF
6001 rm -f conftest.$ac_objext conftest$ac_exeext
6002 if { (eval echo "$as_me:6002: \"$ac_link\"") >&5
6003   (eval $ac_link) 2>&5
6004   ac_status=$?
6005   echo "$as_me:6005: \$? = $ac_status" >&5
6006   (exit $ac_status); } &&
6007          { ac_try='test -s conftest$ac_exeext'
6008   { (eval echo "$as_me:6008: \"$ac_try\"") >&5
6009   (eval $ac_try) 2>&5
6010   ac_status=$?
6011   echo "$as_me:6011: \$? = $ac_status" >&5
6012   (exit $ac_status); }; }; then
6013   cf_cv_utf8_lib=yes
6014 else
6015   echo "$as_me: failed program was:" >&5
6016 cat conftest.$ac_ext >&5
6017
6018 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6019 # will be set on completion of the AC_TRY_LINK below.
6020 cf_cv_header_path_utf8=
6021 cf_cv_library_path_utf8=
6022
6023 echo "${as_me:-configure}:6023: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6024
6025 cf_save_LIBS="$LIBS"
6026
6027 cat >conftest.$ac_ext <<_ACEOF
6028 #line 6028 "configure"
6029 #include "confdefs.h"
6030
6031 #include <libutf8.h>
6032 int
6033 main (void)
6034 {
6035 putwc(0,0);
6036   ;
6037   return 0;
6038 }
6039 _ACEOF
6040 rm -f conftest.$ac_objext conftest$ac_exeext
6041 if { (eval echo "$as_me:6041: \"$ac_link\"") >&5
6042   (eval $ac_link) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); } &&
6046          { ac_try='test -s conftest$ac_exeext'
6047   { (eval echo "$as_me:6047: \"$ac_try\"") >&5
6048   (eval $ac_try) 2>&5
6049   ac_status=$?
6050   echo "$as_me:6050: \$? = $ac_status" >&5
6051   (exit $ac_status); }; }; then
6052
6053         cf_cv_find_linkage_utf8=yes
6054         cf_cv_header_path_utf8=/usr/include
6055         cf_cv_library_path_utf8=/usr/lib
6056
6057 else
6058   echo "$as_me: failed program was:" >&5
6059 cat conftest.$ac_ext >&5
6060
6061 LIBS="-lutf8  $cf_save_LIBS"
6062
6063 cat >conftest.$ac_ext <<_ACEOF
6064 #line 6064 "configure"
6065 #include "confdefs.h"
6066
6067 #include <libutf8.h>
6068 int
6069 main (void)
6070 {
6071 putwc(0,0);
6072   ;
6073   return 0;
6074 }
6075 _ACEOF
6076 rm -f conftest.$ac_objext conftest$ac_exeext
6077 if { (eval echo "$as_me:6077: \"$ac_link\"") >&5
6078   (eval $ac_link) 2>&5
6079   ac_status=$?
6080   echo "$as_me:6080: \$? = $ac_status" >&5
6081   (exit $ac_status); } &&
6082          { ac_try='test -s conftest$ac_exeext'
6083   { (eval echo "$as_me:6083: \"$ac_try\"") >&5
6084   (eval $ac_try) 2>&5
6085   ac_status=$?
6086   echo "$as_me:6086: \$? = $ac_status" >&5
6087   (exit $ac_status); }; }; then
6088
6089         cf_cv_find_linkage_utf8=yes
6090         cf_cv_header_path_utf8=/usr/include
6091         cf_cv_library_path_utf8=/usr/lib
6092         cf_cv_library_file_utf8="-lutf8"
6093
6094 else
6095   echo "$as_me: failed program was:" >&5
6096 cat conftest.$ac_ext >&5
6097
6098         cf_cv_find_linkage_utf8=no
6099         LIBS="$cf_save_LIBS"
6100
6101         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6102
6103 echo "${as_me:-configure}:6103: testing find linkage for utf8 library ..." 1>&5
6104
6105 echo "${as_me:-configure}:6105: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6106
6107         cf_save_CPPFLAGS="$CPPFLAGS"
6108         cf_test_CPPFLAGS="$CPPFLAGS"
6109
6110 cf_search=
6111
6112 # collect the current set of include-directories from compiler flags
6113 cf_header_path_list=""
6114 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6115         for cf_header_path in $CPPFLAGS $CFLAGS
6116         do
6117                 case $cf_header_path in
6118                 (-I*)
6119                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6120
6121 test "x$cf_header_path" != "xNONE" && \
6122 test -d "$cf_header_path" && \
6123  {
6124         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6125         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6126         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6127         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6128         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6129         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6130 }
6131
6132                         cf_header_path_list="$cf_header_path_list $cf_search"
6133                         ;;
6134                 esac
6135         done
6136 fi
6137
6138 # add the variations for the package we are looking for
6139
6140 cf_search=
6141
6142 test "x$prefix" != "xNONE" && \
6143 test -d "$prefix" && \
6144  {
6145         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6146         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6147         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6148         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6149         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6150         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6151 }
6152
6153 for cf_subdir_prefix in \
6154         /usr \
6155         /usr/local \
6156         /usr/pkg \
6157         /opt \
6158         /opt/local \
6159         $HOME
6160 do
6161
6162 test "x$cf_subdir_prefix" != "x$prefix" && \
6163 test -d "$cf_subdir_prefix" && \
6164 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6165         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6166         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6167         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6168         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6169         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6170         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6171 }
6172
6173 done
6174
6175 test "$includedir" != NONE && \
6176 test "$includedir" != "/usr/include" && \
6177 test -d "$includedir" && {
6178         test -d $includedir &&    cf_search="$cf_search $includedir"
6179         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6180 }
6181
6182 test "$oldincludedir" != NONE && \
6183 test "$oldincludedir" != "/usr/include" && \
6184 test -d "$oldincludedir" && {
6185         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6186         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6187 }
6188
6189 cf_search="$cf_search $cf_header_path_list"
6190
6191         for cf_cv_header_path_utf8 in $cf_search
6192         do
6193                 if test -d $cf_cv_header_path_utf8 ; then
6194                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6195
6196 echo "${as_me:-configure}:6196: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6197
6198                         CPPFLAGS="$cf_save_CPPFLAGS"
6199
6200         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6201         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6202
6203                         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <libutf8.h>
6208 int
6209 main (void)
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext
6217 if { (eval echo "$as_me:6217: \"$ac_compile\"") >&5
6218   (eval $ac_compile) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest.$ac_objext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228
6229                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6230
6231 echo "${as_me:-configure}:6231: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6232
6233                                 cf_cv_find_linkage_utf8=maybe
6234                                 cf_test_CPPFLAGS="$CPPFLAGS"
6235                                 break
6236 else
6237   echo "$as_me: failed program was:" >&5
6238 cat conftest.$ac_ext >&5
6239
6240                                 CPPFLAGS="$cf_save_CPPFLAGS"
6241
6242 fi
6243 rm -f conftest.$ac_objext conftest.$ac_ext
6244                 fi
6245         done
6246
6247         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6248
6249 echo "${as_me:-configure}:6249: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6250
6251                 cf_save_LIBS="$LIBS"
6252                 cf_save_LDFLAGS="$LDFLAGS"
6253
6254                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6255
6256 cf_search=
6257 cf_library_path_list=""
6258 if test -n "${LDFLAGS}${LIBS}" ; then
6259         for cf_library_path in $LDFLAGS $LIBS
6260         do
6261                 case $cf_library_path in
6262                 (-L*)
6263                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6264
6265 test "x$cf_library_path" != "xNONE" && \
6266 test -d "$cf_library_path" && \
6267  {
6268         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6269         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6270         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6271         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6272         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6273         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6274 }
6275
6276                         cf_library_path_list="$cf_library_path_list $cf_search"
6277                         ;;
6278                 esac
6279         done
6280 fi
6281
6282 cf_search=
6283
6284 test "x$prefix" != "xNONE" && \
6285 test -d "$prefix" && \
6286  {
6287         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6288         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6289         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6290         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6291         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6292         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6293 }
6294
6295 for cf_subdir_prefix in \
6296         /usr \
6297         /usr/local \
6298         /usr/pkg \
6299         /opt \
6300         /opt/local \
6301         $HOME
6302 do
6303
6304 test "x$cf_subdir_prefix" != "x$prefix" && \
6305 test -d "$cf_subdir_prefix" && \
6306 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6307         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6308         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6309         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6310         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6311         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6312         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6313 }
6314
6315 done
6316
6317 cf_search="$cf_library_path_list $cf_search"
6318
6319                         for cf_cv_library_path_utf8 in $cf_search
6320                         do
6321                                 if test -d $cf_cv_library_path_utf8 ; then
6322                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6323
6324 echo "${as_me:-configure}:6324: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6325
6326                                         CPPFLAGS="$cf_test_CPPFLAGS"
6327                                         LIBS="-lutf8  $cf_save_LIBS"
6328                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6329                                         cat >conftest.$ac_ext <<_ACEOF
6330 #line 6330 "configure"
6331 #include "confdefs.h"
6332
6333 #include <libutf8.h>
6334 int
6335 main (void)
6336 {
6337 putwc(0,0);
6338   ;
6339   return 0;
6340 }
6341 _ACEOF
6342 rm -f conftest.$ac_objext conftest$ac_exeext
6343 if { (eval echo "$as_me:6343: \"$ac_link\"") >&5
6344   (eval $ac_link) 2>&5
6345   ac_status=$?
6346   echo "$as_me:6346: \$? = $ac_status" >&5
6347   (exit $ac_status); } &&
6348          { ac_try='test -s conftest$ac_exeext'
6349   { (eval echo "$as_me:6349: \"$ac_try\"") >&5
6350   (eval $ac_try) 2>&5
6351   ac_status=$?
6352   echo "$as_me:6352: \$? = $ac_status" >&5
6353   (exit $ac_status); }; }; then
6354
6355                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6356
6357 echo "${as_me:-configure}:6357: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6358
6359                                         cf_cv_find_linkage_utf8=yes
6360                                         cf_cv_library_file_utf8="-lutf8"
6361                                         break
6362 else
6363   echo "$as_me: failed program was:" >&5
6364 cat conftest.$ac_ext >&5
6365
6366                                         CPPFLAGS="$cf_save_CPPFLAGS"
6367                                         LIBS="$cf_save_LIBS"
6368                                         LDFLAGS="$cf_save_LDFLAGS"
6369
6370 fi
6371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6372                                 fi
6373                         done
6374                         CPPFLAGS="$cf_save_CPPFLAGS"
6375                         LDFLAGS="$cf_save_LDFLAGS"
6376                 fi
6377
6378         else
6379                 cf_cv_find_linkage_utf8=no
6380         fi
6381
6382 fi
6383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6384
6385 fi
6386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6387
6388 LIBS="$cf_save_LIBS"
6389
6390 if test "$cf_cv_find_linkage_utf8" = yes ; then
6391 cf_cv_utf8_lib=add-on
6392 else
6393 cf_cv_utf8_lib=no
6394 fi
6395
6396 fi
6397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6398 fi
6399 echo "$as_me:6399: result: $cf_cv_utf8_lib" >&5
6400 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6401
6402 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6403 # ncurses/ncursesw:
6404 if test "$cf_cv_utf8_lib" = "add-on" ; then
6405
6406 cat >>confdefs.h <<\EOF
6407 #define HAVE_LIBUTF8_H 1
6408 EOF
6409
6410 if test -n "$cf_cv_header_path_utf8" ; then
6411   for cf_add_incdir in $cf_cv_header_path_utf8
6412   do
6413         while test $cf_add_incdir != /usr/include
6414         do
6415           if test -d $cf_add_incdir
6416           then
6417                 cf_have_incdir=no
6418                 if test -n "$CFLAGS$CPPFLAGS" ; then
6419                   # a loop is needed to ensure we can add subdirs of existing dirs
6420                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6421                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6422                           cf_have_incdir=yes; break
6423                         fi
6424                   done
6425                 fi
6426
6427                 if test "$cf_have_incdir" = no ; then
6428                   if test "$cf_add_incdir" = /usr/local/include ; then
6429                         if test "$GCC" = yes
6430                         then
6431                           cf_save_CPPFLAGS=$CPPFLAGS
6432
6433         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6434         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6435
6436                           cat >conftest.$ac_ext <<_ACEOF
6437 #line 6437 "configure"
6438 #include "confdefs.h"
6439 #include <stdio.h>
6440 int
6441 main (void)
6442 {
6443 printf("Hello")
6444   ;
6445   return 0;
6446 }
6447 _ACEOF
6448 rm -f conftest.$ac_objext
6449 if { (eval echo "$as_me:6449: \"$ac_compile\"") >&5
6450   (eval $ac_compile) 2>&5
6451   ac_status=$?
6452   echo "$as_me:6452: \$? = $ac_status" >&5
6453   (exit $ac_status); } &&
6454          { ac_try='test -s conftest.$ac_objext'
6455   { (eval echo "$as_me:6455: \"$ac_try\"") >&5
6456   (eval $ac_try) 2>&5
6457   ac_status=$?
6458   echo "$as_me:6458: \$? = $ac_status" >&5
6459   (exit $ac_status); }; }; then
6460   :
6461 else
6462   echo "$as_me: failed program was:" >&5
6463 cat conftest.$ac_ext >&5
6464 cf_have_incdir=yes
6465 fi
6466 rm -f conftest.$ac_objext conftest.$ac_ext
6467                           CPPFLAGS=$cf_save_CPPFLAGS
6468                         fi
6469                   fi
6470                 fi
6471
6472                 if test "$cf_have_incdir" = no ; then
6473                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6474
6475 echo "${as_me:-configure}:6475: testing adding $cf_add_incdir to include-path ..." 1>&5
6476
6477                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6478
6479                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6480                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6481                   cf_add_incdir="$cf_top_incdir"
6482                 else
6483                   break
6484                 fi
6485           else
6486                 break
6487           fi
6488         done
6489   done
6490 fi
6491
6492 if test -n "$cf_cv_library_path_utf8" ; then
6493         for cf_add_libdir in $cf_cv_library_path_utf8
6494         do
6495                 if test $cf_add_libdir = /usr/lib ; then
6496                         :
6497                 elif test -d $cf_add_libdir
6498                 then
6499                         cf_have_libdir=no
6500                         if test -n "$LDFLAGS$LIBS" ; then
6501                                 # a loop is needed to ensure we can add subdirs of existing dirs
6502                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6503                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6504                                                 cf_have_libdir=yes; break
6505                                         fi
6506                                 done
6507                         fi
6508                         if test "$cf_have_libdir" = no ; then
6509                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6510
6511 echo "${as_me:-configure}:6511: testing adding $cf_add_libdir to library-path ..." 1>&5
6512
6513                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6514                         fi
6515                 fi
6516         done
6517 fi
6518
6519 cf_add_libs="$LIBS"
6520 # reverse order
6521 cf_add_0lib=
6522 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6523 # filter duplicates
6524 for cf_add_1lib in $cf_add_0lib; do
6525         for cf_add_2lib in $cf_add_libs; do
6526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6527                         cf_add_1lib=
6528                         break
6529                 fi
6530         done
6531         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6532 done
6533 LIBS="$cf_add_libs"
6534
6535 fi
6536
6537 cf_ncuconfig_root=ncursesw
6538 cf_have_ncuconfig=no
6539
6540 if test "x${PKG_CONFIG:=none}" != xnone; then
6541         echo "$as_me:6541: checking pkg-config for $cf_ncuconfig_root" >&5
6542 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6543         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6544                 echo "$as_me:6544: result: yes" >&5
6545 echo "${ECHO_T}yes" >&6
6546
6547                 echo "$as_me:6547: checking if the $cf_ncuconfig_root package files work" >&5
6548 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6549                 cf_have_ncuconfig=unknown
6550
6551                 cf_save_CPPFLAGS="$CPPFLAGS"
6552                 cf_save_LIBS="$LIBS"
6553
6554 cf_fix_cppflags=no
6555 cf_new_cflags=
6556 cf_new_cppflags=
6557 cf_new_extra_cppflags=
6558
6559 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
6560 do
6561 case $cf_fix_cppflags in
6562 (no)
6563         case $cf_add_cflags in
6564         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6565                 case $cf_add_cflags in
6566                 (-D*)
6567                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6568
6569                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6570                                 && test -z "${cf_tst_cflags}" \
6571                                 && cf_fix_cppflags=yes
6572
6573                         if test $cf_fix_cppflags = yes ; then
6574
6575         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6576         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6577
6578                                 continue
6579                         elif test "${cf_tst_cflags}" = "\"'" ; then
6580
6581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6583
6584                                 continue
6585                         fi
6586                         ;;
6587                 esac
6588                 case "$CPPFLAGS" in
6589                 (*$cf_add_cflags)
6590                         ;;
6591                 (*)
6592                         case $cf_add_cflags in
6593                         (-D*)
6594                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6595
6596 CPPFLAGS=`echo "$CPPFLAGS" | \
6597         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6598                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6599
6600                                 ;;
6601                         esac
6602
6603         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6604         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6605
6606                         ;;
6607                 esac
6608                 ;;
6609         (*)
6610
6611         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6612         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6613
6614                 ;;
6615         esac
6616         ;;
6617 (yes)
6618
6619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6621
6622         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6623
6624         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6625                 && test -z "${cf_tst_cflags}" \
6626                 && cf_fix_cppflags=no
6627         ;;
6628 esac
6629 done
6630
6631 if test -n "$cf_new_cflags" ; then
6632
6633         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6634         CFLAGS="${CFLAGS}$cf_new_cflags"
6635
6636 fi
6637
6638 if test -n "$cf_new_cppflags" ; then
6639
6640         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6641         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6642
6643 fi
6644
6645 if test -n "$cf_new_extra_cppflags" ; then
6646
6647         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6648         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6649
6650 fi
6651
6652 cf_add_libs="$LIBS"
6653 # reverse order
6654 cf_add_0lib=
6655 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6656 # filter duplicates
6657 for cf_add_1lib in $cf_add_0lib; do
6658         for cf_add_2lib in $cf_add_libs; do
6659                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6660                         cf_add_1lib=
6661                         break
6662                 fi
6663         done
6664         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6665 done
6666 LIBS="$cf_add_libs"
6667
6668                 cat >conftest.$ac_ext <<_ACEOF
6669 #line 6669 "configure"
6670 #include "confdefs.h"
6671 #include <${cf_cv_ncurses_header:-curses.h}>
6672 int
6673 main (void)
6674 {
6675 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6676   ;
6677   return 0;
6678 }
6679 _ACEOF
6680 rm -f conftest.$ac_objext conftest$ac_exeext
6681 if { (eval echo "$as_me:6681: \"$ac_link\"") >&5
6682   (eval $ac_link) 2>&5
6683   ac_status=$?
6684   echo "$as_me:6684: \$? = $ac_status" >&5
6685   (exit $ac_status); } &&
6686          { ac_try='test -s conftest$ac_exeext'
6687   { (eval echo "$as_me:6687: \"$ac_try\"") >&5
6688   (eval $ac_try) 2>&5
6689   ac_status=$?
6690   echo "$as_me:6690: \$? = $ac_status" >&5
6691   (exit $ac_status); }; }; then
6692   if test "$cross_compiling" = yes; then
6693   cf_have_ncuconfig=maybe
6694 else
6695   cat >conftest.$ac_ext <<_ACEOF
6696 #line 6696 "configure"
6697 #include "confdefs.h"
6698 #include <${cf_cv_ncurses_header:-curses.h}>
6699                                 int main(void)
6700                                 { char *xx = curses_version(); return (xx == 0); }
6701 _ACEOF
6702 rm -f conftest$ac_exeext
6703 if { (eval echo "$as_me:6703: \"$ac_link\"") >&5
6704   (eval $ac_link) 2>&5
6705   ac_status=$?
6706   echo "$as_me:6706: \$? = $ac_status" >&5
6707   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6708   { (eval echo "$as_me:6708: \"$ac_try\"") >&5
6709   (eval $ac_try) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit $ac_status); }; }; then
6713   cf_have_ncuconfig=yes
6714 else
6715   echo "$as_me: program exited with status $ac_status" >&5
6716 echo "$as_me: failed program was:" >&5
6717 cat conftest.$ac_ext >&5
6718 cf_have_ncuconfig=no
6719 fi
6720 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6721 fi
6722 else
6723   echo "$as_me: failed program was:" >&5
6724 cat conftest.$ac_ext >&5
6725 cf_have_ncuconfig=no
6726 fi
6727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6728                 echo "$as_me:6728: result: $cf_have_ncuconfig" >&5
6729 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6730                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6731                 if test "$cf_have_ncuconfig" != "yes"
6732                 then
6733                         CPPFLAGS="$cf_save_CPPFLAGS"
6734                         LIBS="$cf_save_LIBS"
6735                         NCURSES_CONFIG_PKG=none
6736                 else
6737
6738 cat >>confdefs.h <<\EOF
6739 #define NCURSES 1
6740 EOF
6741
6742                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6743
6744 echo "$as_me:6744: checking for terminfo header" >&5
6745 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6746 if test "${cf_cv_term_header+set}" = set; then
6747   echo $ECHO_N "(cached) $ECHO_C" >&6
6748 else
6749
6750 case ${cf_cv_ncurses_header} in
6751 (*/ncurses.h|*/ncursesw.h)
6752         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6753         ;;
6754 (*)
6755         cf_term_header=term.h
6756         ;;
6757 esac
6758
6759 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6760 do
6761 cat >conftest.$ac_ext <<_ACEOF
6762 #line 6762 "configure"
6763 #include "confdefs.h"
6764 #include <stdio.h>
6765 #include <${cf_cv_ncurses_header:-curses.h}>
6766 #include <$cf_test>
6767
6768 int
6769 main (void)
6770 {
6771 int x = auto_left_margin
6772   ;
6773   return 0;
6774 }
6775 _ACEOF
6776 rm -f conftest.$ac_objext
6777 if { (eval echo "$as_me:6777: \"$ac_compile\"") >&5
6778   (eval $ac_compile) 2>&5
6779   ac_status=$?
6780   echo "$as_me:6780: \$? = $ac_status" >&5
6781   (exit $ac_status); } &&
6782          { ac_try='test -s conftest.$ac_objext'
6783   { (eval echo "$as_me:6783: \"$ac_try\"") >&5
6784   (eval $ac_try) 2>&5
6785   ac_status=$?
6786   echo "$as_me:6786: \$? = $ac_status" >&5
6787   (exit $ac_status); }; }; then
6788
6789         cf_cv_term_header="$cf_test"
6790 else
6791   echo "$as_me: failed program was:" >&5
6792 cat conftest.$ac_ext >&5
6793
6794         cf_cv_term_header=unknown
6795
6796 fi
6797 rm -f conftest.$ac_objext conftest.$ac_ext
6798         test "$cf_cv_term_header" != unknown && break
6799 done
6800
6801 fi
6802 echo "$as_me:6802: result: $cf_cv_term_header" >&5
6803 echo "${ECHO_T}$cf_cv_term_header" >&6
6804
6805 # Set definitions to allow ifdef'ing to accommodate subdirectories
6806
6807 case $cf_cv_term_header in
6808 (*term.h)
6809
6810 cat >>confdefs.h <<\EOF
6811 #define HAVE_TERM_H 1
6812 EOF
6813
6814         ;;
6815 esac
6816
6817 case $cf_cv_term_header in
6818 (ncurses/term.h)
6819
6820 cat >>confdefs.h <<\EOF
6821 #define HAVE_NCURSES_TERM_H 1
6822 EOF
6823
6824         ;;
6825 (ncursesw/term.h)
6826
6827 cat >>confdefs.h <<\EOF
6828 #define HAVE_NCURSESW_TERM_H 1
6829 EOF
6830
6831         ;;
6832 esac
6833
6834                 fi
6835
6836         else
6837                 echo "$as_me:6837: result: no" >&5
6838 echo "${ECHO_T}no" >&6
6839                 NCURSES_CONFIG_PKG=none
6840         fi
6841 else
6842         NCURSES_CONFIG_PKG=none
6843 fi
6844
6845 if test "x$cf_have_ncuconfig" = "xno"; then
6846         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6847
6848 if test -n "$ac_tool_prefix"; then
6849   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6850   do
6851     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6852 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6853 echo "$as_me:6853: checking for $ac_word" >&5
6854 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6855 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6856   echo $ECHO_N "(cached) $ECHO_C" >&6
6857 else
6858   if test -n "$NCURSES_CONFIG"; then
6859   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6860 else
6861   ac_save_IFS=$IFS; IFS=$ac_path_separator
6862 ac_dummy="$PATH"
6863 for ac_dir in $ac_dummy; do
6864   IFS=$ac_save_IFS
6865   test -z "$ac_dir" && ac_dir=.
6866   $as_executable_p "$ac_dir/$ac_word" || continue
6867 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6868 echo "$as_me:6868: found $ac_dir/$ac_word" >&5
6869 break
6870 done
6871
6872 fi
6873 fi
6874 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6875 if test -n "$NCURSES_CONFIG"; then
6876   echo "$as_me:6876: result: $NCURSES_CONFIG" >&5
6877 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6878 else
6879   echo "$as_me:6879: result: no" >&5
6880 echo "${ECHO_T}no" >&6
6881 fi
6882
6883     test -n "$NCURSES_CONFIG" && break
6884   done
6885 fi
6886 if test -z "$NCURSES_CONFIG"; then
6887   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6888   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6889 do
6890   # Extract the first word of "$ac_prog", so it can be a program name with args.
6891 set dummy $ac_prog; ac_word=$2
6892 echo "$as_me:6892: checking for $ac_word" >&5
6893 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6894 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6895   echo $ECHO_N "(cached) $ECHO_C" >&6
6896 else
6897   if test -n "$ac_ct_NCURSES_CONFIG"; then
6898   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6899 else
6900   ac_save_IFS=$IFS; IFS=$ac_path_separator
6901 ac_dummy="$PATH"
6902 for ac_dir in $ac_dummy; do
6903   IFS=$ac_save_IFS
6904   test -z "$ac_dir" && ac_dir=.
6905   $as_executable_p "$ac_dir/$ac_word" || continue
6906 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6907 echo "$as_me:6907: found $ac_dir/$ac_word" >&5
6908 break
6909 done
6910
6911 fi
6912 fi
6913 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6914 if test -n "$ac_ct_NCURSES_CONFIG"; then
6915   echo "$as_me:6915: result: $ac_ct_NCURSES_CONFIG" >&5
6916 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6917 else
6918   echo "$as_me:6918: result: no" >&5
6919 echo "${ECHO_T}no" >&6
6920 fi
6921
6922   test -n "$ac_ct_NCURSES_CONFIG" && break
6923 done
6924 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6925
6926   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6927 fi
6928
6929         if test "$NCURSES_CONFIG" != none ; then
6930
6931 cf_fix_cppflags=no
6932 cf_new_cflags=
6933 cf_new_cppflags=
6934 cf_new_extra_cppflags=
6935
6936 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
6937 do
6938 case $cf_fix_cppflags in
6939 (no)
6940         case $cf_add_cflags in
6941         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6942                 case $cf_add_cflags in
6943                 (-D*)
6944                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6945
6946                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6947                                 && test -z "${cf_tst_cflags}" \
6948                                 && cf_fix_cppflags=yes
6949
6950                         if test $cf_fix_cppflags = yes ; then
6951
6952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6954
6955                                 continue
6956                         elif test "${cf_tst_cflags}" = "\"'" ; then
6957
6958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6960
6961                                 continue
6962                         fi
6963                         ;;
6964                 esac
6965                 case "$CPPFLAGS" in
6966                 (*$cf_add_cflags)
6967                         ;;
6968                 (*)
6969                         case $cf_add_cflags in
6970                         (-D*)
6971                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6972
6973 CPPFLAGS=`echo "$CPPFLAGS" | \
6974         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6975                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6976
6977                                 ;;
6978                         esac
6979
6980         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6981         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6982
6983                         ;;
6984                 esac
6985                 ;;
6986         (*)
6987
6988         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6989         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6990
6991                 ;;
6992         esac
6993         ;;
6994 (yes)
6995
6996         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6997         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6998
6999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7000
7001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7002                 && test -z "${cf_tst_cflags}" \
7003                 && cf_fix_cppflags=no
7004         ;;
7005 esac
7006 done
7007
7008 if test -n "$cf_new_cflags" ; then
7009
7010         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7011         CFLAGS="${CFLAGS}$cf_new_cflags"
7012
7013 fi
7014
7015 if test -n "$cf_new_cppflags" ; then
7016
7017         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7018         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7019
7020 fi
7021
7022 if test -n "$cf_new_extra_cppflags" ; then
7023
7024         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7025         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7026
7027 fi
7028
7029 cf_add_libs="$LIBS"
7030 # reverse order
7031 cf_add_0lib=
7032 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7033 # filter duplicates
7034 for cf_add_1lib in $cf_add_0lib; do
7035         for cf_add_2lib in $cf_add_libs; do
7036                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7037                         cf_add_1lib=
7038                         break
7039                 fi
7040         done
7041         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7042 done
7043 LIBS="$cf_add_libs"
7044
7045                 # even with config script, some packages use no-override for curses.h
7046
7047 echo "$as_me:7047: checking if we have identified curses headers" >&5
7048 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7049 if test "${cf_cv_ncurses_header+set}" = set; then
7050   echo $ECHO_N "(cached) $ECHO_C" >&6
7051 else
7052
7053 cf_cv_ncurses_header=none
7054 for cf_header in \
7055         ncurses.h ncursesw/ncurses.h \
7056         curses.h ncursesw/curses.h
7057 do
7058 cat >conftest.$ac_ext <<_ACEOF
7059 #line 7059 "configure"
7060 #include "confdefs.h"
7061 #include <${cf_header}>
7062 int
7063 main (void)
7064 {
7065 initscr(); tgoto("?", 0,0)
7066   ;
7067   return 0;
7068 }
7069 _ACEOF
7070 rm -f conftest.$ac_objext
7071 if { (eval echo "$as_me:7071: \"$ac_compile\"") >&5
7072   (eval $ac_compile) 2>&5
7073   ac_status=$?
7074   echo "$as_me:7074: \$? = $ac_status" >&5
7075   (exit $ac_status); } &&
7076          { ac_try='test -s conftest.$ac_objext'
7077   { (eval echo "$as_me:7077: \"$ac_try\"") >&5
7078   (eval $ac_try) 2>&5
7079   ac_status=$?
7080   echo "$as_me:7080: \$? = $ac_status" >&5
7081   (exit $ac_status); }; }; then
7082   cf_cv_ncurses_header=$cf_header; break
7083 else
7084   echo "$as_me: failed program was:" >&5
7085 cat conftest.$ac_ext >&5
7086 fi
7087 rm -f conftest.$ac_objext conftest.$ac_ext
7088 done
7089
7090 fi
7091 echo "$as_me:7091: result: $cf_cv_ncurses_header" >&5
7092 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7093
7094 if test "$cf_cv_ncurses_header" = none ; then
7095         { { echo "$as_me:7095: error: No curses header-files found" >&5
7096 echo "$as_me: error: No curses header-files found" >&2;}
7097    { (exit 1); exit 1; }; }
7098 fi
7099
7100 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7101
7102 for ac_header in $cf_cv_ncurses_header
7103 do
7104 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7105 echo "$as_me:7105: checking for $ac_header" >&5
7106 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7107 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7108   echo $ECHO_N "(cached) $ECHO_C" >&6
7109 else
7110   cat >conftest.$ac_ext <<_ACEOF
7111 #line 7111 "configure"
7112 #include "confdefs.h"
7113 #include <$ac_header>
7114 _ACEOF
7115 if { (eval echo "$as_me:7115: \"$ac_cpp conftest.$ac_ext\"") >&5
7116   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7117   ac_status=$?
7118   egrep -v '^ *\+' conftest.er1 >conftest.err
7119   rm -f conftest.er1
7120   cat conftest.err >&5
7121   echo "$as_me:7121: \$? = $ac_status" >&5
7122   (exit $ac_status); } >/dev/null; then
7123   if test -s conftest.err; then
7124     ac_cpp_err=$ac_c_preproc_warn_flag
7125   else
7126     ac_cpp_err=
7127   fi
7128 else
7129   ac_cpp_err=yes
7130 fi
7131 if test -z "$ac_cpp_err"; then
7132   eval "$as_ac_Header=yes"
7133 else
7134   echo "$as_me: failed program was:" >&5
7135   cat conftest.$ac_ext >&5
7136   eval "$as_ac_Header=no"
7137 fi
7138 rm -f conftest.err conftest.$ac_ext
7139 fi
7140 echo "$as_me:7140: result: `eval echo '${'$as_ac_Header'}'`" >&5
7141 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7142 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7143   cat >>confdefs.h <<EOF
7144 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7145 EOF
7146
7147 fi
7148 done
7149
7150 cat >>confdefs.h <<\EOF
7151 #define NCURSES 1
7152 EOF
7153
7154 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7155
7156                 cat >>confdefs.h <<EOF
7157 #define $cf_nculib_ROOT 1
7158 EOF
7159
7160                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7161
7162         else
7163
7164 cf_ncuhdr_root=ncursesw
7165
7166 test -n "$cf_cv_curses_dir" && \
7167 test "$cf_cv_curses_dir" != "no" && { \
7168
7169 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7170   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7171   do
7172         while test $cf_add_incdir != /usr/include
7173         do
7174           if test -d $cf_add_incdir
7175           then
7176                 cf_have_incdir=no
7177                 if test -n "$CFLAGS$CPPFLAGS" ; then
7178                   # a loop is needed to ensure we can add subdirs of existing dirs
7179                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7180                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7181                           cf_have_incdir=yes; break
7182                         fi
7183                   done
7184                 fi
7185
7186                 if test "$cf_have_incdir" = no ; then
7187                   if test "$cf_add_incdir" = /usr/local/include ; then
7188                         if test "$GCC" = yes
7189                         then
7190                           cf_save_CPPFLAGS=$CPPFLAGS
7191
7192         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7193         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7194
7195                           cat >conftest.$ac_ext <<_ACEOF
7196 #line 7196 "configure"
7197 #include "confdefs.h"
7198 #include <stdio.h>
7199 int
7200 main (void)
7201 {
7202 printf("Hello")
7203   ;
7204   return 0;
7205 }
7206 _ACEOF
7207 rm -f conftest.$ac_objext
7208 if { (eval echo "$as_me:7208: \"$ac_compile\"") >&5
7209   (eval $ac_compile) 2>&5
7210   ac_status=$?
7211   echo "$as_me:7211: \$? = $ac_status" >&5
7212   (exit $ac_status); } &&
7213          { ac_try='test -s conftest.$ac_objext'
7214   { (eval echo "$as_me:7214: \"$ac_try\"") >&5
7215   (eval $ac_try) 2>&5
7216   ac_status=$?
7217   echo "$as_me:7217: \$? = $ac_status" >&5
7218   (exit $ac_status); }; }; then
7219   :
7220 else
7221   echo "$as_me: failed program was:" >&5
7222 cat conftest.$ac_ext >&5
7223 cf_have_incdir=yes
7224 fi
7225 rm -f conftest.$ac_objext conftest.$ac_ext
7226                           CPPFLAGS=$cf_save_CPPFLAGS
7227                         fi
7228                   fi
7229                 fi
7230
7231                 if test "$cf_have_incdir" = no ; then
7232                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7233
7234 echo "${as_me:-configure}:7234: testing adding $cf_add_incdir to include-path ..." 1>&5
7235
7236                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7237
7238                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7239                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7240                   cf_add_incdir="$cf_top_incdir"
7241                 else
7242                   break
7243                 fi
7244           else
7245                 break
7246           fi
7247         done
7248   done
7249 fi
7250
7251 }
7252
7253 echo "$as_me:7253: checking for $cf_ncuhdr_root header in include-path" >&5
7254 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7255 if test "${cf_cv_ncurses_h+set}" = set; then
7256   echo $ECHO_N "(cached) $ECHO_C" >&6
7257 else
7258
7259         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7260         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7261         for cf_header in $cf_header_list
7262         do
7263
7264         cat >conftest.$ac_ext <<_ACEOF
7265 #line 7265 "configure"
7266 #include "confdefs.h"
7267
7268 #define _XOPEN_SOURCE_EXTENDED
7269 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7270 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7271
7272 #include <$cf_header>
7273 int
7274 main (void)
7275 {
7276
7277 #ifdef NCURSES_VERSION
7278
7279 #ifndef WACS_BSSB
7280         make an error
7281 #endif
7282
7283 printf("%s\n", NCURSES_VERSION);
7284 #else
7285 #ifdef __NCURSES_H
7286 printf("old\n");
7287 #else
7288         make an error
7289 #endif
7290 #endif
7291
7292   ;
7293   return 0;
7294 }
7295 _ACEOF
7296 rm -f conftest.$ac_objext
7297 if { (eval echo "$as_me:7297: \"$ac_compile\"") >&5
7298   (eval $ac_compile) 2>&5
7299   ac_status=$?
7300   echo "$as_me:7300: \$? = $ac_status" >&5
7301   (exit $ac_status); } &&
7302          { ac_try='test -s conftest.$ac_objext'
7303   { (eval echo "$as_me:7303: \"$ac_try\"") >&5
7304   (eval $ac_try) 2>&5
7305   ac_status=$?
7306   echo "$as_me:7306: \$? = $ac_status" >&5
7307   (exit $ac_status); }; }; then
7308   cf_cv_ncurses_h=$cf_header
7309
7310 else
7311   echo "$as_me: failed program was:" >&5
7312 cat conftest.$ac_ext >&5
7313 cf_cv_ncurses_h=no
7314 fi
7315 rm -f conftest.$ac_objext conftest.$ac_ext
7316
7317                 test "$cf_cv_ncurses_h" != no && break
7318         done
7319
7320 fi
7321 echo "$as_me:7321: result: $cf_cv_ncurses_h" >&5
7322 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7323
7324 if test "$cf_cv_ncurses_h" != no ; then
7325         cf_cv_ncurses_header=$cf_cv_ncurses_h
7326 else
7327
7328 echo "$as_me:7328: checking for $cf_ncuhdr_root include-path" >&5
7329 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7330 if test "${cf_cv_ncurses_h2+set}" = set; then
7331   echo $ECHO_N "(cached) $ECHO_C" >&6
7332 else
7333
7334         test -n "$verbose" && echo
7335
7336 cf_search=
7337
7338 # collect the current set of include-directories from compiler flags
7339 cf_header_path_list=""
7340 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7341         for cf_header_path in $CPPFLAGS $CFLAGS
7342         do
7343                 case $cf_header_path in
7344                 (-I*)
7345                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7346
7347 test "x$cf_header_path" != "xNONE" && \
7348 test -d "$cf_header_path" && \
7349  {
7350         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7351         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7352         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7353         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7354         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7355         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"
7356 }
7357
7358                         cf_header_path_list="$cf_header_path_list $cf_search"
7359                         ;;
7360                 esac
7361         done
7362 fi
7363
7364 # add the variations for the package we are looking for
7365
7366 cf_search=
7367
7368 test "x$prefix" != "xNONE" && \
7369 test -d "$prefix" && \
7370  {
7371         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7372         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7373         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7374         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7375         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7376         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7377 }
7378
7379 for cf_subdir_prefix in \
7380         /usr \
7381         /usr/local \
7382         /usr/pkg \
7383         /opt \
7384         /opt/local \
7385         $HOME
7386 do
7387
7388 test "x$cf_subdir_prefix" != "x$prefix" && \
7389 test -d "$cf_subdir_prefix" && \
7390 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7391         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7392         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7393         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7394         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7395         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7396         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"
7397 }
7398
7399 done
7400
7401 test "$includedir" != NONE && \
7402 test "$includedir" != "/usr/include" && \
7403 test -d "$includedir" && {
7404         test -d $includedir &&    cf_search="$cf_search $includedir"
7405         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7406 }
7407
7408 test "$oldincludedir" != NONE && \
7409 test "$oldincludedir" != "/usr/include" && \
7410 test -d "$oldincludedir" && {
7411         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7412         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7413 }
7414
7415 cf_search="$cf_search $cf_header_path_list"
7416
7417         test -n "$verbose" && echo search path $cf_search
7418         cf_save2_CPPFLAGS="$CPPFLAGS"
7419         for cf_incdir in $cf_search
7420         do
7421
7422 if test -n "$cf_incdir" ; then
7423   for cf_add_incdir in $cf_incdir
7424   do
7425         while test $cf_add_incdir != /usr/include
7426         do
7427           if test -d $cf_add_incdir
7428           then
7429                 cf_have_incdir=no
7430                 if test -n "$CFLAGS$CPPFLAGS" ; then
7431                   # a loop is needed to ensure we can add subdirs of existing dirs
7432                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7433                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7434                           cf_have_incdir=yes; break
7435                         fi
7436                   done
7437                 fi
7438
7439                 if test "$cf_have_incdir" = no ; then
7440                   if test "$cf_add_incdir" = /usr/local/include ; then
7441                         if test "$GCC" = yes
7442                         then
7443                           cf_save_CPPFLAGS=$CPPFLAGS
7444
7445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7446         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7447
7448                           cat >conftest.$ac_ext <<_ACEOF
7449 #line 7449 "configure"
7450 #include "confdefs.h"
7451 #include <stdio.h>
7452 int
7453 main (void)
7454 {
7455 printf("Hello")
7456   ;
7457   return 0;
7458 }
7459 _ACEOF
7460 rm -f conftest.$ac_objext
7461 if { (eval echo "$as_me:7461: \"$ac_compile\"") >&5
7462   (eval $ac_compile) 2>&5
7463   ac_status=$?
7464   echo "$as_me:7464: \$? = $ac_status" >&5
7465   (exit $ac_status); } &&
7466          { ac_try='test -s conftest.$ac_objext'
7467   { (eval echo "$as_me:7467: \"$ac_try\"") >&5
7468   (eval $ac_try) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); }; }; then
7472   :
7473 else
7474   echo "$as_me: failed program was:" >&5
7475 cat conftest.$ac_ext >&5
7476 cf_have_incdir=yes
7477 fi
7478 rm -f conftest.$ac_objext conftest.$ac_ext
7479                           CPPFLAGS=$cf_save_CPPFLAGS
7480                         fi
7481                   fi
7482                 fi
7483
7484                 if test "$cf_have_incdir" = no ; then
7485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7486
7487 echo "${as_me:-configure}:7487: testing adding $cf_add_incdir to include-path ..." 1>&5
7488
7489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7490
7491                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7493                   cf_add_incdir="$cf_top_incdir"
7494                 else
7495                   break
7496                 fi
7497           else
7498                 break
7499           fi
7500         done
7501   done
7502 fi
7503
7504                 for cf_header in \
7505                         ncurses.h \
7506                         curses.h
7507                 do
7508
7509         cat >conftest.$ac_ext <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512
7513 #include <$cf_header>
7514 int
7515 main (void)
7516 {
7517
7518 #ifdef NCURSES_VERSION
7519
7520 printf("%s\n", NCURSES_VERSION);
7521 #else
7522 #ifdef __NCURSES_H
7523 printf("old\n");
7524 #else
7525         make an error
7526 #endif
7527 #endif
7528
7529   ;
7530   return 0;
7531 }
7532 _ACEOF
7533 rm -f conftest.$ac_objext
7534 if { (eval echo "$as_me:7534: \"$ac_compile\"") >&5
7535   (eval $ac_compile) 2>&5
7536   ac_status=$?
7537   echo "$as_me:7537: \$? = $ac_status" >&5
7538   (exit $ac_status); } &&
7539          { ac_try='test -s conftest.$ac_objext'
7540   { (eval echo "$as_me:7540: \"$ac_try\"") >&5
7541   (eval $ac_try) 2>&5
7542   ac_status=$?
7543   echo "$as_me:7543: \$? = $ac_status" >&5
7544   (exit $ac_status); }; }; then
7545   cf_cv_ncurses_h2=$cf_header
7546
7547 else
7548   echo "$as_me: failed program was:" >&5
7549 cat conftest.$ac_ext >&5
7550 cf_cv_ncurses_h2=no
7551 fi
7552 rm -f conftest.$ac_objext conftest.$ac_ext
7553
7554                         if test "$cf_cv_ncurses_h2" != no ; then
7555                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7556                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7557                                 break
7558                         fi
7559                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7560                 done
7561                 CPPFLAGS="$cf_save2_CPPFLAGS"
7562                 test "$cf_cv_ncurses_h2" != no && break
7563         done
7564         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7564: error: not found" >&5
7565 echo "$as_me: error: not found" >&2;}
7566    { (exit 1); exit 1; }; }
7567
7568 fi
7569 echo "$as_me:7569: result: $cf_cv_ncurses_h2" >&5
7570 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7571
7572         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7573         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7574         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7575                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7576         fi
7577
7578 if test -n "$cf_1st_incdir" ; then
7579   for cf_add_incdir in $cf_1st_incdir
7580   do
7581         while test $cf_add_incdir != /usr/include
7582         do
7583           if test -d $cf_add_incdir
7584           then
7585                 cf_have_incdir=no
7586                 if test -n "$CFLAGS$CPPFLAGS" ; then
7587                   # a loop is needed to ensure we can add subdirs of existing dirs
7588                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7589                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7590                           cf_have_incdir=yes; break
7591                         fi
7592                   done
7593                 fi
7594
7595                 if test "$cf_have_incdir" = no ; then
7596                   if test "$cf_add_incdir" = /usr/local/include ; then
7597                         if test "$GCC" = yes
7598                         then
7599                           cf_save_CPPFLAGS=$CPPFLAGS
7600
7601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7602         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7603
7604                           cat >conftest.$ac_ext <<_ACEOF
7605 #line 7605 "configure"
7606 #include "confdefs.h"
7607 #include <stdio.h>
7608 int
7609 main (void)
7610 {
7611 printf("Hello")
7612   ;
7613   return 0;
7614 }
7615 _ACEOF
7616 rm -f conftest.$ac_objext
7617 if { (eval echo "$as_me:7617: \"$ac_compile\"") >&5
7618   (eval $ac_compile) 2>&5
7619   ac_status=$?
7620   echo "$as_me:7620: \$? = $ac_status" >&5
7621   (exit $ac_status); } &&
7622          { ac_try='test -s conftest.$ac_objext'
7623   { (eval echo "$as_me:7623: \"$ac_try\"") >&5
7624   (eval $ac_try) 2>&5
7625   ac_status=$?
7626   echo "$as_me:7626: \$? = $ac_status" >&5
7627   (exit $ac_status); }; }; then
7628   :
7629 else
7630   echo "$as_me: failed program was:" >&5
7631 cat conftest.$ac_ext >&5
7632 cf_have_incdir=yes
7633 fi
7634 rm -f conftest.$ac_objext conftest.$ac_ext
7635                           CPPFLAGS=$cf_save_CPPFLAGS
7636                         fi
7637                   fi
7638                 fi
7639
7640                 if test "$cf_have_incdir" = no ; then
7641                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7642
7643 echo "${as_me:-configure}:7643: testing adding $cf_add_incdir to include-path ..." 1>&5
7644
7645                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7646
7647                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7648                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7649                   cf_add_incdir="$cf_top_incdir"
7650                 else
7651                   break
7652                 fi
7653           else
7654                 break
7655           fi
7656         done
7657   done
7658 fi
7659
7660 fi
7661
7662 # Set definitions to allow ifdef'ing for ncurses.h
7663
7664 case $cf_cv_ncurses_header in
7665 (*ncurses.h)
7666
7667 cat >>confdefs.h <<\EOF
7668 #define HAVE_NCURSES_H 1
7669 EOF
7670
7671         ;;
7672 esac
7673
7674 case $cf_cv_ncurses_header in
7675 (ncurses/curses.h|ncurses/ncurses.h)
7676
7677 cat >>confdefs.h <<\EOF
7678 #define HAVE_NCURSES_NCURSES_H 1
7679 EOF
7680
7681         ;;
7682 (ncursesw/curses.h|ncursesw/ncurses.h)
7683
7684 cat >>confdefs.h <<\EOF
7685 #define HAVE_NCURSESW_NCURSES_H 1
7686 EOF
7687
7688         ;;
7689 esac
7690
7691 echo "$as_me:7691: checking for terminfo header" >&5
7692 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7693 if test "${cf_cv_term_header+set}" = set; then
7694   echo $ECHO_N "(cached) $ECHO_C" >&6
7695 else
7696
7697 case ${cf_cv_ncurses_header} in
7698 (*/ncurses.h|*/ncursesw.h)
7699         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7700         ;;
7701 (*)
7702         cf_term_header=term.h
7703         ;;
7704 esac
7705
7706 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7707 do
7708 cat >conftest.$ac_ext <<_ACEOF
7709 #line 7709 "configure"
7710 #include "confdefs.h"
7711 #include <stdio.h>
7712 #include <${cf_cv_ncurses_header:-curses.h}>
7713 #include <$cf_test>
7714
7715 int
7716 main (void)
7717 {
7718 int x = auto_left_margin
7719   ;
7720   return 0;
7721 }
7722 _ACEOF
7723 rm -f conftest.$ac_objext
7724 if { (eval echo "$as_me:7724: \"$ac_compile\"") >&5
7725   (eval $ac_compile) 2>&5
7726   ac_status=$?
7727   echo "$as_me:7727: \$? = $ac_status" >&5
7728   (exit $ac_status); } &&
7729          { ac_try='test -s conftest.$ac_objext'
7730   { (eval echo "$as_me:7730: \"$ac_try\"") >&5
7731   (eval $ac_try) 2>&5
7732   ac_status=$?
7733   echo "$as_me:7733: \$? = $ac_status" >&5
7734   (exit $ac_status); }; }; then
7735
7736         cf_cv_term_header="$cf_test"
7737 else
7738   echo "$as_me: failed program was:" >&5
7739 cat conftest.$ac_ext >&5
7740
7741         cf_cv_term_header=unknown
7742
7743 fi
7744 rm -f conftest.$ac_objext conftest.$ac_ext
7745         test "$cf_cv_term_header" != unknown && break
7746 done
7747
7748 fi
7749 echo "$as_me:7749: result: $cf_cv_term_header" >&5
7750 echo "${ECHO_T}$cf_cv_term_header" >&6
7751
7752 # Set definitions to allow ifdef'ing to accommodate subdirectories
7753
7754 case $cf_cv_term_header in
7755 (*term.h)
7756
7757 cat >>confdefs.h <<\EOF
7758 #define HAVE_TERM_H 1
7759 EOF
7760
7761         ;;
7762 esac
7763
7764 case $cf_cv_term_header in
7765 (ncurses/term.h)
7766
7767 cat >>confdefs.h <<\EOF
7768 #define HAVE_NCURSES_TERM_H 1
7769 EOF
7770
7771         ;;
7772 (ncursesw/term.h)
7773
7774 cat >>confdefs.h <<\EOF
7775 #define HAVE_NCURSESW_TERM_H 1
7776 EOF
7777
7778         ;;
7779 esac
7780
7781 # some applications need this, but should check for NCURSES_VERSION
7782
7783 cat >>confdefs.h <<\EOF
7784 #define NCURSES 1
7785 EOF
7786
7787 echo "$as_me:7787: checking for ncurses version" >&5
7788 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7789 if test "${cf_cv_ncurses_version+set}" = set; then
7790   echo $ECHO_N "(cached) $ECHO_C" >&6
7791 else
7792
7793         cf_cv_ncurses_version=no
7794         cf_tempfile=out$$
7795         rm -f $cf_tempfile
7796         if test "$cross_compiling" = yes; then
7797
7798         # This will not work if the preprocessor splits the line after the
7799         # Autoconf token.  The 'unproto' program does that.
7800         cat > conftest.$ac_ext <<EOF
7801 #include <${cf_cv_ncurses_header:-curses.h}>
7802 #undef Autoconf
7803 #ifdef NCURSES_VERSION
7804 Autoconf NCURSES_VERSION
7805 #else
7806 #ifdef __NCURSES_H
7807 Autoconf "old"
7808 #endif
7809 ;
7810 #endif
7811 EOF
7812         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7813         { (eval echo "$as_me:7813: \"$cf_try\"") >&5
7814   (eval $cf_try) 2>&5
7815   ac_status=$?
7816   echo "$as_me:7816: \$? = $ac_status" >&5
7817   (exit $ac_status); }
7818         if test -f conftest.out ; then
7819                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7820                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7821                 rm -f conftest.out
7822         fi
7823
7824 else
7825   cat >conftest.$ac_ext <<_ACEOF
7826 #line 7826 "configure"
7827 #include "confdefs.h"
7828
7829 #include <${cf_cv_ncurses_header:-curses.h}>
7830 #include <stdio.h>
7831 int main(void)
7832 {
7833         FILE *fp = fopen("$cf_tempfile", "w");
7834 #ifdef NCURSES_VERSION
7835 # ifdef NCURSES_VERSION_PATCH
7836         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7837 # else
7838         fprintf(fp, "%s\n", NCURSES_VERSION);
7839 # endif
7840 #else
7841 # ifdef __NCURSES_H
7842         fprintf(fp, "old\n");
7843 # else
7844         make an error
7845 # endif
7846 #endif
7847         ${cf_cv_main_return:-return}(0);
7848 }
7849 _ACEOF
7850 rm -f conftest$ac_exeext
7851 if { (eval echo "$as_me:7851: \"$ac_link\"") >&5
7852   (eval $ac_link) 2>&5
7853   ac_status=$?
7854   echo "$as_me:7854: \$? = $ac_status" >&5
7855   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7856   { (eval echo "$as_me:7856: \"$ac_try\"") >&5
7857   (eval $ac_try) 2>&5
7858   ac_status=$?
7859   echo "$as_me:7859: \$? = $ac_status" >&5
7860   (exit $ac_status); }; }; then
7861
7862         cf_cv_ncurses_version=`cat $cf_tempfile`
7863 else
7864   echo "$as_me: program exited with status $ac_status" >&5
7865 echo "$as_me: failed program was:" >&5
7866 cat conftest.$ac_ext >&5
7867 fi
7868 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7869 fi
7870         rm -f $cf_tempfile
7871
7872 fi
7873 echo "$as_me:7873: result: $cf_cv_ncurses_version" >&5
7874 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7875 test "$cf_cv_ncurses_version" = no ||
7876 cat >>confdefs.h <<\EOF
7877 #define NCURSES 1
7878 EOF
7879
7880 cf_nculib_root=ncursesw
7881         # This works, except for the special case where we find gpm, but
7882         # ncurses is in a nonstandard location via $LIBS, and we really want
7883         # to link gpm.
7884 cf_ncurses_LIBS=""
7885 cf_ncurses_SAVE="$LIBS"
7886 echo "$as_me:7886: checking for Gpm_Open in -lgpm" >&5
7887 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7888 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7889   echo $ECHO_N "(cached) $ECHO_C" >&6
7890 else
7891   ac_check_lib_save_LIBS=$LIBS
7892 LIBS="-lgpm  $LIBS"
7893 cat >conftest.$ac_ext <<_ACEOF
7894 #line 7894 "configure"
7895 #include "confdefs.h"
7896
7897 /* Override any gcc2 internal prototype to avoid an error.  */
7898 #ifdef __cplusplus
7899 extern "C"
7900 #endif
7901 /* We use char because int might match the return type of a gcc2
7902    builtin and then its argument prototype would still apply.  */
7903 char Gpm_Open ();
7904 int
7905 main (void)
7906 {
7907 Gpm_Open ();
7908   ;
7909   return 0;
7910 }
7911 _ACEOF
7912 rm -f conftest.$ac_objext conftest$ac_exeext
7913 if { (eval echo "$as_me:7913: \"$ac_link\"") >&5
7914   (eval $ac_link) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); } &&
7918          { ac_try='test -s conftest$ac_exeext'
7919   { (eval echo "$as_me:7919: \"$ac_try\"") >&5
7920   (eval $ac_try) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); }; }; then
7924   ac_cv_lib_gpm_Gpm_Open=yes
7925 else
7926   echo "$as_me: failed program was:" >&5
7927 cat conftest.$ac_ext >&5
7928 ac_cv_lib_gpm_Gpm_Open=no
7929 fi
7930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7931 LIBS=$ac_check_lib_save_LIBS
7932 fi
7933 echo "$as_me:7933: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7934 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7935 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7936   echo "$as_me:7936: checking for initscr in -lgpm" >&5
7937 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7938 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7939   echo $ECHO_N "(cached) $ECHO_C" >&6
7940 else
7941   ac_check_lib_save_LIBS=$LIBS
7942 LIBS="-lgpm  $LIBS"
7943 cat >conftest.$ac_ext <<_ACEOF
7944 #line 7944 "configure"
7945 #include "confdefs.h"
7946
7947 /* Override any gcc2 internal prototype to avoid an error.  */
7948 #ifdef __cplusplus
7949 extern "C"
7950 #endif
7951 /* We use char because int might match the return type of a gcc2
7952    builtin and then its argument prototype would still apply.  */
7953 char initscr ();
7954 int
7955 main (void)
7956 {
7957 initscr ();
7958   ;
7959   return 0;
7960 }
7961 _ACEOF
7962 rm -f conftest.$ac_objext conftest$ac_exeext
7963 if { (eval echo "$as_me:7963: \"$ac_link\"") >&5
7964   (eval $ac_link) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); } &&
7968          { ac_try='test -s conftest$ac_exeext'
7969   { (eval echo "$as_me:7969: \"$ac_try\"") >&5
7970   (eval $ac_try) 2>&5
7971   ac_status=$?
7972   echo "$as_me:7972: \$? = $ac_status" >&5
7973   (exit $ac_status); }; }; then
7974   ac_cv_lib_gpm_initscr=yes
7975 else
7976   echo "$as_me: failed program was:" >&5
7977 cat conftest.$ac_ext >&5
7978 ac_cv_lib_gpm_initscr=no
7979 fi
7980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7981 LIBS=$ac_check_lib_save_LIBS
7982 fi
7983 echo "$as_me:7983: result: $ac_cv_lib_gpm_initscr" >&5
7984 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7985 if test $ac_cv_lib_gpm_initscr = yes; then
7986   LIBS="$cf_ncurses_SAVE"
7987 else
7988   cf_ncurses_LIBS="-lgpm"
7989 fi
7990
7991 fi
7992
7993 case $host_os in
7994 (freebsd*)
7995         # This is only necessary if you are linking against an obsolete
7996         # version of ncurses (but it should do no harm, since it's static).
7997         if test "$cf_nculib_root" = ncurses ; then
7998                 echo "$as_me:7998: checking for tgoto in -lmytinfo" >&5
7999 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8000 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8001   echo $ECHO_N "(cached) $ECHO_C" >&6
8002 else
8003   ac_check_lib_save_LIBS=$LIBS
8004 LIBS="-lmytinfo  $LIBS"
8005 cat >conftest.$ac_ext <<_ACEOF
8006 #line 8006 "configure"
8007 #include "confdefs.h"
8008
8009 /* Override any gcc2 internal prototype to avoid an error.  */
8010 #ifdef __cplusplus
8011 extern "C"
8012 #endif
8013 /* We use char because int might match the return type of a gcc2
8014    builtin and then its argument prototype would still apply.  */
8015 char tgoto ();
8016 int
8017 main (void)
8018 {
8019 tgoto ();
8020   ;
8021   return 0;
8022 }
8023 _ACEOF
8024 rm -f conftest.$ac_objext conftest$ac_exeext
8025 if { (eval echo "$as_me:8025: \"$ac_link\"") >&5
8026   (eval $ac_link) 2>&5
8027   ac_status=$?
8028   echo "$as_me:8028: \$? = $ac_status" >&5
8029   (exit $ac_status); } &&
8030          { ac_try='test -s conftest$ac_exeext'
8031   { (eval echo "$as_me:8031: \"$ac_try\"") >&5
8032   (eval $ac_try) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit $ac_status); }; }; then
8036   ac_cv_lib_mytinfo_tgoto=yes
8037 else
8038   echo "$as_me: failed program was:" >&5
8039 cat conftest.$ac_ext >&5
8040 ac_cv_lib_mytinfo_tgoto=no
8041 fi
8042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8043 LIBS=$ac_check_lib_save_LIBS
8044 fi
8045 echo "$as_me:8045: result: $ac_cv_lib_mytinfo_tgoto" >&5
8046 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8047 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8048   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8049 fi
8050
8051         fi
8052         ;;
8053 esac
8054
8055 cf_add_libs="$LIBS"
8056 # reverse order
8057 cf_add_0lib=
8058 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8059 # filter duplicates
8060 for cf_add_1lib in $cf_add_0lib; do
8061         for cf_add_2lib in $cf_add_libs; do
8062                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8063                         cf_add_1lib=
8064                         break
8065                 fi
8066         done
8067         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8068 done
8069 LIBS="$cf_add_libs"
8070
8071 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8072 then
8073
8074 cf_add_libs="$LIBS"
8075 # reverse order
8076 cf_add_0lib=
8077 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8078 # filter duplicates
8079 for cf_add_1lib in $cf_add_0lib; do
8080         for cf_add_2lib in $cf_add_libs; do
8081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8082                         cf_add_1lib=
8083                         break
8084                 fi
8085         done
8086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8087 done
8088 LIBS="$cf_add_libs"
8089
8090 else
8091
8092         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8093         cf_libdir=""
8094         echo "$as_me:8094: checking for initscr" >&5
8095 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8096 if test "${ac_cv_func_initscr+set}" = set; then
8097   echo $ECHO_N "(cached) $ECHO_C" >&6
8098 else
8099   cat >conftest.$ac_ext <<_ACEOF
8100 #line 8100 "configure"
8101 #include "confdefs.h"
8102 #define initscr autoconf_temporary
8103 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8104 #undef initscr
8105
8106 #ifdef __cplusplus
8107 extern "C"
8108 #endif
8109
8110 /* We use char because int might match the return type of a gcc2
8111    builtin and then its argument prototype would still apply.  */
8112 char initscr (void);
8113
8114 int
8115 main (void)
8116 {
8117
8118 /* The GNU C library defines stubs for functions which it implements
8119     to always fail with ENOSYS.  Some functions are actually named
8120     something starting with __ and the normal name is an alias.  */
8121 #if defined (__stub_initscr) || defined (__stub___initscr)
8122 #error found stub for initscr
8123 #endif
8124
8125         return initscr ();
8126   ;
8127   return 0;
8128 }
8129 _ACEOF
8130 rm -f conftest.$ac_objext conftest$ac_exeext
8131 if { (eval echo "$as_me:8131: \"$ac_link\"") >&5
8132   (eval $ac_link) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); } &&
8136          { ac_try='test -s conftest$ac_exeext'
8137   { (eval echo "$as_me:8137: \"$ac_try\"") >&5
8138   (eval $ac_try) 2>&5
8139   ac_status=$?
8140   echo "$as_me:8140: \$? = $ac_status" >&5
8141   (exit $ac_status); }; }; then
8142   ac_cv_func_initscr=yes
8143 else
8144   echo "$as_me: failed program was:" >&5
8145 cat conftest.$ac_ext >&5
8146 ac_cv_func_initscr=no
8147 fi
8148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8149 fi
8150 echo "$as_me:8150: result: $ac_cv_func_initscr" >&5
8151 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8152 if test $ac_cv_func_initscr = yes; then
8153   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8154 else
8155
8156                 cf_save_LIBS="$LIBS"
8157                 echo "$as_me:8157: checking for initscr in -l$cf_nculib_root" >&5
8158 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8159                 LIBS="-l$cf_nculib_root $LIBS"
8160                 cat >conftest.$ac_ext <<_ACEOF
8161 #line 8161 "configure"
8162 #include "confdefs.h"
8163 #include <${cf_cv_ncurses_header:-curses.h}>
8164 int
8165 main (void)
8166 {
8167 initscr()
8168   ;
8169   return 0;
8170 }
8171 _ACEOF
8172 rm -f conftest.$ac_objext conftest$ac_exeext
8173 if { (eval echo "$as_me:8173: \"$ac_link\"") >&5
8174   (eval $ac_link) 2>&5
8175   ac_status=$?
8176   echo "$as_me:8176: \$? = $ac_status" >&5
8177   (exit $ac_status); } &&
8178          { ac_try='test -s conftest$ac_exeext'
8179   { (eval echo "$as_me:8179: \"$ac_try\"") >&5
8180   (eval $ac_try) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); }; }; then
8184   echo "$as_me:8184: result: yes" >&5
8185 echo "${ECHO_T}yes" >&6
8186                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8187
8188 else
8189   echo "$as_me: failed program was:" >&5
8190 cat conftest.$ac_ext >&5
8191 echo "$as_me:8191: result: no" >&5
8192 echo "${ECHO_T}no" >&6
8193
8194 cf_search=
8195 cf_library_path_list=""
8196 if test -n "${LDFLAGS}${LIBS}" ; then
8197         for cf_library_path in $LDFLAGS $LIBS
8198         do
8199                 case $cf_library_path in
8200                 (-L*)
8201                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8202
8203 test "x$cf_library_path" != "xNONE" && \
8204 test -d "$cf_library_path" && \
8205  {
8206         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8207         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8208         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8209         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8210         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8211         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"
8212 }
8213
8214                         cf_library_path_list="$cf_library_path_list $cf_search"
8215                         ;;
8216                 esac
8217         done
8218 fi
8219
8220 cf_search=
8221
8222 test "x$prefix" != "xNONE" && \
8223 test -d "$prefix" && \
8224  {
8225         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8226         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8227         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8228         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8229         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8230         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8231 }
8232
8233 for cf_subdir_prefix in \
8234         /usr \
8235         /usr/local \
8236         /usr/pkg \
8237         /opt \
8238         /opt/local \
8239         $HOME
8240 do
8241
8242 test "x$cf_subdir_prefix" != "x$prefix" && \
8243 test -d "$cf_subdir_prefix" && \
8244 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8245         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8246         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8247         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8248         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8249         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8250         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"
8251 }
8252
8253 done
8254
8255 cf_search="$cf_library_path_list $cf_search"
8256
8257                         for cf_libdir in $cf_search
8258                         do
8259                                 echo "$as_me:8259: checking for -l$cf_nculib_root in $cf_libdir" >&5
8260 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8261                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8262                                 cat >conftest.$ac_ext <<_ACEOF
8263 #line 8263 "configure"
8264 #include "confdefs.h"
8265 #include <${cf_cv_ncurses_header:-curses.h}>
8266 int
8267 main (void)
8268 {
8269 initscr()
8270   ;
8271   return 0;
8272 }
8273 _ACEOF
8274 rm -f conftest.$ac_objext conftest$ac_exeext
8275 if { (eval echo "$as_me:8275: \"$ac_link\"") >&5
8276   (eval $ac_link) 2>&5
8277   ac_status=$?
8278   echo "$as_me:8278: \$? = $ac_status" >&5
8279   (exit $ac_status); } &&
8280          { ac_try='test -s conftest$ac_exeext'
8281   { (eval echo "$as_me:8281: \"$ac_try\"") >&5
8282   (eval $ac_try) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit $ac_status); }; }; then
8286   echo "$as_me:8286: result: yes" >&5
8287 echo "${ECHO_T}yes" >&6
8288                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8289                                          break
8290 else
8291   echo "$as_me: failed program was:" >&5
8292 cat conftest.$ac_ext >&5
8293 echo "$as_me:8293: result: no" >&5
8294 echo "${ECHO_T}no" >&6
8295                                          LIBS="$cf_save_LIBS"
8296 fi
8297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8298                         done
8299
8300 fi
8301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8302
8303 fi
8304
8305 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8306
8307 if test $cf_found_library = no ; then
8308         { { echo "$as_me:8308: error: Cannot link $cf_nculib_root library" >&5
8309 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8310    { (exit 1); exit 1; }; }
8311 fi
8312
8313 fi
8314
8315 if test -n "$cf_ncurses_LIBS" ; then
8316         echo "$as_me:8316: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8317 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8318         cf_ncurses_SAVE="$LIBS"
8319         for p in $cf_ncurses_LIBS ; do
8320                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8321                 if test "$q" != "$LIBS" ; then
8322                         LIBS="$q"
8323                 fi
8324         done
8325         cat >conftest.$ac_ext <<_ACEOF
8326 #line 8326 "configure"
8327 #include "confdefs.h"
8328 #include <${cf_cv_ncurses_header:-curses.h}>
8329 int
8330 main (void)
8331 {
8332 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8333   ;
8334   return 0;
8335 }
8336 _ACEOF
8337 rm -f conftest.$ac_objext conftest$ac_exeext
8338 if { (eval echo "$as_me:8338: \"$ac_link\"") >&5
8339   (eval $ac_link) 2>&5
8340   ac_status=$?
8341   echo "$as_me:8341: \$? = $ac_status" >&5
8342   (exit $ac_status); } &&
8343          { ac_try='test -s conftest$ac_exeext'
8344   { (eval echo "$as_me:8344: \"$ac_try\"") >&5
8345   (eval $ac_try) 2>&5
8346   ac_status=$?
8347   echo "$as_me:8347: \$? = $ac_status" >&5
8348   (exit $ac_status); }; }; then
8349   echo "$as_me:8349: result: yes" >&5
8350 echo "${ECHO_T}yes" >&6
8351 else
8352   echo "$as_me: failed program was:" >&5
8353 cat conftest.$ac_ext >&5
8354 echo "$as_me:8354: result: no" >&5
8355 echo "${ECHO_T}no" >&6
8356                  LIBS="$cf_ncurses_SAVE"
8357 fi
8358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8359 fi
8360
8361 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8362
8363 cat >>confdefs.h <<EOF
8364 #define $cf_nculib_ROOT 1
8365 EOF
8366
8367         fi
8368 else
8369         NCURSES_CONFIG=none
8370 fi
8371
8372 else
8373
8374 cf_ncuconfig_root=ncurses
8375 cf_have_ncuconfig=no
8376
8377 if test "x${PKG_CONFIG:=none}" != xnone; then
8378         echo "$as_me:8378: checking pkg-config for $cf_ncuconfig_root" >&5
8379 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8380         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8381                 echo "$as_me:8381: result: yes" >&5
8382 echo "${ECHO_T}yes" >&6
8383
8384                 echo "$as_me:8384: checking if the $cf_ncuconfig_root package files work" >&5
8385 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8386                 cf_have_ncuconfig=unknown
8387
8388                 cf_save_CPPFLAGS="$CPPFLAGS"
8389                 cf_save_LIBS="$LIBS"
8390
8391 cf_fix_cppflags=no
8392 cf_new_cflags=
8393 cf_new_cppflags=
8394 cf_new_extra_cppflags=
8395
8396 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
8397 do
8398 case $cf_fix_cppflags in
8399 (no)
8400         case $cf_add_cflags in
8401         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8402                 case $cf_add_cflags in
8403                 (-D*)
8404                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8405
8406                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8407                                 && test -z "${cf_tst_cflags}" \
8408                                 && cf_fix_cppflags=yes
8409
8410                         if test $cf_fix_cppflags = yes ; then
8411
8412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8414
8415                                 continue
8416                         elif test "${cf_tst_cflags}" = "\"'" ; then
8417
8418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8420
8421                                 continue
8422                         fi
8423                         ;;
8424                 esac
8425                 case "$CPPFLAGS" in
8426                 (*$cf_add_cflags)
8427                         ;;
8428                 (*)
8429                         case $cf_add_cflags in
8430                         (-D*)
8431                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8432
8433 CPPFLAGS=`echo "$CPPFLAGS" | \
8434         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8435                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8436
8437                                 ;;
8438                         esac
8439
8440         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8441         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8442
8443                         ;;
8444                 esac
8445                 ;;
8446         (*)
8447
8448         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8449         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8450
8451                 ;;
8452         esac
8453         ;;
8454 (yes)
8455
8456         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8457         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8458
8459         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8460
8461         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8462                 && test -z "${cf_tst_cflags}" \
8463                 && cf_fix_cppflags=no
8464         ;;
8465 esac
8466 done
8467
8468 if test -n "$cf_new_cflags" ; then
8469
8470         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8471         CFLAGS="${CFLAGS}$cf_new_cflags"
8472
8473 fi
8474
8475 if test -n "$cf_new_cppflags" ; then
8476
8477         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8478         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8479
8480 fi
8481
8482 if test -n "$cf_new_extra_cppflags" ; then
8483
8484         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8485         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8486
8487 fi
8488
8489 cf_add_libs="$LIBS"
8490 # reverse order
8491 cf_add_0lib=
8492 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8493 # filter duplicates
8494 for cf_add_1lib in $cf_add_0lib; do
8495         for cf_add_2lib in $cf_add_libs; do
8496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8497                         cf_add_1lib=
8498                         break
8499                 fi
8500         done
8501         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8502 done
8503 LIBS="$cf_add_libs"
8504
8505                 cat >conftest.$ac_ext <<_ACEOF
8506 #line 8506 "configure"
8507 #include "confdefs.h"
8508 #include <${cf_cv_ncurses_header:-curses.h}>
8509 int
8510 main (void)
8511 {
8512 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f conftest.$ac_objext conftest$ac_exeext
8518 if { (eval echo "$as_me:8518: \"$ac_link\"") >&5
8519   (eval $ac_link) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); } &&
8523          { ac_try='test -s conftest$ac_exeext'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); }; }; then
8529   if test "$cross_compiling" = yes; then
8530   cf_have_ncuconfig=maybe
8531 else
8532   cat >conftest.$ac_ext <<_ACEOF
8533 #line 8533 "configure"
8534 #include "confdefs.h"
8535 #include <${cf_cv_ncurses_header:-curses.h}>
8536                                 int main(void)
8537                                 { char *xx = curses_version(); return (xx == 0); }
8538 _ACEOF
8539 rm -f conftest$ac_exeext
8540 if { (eval echo "$as_me:8540: \"$ac_link\"") >&5
8541   (eval $ac_link) 2>&5
8542   ac_status=$?
8543   echo "$as_me:8543: \$? = $ac_status" >&5
8544   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8545   { (eval echo "$as_me:8545: \"$ac_try\"") >&5
8546   (eval $ac_try) 2>&5
8547   ac_status=$?
8548   echo "$as_me:8548: \$? = $ac_status" >&5
8549   (exit $ac_status); }; }; then
8550   cf_have_ncuconfig=yes
8551 else
8552   echo "$as_me: program exited with status $ac_status" >&5
8553 echo "$as_me: failed program was:" >&5
8554 cat conftest.$ac_ext >&5
8555 cf_have_ncuconfig=no
8556 fi
8557 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8558 fi
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat conftest.$ac_ext >&5
8562 cf_have_ncuconfig=no
8563 fi
8564 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8565                 echo "$as_me:8565: result: $cf_have_ncuconfig" >&5
8566 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8567                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8568                 if test "$cf_have_ncuconfig" != "yes"
8569                 then
8570                         CPPFLAGS="$cf_save_CPPFLAGS"
8571                         LIBS="$cf_save_LIBS"
8572                         NCURSES_CONFIG_PKG=none
8573                 else
8574
8575 cat >>confdefs.h <<\EOF
8576 #define NCURSES 1
8577 EOF
8578
8579                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8580
8581 echo "$as_me:8581: checking for terminfo header" >&5
8582 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8583 if test "${cf_cv_term_header+set}" = set; then
8584   echo $ECHO_N "(cached) $ECHO_C" >&6
8585 else
8586
8587 case ${cf_cv_ncurses_header} in
8588 (*/ncurses.h|*/ncursesw.h)
8589         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8590         ;;
8591 (*)
8592         cf_term_header=term.h
8593         ;;
8594 esac
8595
8596 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8597 do
8598 cat >conftest.$ac_ext <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601 #include <stdio.h>
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 #include <$cf_test>
8604
8605 int
8606 main (void)
8607 {
8608 int x = auto_left_margin
8609   ;
8610   return 0;
8611 }
8612 _ACEOF
8613 rm -f conftest.$ac_objext
8614 if { (eval echo "$as_me:8614: \"$ac_compile\"") >&5
8615   (eval $ac_compile) 2>&5
8616   ac_status=$?
8617   echo "$as_me:8617: \$? = $ac_status" >&5
8618   (exit $ac_status); } &&
8619          { ac_try='test -s conftest.$ac_objext'
8620   { (eval echo "$as_me:8620: \"$ac_try\"") >&5
8621   (eval $ac_try) 2>&5
8622   ac_status=$?
8623   echo "$as_me:8623: \$? = $ac_status" >&5
8624   (exit $ac_status); }; }; then
8625
8626         cf_cv_term_header="$cf_test"
8627 else
8628   echo "$as_me: failed program was:" >&5
8629 cat conftest.$ac_ext >&5
8630
8631         cf_cv_term_header=unknown
8632
8633 fi
8634 rm -f conftest.$ac_objext conftest.$ac_ext
8635         test "$cf_cv_term_header" != unknown && break
8636 done
8637
8638 fi
8639 echo "$as_me:8639: result: $cf_cv_term_header" >&5
8640 echo "${ECHO_T}$cf_cv_term_header" >&6
8641
8642 # Set definitions to allow ifdef'ing to accommodate subdirectories
8643
8644 case $cf_cv_term_header in
8645 (*term.h)
8646
8647 cat >>confdefs.h <<\EOF
8648 #define HAVE_TERM_H 1
8649 EOF
8650
8651         ;;
8652 esac
8653
8654 case $cf_cv_term_header in
8655 (ncurses/term.h)
8656
8657 cat >>confdefs.h <<\EOF
8658 #define HAVE_NCURSES_TERM_H 1
8659 EOF
8660
8661         ;;
8662 (ncursesw/term.h)
8663
8664 cat >>confdefs.h <<\EOF
8665 #define HAVE_NCURSESW_TERM_H 1
8666 EOF
8667
8668         ;;
8669 esac
8670
8671                 fi
8672
8673         else
8674                 echo "$as_me:8674: result: no" >&5
8675 echo "${ECHO_T}no" >&6
8676                 NCURSES_CONFIG_PKG=none
8677         fi
8678 else
8679         NCURSES_CONFIG_PKG=none
8680 fi
8681
8682 if test "x$cf_have_ncuconfig" = "xno"; then
8683         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8684
8685 if test -n "$ac_tool_prefix"; then
8686   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8687   do
8688     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8689 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8690 echo "$as_me:8690: checking for $ac_word" >&5
8691 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8692 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8693   echo $ECHO_N "(cached) $ECHO_C" >&6
8694 else
8695   if test -n "$NCURSES_CONFIG"; then
8696   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8697 else
8698   ac_save_IFS=$IFS; IFS=$ac_path_separator
8699 ac_dummy="$PATH"
8700 for ac_dir in $ac_dummy; do
8701   IFS=$ac_save_IFS
8702   test -z "$ac_dir" && ac_dir=.
8703   $as_executable_p "$ac_dir/$ac_word" || continue
8704 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8705 echo "$as_me:8705: found $ac_dir/$ac_word" >&5
8706 break
8707 done
8708
8709 fi
8710 fi
8711 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8712 if test -n "$NCURSES_CONFIG"; then
8713   echo "$as_me:8713: result: $NCURSES_CONFIG" >&5
8714 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8715 else
8716   echo "$as_me:8716: result: no" >&5
8717 echo "${ECHO_T}no" >&6
8718 fi
8719
8720     test -n "$NCURSES_CONFIG" && break
8721   done
8722 fi
8723 if test -z "$NCURSES_CONFIG"; then
8724   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8725   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8726 do
8727   # Extract the first word of "$ac_prog", so it can be a program name with args.
8728 set dummy $ac_prog; ac_word=$2
8729 echo "$as_me:8729: checking for $ac_word" >&5
8730 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8731 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8732   echo $ECHO_N "(cached) $ECHO_C" >&6
8733 else
8734   if test -n "$ac_ct_NCURSES_CONFIG"; then
8735   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8736 else
8737   ac_save_IFS=$IFS; IFS=$ac_path_separator
8738 ac_dummy="$PATH"
8739 for ac_dir in $ac_dummy; do
8740   IFS=$ac_save_IFS
8741   test -z "$ac_dir" && ac_dir=.
8742   $as_executable_p "$ac_dir/$ac_word" || continue
8743 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8744 echo "$as_me:8744: found $ac_dir/$ac_word" >&5
8745 break
8746 done
8747
8748 fi
8749 fi
8750 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8751 if test -n "$ac_ct_NCURSES_CONFIG"; then
8752   echo "$as_me:8752: result: $ac_ct_NCURSES_CONFIG" >&5
8753 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8754 else
8755   echo "$as_me:8755: result: no" >&5
8756 echo "${ECHO_T}no" >&6
8757 fi
8758
8759   test -n "$ac_ct_NCURSES_CONFIG" && break
8760 done
8761 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8762
8763   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8764 fi
8765
8766         if test "$NCURSES_CONFIG" != none ; then
8767
8768 cf_fix_cppflags=no
8769 cf_new_cflags=
8770 cf_new_cppflags=
8771 cf_new_extra_cppflags=
8772
8773 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8774 do
8775 case $cf_fix_cppflags in
8776 (no)
8777         case $cf_add_cflags in
8778         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8779                 case $cf_add_cflags in
8780                 (-D*)
8781                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8782
8783                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8784                                 && test -z "${cf_tst_cflags}" \
8785                                 && cf_fix_cppflags=yes
8786
8787                         if test $cf_fix_cppflags = yes ; then
8788
8789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8791
8792                                 continue
8793                         elif test "${cf_tst_cflags}" = "\"'" ; then
8794
8795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8797
8798                                 continue
8799                         fi
8800                         ;;
8801                 esac
8802                 case "$CPPFLAGS" in
8803                 (*$cf_add_cflags)
8804                         ;;
8805                 (*)
8806                         case $cf_add_cflags in
8807                         (-D*)
8808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8809
8810 CPPFLAGS=`echo "$CPPFLAGS" | \
8811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8813
8814                                 ;;
8815                         esac
8816
8817         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8818         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8819
8820                         ;;
8821                 esac
8822                 ;;
8823         (*)
8824
8825         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8826         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8827
8828                 ;;
8829         esac
8830         ;;
8831 (yes)
8832
8833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8835
8836         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8837
8838         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8839                 && test -z "${cf_tst_cflags}" \
8840                 && cf_fix_cppflags=no
8841         ;;
8842 esac
8843 done
8844
8845 if test -n "$cf_new_cflags" ; then
8846
8847         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8848         CFLAGS="${CFLAGS}$cf_new_cflags"
8849
8850 fi
8851
8852 if test -n "$cf_new_cppflags" ; then
8853
8854         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8855         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8856
8857 fi
8858
8859 if test -n "$cf_new_extra_cppflags" ; then
8860
8861         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8862         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8863
8864 fi
8865
8866 cf_add_libs="$LIBS"
8867 # reverse order
8868 cf_add_0lib=
8869 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8870 # filter duplicates
8871 for cf_add_1lib in $cf_add_0lib; do
8872         for cf_add_2lib in $cf_add_libs; do
8873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8874                         cf_add_1lib=
8875                         break
8876                 fi
8877         done
8878         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8879 done
8880 LIBS="$cf_add_libs"
8881
8882                 # even with config script, some packages use no-override for curses.h
8883
8884 echo "$as_me:8884: checking if we have identified curses headers" >&5
8885 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8886 if test "${cf_cv_ncurses_header+set}" = set; then
8887   echo $ECHO_N "(cached) $ECHO_C" >&6
8888 else
8889
8890 cf_cv_ncurses_header=none
8891 for cf_header in \
8892         ncurses.h ncurses/ncurses.h \
8893         curses.h ncurses/curses.h
8894 do
8895 cat >conftest.$ac_ext <<_ACEOF
8896 #line 8896 "configure"
8897 #include "confdefs.h"
8898 #include <${cf_header}>
8899 int
8900 main (void)
8901 {
8902 initscr(); tgoto("?", 0,0)
8903   ;
8904   return 0;
8905 }
8906 _ACEOF
8907 rm -f conftest.$ac_objext
8908 if { (eval echo "$as_me:8908: \"$ac_compile\"") >&5
8909   (eval $ac_compile) 2>&5
8910   ac_status=$?
8911   echo "$as_me:8911: \$? = $ac_status" >&5
8912   (exit $ac_status); } &&
8913          { ac_try='test -s conftest.$ac_objext'
8914   { (eval echo "$as_me:8914: \"$ac_try\"") >&5
8915   (eval $ac_try) 2>&5
8916   ac_status=$?
8917   echo "$as_me:8917: \$? = $ac_status" >&5
8918   (exit $ac_status); }; }; then
8919   cf_cv_ncurses_header=$cf_header; break
8920 else
8921   echo "$as_me: failed program was:" >&5
8922 cat conftest.$ac_ext >&5
8923 fi
8924 rm -f conftest.$ac_objext conftest.$ac_ext
8925 done
8926
8927 fi
8928 echo "$as_me:8928: result: $cf_cv_ncurses_header" >&5
8929 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8930
8931 if test "$cf_cv_ncurses_header" = none ; then
8932         { { echo "$as_me:8932: error: No curses header-files found" >&5
8933 echo "$as_me: error: No curses header-files found" >&2;}
8934    { (exit 1); exit 1; }; }
8935 fi
8936
8937 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8938
8939 for ac_header in $cf_cv_ncurses_header
8940 do
8941 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8942 echo "$as_me:8942: checking for $ac_header" >&5
8943 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8944 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8945   echo $ECHO_N "(cached) $ECHO_C" >&6
8946 else
8947   cat >conftest.$ac_ext <<_ACEOF
8948 #line 8948 "configure"
8949 #include "confdefs.h"
8950 #include <$ac_header>
8951 _ACEOF
8952 if { (eval echo "$as_me:8952: \"$ac_cpp conftest.$ac_ext\"") >&5
8953   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8954   ac_status=$?
8955   egrep -v '^ *\+' conftest.er1 >conftest.err
8956   rm -f conftest.er1
8957   cat conftest.err >&5
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit $ac_status); } >/dev/null; then
8960   if test -s conftest.err; then
8961     ac_cpp_err=$ac_c_preproc_warn_flag
8962   else
8963     ac_cpp_err=
8964   fi
8965 else
8966   ac_cpp_err=yes
8967 fi
8968 if test -z "$ac_cpp_err"; then
8969   eval "$as_ac_Header=yes"
8970 else
8971   echo "$as_me: failed program was:" >&5
8972   cat conftest.$ac_ext >&5
8973   eval "$as_ac_Header=no"
8974 fi
8975 rm -f conftest.err conftest.$ac_ext
8976 fi
8977 echo "$as_me:8977: result: `eval echo '${'$as_ac_Header'}'`" >&5
8978 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8979 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8980   cat >>confdefs.h <<EOF
8981 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8982 EOF
8983
8984 fi
8985 done
8986
8987 cat >>confdefs.h <<\EOF
8988 #define NCURSES 1
8989 EOF
8990
8991 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8992
8993                 cat >>confdefs.h <<EOF
8994 #define $cf_nculib_ROOT 1
8995 EOF
8996
8997                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8998
8999         else
9000
9001 cf_ncuhdr_root=ncurses
9002
9003 test -n "$cf_cv_curses_dir" && \
9004 test "$cf_cv_curses_dir" != "no" && { \
9005
9006 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9007   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9008   do
9009         while test $cf_add_incdir != /usr/include
9010         do
9011           if test -d $cf_add_incdir
9012           then
9013                 cf_have_incdir=no
9014                 if test -n "$CFLAGS$CPPFLAGS" ; then
9015                   # a loop is needed to ensure we can add subdirs of existing dirs
9016                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9017                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9018                           cf_have_incdir=yes; break
9019                         fi
9020                   done
9021                 fi
9022
9023                 if test "$cf_have_incdir" = no ; then
9024                   if test "$cf_add_incdir" = /usr/local/include ; then
9025                         if test "$GCC" = yes
9026                         then
9027                           cf_save_CPPFLAGS=$CPPFLAGS
9028
9029         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9030         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9031
9032                           cat >conftest.$ac_ext <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035 #include <stdio.h>
9036 int
9037 main (void)
9038 {
9039 printf("Hello")
9040   ;
9041   return 0;
9042 }
9043 _ACEOF
9044 rm -f conftest.$ac_objext
9045 if { (eval echo "$as_me:9045: \"$ac_compile\"") >&5
9046   (eval $ac_compile) 2>&5
9047   ac_status=$?
9048   echo "$as_me:9048: \$? = $ac_status" >&5
9049   (exit $ac_status); } &&
9050          { ac_try='test -s conftest.$ac_objext'
9051   { (eval echo "$as_me:9051: \"$ac_try\"") >&5
9052   (eval $ac_try) 2>&5
9053   ac_status=$?
9054   echo "$as_me:9054: \$? = $ac_status" >&5
9055   (exit $ac_status); }; }; then
9056   :
9057 else
9058   echo "$as_me: failed program was:" >&5
9059 cat conftest.$ac_ext >&5
9060 cf_have_incdir=yes
9061 fi
9062 rm -f conftest.$ac_objext conftest.$ac_ext
9063                           CPPFLAGS=$cf_save_CPPFLAGS
9064                         fi
9065                   fi
9066                 fi
9067
9068                 if test "$cf_have_incdir" = no ; then
9069                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9070
9071 echo "${as_me:-configure}:9071: testing adding $cf_add_incdir to include-path ..." 1>&5
9072
9073                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9074
9075                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9076                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9077                   cf_add_incdir="$cf_top_incdir"
9078                 else
9079                   break
9080                 fi
9081           else
9082                 break
9083           fi
9084         done
9085   done
9086 fi
9087
9088 }
9089
9090 echo "$as_me:9090: checking for $cf_ncuhdr_root header in include-path" >&5
9091 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9092 if test "${cf_cv_ncurses_h+set}" = set; then
9093   echo $ECHO_N "(cached) $ECHO_C" >&6
9094 else
9095
9096         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9097         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9098         for cf_header in $cf_header_list
9099         do
9100
9101         cat >conftest.$ac_ext <<_ACEOF
9102 #line 9102 "configure"
9103 #include "confdefs.h"
9104
9105 #include <$cf_header>
9106 int
9107 main (void)
9108 {
9109
9110 #ifdef NCURSES_VERSION
9111
9112 printf("%s\n", NCURSES_VERSION);
9113 #else
9114 #ifdef __NCURSES_H
9115 printf("old\n");
9116 #else
9117         make an error
9118 #endif
9119 #endif
9120
9121   ;
9122   return 0;
9123 }
9124 _ACEOF
9125 rm -f conftest.$ac_objext
9126 if { (eval echo "$as_me:9126: \"$ac_compile\"") >&5
9127   (eval $ac_compile) 2>&5
9128   ac_status=$?
9129   echo "$as_me:9129: \$? = $ac_status" >&5
9130   (exit $ac_status); } &&
9131          { ac_try='test -s conftest.$ac_objext'
9132   { (eval echo "$as_me:9132: \"$ac_try\"") >&5
9133   (eval $ac_try) 2>&5
9134   ac_status=$?
9135   echo "$as_me:9135: \$? = $ac_status" >&5
9136   (exit $ac_status); }; }; then
9137   cf_cv_ncurses_h=$cf_header
9138
9139 else
9140   echo "$as_me: failed program was:" >&5
9141 cat conftest.$ac_ext >&5
9142 cf_cv_ncurses_h=no
9143 fi
9144 rm -f conftest.$ac_objext conftest.$ac_ext
9145
9146                 test "$cf_cv_ncurses_h" != no && break
9147         done
9148
9149 fi
9150 echo "$as_me:9150: result: $cf_cv_ncurses_h" >&5
9151 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9152
9153 if test "$cf_cv_ncurses_h" != no ; then
9154         cf_cv_ncurses_header=$cf_cv_ncurses_h
9155 else
9156
9157 echo "$as_me:9157: checking for $cf_ncuhdr_root include-path" >&5
9158 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9159 if test "${cf_cv_ncurses_h2+set}" = set; then
9160   echo $ECHO_N "(cached) $ECHO_C" >&6
9161 else
9162
9163         test -n "$verbose" && echo
9164
9165 cf_search=
9166
9167 # collect the current set of include-directories from compiler flags
9168 cf_header_path_list=""
9169 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9170         for cf_header_path in $CPPFLAGS $CFLAGS
9171         do
9172                 case $cf_header_path in
9173                 (-I*)
9174                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9175
9176 test "x$cf_header_path" != "xNONE" && \
9177 test -d "$cf_header_path" && \
9178  {
9179         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9180         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9181         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9182         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9183         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9184         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"
9185 }
9186
9187                         cf_header_path_list="$cf_header_path_list $cf_search"
9188                         ;;
9189                 esac
9190         done
9191 fi
9192
9193 # add the variations for the package we are looking for
9194
9195 cf_search=
9196
9197 test "x$prefix" != "xNONE" && \
9198 test -d "$prefix" && \
9199  {
9200         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9201         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9202         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9203         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9204         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9205         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9206 }
9207
9208 for cf_subdir_prefix in \
9209         /usr \
9210         /usr/local \
9211         /usr/pkg \
9212         /opt \
9213         /opt/local \
9214         $HOME
9215 do
9216
9217 test "x$cf_subdir_prefix" != "x$prefix" && \
9218 test -d "$cf_subdir_prefix" && \
9219 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9220         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9221         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9222         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9223         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9224         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9225         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"
9226 }
9227
9228 done
9229
9230 test "$includedir" != NONE && \
9231 test "$includedir" != "/usr/include" && \
9232 test -d "$includedir" && {
9233         test -d $includedir &&    cf_search="$cf_search $includedir"
9234         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9235 }
9236
9237 test "$oldincludedir" != NONE && \
9238 test "$oldincludedir" != "/usr/include" && \
9239 test -d "$oldincludedir" && {
9240         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9241         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9242 }
9243
9244 cf_search="$cf_search $cf_header_path_list"
9245
9246         test -n "$verbose" && echo search path $cf_search
9247         cf_save2_CPPFLAGS="$CPPFLAGS"
9248         for cf_incdir in $cf_search
9249         do
9250
9251 if test -n "$cf_incdir" ; then
9252   for cf_add_incdir in $cf_incdir
9253   do
9254         while test $cf_add_incdir != /usr/include
9255         do
9256           if test -d $cf_add_incdir
9257           then
9258                 cf_have_incdir=no
9259                 if test -n "$CFLAGS$CPPFLAGS" ; then
9260                   # a loop is needed to ensure we can add subdirs of existing dirs
9261                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9262                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9263                           cf_have_incdir=yes; break
9264                         fi
9265                   done
9266                 fi
9267
9268                 if test "$cf_have_incdir" = no ; then
9269                   if test "$cf_add_incdir" = /usr/local/include ; then
9270                         if test "$GCC" = yes
9271                         then
9272                           cf_save_CPPFLAGS=$CPPFLAGS
9273
9274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9275         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9276
9277                           cat >conftest.$ac_ext <<_ACEOF
9278 #line 9278 "configure"
9279 #include "confdefs.h"
9280 #include <stdio.h>
9281 int
9282 main (void)
9283 {
9284 printf("Hello")
9285   ;
9286   return 0;
9287 }
9288 _ACEOF
9289 rm -f conftest.$ac_objext
9290 if { (eval echo "$as_me:9290: \"$ac_compile\"") >&5
9291   (eval $ac_compile) 2>&5
9292   ac_status=$?
9293   echo "$as_me:9293: \$? = $ac_status" >&5
9294   (exit $ac_status); } &&
9295          { ac_try='test -s conftest.$ac_objext'
9296   { (eval echo "$as_me:9296: \"$ac_try\"") >&5
9297   (eval $ac_try) 2>&5
9298   ac_status=$?
9299   echo "$as_me:9299: \$? = $ac_status" >&5
9300   (exit $ac_status); }; }; then
9301   :
9302 else
9303   echo "$as_me: failed program was:" >&5
9304 cat conftest.$ac_ext >&5
9305 cf_have_incdir=yes
9306 fi
9307 rm -f conftest.$ac_objext conftest.$ac_ext
9308                           CPPFLAGS=$cf_save_CPPFLAGS
9309                         fi
9310                   fi
9311                 fi
9312
9313                 if test "$cf_have_incdir" = no ; then
9314                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9315
9316 echo "${as_me:-configure}:9316: testing adding $cf_add_incdir to include-path ..." 1>&5
9317
9318                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9319
9320                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9321                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9322                   cf_add_incdir="$cf_top_incdir"
9323                 else
9324                   break
9325                 fi
9326           else
9327                 break
9328           fi
9329         done
9330   done
9331 fi
9332
9333                 for cf_header in \
9334                         ncurses.h \
9335                         curses.h
9336                 do
9337
9338         cat >conftest.$ac_ext <<_ACEOF
9339 #line 9339 "configure"
9340 #include "confdefs.h"
9341
9342 #include <$cf_header>
9343 int
9344 main (void)
9345 {
9346
9347 #ifdef NCURSES_VERSION
9348
9349 printf("%s\n", NCURSES_VERSION);
9350 #else
9351 #ifdef __NCURSES_H
9352 printf("old\n");
9353 #else
9354         make an error
9355 #endif
9356 #endif
9357
9358   ;
9359   return 0;
9360 }
9361 _ACEOF
9362 rm -f conftest.$ac_objext
9363 if { (eval echo "$as_me:9363: \"$ac_compile\"") >&5
9364   (eval $ac_compile) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); } &&
9368          { ac_try='test -s conftest.$ac_objext'
9369   { (eval echo "$as_me:9369: \"$ac_try\"") >&5
9370   (eval $ac_try) 2>&5
9371   ac_status=$?
9372   echo "$as_me:9372: \$? = $ac_status" >&5
9373   (exit $ac_status); }; }; then
9374   cf_cv_ncurses_h2=$cf_header
9375
9376 else
9377   echo "$as_me: failed program was:" >&5
9378 cat conftest.$ac_ext >&5
9379 cf_cv_ncurses_h2=no
9380 fi
9381 rm -f conftest.$ac_objext conftest.$ac_ext
9382
9383                         if test "$cf_cv_ncurses_h2" != no ; then
9384                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9385                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9386                                 break
9387                         fi
9388                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9389                 done
9390                 CPPFLAGS="$cf_save2_CPPFLAGS"
9391                 test "$cf_cv_ncurses_h2" != no && break
9392         done
9393         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9393: error: not found" >&5
9394 echo "$as_me: error: not found" >&2;}
9395    { (exit 1); exit 1; }; }
9396
9397 fi
9398 echo "$as_me:9398: result: $cf_cv_ncurses_h2" >&5
9399 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9400
9401         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9402         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9403         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9404                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9405         fi
9406
9407 if test -n "$cf_1st_incdir" ; then
9408   for cf_add_incdir in $cf_1st_incdir
9409   do
9410         while test $cf_add_incdir != /usr/include
9411         do
9412           if test -d $cf_add_incdir
9413           then
9414                 cf_have_incdir=no
9415                 if test -n "$CFLAGS$CPPFLAGS" ; then
9416                   # a loop is needed to ensure we can add subdirs of existing dirs
9417                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9418                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9419                           cf_have_incdir=yes; break
9420                         fi
9421                   done
9422                 fi
9423
9424                 if test "$cf_have_incdir" = no ; then
9425                   if test "$cf_add_incdir" = /usr/local/include ; then
9426                         if test "$GCC" = yes
9427                         then
9428                           cf_save_CPPFLAGS=$CPPFLAGS
9429
9430         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9431         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9432
9433                           cat >conftest.$ac_ext <<_ACEOF
9434 #line 9434 "configure"
9435 #include "confdefs.h"
9436 #include <stdio.h>
9437 int
9438 main (void)
9439 {
9440 printf("Hello")
9441   ;
9442   return 0;
9443 }
9444 _ACEOF
9445 rm -f conftest.$ac_objext
9446 if { (eval echo "$as_me:9446: \"$ac_compile\"") >&5
9447   (eval $ac_compile) 2>&5
9448   ac_status=$?
9449   echo "$as_me:9449: \$? = $ac_status" >&5
9450   (exit $ac_status); } &&
9451          { ac_try='test -s conftest.$ac_objext'
9452   { (eval echo "$as_me:9452: \"$ac_try\"") >&5
9453   (eval $ac_try) 2>&5
9454   ac_status=$?
9455   echo "$as_me:9455: \$? = $ac_status" >&5
9456   (exit $ac_status); }; }; then
9457   :
9458 else
9459   echo "$as_me: failed program was:" >&5
9460 cat conftest.$ac_ext >&5
9461 cf_have_incdir=yes
9462 fi
9463 rm -f conftest.$ac_objext conftest.$ac_ext
9464                           CPPFLAGS=$cf_save_CPPFLAGS
9465                         fi
9466                   fi
9467                 fi
9468
9469                 if test "$cf_have_incdir" = no ; then
9470                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9471
9472 echo "${as_me:-configure}:9472: testing adding $cf_add_incdir to include-path ..." 1>&5
9473
9474                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9475
9476                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9477                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9478                   cf_add_incdir="$cf_top_incdir"
9479                 else
9480                   break
9481                 fi
9482           else
9483                 break
9484           fi
9485         done
9486   done
9487 fi
9488
9489 fi
9490
9491 # Set definitions to allow ifdef'ing for ncurses.h
9492
9493 case $cf_cv_ncurses_header in
9494 (*ncurses.h)
9495
9496 cat >>confdefs.h <<\EOF
9497 #define HAVE_NCURSES_H 1
9498 EOF
9499
9500         ;;
9501 esac
9502
9503 case $cf_cv_ncurses_header in
9504 (ncurses/curses.h|ncurses/ncurses.h)
9505
9506 cat >>confdefs.h <<\EOF
9507 #define HAVE_NCURSES_NCURSES_H 1
9508 EOF
9509
9510         ;;
9511 (ncursesw/curses.h|ncursesw/ncurses.h)
9512
9513 cat >>confdefs.h <<\EOF
9514 #define HAVE_NCURSESW_NCURSES_H 1
9515 EOF
9516
9517         ;;
9518 esac
9519
9520 echo "$as_me:9520: checking for terminfo header" >&5
9521 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9522 if test "${cf_cv_term_header+set}" = set; then
9523   echo $ECHO_N "(cached) $ECHO_C" >&6
9524 else
9525
9526 case ${cf_cv_ncurses_header} in
9527 (*/ncurses.h|*/ncursesw.h)
9528         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9529         ;;
9530 (*)
9531         cf_term_header=term.h
9532         ;;
9533 esac
9534
9535 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9536 do
9537 cat >conftest.$ac_ext <<_ACEOF
9538 #line 9538 "configure"
9539 #include "confdefs.h"
9540 #include <stdio.h>
9541 #include <${cf_cv_ncurses_header:-curses.h}>
9542 #include <$cf_test>
9543
9544 int
9545 main (void)
9546 {
9547 int x = auto_left_margin
9548   ;
9549   return 0;
9550 }
9551 _ACEOF
9552 rm -f conftest.$ac_objext
9553 if { (eval echo "$as_me:9553: \"$ac_compile\"") >&5
9554   (eval $ac_compile) 2>&5
9555   ac_status=$?
9556   echo "$as_me:9556: \$? = $ac_status" >&5
9557   (exit $ac_status); } &&
9558          { ac_try='test -s conftest.$ac_objext'
9559   { (eval echo "$as_me:9559: \"$ac_try\"") >&5
9560   (eval $ac_try) 2>&5
9561   ac_status=$?
9562   echo "$as_me:9562: \$? = $ac_status" >&5
9563   (exit $ac_status); }; }; then
9564
9565         cf_cv_term_header="$cf_test"
9566 else
9567   echo "$as_me: failed program was:" >&5
9568 cat conftest.$ac_ext >&5
9569
9570         cf_cv_term_header=unknown
9571
9572 fi
9573 rm -f conftest.$ac_objext conftest.$ac_ext
9574         test "$cf_cv_term_header" != unknown && break
9575 done
9576
9577 fi
9578 echo "$as_me:9578: result: $cf_cv_term_header" >&5
9579 echo "${ECHO_T}$cf_cv_term_header" >&6
9580
9581 # Set definitions to allow ifdef'ing to accommodate subdirectories
9582
9583 case $cf_cv_term_header in
9584 (*term.h)
9585
9586 cat >>confdefs.h <<\EOF
9587 #define HAVE_TERM_H 1
9588 EOF
9589
9590         ;;
9591 esac
9592
9593 case $cf_cv_term_header in
9594 (ncurses/term.h)
9595
9596 cat >>confdefs.h <<\EOF
9597 #define HAVE_NCURSES_TERM_H 1
9598 EOF
9599
9600         ;;
9601 (ncursesw/term.h)
9602
9603 cat >>confdefs.h <<\EOF
9604 #define HAVE_NCURSESW_TERM_H 1
9605 EOF
9606
9607         ;;
9608 esac
9609
9610 # some applications need this, but should check for NCURSES_VERSION
9611
9612 cat >>confdefs.h <<\EOF
9613 #define NCURSES 1
9614 EOF
9615
9616 echo "$as_me:9616: checking for ncurses version" >&5
9617 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9618 if test "${cf_cv_ncurses_version+set}" = set; then
9619   echo $ECHO_N "(cached) $ECHO_C" >&6
9620 else
9621
9622         cf_cv_ncurses_version=no
9623         cf_tempfile=out$$
9624         rm -f $cf_tempfile
9625         if test "$cross_compiling" = yes; then
9626
9627         # This will not work if the preprocessor splits the line after the
9628         # Autoconf token.  The 'unproto' program does that.
9629         cat > conftest.$ac_ext <<EOF
9630 #include <${cf_cv_ncurses_header:-curses.h}>
9631 #undef Autoconf
9632 #ifdef NCURSES_VERSION
9633 Autoconf NCURSES_VERSION
9634 #else
9635 #ifdef __NCURSES_H
9636 Autoconf "old"
9637 #endif
9638 ;
9639 #endif
9640 EOF
9641         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9642         { (eval echo "$as_me:9642: \"$cf_try\"") >&5
9643   (eval $cf_try) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); }
9647         if test -f conftest.out ; then
9648                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9649                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9650                 rm -f conftest.out
9651         fi
9652
9653 else
9654   cat >conftest.$ac_ext <<_ACEOF
9655 #line 9655 "configure"
9656 #include "confdefs.h"
9657
9658 #include <${cf_cv_ncurses_header:-curses.h}>
9659 #include <stdio.h>
9660 int main(void)
9661 {
9662         FILE *fp = fopen("$cf_tempfile", "w");
9663 #ifdef NCURSES_VERSION
9664 # ifdef NCURSES_VERSION_PATCH
9665         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9666 # else
9667         fprintf(fp, "%s\n", NCURSES_VERSION);
9668 # endif
9669 #else
9670 # ifdef __NCURSES_H
9671         fprintf(fp, "old\n");
9672 # else
9673         make an error
9674 # endif
9675 #endif
9676         ${cf_cv_main_return:-return}(0);
9677 }
9678 _ACEOF
9679 rm -f conftest$ac_exeext
9680 if { (eval echo "$as_me:9680: \"$ac_link\"") >&5
9681   (eval $ac_link) 2>&5
9682   ac_status=$?
9683   echo "$as_me:9683: \$? = $ac_status" >&5
9684   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9685   { (eval echo "$as_me:9685: \"$ac_try\"") >&5
9686   (eval $ac_try) 2>&5
9687   ac_status=$?
9688   echo "$as_me:9688: \$? = $ac_status" >&5
9689   (exit $ac_status); }; }; then
9690
9691         cf_cv_ncurses_version=`cat $cf_tempfile`
9692 else
9693   echo "$as_me: program exited with status $ac_status" >&5
9694 echo "$as_me: failed program was:" >&5
9695 cat conftest.$ac_ext >&5
9696 fi
9697 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9698 fi
9699         rm -f $cf_tempfile
9700
9701 fi
9702 echo "$as_me:9702: result: $cf_cv_ncurses_version" >&5
9703 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9704 test "$cf_cv_ncurses_version" = no ||
9705 cat >>confdefs.h <<\EOF
9706 #define NCURSES 1
9707 EOF
9708
9709 cf_nculib_root=ncurses
9710         # This works, except for the special case where we find gpm, but
9711         # ncurses is in a nonstandard location via $LIBS, and we really want
9712         # to link gpm.
9713 cf_ncurses_LIBS=""
9714 cf_ncurses_SAVE="$LIBS"
9715 echo "$as_me:9715: checking for Gpm_Open in -lgpm" >&5
9716 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9717 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9718   echo $ECHO_N "(cached) $ECHO_C" >&6
9719 else
9720   ac_check_lib_save_LIBS=$LIBS
9721 LIBS="-lgpm  $LIBS"
9722 cat >conftest.$ac_ext <<_ACEOF
9723 #line 9723 "configure"
9724 #include "confdefs.h"
9725
9726 /* Override any gcc2 internal prototype to avoid an error.  */
9727 #ifdef __cplusplus
9728 extern "C"
9729 #endif
9730 /* We use char because int might match the return type of a gcc2
9731    builtin and then its argument prototype would still apply.  */
9732 char Gpm_Open ();
9733 int
9734 main (void)
9735 {
9736 Gpm_Open ();
9737   ;
9738   return 0;
9739 }
9740 _ACEOF
9741 rm -f conftest.$ac_objext conftest$ac_exeext
9742 if { (eval echo "$as_me:9742: \"$ac_link\"") >&5
9743   (eval $ac_link) 2>&5
9744   ac_status=$?
9745   echo "$as_me:9745: \$? = $ac_status" >&5
9746   (exit $ac_status); } &&
9747          { ac_try='test -s conftest$ac_exeext'
9748   { (eval echo "$as_me:9748: \"$ac_try\"") >&5
9749   (eval $ac_try) 2>&5
9750   ac_status=$?
9751   echo "$as_me:9751: \$? = $ac_status" >&5
9752   (exit $ac_status); }; }; then
9753   ac_cv_lib_gpm_Gpm_Open=yes
9754 else
9755   echo "$as_me: failed program was:" >&5
9756 cat conftest.$ac_ext >&5
9757 ac_cv_lib_gpm_Gpm_Open=no
9758 fi
9759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9760 LIBS=$ac_check_lib_save_LIBS
9761 fi
9762 echo "$as_me:9762: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9763 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9764 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9765   echo "$as_me:9765: checking for initscr in -lgpm" >&5
9766 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9767 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9768   echo $ECHO_N "(cached) $ECHO_C" >&6
9769 else
9770   ac_check_lib_save_LIBS=$LIBS
9771 LIBS="-lgpm  $LIBS"
9772 cat >conftest.$ac_ext <<_ACEOF
9773 #line 9773 "configure"
9774 #include "confdefs.h"
9775
9776 /* Override any gcc2 internal prototype to avoid an error.  */
9777 #ifdef __cplusplus
9778 extern "C"
9779 #endif
9780 /* We use char because int might match the return type of a gcc2
9781    builtin and then its argument prototype would still apply.  */
9782 char initscr ();
9783 int
9784 main (void)
9785 {
9786 initscr ();
9787   ;
9788   return 0;
9789 }
9790 _ACEOF
9791 rm -f conftest.$ac_objext conftest$ac_exeext
9792 if { (eval echo "$as_me:9792: \"$ac_link\"") >&5
9793   (eval $ac_link) 2>&5
9794   ac_status=$?
9795   echo "$as_me:9795: \$? = $ac_status" >&5
9796   (exit $ac_status); } &&
9797          { ac_try='test -s conftest$ac_exeext'
9798   { (eval echo "$as_me:9798: \"$ac_try\"") >&5
9799   (eval $ac_try) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); }; }; then
9803   ac_cv_lib_gpm_initscr=yes
9804 else
9805   echo "$as_me: failed program was:" >&5
9806 cat conftest.$ac_ext >&5
9807 ac_cv_lib_gpm_initscr=no
9808 fi
9809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9810 LIBS=$ac_check_lib_save_LIBS
9811 fi
9812 echo "$as_me:9812: result: $ac_cv_lib_gpm_initscr" >&5
9813 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9814 if test $ac_cv_lib_gpm_initscr = yes; then
9815   LIBS="$cf_ncurses_SAVE"
9816 else
9817   cf_ncurses_LIBS="-lgpm"
9818 fi
9819
9820 fi
9821
9822 case $host_os in
9823 (freebsd*)
9824         # This is only necessary if you are linking against an obsolete
9825         # version of ncurses (but it should do no harm, since it's static).
9826         if test "$cf_nculib_root" = ncurses ; then
9827                 echo "$as_me:9827: checking for tgoto in -lmytinfo" >&5
9828 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9829 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9830   echo $ECHO_N "(cached) $ECHO_C" >&6
9831 else
9832   ac_check_lib_save_LIBS=$LIBS
9833 LIBS="-lmytinfo  $LIBS"
9834 cat >conftest.$ac_ext <<_ACEOF
9835 #line 9835 "configure"
9836 #include "confdefs.h"
9837
9838 /* Override any gcc2 internal prototype to avoid an error.  */
9839 #ifdef __cplusplus
9840 extern "C"
9841 #endif
9842 /* We use char because int might match the return type of a gcc2
9843    builtin and then its argument prototype would still apply.  */
9844 char tgoto ();
9845 int
9846 main (void)
9847 {
9848 tgoto ();
9849   ;
9850   return 0;
9851 }
9852 _ACEOF
9853 rm -f conftest.$ac_objext conftest$ac_exeext
9854 if { (eval echo "$as_me:9854: \"$ac_link\"") >&5
9855   (eval $ac_link) 2>&5
9856   ac_status=$?
9857   echo "$as_me:9857: \$? = $ac_status" >&5
9858   (exit $ac_status); } &&
9859          { ac_try='test -s conftest$ac_exeext'
9860   { (eval echo "$as_me:9860: \"$ac_try\"") >&5
9861   (eval $ac_try) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit $ac_status); }; }; then
9865   ac_cv_lib_mytinfo_tgoto=yes
9866 else
9867   echo "$as_me: failed program was:" >&5
9868 cat conftest.$ac_ext >&5
9869 ac_cv_lib_mytinfo_tgoto=no
9870 fi
9871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9872 LIBS=$ac_check_lib_save_LIBS
9873 fi
9874 echo "$as_me:9874: result: $ac_cv_lib_mytinfo_tgoto" >&5
9875 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9876 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9877   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9878 fi
9879
9880         fi
9881         ;;
9882 esac
9883
9884 cf_add_libs="$LIBS"
9885 # reverse order
9886 cf_add_0lib=
9887 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9888 # filter duplicates
9889 for cf_add_1lib in $cf_add_0lib; do
9890         for cf_add_2lib in $cf_add_libs; do
9891                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9892                         cf_add_1lib=
9893                         break
9894                 fi
9895         done
9896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9897 done
9898 LIBS="$cf_add_libs"
9899
9900 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9901 then
9902
9903 cf_add_libs="$LIBS"
9904 # reverse order
9905 cf_add_0lib=
9906 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9907 # filter duplicates
9908 for cf_add_1lib in $cf_add_0lib; do
9909         for cf_add_2lib in $cf_add_libs; do
9910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9911                         cf_add_1lib=
9912                         break
9913                 fi
9914         done
9915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9916 done
9917 LIBS="$cf_add_libs"
9918
9919 else
9920
9921         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9922         cf_libdir=""
9923         echo "$as_me:9923: checking for initscr" >&5
9924 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9925 if test "${ac_cv_func_initscr+set}" = set; then
9926   echo $ECHO_N "(cached) $ECHO_C" >&6
9927 else
9928   cat >conftest.$ac_ext <<_ACEOF
9929 #line 9929 "configure"
9930 #include "confdefs.h"
9931 #define initscr autoconf_temporary
9932 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9933 #undef initscr
9934
9935 #ifdef __cplusplus
9936 extern "C"
9937 #endif
9938
9939 /* We use char because int might match the return type of a gcc2
9940    builtin and then its argument prototype would still apply.  */
9941 char initscr (void);
9942
9943 int
9944 main (void)
9945 {
9946
9947 /* The GNU C library defines stubs for functions which it implements
9948     to always fail with ENOSYS.  Some functions are actually named
9949     something starting with __ and the normal name is an alias.  */
9950 #if defined (__stub_initscr) || defined (__stub___initscr)
9951 #error found stub for initscr
9952 #endif
9953
9954         return initscr ();
9955   ;
9956   return 0;
9957 }
9958 _ACEOF
9959 rm -f conftest.$ac_objext conftest$ac_exeext
9960 if { (eval echo "$as_me:9960: \"$ac_link\"") >&5
9961   (eval $ac_link) 2>&5
9962   ac_status=$?
9963   echo "$as_me:9963: \$? = $ac_status" >&5
9964   (exit $ac_status); } &&
9965          { ac_try='test -s conftest$ac_exeext'
9966   { (eval echo "$as_me:9966: \"$ac_try\"") >&5
9967   (eval $ac_try) 2>&5
9968   ac_status=$?
9969   echo "$as_me:9969: \$? = $ac_status" >&5
9970   (exit $ac_status); }; }; then
9971   ac_cv_func_initscr=yes
9972 else
9973   echo "$as_me: failed program was:" >&5
9974 cat conftest.$ac_ext >&5
9975 ac_cv_func_initscr=no
9976 fi
9977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9978 fi
9979 echo "$as_me:9979: result: $ac_cv_func_initscr" >&5
9980 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9981 if test $ac_cv_func_initscr = yes; then
9982   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9983 else
9984
9985                 cf_save_LIBS="$LIBS"
9986                 echo "$as_me:9986: checking for initscr in -l$cf_nculib_root" >&5
9987 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9988                 LIBS="-l$cf_nculib_root $LIBS"
9989                 cat >conftest.$ac_ext <<_ACEOF
9990 #line 9990 "configure"
9991 #include "confdefs.h"
9992 #include <${cf_cv_ncurses_header:-curses.h}>
9993 int
9994 main (void)
9995 {
9996 initscr()
9997   ;
9998   return 0;
9999 }
10000 _ACEOF
10001 rm -f conftest.$ac_objext conftest$ac_exeext
10002 if { (eval echo "$as_me:10002: \"$ac_link\"") >&5
10003   (eval $ac_link) 2>&5
10004   ac_status=$?
10005   echo "$as_me:10005: \$? = $ac_status" >&5
10006   (exit $ac_status); } &&
10007          { ac_try='test -s conftest$ac_exeext'
10008   { (eval echo "$as_me:10008: \"$ac_try\"") >&5
10009   (eval $ac_try) 2>&5
10010   ac_status=$?
10011   echo "$as_me:10011: \$? = $ac_status" >&5
10012   (exit $ac_status); }; }; then
10013   echo "$as_me:10013: result: yes" >&5
10014 echo "${ECHO_T}yes" >&6
10015                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10016
10017 else
10018   echo "$as_me: failed program was:" >&5
10019 cat conftest.$ac_ext >&5
10020 echo "$as_me:10020: result: no" >&5
10021 echo "${ECHO_T}no" >&6
10022
10023 cf_search=
10024 cf_library_path_list=""
10025 if test -n "${LDFLAGS}${LIBS}" ; then
10026         for cf_library_path in $LDFLAGS $LIBS
10027         do
10028                 case $cf_library_path in
10029                 (-L*)
10030                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10031
10032 test "x$cf_library_path" != "xNONE" && \
10033 test -d "$cf_library_path" && \
10034  {
10035         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10036         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10037         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10038         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10039         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10040         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"
10041 }
10042
10043                         cf_library_path_list="$cf_library_path_list $cf_search"
10044                         ;;
10045                 esac
10046         done
10047 fi
10048
10049 cf_search=
10050
10051 test "x$prefix" != "xNONE" && \
10052 test -d "$prefix" && \
10053  {
10054         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10055         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10056         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10057         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10058         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10059         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10060 }
10061
10062 for cf_subdir_prefix in \
10063         /usr \
10064         /usr/local \
10065         /usr/pkg \
10066         /opt \
10067         /opt/local \
10068         $HOME
10069 do
10070
10071 test "x$cf_subdir_prefix" != "x$prefix" && \
10072 test -d "$cf_subdir_prefix" && \
10073 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10074         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10075         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10076         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10077         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10078         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10079         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"
10080 }
10081
10082 done
10083
10084 cf_search="$cf_library_path_list $cf_search"
10085
10086                         for cf_libdir in $cf_search
10087                         do
10088                                 echo "$as_me:10088: checking for -l$cf_nculib_root in $cf_libdir" >&5
10089 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10090                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10091                                 cat >conftest.$ac_ext <<_ACEOF
10092 #line 10092 "configure"
10093 #include "confdefs.h"
10094 #include <${cf_cv_ncurses_header:-curses.h}>
10095 int
10096 main (void)
10097 {
10098 initscr()
10099   ;
10100   return 0;
10101 }
10102 _ACEOF
10103 rm -f conftest.$ac_objext conftest$ac_exeext
10104 if { (eval echo "$as_me:10104: \"$ac_link\"") >&5
10105   (eval $ac_link) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); } &&
10109          { ac_try='test -s conftest$ac_exeext'
10110   { (eval echo "$as_me:10110: \"$ac_try\"") >&5
10111   (eval $ac_try) 2>&5
10112   ac_status=$?
10113   echo "$as_me:10113: \$? = $ac_status" >&5
10114   (exit $ac_status); }; }; then
10115   echo "$as_me:10115: result: yes" >&5
10116 echo "${ECHO_T}yes" >&6
10117                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10118                                          break
10119 else
10120   echo "$as_me: failed program was:" >&5
10121 cat conftest.$ac_ext >&5
10122 echo "$as_me:10122: result: no" >&5
10123 echo "${ECHO_T}no" >&6
10124                                          LIBS="$cf_save_LIBS"
10125 fi
10126 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10127                         done
10128
10129 fi
10130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10131
10132 fi
10133
10134 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10135
10136 if test $cf_found_library = no ; then
10137         { { echo "$as_me:10137: error: Cannot link $cf_nculib_root library" >&5
10138 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10139    { (exit 1); exit 1; }; }
10140 fi
10141
10142 fi
10143
10144 if test -n "$cf_ncurses_LIBS" ; then
10145         echo "$as_me:10145: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10146 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10147         cf_ncurses_SAVE="$LIBS"
10148         for p in $cf_ncurses_LIBS ; do
10149                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10150                 if test "$q" != "$LIBS" ; then
10151                         LIBS="$q"
10152                 fi
10153         done
10154         cat >conftest.$ac_ext <<_ACEOF
10155 #line 10155 "configure"
10156 #include "confdefs.h"
10157 #include <${cf_cv_ncurses_header:-curses.h}>
10158 int
10159 main (void)
10160 {
10161 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10162   ;
10163   return 0;
10164 }
10165 _ACEOF
10166 rm -f conftest.$ac_objext conftest$ac_exeext
10167 if { (eval echo "$as_me:10167: \"$ac_link\"") >&5
10168   (eval $ac_link) 2>&5
10169   ac_status=$?
10170   echo "$as_me:10170: \$? = $ac_status" >&5
10171   (exit $ac_status); } &&
10172          { ac_try='test -s conftest$ac_exeext'
10173   { (eval echo "$as_me:10173: \"$ac_try\"") >&5
10174   (eval $ac_try) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); }; }; then
10178   echo "$as_me:10178: result: yes" >&5
10179 echo "${ECHO_T}yes" >&6
10180 else
10181   echo "$as_me: failed program was:" >&5
10182 cat conftest.$ac_ext >&5
10183 echo "$as_me:10183: result: no" >&5
10184 echo "${ECHO_T}no" >&6
10185                  LIBS="$cf_ncurses_SAVE"
10186 fi
10187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10188 fi
10189
10190 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10191
10192 cat >>confdefs.h <<EOF
10193 #define $cf_nculib_ROOT 1
10194 EOF
10195
10196         fi
10197 else
10198         NCURSES_CONFIG=none
10199 fi
10200
10201 fi
10202
10203 if test "$NCURSES_CONFIG_PKG" != none ; then
10204         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10205
10206         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10207         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10208         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10209
10210         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10211         if test -z "$cf_cv_abi_version"
10212         then
10213                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10214         fi
10215
10216 elif test "$NCURSES_CONFIG" != none ; then
10217
10218         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10219
10220         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10221         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10222         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10223
10224         # ABI version is not available from headers
10225         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10226
10227 else
10228
10229         for cf_name in MAJOR MINOR PATCH
10230         do
10231         cat >conftest.$ac_ext <<CF_EOF
10232         #include <${cf_cv_ncurses_header:-curses.h}>
10233         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10234 CF_EOF
10235                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10236                 { (eval echo "$as_me:10236: \"$cf_try\"") >&5
10237   (eval $cf_try) 2>&5
10238   ac_status=$?
10239   echo "$as_me:10239: \$? = $ac_status" >&5
10240   (exit $ac_status); }
10241                 if test -f conftest.out ; then
10242                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10243                         eval NCURSES_$cf_name=\"$cf_result\"
10244                         # cat conftest.$ac_ext
10245                         # cat conftest.out
10246                 fi
10247         done
10248
10249         cf_cv_abi_version=${NCURSES_MAJOR}
10250
10251 fi
10252
10253 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10254
10255 cf_cv_timestamp=`date`
10256
10257 echo "$as_me:10257: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10258 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10259
10260 echo "$as_me:10260: checking if you want to have a library-prefix" >&5
10261 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10262
10263 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10264 if test "${with_lib_prefix+set}" = set; then
10265   withval="$with_lib_prefix"
10266   with_lib_prefix=$withval
10267 else
10268   with_lib_prefix=auto
10269 fi;
10270 echo "$as_me:10270: result: $with_lib_prefix" >&5
10271 echo "${ECHO_T}$with_lib_prefix" >&6
10272
10273 if test $with_lib_prefix = auto
10274 then
10275
10276         case $cf_cv_system_name in
10277         (OS/2*|os2*)
10278                 if test "$DFT_LWR_MODEL" = libtool; then
10279                         LIB_PREFIX='lib'
10280                 else
10281                         LIB_PREFIX=''
10282                 fi
10283                 ;;
10284         (*)     LIB_PREFIX='lib'
10285                 ;;
10286         esac
10287 cf_prefix=$LIB_PREFIX
10288
10289 elif test $with_lib_prefix = no
10290 then
10291         LIB_PREFIX=
10292 else
10293         LIB_PREFIX=$with_lib_prefix
10294 fi
10295
10296 LIB_SUFFIX=
10297
10298 ###############################################################################
10299
10300 if test X"$CC_G_OPT" = X"" ; then
10301         CC_G_OPT='-g'
10302         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10303 fi
10304
10305 echo "$as_me:10305: checking for default loader flags" >&5
10306 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10307 case $DFT_LWR_MODEL in
10308 (normal)  LD_MODEL=''   ;;
10309 (debug)   LD_MODEL=$CC_G_OPT ;;
10310 (profile) LD_MODEL='-pg';;
10311 (shared)  LD_MODEL=''   ;;
10312 esac
10313 echo "$as_me:10313: result: $LD_MODEL" >&5
10314 echo "${ECHO_T}$LD_MODEL" >&6
10315
10316 LD_RPATH_OPT=
10317 if test "x$cf_cv_enable_rpath" != xno
10318 then
10319         echo "$as_me:10319: checking for an rpath option" >&5
10320 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10321         case $cf_cv_system_name in
10322         (irix*)
10323                 if test "$GCC" = yes; then
10324                         LD_RPATH_OPT="-Wl,-rpath,"
10325                 else
10326                         LD_RPATH_OPT="-rpath "
10327                 fi
10328                 ;;
10329         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10330                 LD_RPATH_OPT="-Wl,-rpath,"
10331                 ;;
10332         (openbsd[2-9].*|mirbsd*)
10333                 LD_RPATH_OPT="-Wl,-rpath,"
10334                 ;;
10335         (dragonfly*)
10336                 LD_RPATH_OPT="-rpath "
10337                 ;;
10338         (netbsd*)
10339                 LD_RPATH_OPT="-Wl,-rpath,"
10340                 ;;
10341         (osf*|mls+*)
10342                 LD_RPATH_OPT="-rpath "
10343                 ;;
10344         (solaris2*)
10345                 LD_RPATH_OPT="-R"
10346                 ;;
10347         (*)
10348                 ;;
10349         esac
10350         echo "$as_me:10350: result: $LD_RPATH_OPT" >&5
10351 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10352
10353         case "x$LD_RPATH_OPT" in
10354         (x-R*)
10355                 echo "$as_me:10355: checking if we need a space after rpath option" >&5
10356 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10357                 cf_save_LIBS="$LIBS"
10358
10359 cf_add_libs="$LIBS"
10360 # reverse order
10361 cf_add_0lib=
10362 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10363 # filter duplicates
10364 for cf_add_1lib in $cf_add_0lib; do
10365         for cf_add_2lib in $cf_add_libs; do
10366                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10367                         cf_add_1lib=
10368                         break
10369                 fi
10370         done
10371         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10372 done
10373 LIBS="$cf_add_libs"
10374
10375                 cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 int
10380 main (void)
10381 {
10382
10383   ;
10384   return 0;
10385 }
10386 _ACEOF
10387 rm -f conftest.$ac_objext conftest$ac_exeext
10388 if { (eval echo "$as_me:10388: \"$ac_link\"") >&5
10389   (eval $ac_link) 2>&5
10390   ac_status=$?
10391   echo "$as_me:10391: \$? = $ac_status" >&5
10392   (exit $ac_status); } &&
10393          { ac_try='test -s conftest$ac_exeext'
10394   { (eval echo "$as_me:10394: \"$ac_try\"") >&5
10395   (eval $ac_try) 2>&5
10396   ac_status=$?
10397   echo "$as_me:10397: \$? = $ac_status" >&5
10398   (exit $ac_status); }; }; then
10399   cf_rpath_space=no
10400 else
10401   echo "$as_me: failed program was:" >&5
10402 cat conftest.$ac_ext >&5
10403 cf_rpath_space=yes
10404 fi
10405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10406                 LIBS="$cf_save_LIBS"
10407                 echo "$as_me:10407: result: $cf_rpath_space" >&5
10408 echo "${ECHO_T}$cf_rpath_space" >&6
10409                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
10410                 ;;
10411         esac
10412 fi
10413
10414         RM_SHARED_OPTS=
10415         LOCAL_LDFLAGS=
10416         LOCAL_LDFLAGS2=
10417         LD_SHARED_OPTS=
10418         INSTALL_LIB="-m 644"
10419         : ${rel_builddir:=.}
10420
10421         shlibdir=$libdir
10422
10423         MAKE_DLLS="#"
10424
10425         cf_cv_do_symlinks=no
10426         cf_ld_rpath_opt=
10427         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
10428
10429         echo "$as_me:10429: checking if release/abi version should be used for shared libs" >&5
10430 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
10431
10432 # Check whether --with-shlib-version or --without-shlib-version was given.
10433 if test "${with_shlib_version+set}" = set; then
10434   withval="$with_shlib_version"
10435   test -z "$withval" && withval=auto
10436         case $withval in
10437         (yes)
10438                 cf_cv_shlib_version=auto
10439                 ;;
10440         (rel|abi|auto)
10441                 cf_cv_shlib_version=$withval
10442                 ;;
10443         (*)
10444                 echo "$as_me:10444: result: $withval" >&5
10445 echo "${ECHO_T}$withval" >&6
10446                 { { echo "$as_me:10446: error: option value must be one of: rel, abi, or auto" >&5
10447 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
10448    { (exit 1); exit 1; }; }
10449                 ;;
10450         esac
10451
10452 else
10453   cf_cv_shlib_version=auto
10454 fi;
10455         echo "$as_me:10455: result: $cf_cv_shlib_version" >&5
10456 echo "${ECHO_T}$cf_cv_shlib_version" >&6
10457
10458         cf_cv_rm_so_locs=no
10459         cf_try_cflags=
10460
10461         # Some less-capable ports of gcc support only -fpic
10462         CC_SHARED_OPTS=
10463
10464         cf_try_fPIC=no
10465         if test "$GCC" = yes
10466         then
10467                 cf_try_fPIC=yes
10468         else
10469                 case $cf_cv_system_name in
10470                 (*linux*)       # e.g., PGI compiler
10471                         cf_try_fPIC=yes
10472                         ;;
10473                 esac
10474         fi
10475
10476         if test "$cf_try_fPIC" = yes
10477         then
10478                 echo "$as_me:10478: checking which $CC option to use" >&5
10479 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
10480                 cf_save_CFLAGS="$CFLAGS"
10481                 for CC_SHARED_OPTS in -fPIC -fpic ''
10482                 do
10483                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
10484                         cat >conftest.$ac_ext <<_ACEOF
10485 #line 10485 "configure"
10486 #include "confdefs.h"
10487 #include <stdio.h>
10488 int
10489 main (void)
10490 {
10491 int x = 1
10492   ;
10493   return 0;
10494 }
10495 _ACEOF
10496 rm -f conftest.$ac_objext
10497 if { (eval echo "$as_me:10497: \"$ac_compile\"") >&5
10498   (eval $ac_compile) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); } &&
10502          { ac_try='test -s conftest.$ac_objext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508   break
10509 else
10510   echo "$as_me: failed program was:" >&5
10511 cat conftest.$ac_ext >&5
10512 fi
10513 rm -f conftest.$ac_objext conftest.$ac_ext
10514                 done
10515                 echo "$as_me:10515: result: $CC_SHARED_OPTS" >&5
10516 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
10517                 CFLAGS="$cf_save_CFLAGS"
10518         fi
10519
10520         cf_cv_shlib_version_infix=no
10521
10522         case $cf_cv_system_name in
10523         (aix4.3-9*|aix[5-7]*)
10524                 if test "$GCC" = yes; then
10525                         CC_SHARED_OPTS='-Wl,-brtl'
10526                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10527                 else
10528                         CC_SHARED_OPTS='-brtl'
10529                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
10530                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10531                 fi
10532                 ;;
10533         (beos*)
10534                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
10535                 ;;
10536         (cygwin*)
10537                 CC_SHARED_OPTS=
10538                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10539                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10540                 cf_cv_shlib_version=cygdll
10541                 cf_cv_shlib_version_infix=cygdll
10542                 shlibdir=$bindir
10543                 MAKE_DLLS=
10544                 cat >mk_shared_lib.sh <<-CF_EOF
10545                 #!$SHELL
10546                 SHARED_LIB=\$1
10547                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10548                 shift
10549                 cat <<-EOF
10550                 Linking shared library
10551                 ** SHARED_LIB \$SHARED_LIB
10552                 ** IMPORT_LIB \$IMPORT_LIB
10553 EOF
10554                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10555 CF_EOF
10556                 chmod +x mk_shared_lib.sh
10557                 ;;
10558         (msys*)
10559                 CC_SHARED_OPTS=
10560                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10561                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10562                 cf_cv_shlib_version=msysdll
10563                 cf_cv_shlib_version_infix=msysdll
10564                 shlibdir=$bindir
10565                 MAKE_DLLS=
10566                 cat >mk_shared_lib.sh <<-CF_EOF
10567                 #!$SHELL
10568                 SHARED_LIB=\$1
10569                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10570                 shift
10571                 cat <<-EOF
10572                 Linking shared library
10573                 ** SHARED_LIB \$SHARED_LIB
10574                 ** IMPORT_LIB \$IMPORT_LIB
10575 EOF
10576                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10577 CF_EOF
10578                 chmod +x mk_shared_lib.sh
10579                 ;;
10580         (darwin*)
10581                 cf_try_cflags="no-cpp-precomp"
10582                 CC_SHARED_OPTS="-dynamic"
10583                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
10584                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
10585                 cf_cv_shlib_version_infix=yes
10586                 echo "$as_me:10586: checking if ld -search_paths_first works" >&5
10587 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
10588 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
10589   echo $ECHO_N "(cached) $ECHO_C" >&6
10590 else
10591
10592                         cf_save_LDFLAGS=$LDFLAGS
10593                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10594                         cat >conftest.$ac_ext <<_ACEOF
10595 #line 10595 "configure"
10596 #include "confdefs.h"
10597
10598 int
10599 main (void)
10600 {
10601 int i;
10602   ;
10603   return 0;
10604 }
10605 _ACEOF
10606 rm -f conftest.$ac_objext conftest$ac_exeext
10607 if { (eval echo "$as_me:10607: \"$ac_link\"") >&5
10608   (eval $ac_link) 2>&5
10609   ac_status=$?
10610   echo "$as_me:10610: \$? = $ac_status" >&5
10611   (exit $ac_status); } &&
10612          { ac_try='test -s conftest$ac_exeext'
10613   { (eval echo "$as_me:10613: \"$ac_try\"") >&5
10614   (eval $ac_try) 2>&5
10615   ac_status=$?
10616   echo "$as_me:10616: \$? = $ac_status" >&5
10617   (exit $ac_status); }; }; then
10618   cf_cv_ldflags_search_paths_first=yes
10619 else
10620   echo "$as_me: failed program was:" >&5
10621 cat conftest.$ac_ext >&5
10622 cf_cv_ldflags_search_paths_first=no
10623 fi
10624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10625                                 LDFLAGS=$cf_save_LDFLAGS
10626 fi
10627 echo "$as_me:10627: result: $cf_cv_ldflags_search_paths_first" >&5
10628 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
10629                 if test $cf_cv_ldflags_search_paths_first = yes; then
10630                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10631                 fi
10632                 ;;
10633         (hpux[7-8]*)
10634                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
10635                 if test "$GCC" != yes; then
10636                         CC_SHARED_OPTS='+Z'
10637                 fi
10638                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
10639                 INSTALL_LIB="-m 555"
10640                 ;;
10641         (hpux*)
10642                 # (tested with gcc 2.7.2 -- I don't have c89)
10643                 if test "$GCC" = yes; then
10644                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
10645                 else
10646                         CC_SHARED_OPTS='+Z'
10647                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
10648                 fi
10649                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
10650                 # HP-UX shared libraries must be executable, and should be
10651                 # readonly to exploit a quirk in the memory manager.
10652                 INSTALL_LIB="-m 555"
10653                 ;;
10654         (interix*)
10655                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10656                 if test "$cf_cv_shlib_version" = rel; then
10657                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10658                 else
10659                         cf_shared_soname='`basename $@`'
10660                 fi
10661                 CC_SHARED_OPTS=
10662                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
10663                 ;;
10664         (irix*)
10665                 if test "$cf_cv_enable_rpath" = yes ; then
10666                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10667                 fi
10668                 # tested with IRIX 5.2 and 'cc'.
10669                 if test "$GCC" != yes; then
10670                         CC_SHARED_OPTS='-KPIC'
10671                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
10672                 else
10673                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
10674                 fi
10675                 cf_cv_rm_so_locs=yes
10676                 ;;
10677         (linux*|gnu*|k*bsd*-gnu)
10678                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10679                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10680                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10681                 fi
10682                 if test "$cf_cv_enable_rpath" = yes ; then
10683                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10684                 fi
10685
10686         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10687         if test "$cf_cv_shlib_version" = rel; then
10688                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10689         else
10690                 cf_cv_shared_soname='`basename $@`'
10691         fi
10692
10693                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10694                 ;;
10695         (mingw*)
10696                 cf_cv_shlib_version=mingw
10697                 cf_cv_shlib_version_infix=mingw
10698                 shlibdir=$bindir
10699                 MAKE_DLLS=
10700                 if test "$DFT_LWR_MODEL" = "shared" ; then
10701                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
10702                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10703                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
10704                 fi
10705                 CC_SHARED_OPTS=
10706                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10707                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10708                 cat >mk_shared_lib.sh <<-CF_EOF
10709                 #!$SHELL
10710                 SHARED_LIB=\$1
10711                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
10712                 shift
10713                 cat <<-EOF
10714                 Linking shared library
10715                 ** SHARED_LIB \$SHARED_LIB
10716                 ** IMPORT_LIB \$IMPORT_LIB
10717 EOF
10718                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10719 CF_EOF
10720                 chmod +x mk_shared_lib.sh
10721                 ;;
10722         (openbsd[2-9].*|mirbsd*)
10723                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10724                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10725                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10726                 fi
10727                 if test "$cf_cv_enable_rpath" = yes ; then
10728                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10729                 fi
10730                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10731
10732         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10733         if test "$cf_cv_shlib_version" = rel; then
10734                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10735         else
10736                 cf_cv_shared_soname='`basename $@`'
10737         fi
10738
10739                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10740                 ;;
10741         (nto-qnx*|openbsd*|freebsd[12].*)
10742                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10743                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
10744                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10745                 ;;
10746         (dragonfly*|freebsd*)
10747                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10748                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10749                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10750                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
10751                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10752                 fi
10753
10754         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10755         if test "$cf_cv_shlib_version" = rel; then
10756                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10757         else
10758                 cf_cv_shared_soname='`basename $@`'
10759         fi
10760
10761                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10762                 ;;
10763         (netbsd*)
10764                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10765                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10766                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10767                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10768                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10769                         if test "$cf_cv_shlib_version" = auto; then
10770                         if test -f /usr/libexec/ld.elf_so; then
10771                                 cf_cv_shlib_version=abi
10772                         else
10773                                 cf_cv_shlib_version=rel
10774                         fi
10775                         fi
10776
10777         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10778         if test "$cf_cv_shlib_version" = rel; then
10779                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10780         else
10781                 cf_cv_shared_soname='`basename $@`'
10782         fi
10783
10784                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
10785                 else
10786                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
10787                 fi
10788                 ;;
10789         (osf*|mls+*)
10790                 # tested with OSF/1 V3.2 and 'cc'
10791                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
10792                 # link with shared libs).
10793                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
10794                 case $host_os in
10795                 (osf4*)
10796                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
10797                         ;;
10798                 esac
10799                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
10800                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10801                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10802                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10803                 fi
10804                 cf_cv_rm_so_locs=yes
10805                 ;;
10806         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
10807                 # tested with osr5.0.5
10808                 if test "$GCC" != yes; then
10809                         CC_SHARED_OPTS='-belf -KPIC'
10810                 fi
10811                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
10812                 if test "$cf_cv_enable_rpath" = yes ; then
10813                         # only way is to set LD_RUN_PATH but no switch for it
10814                         RUN_PATH=$libdir
10815                 fi
10816                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10817                 LINK_PROGS='LD_RUN_PATH=${libdir}'
10818                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
10819                 ;;
10820         (sunos4*)
10821                 # tested with SunOS 4.1.1 and gcc 2.7.0
10822                 if test "$GCC" != yes; then
10823                         CC_SHARED_OPTS='-KPIC'
10824                 fi
10825                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
10826                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10827                 ;;
10828         (solaris2*)
10829                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
10830                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
10831                 if test "$DFT_LWR_MODEL" = "shared" ; then
10832                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
10833                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10834                 fi
10835                 if test "$cf_cv_enable_rpath" = yes ; then
10836                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
10837                 fi
10838
10839         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10840         if test "$cf_cv_shlib_version" = rel; then
10841                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10842         else
10843                 cf_cv_shared_soname='`basename $@`'
10844         fi
10845
10846                 if test "$GCC" != yes; then
10847                         cf_save_CFLAGS="$CFLAGS"
10848                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
10849                         do
10850                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
10851                                 cat >conftest.$ac_ext <<_ACEOF
10852 #line 10852 "configure"
10853 #include "confdefs.h"
10854 #include <stdio.h>
10855 int
10856 main (void)
10857 {
10858 printf("Hello\n");
10859   ;
10860   return 0;
10861 }
10862 _ACEOF
10863 rm -f conftest.$ac_objext
10864 if { (eval echo "$as_me:10864: \"$ac_compile\"") >&5
10865   (eval $ac_compile) 2>&5
10866   ac_status=$?
10867   echo "$as_me:10867: \$? = $ac_status" >&5
10868   (exit $ac_status); } &&
10869          { ac_try='test -s conftest.$ac_objext'
10870   { (eval echo "$as_me:10870: \"$ac_try\"") >&5
10871   (eval $ac_try) 2>&5
10872   ac_status=$?
10873   echo "$as_me:10873: \$? = $ac_status" >&5
10874   (exit $ac_status); }; }; then
10875   break
10876 else
10877   echo "$as_me: failed program was:" >&5
10878 cat conftest.$ac_ext >&5
10879 fi
10880 rm -f conftest.$ac_objext conftest.$ac_ext
10881                         done
10882                         CFLAGS="$cf_save_CFLAGS"
10883                         CC_SHARED_OPTS=$cf_shared_opts
10884                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10885                 else
10886                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10887                 fi
10888                 ;;
10889         (sysv5uw7*|unix_sv*)
10890                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10891                 if test "$GCC" != yes; then
10892                         CC_SHARED_OPTS='-KPIC'
10893                 fi
10894                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10895                 ;;
10896         (*)
10897                 CC_SHARED_OPTS='unknown'
10898                 MK_SHARED_LIB='echo unknown'
10899                 ;;
10900         esac
10901
10902         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10903         case "$cf_cv_shlib_version" in
10904         (rel|abi)
10905                 case "$MK_SHARED_LIB" in
10906                 (*'-o $@')
10907                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10908                         ;;
10909                 (*)
10910                         { echo "$as_me:10910: WARNING: ignored --with-shlib-version" >&5
10911 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10912                         ;;
10913                 esac
10914                 ;;
10915         esac
10916
10917         if test -n "$cf_try_cflags"
10918         then
10919 cat > conftest.$ac_ext <<EOF
10920 #line 10920 "${as_me:-configure}"
10921 #include <stdio.h>
10922 int main(int argc, char *argv[])
10923 {
10924         printf("hello\n");
10925         return (argv[argc-1] == 0) ;
10926 }
10927 EOF
10928                 cf_save_CFLAGS="$CFLAGS"
10929                 for cf_opt in $cf_try_cflags
10930                 do
10931                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10932                         echo "$as_me:10932: checking if CFLAGS option -$cf_opt works" >&5
10933 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10934                         if { (eval echo "$as_me:10934: \"$ac_compile\"") >&5
10935   (eval $ac_compile) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit $ac_status); }; then
10939                                 echo "$as_me:10939: result: yes" >&5
10940 echo "${ECHO_T}yes" >&6
10941                                 cf_save_CFLAGS="$CFLAGS"
10942                         else
10943                                 echo "$as_me:10943: result: no" >&5
10944 echo "${ECHO_T}no" >&6
10945                         fi
10946                 done
10947                 CFLAGS="$cf_save_CFLAGS"
10948         fi
10949
10950         # RPATH_LIST is a colon-separated list of directories
10951         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10952         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10953
10954         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10955
10956         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10957
10958 echo "${as_me:-configure}:10958: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10959
10960         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10961
10962 echo "${as_me:-configure}:10962: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10963
10964 # The test/sample programs in the original tree link using rpath option.
10965 # Make it optional for packagers.
10966 if test -n "$LOCAL_LDFLAGS"
10967 then
10968         echo "$as_me:10968: checking if you want to link sample programs with rpath option" >&5
10969 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10970
10971 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10972 if test "${enable_rpath_link+set}" = set; then
10973   enableval="$enable_rpath_link"
10974   with_rpath_link=$enableval
10975 else
10976   with_rpath_link=yes
10977 fi;
10978         echo "$as_me:10978: result: $with_rpath_link" >&5
10979 echo "${ECHO_T}$with_rpath_link" >&6
10980         if test "$with_rpath_link" = no
10981         then
10982                 LOCAL_LDFLAGS=
10983                 LOCAL_LDFLAGS2=
10984         fi
10985 fi
10986
10987 ###############################################################################
10988
10989 ###   use option --enable-broken-linker to force on use of broken-linker support
10990 echo "$as_me:10990: checking if you want broken-linker support code" >&5
10991 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10992
10993 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10994 if test "${enable_broken_linker+set}" = set; then
10995   enableval="$enable_broken_linker"
10996   with_broken_linker=$enableval
10997 else
10998   with_broken_linker=${BROKEN_LINKER:-no}
10999 fi;
11000 echo "$as_me:11000: result: $with_broken_linker" >&5
11001 echo "${ECHO_T}$with_broken_linker" >&6
11002
11003 BROKEN_LINKER=0
11004 if test "$with_broken_linker" = yes ; then
11005         cat >>confdefs.h <<\EOF
11006 #define BROKEN_LINKER 1
11007 EOF
11008
11009         BROKEN_LINKER=1
11010 elif test "$DFT_LWR_MODEL" = shared ; then
11011         case $cf_cv_system_name in
11012         (cygwin*)
11013                 cat >>confdefs.h <<\EOF
11014 #define BROKEN_LINKER 1
11015 EOF
11016
11017                 BROKEN_LINKER=1
11018                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
11019
11020 echo "${as_me:-configure}:11020: testing cygwin linker is broken anyway ..." 1>&5
11021
11022                 ;;
11023         esac
11024 fi
11025
11026 # Check to define _XOPEN_SOURCE "automatically"
11027
11028 echo "$as_me:11028: checking if the POSIX test-macros are already defined" >&5
11029 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11030 if test "${cf_cv_posix_visible+set}" = set; then
11031   echo $ECHO_N "(cached) $ECHO_C" >&6
11032 else
11033
11034 cat >conftest.$ac_ext <<_ACEOF
11035 #line 11035 "configure"
11036 #include "confdefs.h"
11037 #include <stdio.h>
11038 int
11039 main (void)
11040 {
11041
11042 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11043         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11044         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11045         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11046 #error conflicting symbols found
11047 #endif
11048
11049   ;
11050   return 0;
11051 }
11052 _ACEOF
11053 rm -f conftest.$ac_objext
11054 if { (eval echo "$as_me:11054: \"$ac_compile\"") >&5
11055   (eval $ac_compile) 2>&5
11056   ac_status=$?
11057   echo "$as_me:11057: \$? = $ac_status" >&5
11058   (exit $ac_status); } &&
11059          { ac_try='test -s conftest.$ac_objext'
11060   { (eval echo "$as_me:11060: \"$ac_try\"") >&5
11061   (eval $ac_try) 2>&5
11062   ac_status=$?
11063   echo "$as_me:11063: \$? = $ac_status" >&5
11064   (exit $ac_status); }; }; then
11065   cf_cv_posix_visible=no
11066 else
11067   echo "$as_me: failed program was:" >&5
11068 cat conftest.$ac_ext >&5
11069 cf_cv_posix_visible=yes
11070 fi
11071 rm -f conftest.$ac_objext conftest.$ac_ext
11072
11073 fi
11074 echo "$as_me:11074: result: $cf_cv_posix_visible" >&5
11075 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11076
11077 if test "$cf_cv_posix_visible" = no; then
11078
11079 cf_XOPEN_SOURCE=600
11080 cf_POSIX_C_SOURCE=199506L
11081 cf_xopen_source=
11082
11083 case $host_os in
11084 (aix[4-7]*)
11085         cf_xopen_source="-D_ALL_SOURCE"
11086         ;;
11087 (msys)
11088         cf_XOPEN_SOURCE=600
11089         ;;
11090 (darwin[0-8].*)
11091         cf_xopen_source="-D_APPLE_C_SOURCE"
11092         ;;
11093 (darwin*)
11094         cf_xopen_source="-D_DARWIN_C_SOURCE"
11095         cf_XOPEN_SOURCE=
11096         ;;
11097 (freebsd*|dragonfly*|midnightbsd*)
11098         # 5.x headers associate
11099         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11100         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11101         cf_POSIX_C_SOURCE=200112L
11102         cf_XOPEN_SOURCE=600
11103         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11104         ;;
11105 (hpux11*)
11106         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11107         ;;
11108 (hpux*)
11109         cf_xopen_source="-D_HPUX_SOURCE"
11110         ;;
11111 (irix[56].*)
11112         cf_xopen_source="-D_SGI_SOURCE"
11113         cf_XOPEN_SOURCE=
11114         ;;
11115 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11116
11117 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11118
11119 echo "$as_me:11119: checking if this is the GNU C library" >&5
11120 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11121 if test "${cf_cv_gnu_library+set}" = set; then
11122   echo $ECHO_N "(cached) $ECHO_C" >&6
11123 else
11124
11125 cat >conftest.$ac_ext <<_ACEOF
11126 #line 11126 "configure"
11127 #include "confdefs.h"
11128 #include <sys/types.h>
11129 int
11130 main (void)
11131 {
11132
11133         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11134                 return 0;
11135         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11136                 return 0;
11137         #else
11138         #       error not GNU C library
11139         #endif
11140   ;
11141   return 0;
11142 }
11143 _ACEOF
11144 rm -f conftest.$ac_objext
11145 if { (eval echo "$as_me:11145: \"$ac_compile\"") >&5
11146   (eval $ac_compile) 2>&5
11147   ac_status=$?
11148   echo "$as_me:11148: \$? = $ac_status" >&5
11149   (exit $ac_status); } &&
11150          { ac_try='test -s conftest.$ac_objext'
11151   { (eval echo "$as_me:11151: \"$ac_try\"") >&5
11152   (eval $ac_try) 2>&5
11153   ac_status=$?
11154   echo "$as_me:11154: \$? = $ac_status" >&5
11155   (exit $ac_status); }; }; then
11156   cf_cv_gnu_library=yes
11157 else
11158   echo "$as_me: failed program was:" >&5
11159 cat conftest.$ac_ext >&5
11160 cf_cv_gnu_library=no
11161 fi
11162 rm -f conftest.$ac_objext conftest.$ac_ext
11163
11164 fi
11165 echo "$as_me:11165: result: $cf_cv_gnu_library" >&5
11166 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11167
11168 if test x$cf_cv_gnu_library = xyes; then
11169
11170         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11171         # was changed to help a little.  newlib incorporated the change about 4
11172         # years later.
11173         echo "$as_me:11173: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11174 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11175 if test "${cf_cv_gnu_library_219+set}" = set; then
11176   echo $ECHO_N "(cached) $ECHO_C" >&6
11177 else
11178
11179                 cf_save="$CPPFLAGS"
11180
11181         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11182         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11183
11184                 cat >conftest.$ac_ext <<_ACEOF
11185 #line 11185 "configure"
11186 #include "confdefs.h"
11187 #include <sys/types.h>
11188 int
11189 main (void)
11190 {
11191
11192                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11193                                 return 0;
11194                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11195                                 return 0;
11196                         #else
11197                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11198                         #endif
11199   ;
11200   return 0;
11201 }
11202 _ACEOF
11203 rm -f conftest.$ac_objext
11204 if { (eval echo "$as_me:11204: \"$ac_compile\"") >&5
11205   (eval $ac_compile) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); } &&
11209          { ac_try='test -s conftest.$ac_objext'
11210   { (eval echo "$as_me:11210: \"$ac_try\"") >&5
11211   (eval $ac_try) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit $ac_status); }; }; then
11215   cf_cv_gnu_library_219=yes
11216 else
11217   echo "$as_me: failed program was:" >&5
11218 cat conftest.$ac_ext >&5
11219 cf_cv_gnu_library_219=no
11220 fi
11221 rm -f conftest.$ac_objext conftest.$ac_ext
11222                 CPPFLAGS="$cf_save"
11223
11224 fi
11225 echo "$as_me:11225: result: $cf_cv_gnu_library_219" >&5
11226 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11227
11228         if test "x$cf_cv_gnu_library_219" = xyes; then
11229                 cf_save="$CPPFLAGS"
11230                 echo "$as_me:11230: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11231 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11232 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11233   echo $ECHO_N "(cached) $ECHO_C" >&6
11234 else
11235
11236 cf_fix_cppflags=no
11237 cf_new_cflags=
11238 cf_new_cppflags=
11239 cf_new_extra_cppflags=
11240
11241 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11242 do
11243 case $cf_fix_cppflags in
11244 (no)
11245         case $cf_add_cflags in
11246         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11247                 case $cf_add_cflags in
11248                 (-D*)
11249                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11250
11251                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11252                                 && test -z "${cf_tst_cflags}" \
11253                                 && cf_fix_cppflags=yes
11254
11255                         if test $cf_fix_cppflags = yes ; then
11256
11257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11259
11260                                 continue
11261                         elif test "${cf_tst_cflags}" = "\"'" ; then
11262
11263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11265
11266                                 continue
11267                         fi
11268                         ;;
11269                 esac
11270                 case "$CPPFLAGS" in
11271                 (*$cf_add_cflags)
11272                         ;;
11273                 (*)
11274                         case $cf_add_cflags in
11275                         (-D*)
11276                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11277
11278 CPPFLAGS=`echo "$CPPFLAGS" | \
11279         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11280                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11281
11282                                 ;;
11283                         esac
11284
11285         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11286         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11287
11288                         ;;
11289                 esac
11290                 ;;
11291         (*)
11292
11293         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11294         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11295
11296                 ;;
11297         esac
11298         ;;
11299 (yes)
11300
11301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11303
11304         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11305
11306         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11307                 && test -z "${cf_tst_cflags}" \
11308                 && cf_fix_cppflags=no
11309         ;;
11310 esac
11311 done
11312
11313 if test -n "$cf_new_cflags" ; then
11314
11315         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11316         CFLAGS="${CFLAGS}$cf_new_cflags"
11317
11318 fi
11319
11320 if test -n "$cf_new_cppflags" ; then
11321
11322         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11323         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11324
11325 fi
11326
11327 if test -n "$cf_new_extra_cppflags" ; then
11328
11329         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11330         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11331
11332 fi
11333
11334                         cat >conftest.$ac_ext <<_ACEOF
11335 #line 11335 "configure"
11336 #include "confdefs.h"
11337
11338                                 #include <limits.h>
11339                                 #include <sys/types.h>
11340
11341 int
11342 main (void)
11343 {
11344
11345                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11346                                         return 0;
11347                                 #else
11348                                 #       error GNU C library is too old
11349                                 #endif
11350   ;
11351   return 0;
11352 }
11353 _ACEOF
11354 rm -f conftest.$ac_objext
11355 if { (eval echo "$as_me:11355: \"$ac_compile\"") >&5
11356   (eval $ac_compile) 2>&5
11357   ac_status=$?
11358   echo "$as_me:11358: \$? = $ac_status" >&5
11359   (exit $ac_status); } &&
11360          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_gnu_dftsrc_219=yes
11367 else
11368   echo "$as_me: failed program was:" >&5
11369 cat conftest.$ac_ext >&5
11370 cf_cv_gnu_dftsrc_219=no
11371 fi
11372 rm -f conftest.$ac_objext conftest.$ac_ext
11373
11374 fi
11375 echo "$as_me:11375: result: $cf_cv_gnu_dftsrc_219" >&5
11376 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11377                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11378         else
11379                 cf_cv_gnu_dftsrc_219=maybe
11380         fi
11381
11382         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11383
11384                 echo "$as_me:11384: checking if we must define _GNU_SOURCE" >&5
11385 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11386 if test "${cf_cv_gnu_source+set}" = set; then
11387   echo $ECHO_N "(cached) $ECHO_C" >&6
11388 else
11389
11390                 cat >conftest.$ac_ext <<_ACEOF
11391 #line 11391 "configure"
11392 #include "confdefs.h"
11393 #include <sys/types.h>
11394 int
11395 main (void)
11396 {
11397
11398                         #ifndef _XOPEN_SOURCE
11399                         #error  expected _XOPEN_SOURCE to be defined
11400                         #endif
11401   ;
11402   return 0;
11403 }
11404 _ACEOF
11405 rm -f conftest.$ac_objext
11406 if { (eval echo "$as_me:11406: \"$ac_compile\"") >&5
11407   (eval $ac_compile) 2>&5
11408   ac_status=$?
11409   echo "$as_me:11409: \$? = $ac_status" >&5
11410   (exit $ac_status); } &&
11411          { ac_try='test -s conftest.$ac_objext'
11412   { (eval echo "$as_me:11412: \"$ac_try\"") >&5
11413   (eval $ac_try) 2>&5
11414   ac_status=$?
11415   echo "$as_me:11415: \$? = $ac_status" >&5
11416   (exit $ac_status); }; }; then
11417   cf_cv_gnu_source=no
11418 else
11419   echo "$as_me: failed program was:" >&5
11420 cat conftest.$ac_ext >&5
11421 cf_save="$CPPFLAGS"
11422
11423 cf_fix_cppflags=no
11424 cf_new_cflags=
11425 cf_new_cppflags=
11426 cf_new_extra_cppflags=
11427
11428 for cf_add_cflags in -D_GNU_SOURCE
11429 do
11430 case $cf_fix_cppflags in
11431 (no)
11432         case $cf_add_cflags in
11433         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11434                 case $cf_add_cflags in
11435                 (-D*)
11436                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11437
11438                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11439                                 && test -z "${cf_tst_cflags}" \
11440                                 && cf_fix_cppflags=yes
11441
11442                         if test $cf_fix_cppflags = yes ; then
11443
11444         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11445         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11446
11447                                 continue
11448                         elif test "${cf_tst_cflags}" = "\"'" ; then
11449
11450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11452
11453                                 continue
11454                         fi
11455                         ;;
11456                 esac
11457                 case "$CPPFLAGS" in
11458                 (*$cf_add_cflags)
11459                         ;;
11460                 (*)
11461                         case $cf_add_cflags in
11462                         (-D*)
11463                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11464
11465 CPPFLAGS=`echo "$CPPFLAGS" | \
11466         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11467                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11468
11469                                 ;;
11470                         esac
11471
11472         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11473         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11474
11475                         ;;
11476                 esac
11477                 ;;
11478         (*)
11479
11480         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11481         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11482
11483                 ;;
11484         esac
11485         ;;
11486 (yes)
11487
11488         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11489         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11490
11491         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11492
11493         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11494                 && test -z "${cf_tst_cflags}" \
11495                 && cf_fix_cppflags=no
11496         ;;
11497 esac
11498 done
11499
11500 if test -n "$cf_new_cflags" ; then
11501
11502         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11503         CFLAGS="${CFLAGS}$cf_new_cflags"
11504
11505 fi
11506
11507 if test -n "$cf_new_cppflags" ; then
11508
11509         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11510         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11511
11512 fi
11513
11514 if test -n "$cf_new_extra_cppflags" ; then
11515
11516         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11517         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11518
11519 fi
11520
11521                          cat >conftest.$ac_ext <<_ACEOF
11522 #line 11522 "configure"
11523 #include "confdefs.h"
11524 #include <sys/types.h>
11525 int
11526 main (void)
11527 {
11528
11529                                 #ifdef _XOPEN_SOURCE
11530                                 #error  expected _XOPEN_SOURCE to be undefined
11531                                 #endif
11532   ;
11533   return 0;
11534 }
11535 _ACEOF
11536 rm -f conftest.$ac_objext
11537 if { (eval echo "$as_me:11537: \"$ac_compile\"") >&5
11538   (eval $ac_compile) 2>&5
11539   ac_status=$?
11540   echo "$as_me:11540: \$? = $ac_status" >&5
11541   (exit $ac_status); } &&
11542          { ac_try='test -s conftest.$ac_objext'
11543   { (eval echo "$as_me:11543: \"$ac_try\"") >&5
11544   (eval $ac_try) 2>&5
11545   ac_status=$?
11546   echo "$as_me:11546: \$? = $ac_status" >&5
11547   (exit $ac_status); }; }; then
11548   cf_cv_gnu_source=no
11549 else
11550   echo "$as_me: failed program was:" >&5
11551 cat conftest.$ac_ext >&5
11552 cf_cv_gnu_source=yes
11553 fi
11554 rm -f conftest.$ac_objext conftest.$ac_ext
11555                         CPPFLAGS="$cf_save"
11556
11557 fi
11558 rm -f conftest.$ac_objext conftest.$ac_ext
11559
11560 fi
11561 echo "$as_me:11561: result: $cf_cv_gnu_source" >&5
11562 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11563
11564                 if test "$cf_cv_gnu_source" = yes
11565                 then
11566                 echo "$as_me:11566: checking if we should also define _DEFAULT_SOURCE" >&5
11567 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11568 if test "${cf_cv_default_source+set}" = set; then
11569   echo $ECHO_N "(cached) $ECHO_C" >&6
11570 else
11571
11572         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11573         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11574
11575                         cat >conftest.$ac_ext <<_ACEOF
11576 #line 11576 "configure"
11577 #include "confdefs.h"
11578 #include <sys/types.h>
11579 int
11580 main (void)
11581 {
11582
11583                                 #ifdef _DEFAULT_SOURCE
11584                                 #error  expected _DEFAULT_SOURCE to be undefined
11585                                 #endif
11586   ;
11587   return 0;
11588 }
11589 _ACEOF
11590 rm -f conftest.$ac_objext
11591 if { (eval echo "$as_me:11591: \"$ac_compile\"") >&5
11592   (eval $ac_compile) 2>&5
11593   ac_status=$?
11594   echo "$as_me:11594: \$? = $ac_status" >&5
11595   (exit $ac_status); } &&
11596          { ac_try='test -s conftest.$ac_objext'
11597   { (eval echo "$as_me:11597: \"$ac_try\"") >&5
11598   (eval $ac_try) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit $ac_status); }; }; then
11602   cf_cv_default_source=no
11603 else
11604   echo "$as_me: failed program was:" >&5
11605 cat conftest.$ac_ext >&5
11606 cf_cv_default_source=yes
11607 fi
11608 rm -f conftest.$ac_objext conftest.$ac_ext
11609
11610 fi
11611 echo "$as_me:11611: result: $cf_cv_default_source" >&5
11612 echo "${ECHO_T}$cf_cv_default_source" >&6
11613                         if test "$cf_cv_default_source" = yes
11614                         then
11615
11616         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11617         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11618
11619                         fi
11620                 fi
11621         fi
11622
11623 fi
11624
11625         ;;
11626 (minix*)
11627         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11628         ;;
11629 (mirbsd*)
11630         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11631         cf_XOPEN_SOURCE=
11632
11633 if test "$cf_cv_posix_visible" = no; then
11634
11635 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11636
11637 cf_save_CFLAGS="$CFLAGS"
11638 cf_save_CPPFLAGS="$CPPFLAGS"
11639
11640 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11641         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11642                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11643
11644 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11645         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11646                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11647
11648 echo "$as_me:11648: checking if we should define _POSIX_C_SOURCE" >&5
11649 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11650 if test "${cf_cv_posix_c_source+set}" = set; then
11651   echo $ECHO_N "(cached) $ECHO_C" >&6
11652 else
11653
11654 echo "${as_me:-configure}:11654: testing if the symbol is already defined go no further ..." 1>&5
11655
11656         cat >conftest.$ac_ext <<_ACEOF
11657 #line 11657 "configure"
11658 #include "confdefs.h"
11659 #include <sys/types.h>
11660 int
11661 main (void)
11662 {
11663
11664 #ifndef _POSIX_C_SOURCE
11665 make an error
11666 #endif
11667   ;
11668   return 0;
11669 }
11670 _ACEOF
11671 rm -f conftest.$ac_objext
11672 if { (eval echo "$as_me:11672: \"$ac_compile\"") >&5
11673   (eval $ac_compile) 2>&5
11674   ac_status=$?
11675   echo "$as_me:11675: \$? = $ac_status" >&5
11676   (exit $ac_status); } &&
11677          { ac_try='test -s conftest.$ac_objext'
11678   { (eval echo "$as_me:11678: \"$ac_try\"") >&5
11679   (eval $ac_try) 2>&5
11680   ac_status=$?
11681   echo "$as_me:11681: \$? = $ac_status" >&5
11682   (exit $ac_status); }; }; then
11683   cf_cv_posix_c_source=no
11684 else
11685   echo "$as_me: failed program was:" >&5
11686 cat conftest.$ac_ext >&5
11687 cf_want_posix_source=no
11688          case .$cf_POSIX_C_SOURCE in
11689          (.[12]??*)
11690                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11691                 ;;
11692          (.2)
11693                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11694                 cf_want_posix_source=yes
11695                 ;;
11696          (.*)
11697                 cf_want_posix_source=yes
11698                 ;;
11699          esac
11700          if test "$cf_want_posix_source" = yes ; then
11701                 cat >conftest.$ac_ext <<_ACEOF
11702 #line 11702 "configure"
11703 #include "confdefs.h"
11704 #include <sys/types.h>
11705 int
11706 main (void)
11707 {
11708
11709 #ifdef _POSIX_SOURCE
11710 make an error
11711 #endif
11712   ;
11713   return 0;
11714 }
11715 _ACEOF
11716 rm -f conftest.$ac_objext
11717 if { (eval echo "$as_me:11717: \"$ac_compile\"") >&5
11718   (eval $ac_compile) 2>&5
11719   ac_status=$?
11720   echo "$as_me:11720: \$? = $ac_status" >&5
11721   (exit $ac_status); } &&
11722          { ac_try='test -s conftest.$ac_objext'
11723   { (eval echo "$as_me:11723: \"$ac_try\"") >&5
11724   (eval $ac_try) 2>&5
11725   ac_status=$?
11726   echo "$as_me:11726: \$? = $ac_status" >&5
11727   (exit $ac_status); }; }; then
11728   :
11729 else
11730   echo "$as_me: failed program was:" >&5
11731 cat conftest.$ac_ext >&5
11732 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11733 fi
11734 rm -f conftest.$ac_objext conftest.$ac_ext
11735          fi
11736
11737 echo "${as_me:-configure}:11737: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11738
11739          CFLAGS="$cf_trim_CFLAGS"
11740          CPPFLAGS="$cf_trim_CPPFLAGS"
11741
11742         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11743         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11744
11745 echo "${as_me:-configure}:11745: testing if the second compile does not leave our definition intact error ..." 1>&5
11746
11747          cat >conftest.$ac_ext <<_ACEOF
11748 #line 11748 "configure"
11749 #include "confdefs.h"
11750 #include <sys/types.h>
11751 int
11752 main (void)
11753 {
11754
11755 #ifndef _POSIX_C_SOURCE
11756 make an error
11757 #endif
11758   ;
11759   return 0;
11760 }
11761 _ACEOF
11762 rm -f conftest.$ac_objext
11763 if { (eval echo "$as_me:11763: \"$ac_compile\"") >&5
11764   (eval $ac_compile) 2>&5
11765   ac_status=$?
11766   echo "$as_me:11766: \$? = $ac_status" >&5
11767   (exit $ac_status); } &&
11768          { ac_try='test -s conftest.$ac_objext'
11769   { (eval echo "$as_me:11769: \"$ac_try\"") >&5
11770   (eval $ac_try) 2>&5
11771   ac_status=$?
11772   echo "$as_me:11772: \$? = $ac_status" >&5
11773   (exit $ac_status); }; }; then
11774   :
11775 else
11776   echo "$as_me: failed program was:" >&5
11777 cat conftest.$ac_ext >&5
11778 cf_cv_posix_c_source=no
11779 fi
11780 rm -f conftest.$ac_objext conftest.$ac_ext
11781          CFLAGS="$cf_save_CFLAGS"
11782          CPPFLAGS="$cf_save_CPPFLAGS"
11783
11784 fi
11785 rm -f conftest.$ac_objext conftest.$ac_ext
11786
11787 fi
11788 echo "$as_me:11788: result: $cf_cv_posix_c_source" >&5
11789 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11790
11791 if test "$cf_cv_posix_c_source" != no ; then
11792         CFLAGS="$cf_trim_CFLAGS"
11793         CPPFLAGS="$cf_trim_CPPFLAGS"
11794
11795 cf_fix_cppflags=no
11796 cf_new_cflags=
11797 cf_new_cppflags=
11798 cf_new_extra_cppflags=
11799
11800 for cf_add_cflags in $cf_cv_posix_c_source
11801 do
11802 case $cf_fix_cppflags in
11803 (no)
11804         case $cf_add_cflags in
11805         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11806                 case $cf_add_cflags in
11807                 (-D*)
11808                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11809
11810                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11811                                 && test -z "${cf_tst_cflags}" \
11812                                 && cf_fix_cppflags=yes
11813
11814                         if test $cf_fix_cppflags = yes ; then
11815
11816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11818
11819                                 continue
11820                         elif test "${cf_tst_cflags}" = "\"'" ; then
11821
11822         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11823         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11824
11825                                 continue
11826                         fi
11827                         ;;
11828                 esac
11829                 case "$CPPFLAGS" in
11830                 (*$cf_add_cflags)
11831                         ;;
11832                 (*)
11833                         case $cf_add_cflags in
11834                         (-D*)
11835                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11836
11837 CPPFLAGS=`echo "$CPPFLAGS" | \
11838         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11839                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11840
11841                                 ;;
11842                         esac
11843
11844         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11845         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11846
11847                         ;;
11848                 esac
11849                 ;;
11850         (*)
11851
11852         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11853         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11854
11855                 ;;
11856         esac
11857         ;;
11858 (yes)
11859
11860         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11861         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11862
11863         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11864
11865         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11866                 && test -z "${cf_tst_cflags}" \
11867                 && cf_fix_cppflags=no
11868         ;;
11869 esac
11870 done
11871
11872 if test -n "$cf_new_cflags" ; then
11873
11874         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11875         CFLAGS="${CFLAGS}$cf_new_cflags"
11876
11877 fi
11878
11879 if test -n "$cf_new_cppflags" ; then
11880
11881         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11882         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11883
11884 fi
11885
11886 if test -n "$cf_new_extra_cppflags" ; then
11887
11888         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11889         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11890
11891 fi
11892
11893 fi
11894
11895 fi # cf_cv_posix_visible
11896
11897         ;;
11898 (netbsd*)
11899         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11900         ;;
11901 (openbsd[4-9]*)
11902         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11903         cf_xopen_source="-D_BSD_SOURCE"
11904         cf_XOPEN_SOURCE=600
11905         ;;
11906 (openbsd*)
11907         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11908         ;;
11909 (osf[45]*)
11910         cf_xopen_source="-D_OSF_SOURCE"
11911         ;;
11912 (nto-qnx*)
11913         cf_xopen_source="-D_QNX_SOURCE"
11914         ;;
11915 (sco*)
11916         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11917         ;;
11918 (solaris2.*)
11919         cf_xopen_source="-D__EXTENSIONS__"
11920         cf_cv_xopen_source=broken
11921         ;;
11922 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11923         cf_XOPEN_SOURCE=
11924         cf_POSIX_C_SOURCE=
11925         ;;
11926 (*)
11927
11928 echo "$as_me:11928: checking if we should define _XOPEN_SOURCE" >&5
11929 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11930 if test "${cf_cv_xopen_source+set}" = set; then
11931   echo $ECHO_N "(cached) $ECHO_C" >&6
11932 else
11933
11934         cat >conftest.$ac_ext <<_ACEOF
11935 #line 11935 "configure"
11936 #include "confdefs.h"
11937
11938 #include <stdlib.h>
11939 #include <string.h>
11940 #include <sys/types.h>
11941
11942 int
11943 main (void)
11944 {
11945
11946 #ifndef _XOPEN_SOURCE
11947 make an error
11948 #endif
11949   ;
11950   return 0;
11951 }
11952 _ACEOF
11953 rm -f conftest.$ac_objext
11954 if { (eval echo "$as_me:11954: \"$ac_compile\"") >&5
11955   (eval $ac_compile) 2>&5
11956   ac_status=$?
11957   echo "$as_me:11957: \$? = $ac_status" >&5
11958   (exit $ac_status); } &&
11959          { ac_try='test -s conftest.$ac_objext'
11960   { (eval echo "$as_me:11960: \"$ac_try\"") >&5
11961   (eval $ac_try) 2>&5
11962   ac_status=$?
11963   echo "$as_me:11963: \$? = $ac_status" >&5
11964   (exit $ac_status); }; }; then
11965   cf_cv_xopen_source=no
11966 else
11967   echo "$as_me: failed program was:" >&5
11968 cat conftest.$ac_ext >&5
11969 cf_save="$CPPFLAGS"
11970
11971         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11972         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11973
11974          cat >conftest.$ac_ext <<_ACEOF
11975 #line 11975 "configure"
11976 #include "confdefs.h"
11977
11978 #include <stdlib.h>
11979 #include <string.h>
11980 #include <sys/types.h>
11981
11982 int
11983 main (void)
11984 {
11985
11986 #ifdef _XOPEN_SOURCE
11987 make an error
11988 #endif
11989   ;
11990   return 0;
11991 }
11992 _ACEOF
11993 rm -f conftest.$ac_objext
11994 if { (eval echo "$as_me:11994: \"$ac_compile\"") >&5
11995   (eval $ac_compile) 2>&5
11996   ac_status=$?
11997   echo "$as_me:11997: \$? = $ac_status" >&5
11998   (exit $ac_status); } &&
11999          { ac_try='test -s conftest.$ac_objext'
12000   { (eval echo "$as_me:12000: \"$ac_try\"") >&5
12001   (eval $ac_try) 2>&5
12002   ac_status=$?
12003   echo "$as_me:12003: \$? = $ac_status" >&5
12004   (exit $ac_status); }; }; then
12005   cf_cv_xopen_source=no
12006 else
12007   echo "$as_me: failed program was:" >&5
12008 cat conftest.$ac_ext >&5
12009 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12010 fi
12011 rm -f conftest.$ac_objext conftest.$ac_ext
12012         CPPFLAGS="$cf_save"
12013
12014 fi
12015 rm -f conftest.$ac_objext conftest.$ac_ext
12016
12017 fi
12018 echo "$as_me:12018: result: $cf_cv_xopen_source" >&5
12019 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12020
12021 if test "$cf_cv_xopen_source" != no ; then
12022
12023 CFLAGS=`echo "$CFLAGS" | \
12024         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12025                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12026
12027 CPPFLAGS=`echo "$CPPFLAGS" | \
12028         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12029                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12030
12031         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12032
12033 cf_fix_cppflags=no
12034 cf_new_cflags=
12035 cf_new_cppflags=
12036 cf_new_extra_cppflags=
12037
12038 for cf_add_cflags in $cf_temp_xopen_source
12039 do
12040 case $cf_fix_cppflags in
12041 (no)
12042         case $cf_add_cflags in
12043         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12044                 case $cf_add_cflags in
12045                 (-D*)
12046                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12047
12048                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12049                                 && test -z "${cf_tst_cflags}" \
12050                                 && cf_fix_cppflags=yes
12051
12052                         if test $cf_fix_cppflags = yes ; then
12053
12054         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12055         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12056
12057                                 continue
12058                         elif test "${cf_tst_cflags}" = "\"'" ; then
12059
12060         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12061         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12062
12063                                 continue
12064                         fi
12065                         ;;
12066                 esac
12067                 case "$CPPFLAGS" in
12068                 (*$cf_add_cflags)
12069                         ;;
12070                 (*)
12071                         case $cf_add_cflags in
12072                         (-D*)
12073                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12074
12075 CPPFLAGS=`echo "$CPPFLAGS" | \
12076         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12077                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12078
12079                                 ;;
12080                         esac
12081
12082         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12083         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12084
12085                         ;;
12086                 esac
12087                 ;;
12088         (*)
12089
12090         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12091         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12092
12093                 ;;
12094         esac
12095         ;;
12096 (yes)
12097
12098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12100
12101         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12102
12103         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12104                 && test -z "${cf_tst_cflags}" \
12105                 && cf_fix_cppflags=no
12106         ;;
12107 esac
12108 done
12109
12110 if test -n "$cf_new_cflags" ; then
12111
12112         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12113         CFLAGS="${CFLAGS}$cf_new_cflags"
12114
12115 fi
12116
12117 if test -n "$cf_new_cppflags" ; then
12118
12119         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12120         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12121
12122 fi
12123
12124 if test -n "$cf_new_extra_cppflags" ; then
12125
12126         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12127         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12128
12129 fi
12130
12131 fi
12132
12133 if test "$cf_cv_posix_visible" = no; then
12134
12135 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12136
12137 cf_save_CFLAGS="$CFLAGS"
12138 cf_save_CPPFLAGS="$CPPFLAGS"
12139
12140 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12141         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12142                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12143
12144 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12145         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12146                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12147
12148 echo "$as_me:12148: checking if we should define _POSIX_C_SOURCE" >&5
12149 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12150 if test "${cf_cv_posix_c_source+set}" = set; then
12151   echo $ECHO_N "(cached) $ECHO_C" >&6
12152 else
12153
12154 echo "${as_me:-configure}:12154: testing if the symbol is already defined go no further ..." 1>&5
12155
12156         cat >conftest.$ac_ext <<_ACEOF
12157 #line 12157 "configure"
12158 #include "confdefs.h"
12159 #include <sys/types.h>
12160 int
12161 main (void)
12162 {
12163
12164 #ifndef _POSIX_C_SOURCE
12165 make an error
12166 #endif
12167   ;
12168   return 0;
12169 }
12170 _ACEOF
12171 rm -f conftest.$ac_objext
12172 if { (eval echo "$as_me:12172: \"$ac_compile\"") >&5
12173   (eval $ac_compile) 2>&5
12174   ac_status=$?
12175   echo "$as_me:12175: \$? = $ac_status" >&5
12176   (exit $ac_status); } &&
12177          { ac_try='test -s conftest.$ac_objext'
12178   { (eval echo "$as_me:12178: \"$ac_try\"") >&5
12179   (eval $ac_try) 2>&5
12180   ac_status=$?
12181   echo "$as_me:12181: \$? = $ac_status" >&5
12182   (exit $ac_status); }; }; then
12183   cf_cv_posix_c_source=no
12184 else
12185   echo "$as_me: failed program was:" >&5
12186 cat conftest.$ac_ext >&5
12187 cf_want_posix_source=no
12188          case .$cf_POSIX_C_SOURCE in
12189          (.[12]??*)
12190                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12191                 ;;
12192          (.2)
12193                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12194                 cf_want_posix_source=yes
12195                 ;;
12196          (.*)
12197                 cf_want_posix_source=yes
12198                 ;;
12199          esac
12200          if test "$cf_want_posix_source" = yes ; then
12201                 cat >conftest.$ac_ext <<_ACEOF
12202 #line 12202 "configure"
12203 #include "confdefs.h"
12204 #include <sys/types.h>
12205 int
12206 main (void)
12207 {
12208
12209 #ifdef _POSIX_SOURCE
12210 make an error
12211 #endif
12212   ;
12213   return 0;
12214 }
12215 _ACEOF
12216 rm -f conftest.$ac_objext
12217 if { (eval echo "$as_me:12217: \"$ac_compile\"") >&5
12218   (eval $ac_compile) 2>&5
12219   ac_status=$?
12220   echo "$as_me:12220: \$? = $ac_status" >&5
12221   (exit $ac_status); } &&
12222          { ac_try='test -s conftest.$ac_objext'
12223   { (eval echo "$as_me:12223: \"$ac_try\"") >&5
12224   (eval $ac_try) 2>&5
12225   ac_status=$?
12226   echo "$as_me:12226: \$? = $ac_status" >&5
12227   (exit $ac_status); }; }; then
12228   :
12229 else
12230   echo "$as_me: failed program was:" >&5
12231 cat conftest.$ac_ext >&5
12232 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12233 fi
12234 rm -f conftest.$ac_objext conftest.$ac_ext
12235          fi
12236
12237 echo "${as_me:-configure}:12237: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12238
12239          CFLAGS="$cf_trim_CFLAGS"
12240          CPPFLAGS="$cf_trim_CPPFLAGS"
12241
12242         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12243         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12244
12245 echo "${as_me:-configure}:12245: testing if the second compile does not leave our definition intact error ..." 1>&5
12246
12247          cat >conftest.$ac_ext <<_ACEOF
12248 #line 12248 "configure"
12249 #include "confdefs.h"
12250 #include <sys/types.h>
12251 int
12252 main (void)
12253 {
12254
12255 #ifndef _POSIX_C_SOURCE
12256 make an error
12257 #endif
12258   ;
12259   return 0;
12260 }
12261 _ACEOF
12262 rm -f conftest.$ac_objext
12263 if { (eval echo "$as_me:12263: \"$ac_compile\"") >&5
12264   (eval $ac_compile) 2>&5
12265   ac_status=$?
12266   echo "$as_me:12266: \$? = $ac_status" >&5
12267   (exit $ac_status); } &&
12268          { ac_try='test -s conftest.$ac_objext'
12269   { (eval echo "$as_me:12269: \"$ac_try\"") >&5
12270   (eval $ac_try) 2>&5
12271   ac_status=$?
12272   echo "$as_me:12272: \$? = $ac_status" >&5
12273   (exit $ac_status); }; }; then
12274   :
12275 else
12276   echo "$as_me: failed program was:" >&5
12277 cat conftest.$ac_ext >&5
12278 cf_cv_posix_c_source=no
12279 fi
12280 rm -f conftest.$ac_objext conftest.$ac_ext
12281          CFLAGS="$cf_save_CFLAGS"
12282          CPPFLAGS="$cf_save_CPPFLAGS"
12283
12284 fi
12285 rm -f conftest.$ac_objext conftest.$ac_ext
12286
12287 fi
12288 echo "$as_me:12288: result: $cf_cv_posix_c_source" >&5
12289 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12290
12291 if test "$cf_cv_posix_c_source" != no ; then
12292         CFLAGS="$cf_trim_CFLAGS"
12293         CPPFLAGS="$cf_trim_CPPFLAGS"
12294
12295 cf_fix_cppflags=no
12296 cf_new_cflags=
12297 cf_new_cppflags=
12298 cf_new_extra_cppflags=
12299
12300 for cf_add_cflags in $cf_cv_posix_c_source
12301 do
12302 case $cf_fix_cppflags in
12303 (no)
12304         case $cf_add_cflags in
12305         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12306                 case $cf_add_cflags in
12307                 (-D*)
12308                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12309
12310                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12311                                 && test -z "${cf_tst_cflags}" \
12312                                 && cf_fix_cppflags=yes
12313
12314                         if test $cf_fix_cppflags = yes ; then
12315
12316         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12317         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12318
12319                                 continue
12320                         elif test "${cf_tst_cflags}" = "\"'" ; then
12321
12322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12324
12325                                 continue
12326                         fi
12327                         ;;
12328                 esac
12329                 case "$CPPFLAGS" in
12330                 (*$cf_add_cflags)
12331                         ;;
12332                 (*)
12333                         case $cf_add_cflags in
12334                         (-D*)
12335                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12336
12337 CPPFLAGS=`echo "$CPPFLAGS" | \
12338         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12339                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12340
12341                                 ;;
12342                         esac
12343
12344         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12345         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12346
12347                         ;;
12348                 esac
12349                 ;;
12350         (*)
12351
12352         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12353         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12354
12355                 ;;
12356         esac
12357         ;;
12358 (yes)
12359
12360         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12361         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12362
12363         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12364
12365         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12366                 && test -z "${cf_tst_cflags}" \
12367                 && cf_fix_cppflags=no
12368         ;;
12369 esac
12370 done
12371
12372 if test -n "$cf_new_cflags" ; then
12373
12374         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12375         CFLAGS="${CFLAGS}$cf_new_cflags"
12376
12377 fi
12378
12379 if test -n "$cf_new_cppflags" ; then
12380
12381         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12382         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12383
12384 fi
12385
12386 if test -n "$cf_new_extra_cppflags" ; then
12387
12388         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12389         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12390
12391 fi
12392
12393 fi
12394
12395 fi # cf_cv_posix_visible
12396
12397         ;;
12398 esac
12399
12400 if test -n "$cf_xopen_source" ; then
12401
12402 cf_fix_cppflags=no
12403 cf_new_cflags=
12404 cf_new_cppflags=
12405 cf_new_extra_cppflags=
12406
12407 for cf_add_cflags in $cf_xopen_source
12408 do
12409 case $cf_fix_cppflags in
12410 (no)
12411         case $cf_add_cflags in
12412         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12413                 case $cf_add_cflags in
12414                 (-D*)
12415                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12416
12417                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12418                                 && test -z "${cf_tst_cflags}" \
12419                                 && cf_fix_cppflags=yes
12420
12421                         if test $cf_fix_cppflags = yes ; then
12422
12423         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12424         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12425
12426                                 continue
12427                         elif test "${cf_tst_cflags}" = "\"'" ; then
12428
12429         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12430         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12431
12432                                 continue
12433                         fi
12434                         ;;
12435                 esac
12436                 case "$CPPFLAGS" in
12437                 (*$cf_add_cflags)
12438                         ;;
12439                 (*)
12440                         case $cf_add_cflags in
12441                         (-D*)
12442                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12443
12444 CPPFLAGS=`echo "$CPPFLAGS" | \
12445         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12446                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12447
12448                                 ;;
12449                         esac
12450
12451         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12452         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12453
12454                         ;;
12455                 esac
12456                 ;;
12457         (*)
12458
12459         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12460         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12461
12462                 ;;
12463         esac
12464         ;;
12465 (yes)
12466
12467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12469
12470         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12471
12472         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12473                 && test -z "${cf_tst_cflags}" \
12474                 && cf_fix_cppflags=no
12475         ;;
12476 esac
12477 done
12478
12479 if test -n "$cf_new_cflags" ; then
12480         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12481
12482 echo "${as_me:-configure}:12482: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12483
12484         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12485         CFLAGS="${CFLAGS}$cf_new_cflags"
12486
12487 fi
12488
12489 if test -n "$cf_new_cppflags" ; then
12490         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12491
12492 echo "${as_me:-configure}:12492: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12493
12494         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12495         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12496
12497 fi
12498
12499 if test -n "$cf_new_extra_cppflags" ; then
12500         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12501
12502 echo "${as_me:-configure}:12502: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12503
12504         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12505         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12506
12507 fi
12508
12509 fi
12510
12511 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12512         echo "$as_me:12512: checking if _XOPEN_SOURCE really is set" >&5
12513 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12514         cat >conftest.$ac_ext <<_ACEOF
12515 #line 12515 "configure"
12516 #include "confdefs.h"
12517 #include <stdlib.h>
12518 int
12519 main (void)
12520 {
12521
12522 #ifndef _XOPEN_SOURCE
12523 make an error
12524 #endif
12525   ;
12526   return 0;
12527 }
12528 _ACEOF
12529 rm -f conftest.$ac_objext
12530 if { (eval echo "$as_me:12530: \"$ac_compile\"") >&5
12531   (eval $ac_compile) 2>&5
12532   ac_status=$?
12533   echo "$as_me:12533: \$? = $ac_status" >&5
12534   (exit $ac_status); } &&
12535          { ac_try='test -s conftest.$ac_objext'
12536   { (eval echo "$as_me:12536: \"$ac_try\"") >&5
12537   (eval $ac_try) 2>&5
12538   ac_status=$?
12539   echo "$as_me:12539: \$? = $ac_status" >&5
12540   (exit $ac_status); }; }; then
12541   cf_XOPEN_SOURCE_set=yes
12542 else
12543   echo "$as_me: failed program was:" >&5
12544 cat conftest.$ac_ext >&5
12545 cf_XOPEN_SOURCE_set=no
12546 fi
12547 rm -f conftest.$ac_objext conftest.$ac_ext
12548         echo "$as_me:12548: result: $cf_XOPEN_SOURCE_set" >&5
12549 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12550         if test $cf_XOPEN_SOURCE_set = yes
12551         then
12552                 cat >conftest.$ac_ext <<_ACEOF
12553 #line 12553 "configure"
12554 #include "confdefs.h"
12555 #include <stdlib.h>
12556 int
12557 main (void)
12558 {
12559
12560 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12561 make an error
12562 #endif
12563   ;
12564   return 0;
12565 }
12566 _ACEOF
12567 rm -f conftest.$ac_objext
12568 if { (eval echo "$as_me:12568: \"$ac_compile\"") >&5
12569   (eval $ac_compile) 2>&5
12570   ac_status=$?
12571   echo "$as_me:12571: \$? = $ac_status" >&5
12572   (exit $ac_status); } &&
12573          { ac_try='test -s conftest.$ac_objext'
12574   { (eval echo "$as_me:12574: \"$ac_try\"") >&5
12575   (eval $ac_try) 2>&5
12576   ac_status=$?
12577   echo "$as_me:12577: \$? = $ac_status" >&5
12578   (exit $ac_status); }; }; then
12579   cf_XOPEN_SOURCE_set_ok=yes
12580 else
12581   echo "$as_me: failed program was:" >&5
12582 cat conftest.$ac_ext >&5
12583 cf_XOPEN_SOURCE_set_ok=no
12584 fi
12585 rm -f conftest.$ac_objext conftest.$ac_ext
12586                 if test $cf_XOPEN_SOURCE_set_ok = no
12587                 then
12588                         { echo "$as_me:12588: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12589 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12590                 fi
12591         else
12592
12593 echo "$as_me:12593: checking if we should define _XOPEN_SOURCE" >&5
12594 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12595 if test "${cf_cv_xopen_source+set}" = set; then
12596   echo $ECHO_N "(cached) $ECHO_C" >&6
12597 else
12598
12599         cat >conftest.$ac_ext <<_ACEOF
12600 #line 12600 "configure"
12601 #include "confdefs.h"
12602
12603 #include <stdlib.h>
12604 #include <string.h>
12605 #include <sys/types.h>
12606
12607 int
12608 main (void)
12609 {
12610
12611 #ifndef _XOPEN_SOURCE
12612 make an error
12613 #endif
12614   ;
12615   return 0;
12616 }
12617 _ACEOF
12618 rm -f conftest.$ac_objext
12619 if { (eval echo "$as_me:12619: \"$ac_compile\"") >&5
12620   (eval $ac_compile) 2>&5
12621   ac_status=$?
12622   echo "$as_me:12622: \$? = $ac_status" >&5
12623   (exit $ac_status); } &&
12624          { ac_try='test -s conftest.$ac_objext'
12625   { (eval echo "$as_me:12625: \"$ac_try\"") >&5
12626   (eval $ac_try) 2>&5
12627   ac_status=$?
12628   echo "$as_me:12628: \$? = $ac_status" >&5
12629   (exit $ac_status); }; }; then
12630   cf_cv_xopen_source=no
12631 else
12632   echo "$as_me: failed program was:" >&5
12633 cat conftest.$ac_ext >&5
12634 cf_save="$CPPFLAGS"
12635
12636         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12637         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12638
12639          cat >conftest.$ac_ext <<_ACEOF
12640 #line 12640 "configure"
12641 #include "confdefs.h"
12642
12643 #include <stdlib.h>
12644 #include <string.h>
12645 #include <sys/types.h>
12646
12647 int
12648 main (void)
12649 {
12650
12651 #ifdef _XOPEN_SOURCE
12652 make an error
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_xopen_source=no
12671 else
12672   echo "$as_me: failed program was:" >&5
12673 cat conftest.$ac_ext >&5
12674 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12675 fi
12676 rm -f conftest.$ac_objext conftest.$ac_ext
12677         CPPFLAGS="$cf_save"
12678
12679 fi
12680 rm -f conftest.$ac_objext conftest.$ac_ext
12681
12682 fi
12683 echo "$as_me:12683: result: $cf_cv_xopen_source" >&5
12684 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12685
12686 if test "$cf_cv_xopen_source" != no ; then
12687
12688 CFLAGS=`echo "$CFLAGS" | \
12689         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12690                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12691
12692 CPPFLAGS=`echo "$CPPFLAGS" | \
12693         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12694                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12695
12696         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12697
12698 cf_fix_cppflags=no
12699 cf_new_cflags=
12700 cf_new_cppflags=
12701 cf_new_extra_cppflags=
12702
12703 for cf_add_cflags in $cf_temp_xopen_source
12704 do
12705 case $cf_fix_cppflags in
12706 (no)
12707         case $cf_add_cflags in
12708         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12709                 case $cf_add_cflags in
12710                 (-D*)
12711                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12712
12713                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12714                                 && test -z "${cf_tst_cflags}" \
12715                                 && cf_fix_cppflags=yes
12716
12717                         if test $cf_fix_cppflags = yes ; then
12718
12719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12721
12722                                 continue
12723                         elif test "${cf_tst_cflags}" = "\"'" ; then
12724
12725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12727
12728                                 continue
12729                         fi
12730                         ;;
12731                 esac
12732                 case "$CPPFLAGS" in
12733                 (*$cf_add_cflags)
12734                         ;;
12735                 (*)
12736                         case $cf_add_cflags in
12737                         (-D*)
12738                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12739
12740 CPPFLAGS=`echo "$CPPFLAGS" | \
12741         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12742                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12743
12744                                 ;;
12745                         esac
12746
12747         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12748         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12749
12750                         ;;
12751                 esac
12752                 ;;
12753         (*)
12754
12755         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12756         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12757
12758                 ;;
12759         esac
12760         ;;
12761 (yes)
12762
12763         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12764         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12765
12766         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12767
12768         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12769                 && test -z "${cf_tst_cflags}" \
12770                 && cf_fix_cppflags=no
12771         ;;
12772 esac
12773 done
12774
12775 if test -n "$cf_new_cflags" ; then
12776
12777         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12778         CFLAGS="${CFLAGS}$cf_new_cflags"
12779
12780 fi
12781
12782 if test -n "$cf_new_cppflags" ; then
12783
12784         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12785         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12786
12787 fi
12788
12789 if test -n "$cf_new_extra_cppflags" ; then
12790
12791         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12792         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12793
12794 fi
12795
12796 fi
12797
12798         fi
12799 fi
12800 fi # cf_cv_posix_visible
12801
12802 # Check whether --enable-largefile or --disable-largefile was given.
12803 if test "${enable_largefile+set}" = set; then
12804   enableval="$enable_largefile"
12805
12806 fi;
12807 if test "$enable_largefile" != no; then
12808
12809   echo "$as_me:12809: checking for special C compiler options needed for large files" >&5
12810 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12811 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12812   echo $ECHO_N "(cached) $ECHO_C" >&6
12813 else
12814   ac_cv_sys_largefile_CC=no
12815      if test "$GCC" != yes; then
12816        ac_save_CC=$CC
12817        while :; do
12818          # IRIX 6.2 and later do not support large files by default,
12819          # so use the C compiler's -n32 option if that helps.
12820          cat >conftest.$ac_ext <<_ACEOF
12821 #line 12821 "configure"
12822 #include "confdefs.h"
12823 #include <sys/types.h>
12824  /* Check that off_t can represent 2**63 - 1 correctly.
12825     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12826     since some C++ compilers masquerading as C compilers
12827     incorrectly reject 9223372036854775807.  */
12828 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12829   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12830                        && LARGE_OFF_T % 2147483647 == 1)
12831                       ? 1 : -1];
12832 int
12833 main (void)
12834 {
12835
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   break
12853 else
12854   echo "$as_me: failed program was:" >&5
12855 cat conftest.$ac_ext >&5
12856 fi
12857 rm -f conftest.$ac_objext
12858          CC="$CC -n32"
12859          rm -f conftest.$ac_objext
12860 if { (eval echo "$as_me:12860: \"$ac_compile\"") >&5
12861   (eval $ac_compile) 2>&5
12862   ac_status=$?
12863   echo "$as_me:12863: \$? = $ac_status" >&5
12864   (exit $ac_status); } &&
12865          { ac_try='test -s conftest.$ac_objext'
12866   { (eval echo "$as_me:12866: \"$ac_try\"") >&5
12867   (eval $ac_try) 2>&5
12868   ac_status=$?
12869   echo "$as_me:12869: \$? = $ac_status" >&5
12870   (exit $ac_status); }; }; then
12871   ac_cv_sys_largefile_CC=' -n32'; break
12872 else
12873   echo "$as_me: failed program was:" >&5
12874 cat conftest.$ac_ext >&5
12875 fi
12876 rm -f conftest.$ac_objext
12877          break
12878        done
12879        CC=$ac_save_CC
12880        rm -f conftest.$ac_ext
12881     fi
12882 fi
12883 echo "$as_me:12883: result: $ac_cv_sys_largefile_CC" >&5
12884 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12885   if test "$ac_cv_sys_largefile_CC" != no; then
12886     CC=$CC$ac_cv_sys_largefile_CC
12887   fi
12888
12889   echo "$as_me:12889: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12890 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12891 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12892   echo $ECHO_N "(cached) $ECHO_C" >&6
12893 else
12894   while :; do
12895   ac_cv_sys_file_offset_bits=no
12896   cat >conftest.$ac_ext <<_ACEOF
12897 #line 12897 "configure"
12898 #include "confdefs.h"
12899 #include <sys/types.h>
12900  /* Check that off_t can represent 2**63 - 1 correctly.
12901     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12902     since some C++ compilers masquerading as C compilers
12903     incorrectly reject 9223372036854775807.  */
12904 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12905   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12906                        && LARGE_OFF_T % 2147483647 == 1)
12907                       ? 1 : -1];
12908 int
12909 main (void)
12910 {
12911
12912   ;
12913   return 0;
12914 }
12915 _ACEOF
12916 rm -f conftest.$ac_objext
12917 if { (eval echo "$as_me:12917: \"$ac_compile\"") >&5
12918   (eval $ac_compile) 2>&5
12919   ac_status=$?
12920   echo "$as_me:12920: \$? = $ac_status" >&5
12921   (exit $ac_status); } &&
12922          { ac_try='test -s conftest.$ac_objext'
12923   { (eval echo "$as_me:12923: \"$ac_try\"") >&5
12924   (eval $ac_try) 2>&5
12925   ac_status=$?
12926   echo "$as_me:12926: \$? = $ac_status" >&5
12927   (exit $ac_status); }; }; then
12928   break
12929 else
12930   echo "$as_me: failed program was:" >&5
12931 cat conftest.$ac_ext >&5
12932 fi
12933 rm -f conftest.$ac_objext conftest.$ac_ext
12934   cat >conftest.$ac_ext <<_ACEOF
12935 #line 12935 "configure"
12936 #include "confdefs.h"
12937 #define _FILE_OFFSET_BITS 64
12938 #include <sys/types.h>
12939  /* Check that off_t can represent 2**63 - 1 correctly.
12940     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12941     since some C++ compilers masquerading as C compilers
12942     incorrectly reject 9223372036854775807.  */
12943 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12944   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12945                        && LARGE_OFF_T % 2147483647 == 1)
12946                       ? 1 : -1];
12947 int
12948 main (void)
12949 {
12950
12951   ;
12952   return 0;
12953 }
12954 _ACEOF
12955 rm -f conftest.$ac_objext
12956 if { (eval echo "$as_me:12956: \"$ac_compile\"") >&5
12957   (eval $ac_compile) 2>&5
12958   ac_status=$?
12959   echo "$as_me:12959: \$? = $ac_status" >&5
12960   (exit $ac_status); } &&
12961          { ac_try='test -s conftest.$ac_objext'
12962   { (eval echo "$as_me:12962: \"$ac_try\"") >&5
12963   (eval $ac_try) 2>&5
12964   ac_status=$?
12965   echo "$as_me:12965: \$? = $ac_status" >&5
12966   (exit $ac_status); }; }; then
12967   ac_cv_sys_file_offset_bits=64; break
12968 else
12969   echo "$as_me: failed program was:" >&5
12970 cat conftest.$ac_ext >&5
12971 fi
12972 rm -f conftest.$ac_objext conftest.$ac_ext
12973   break
12974 done
12975 fi
12976 echo "$as_me:12976: result: $ac_cv_sys_file_offset_bits" >&5
12977 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12978 if test "$ac_cv_sys_file_offset_bits" != no; then
12979
12980 cat >>confdefs.h <<EOF
12981 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12982 EOF
12983
12984 fi
12985 rm -rf conftest*
12986   echo "$as_me:12986: checking for _LARGE_FILES value needed for large files" >&5
12987 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12988 if test "${ac_cv_sys_large_files+set}" = set; then
12989   echo $ECHO_N "(cached) $ECHO_C" >&6
12990 else
12991   while :; do
12992   ac_cv_sys_large_files=no
12993   cat >conftest.$ac_ext <<_ACEOF
12994 #line 12994 "configure"
12995 #include "confdefs.h"
12996 #include <sys/types.h>
12997  /* Check that off_t can represent 2**63 - 1 correctly.
12998     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12999     since some C++ compilers masquerading as C compilers
13000     incorrectly reject 9223372036854775807.  */
13001 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13002   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13003                        && LARGE_OFF_T % 2147483647 == 1)
13004                       ? 1 : -1];
13005 int
13006 main (void)
13007 {
13008
13009   ;
13010   return 0;
13011 }
13012 _ACEOF
13013 rm -f conftest.$ac_objext
13014 if { (eval echo "$as_me:13014: \"$ac_compile\"") >&5
13015   (eval $ac_compile) 2>&5
13016   ac_status=$?
13017   echo "$as_me:13017: \$? = $ac_status" >&5
13018   (exit $ac_status); } &&
13019          { ac_try='test -s conftest.$ac_objext'
13020   { (eval echo "$as_me:13020: \"$ac_try\"") >&5
13021   (eval $ac_try) 2>&5
13022   ac_status=$?
13023   echo "$as_me:13023: \$? = $ac_status" >&5
13024   (exit $ac_status); }; }; then
13025   break
13026 else
13027   echo "$as_me: failed program was:" >&5
13028 cat conftest.$ac_ext >&5
13029 fi
13030 rm -f conftest.$ac_objext conftest.$ac_ext
13031   cat >conftest.$ac_ext <<_ACEOF
13032 #line 13032 "configure"
13033 #include "confdefs.h"
13034 #define _LARGE_FILES 1
13035 #include <sys/types.h>
13036  /* Check that off_t can represent 2**63 - 1 correctly.
13037     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13038     since some C++ compilers masquerading as C compilers
13039     incorrectly reject 9223372036854775807.  */
13040 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13041   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13042                        && LARGE_OFF_T % 2147483647 == 1)
13043                       ? 1 : -1];
13044 int
13045 main (void)
13046 {
13047
13048   ;
13049   return 0;
13050 }
13051 _ACEOF
13052 rm -f conftest.$ac_objext
13053 if { (eval echo "$as_me:13053: \"$ac_compile\"") >&5
13054   (eval $ac_compile) 2>&5
13055   ac_status=$?
13056   echo "$as_me:13056: \$? = $ac_status" >&5
13057   (exit $ac_status); } &&
13058          { ac_try='test -s conftest.$ac_objext'
13059   { (eval echo "$as_me:13059: \"$ac_try\"") >&5
13060   (eval $ac_try) 2>&5
13061   ac_status=$?
13062   echo "$as_me:13062: \$? = $ac_status" >&5
13063   (exit $ac_status); }; }; then
13064   ac_cv_sys_large_files=1; break
13065 else
13066   echo "$as_me: failed program was:" >&5
13067 cat conftest.$ac_ext >&5
13068 fi
13069 rm -f conftest.$ac_objext conftest.$ac_ext
13070   break
13071 done
13072 fi
13073 echo "$as_me:13073: result: $ac_cv_sys_large_files" >&5
13074 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13075 if test "$ac_cv_sys_large_files" != no; then
13076
13077 cat >>confdefs.h <<EOF
13078 #define _LARGE_FILES $ac_cv_sys_large_files
13079 EOF
13080
13081 fi
13082 rm -rf conftest*
13083 fi
13084
13085         if test "$enable_largefile" != no ; then
13086         echo "$as_me:13086: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13087 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13088 if test "${ac_cv_sys_largefile_source+set}" = set; then
13089   echo $ECHO_N "(cached) $ECHO_C" >&6
13090 else
13091   while :; do
13092   ac_cv_sys_largefile_source=no
13093   cat >conftest.$ac_ext <<_ACEOF
13094 #line 13094 "configure"
13095 #include "confdefs.h"
13096 #include <stdio.h>
13097 int
13098 main (void)
13099 {
13100 return !fseeko;
13101   ;
13102   return 0;
13103 }
13104 _ACEOF
13105 rm -f conftest.$ac_objext
13106 if { (eval echo "$as_me:13106: \"$ac_compile\"") >&5
13107   (eval $ac_compile) 2>&5
13108   ac_status=$?
13109   echo "$as_me:13109: \$? = $ac_status" >&5
13110   (exit $ac_status); } &&
13111          { ac_try='test -s conftest.$ac_objext'
13112   { (eval echo "$as_me:13112: \"$ac_try\"") >&5
13113   (eval $ac_try) 2>&5
13114   ac_status=$?
13115   echo "$as_me:13115: \$? = $ac_status" >&5
13116   (exit $ac_status); }; }; then
13117   break
13118 else
13119   echo "$as_me: failed program was:" >&5
13120 cat conftest.$ac_ext >&5
13121 fi
13122 rm -f conftest.$ac_objext conftest.$ac_ext
13123   cat >conftest.$ac_ext <<_ACEOF
13124 #line 13124 "configure"
13125 #include "confdefs.h"
13126 #define _LARGEFILE_SOURCE 1
13127 #include <stdio.h>
13128 int
13129 main (void)
13130 {
13131 return !fseeko;
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest.$ac_objext
13137 if { (eval echo "$as_me:13137: \"$ac_compile\"") >&5
13138   (eval $ac_compile) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } &&
13142          { ac_try='test -s conftest.$ac_objext'
13143   { (eval echo "$as_me:13143: \"$ac_try\"") >&5
13144   (eval $ac_try) 2>&5
13145   ac_status=$?
13146   echo "$as_me:13146: \$? = $ac_status" >&5
13147   (exit $ac_status); }; }; then
13148   ac_cv_sys_largefile_source=1; break
13149 else
13150   echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 fi
13153 rm -f conftest.$ac_objext conftest.$ac_ext
13154   break
13155 done
13156 fi
13157 echo "$as_me:13157: result: $ac_cv_sys_largefile_source" >&5
13158 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13159 if test "$ac_cv_sys_largefile_source" != no; then
13160
13161 cat >>confdefs.h <<EOF
13162 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13163 EOF
13164
13165 fi
13166 rm -rf conftest*
13167
13168 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13169 # in glibc 2.1.3, but that breaks too many other things.
13170 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13171 echo "$as_me:13171: checking for fseeko" >&5
13172 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13173 if test "${ac_cv_func_fseeko+set}" = set; then
13174   echo $ECHO_N "(cached) $ECHO_C" >&6
13175 else
13176   cat >conftest.$ac_ext <<_ACEOF
13177 #line 13177 "configure"
13178 #include "confdefs.h"
13179 #include <stdio.h>
13180 int
13181 main (void)
13182 {
13183 return fseeko && fseeko (stdin, 0, 0);
13184   ;
13185   return 0;
13186 }
13187 _ACEOF
13188 rm -f conftest.$ac_objext conftest$ac_exeext
13189 if { (eval echo "$as_me:13189: \"$ac_link\"") >&5
13190   (eval $ac_link) 2>&5
13191   ac_status=$?
13192   echo "$as_me:13192: \$? = $ac_status" >&5
13193   (exit $ac_status); } &&
13194          { ac_try='test -s conftest$ac_exeext'
13195   { (eval echo "$as_me:13195: \"$ac_try\"") >&5
13196   (eval $ac_try) 2>&5
13197   ac_status=$?
13198   echo "$as_me:13198: \$? = $ac_status" >&5
13199   (exit $ac_status); }; }; then
13200   ac_cv_func_fseeko=yes
13201 else
13202   echo "$as_me: failed program was:" >&5
13203 cat conftest.$ac_ext >&5
13204 ac_cv_func_fseeko=no
13205 fi
13206 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13207 fi
13208 echo "$as_me:13208: result: $ac_cv_func_fseeko" >&5
13209 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13210 if test $ac_cv_func_fseeko = yes; then
13211
13212 cat >>confdefs.h <<\EOF
13213 #define HAVE_FSEEKO 1
13214 EOF
13215
13216 fi
13217
13218         # Normally we would collect these definitions in the config.h,
13219         # but (like _XOPEN_SOURCE), some environments rely on having these
13220         # defined before any of the system headers are included.  Another
13221         # case comes up with C++, e.g., on AIX the compiler compiles the
13222         # header files by themselves before looking at the body files it is
13223         # told to compile.  For ncurses, those header files do not include
13224         # the config.h
13225         if test "$ac_cv_sys_large_files" != no
13226         then
13227
13228         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13229         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13230
13231         fi
13232         if test "$ac_cv_sys_largefile_source" != no
13233         then
13234
13235         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13236         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13237
13238         fi
13239         if test "$ac_cv_sys_file_offset_bits" != no
13240         then
13241
13242         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13243         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13244
13245         fi
13246
13247         echo "$as_me:13247: checking whether to use struct dirent64" >&5
13248 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13249 if test "${cf_cv_struct_dirent64+set}" = set; then
13250   echo $ECHO_N "(cached) $ECHO_C" >&6
13251 else
13252
13253                 cat >conftest.$ac_ext <<_ACEOF
13254 #line 13254 "configure"
13255 #include "confdefs.h"
13256
13257 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13258 #include <sys/types.h>
13259 #include <dirent.h>
13260
13261 int
13262 main (void)
13263 {
13264
13265                 /* if transitional largefile support is setup, this is true */
13266                 extern struct dirent64 * readdir(DIR *);
13267                 struct dirent64 *x = readdir((DIR *)0);
13268                 struct dirent *y = readdir((DIR *)0);
13269                 int z = x - y;
13270
13271   ;
13272   return 0;
13273 }
13274 _ACEOF
13275 rm -f conftest.$ac_objext
13276 if { (eval echo "$as_me:13276: \"$ac_compile\"") >&5
13277   (eval $ac_compile) 2>&5
13278   ac_status=$?
13279   echo "$as_me:13279: \$? = $ac_status" >&5
13280   (exit $ac_status); } &&
13281          { ac_try='test -s conftest.$ac_objext'
13282   { (eval echo "$as_me:13282: \"$ac_try\"") >&5
13283   (eval $ac_try) 2>&5
13284   ac_status=$?
13285   echo "$as_me:13285: \$? = $ac_status" >&5
13286   (exit $ac_status); }; }; then
13287   cf_cv_struct_dirent64=yes
13288 else
13289   echo "$as_me: failed program was:" >&5
13290 cat conftest.$ac_ext >&5
13291 cf_cv_struct_dirent64=no
13292 fi
13293 rm -f conftest.$ac_objext conftest.$ac_ext
13294
13295 fi
13296 echo "$as_me:13296: result: $cf_cv_struct_dirent64" >&5
13297 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13298         test "$cf_cv_struct_dirent64" = yes &&
13299 cat >>confdefs.h <<\EOF
13300 #define HAVE_STRUCT_DIRENT64 1
13301 EOF
13302
13303         fi
13304
13305 ### Enable compiling-in rcs id's
13306 echo "$as_me:13306: checking if RCS identifiers should be compiled-in" >&5
13307 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13308
13309 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13310 if test "${with_rcs_ids+set}" = set; then
13311   withval="$with_rcs_ids"
13312   with_rcs_ids=$withval
13313 else
13314   with_rcs_ids=no
13315 fi;
13316 echo "$as_me:13316: result: $with_rcs_ids" >&5
13317 echo "${ECHO_T}$with_rcs_ids" >&6
13318 test "$with_rcs_ids" = yes &&
13319 cat >>confdefs.h <<\EOF
13320 #define USE_RCS_IDS 1
13321 EOF
13322
13323 ###############################################################################
13324
13325 ### Note that some functions (such as const) are normally disabled anyway.
13326 echo "$as_me:13326: checking if you want to build with function extensions" >&5
13327 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13328
13329 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13330 if test "${enable_ext_funcs+set}" = set; then
13331   enableval="$enable_ext_funcs"
13332   with_ext_funcs=$enableval
13333 else
13334   with_ext_funcs=yes
13335 fi;
13336 echo "$as_me:13336: result: $with_ext_funcs" >&5
13337 echo "${ECHO_T}$with_ext_funcs" >&6
13338 if test "$with_ext_funcs" = yes ; then
13339         NCURSES_EXT_FUNCS=1
13340
13341 cat >>confdefs.h <<\EOF
13342 #define HAVE_USE_DEFAULT_COLORS 1
13343 EOF
13344
13345 cat >>confdefs.h <<\EOF
13346 #define NCURSES_EXT_FUNCS 1
13347 EOF
13348
13349 else
13350         NCURSES_EXT_FUNCS=0
13351 fi
13352
13353 ###   use option --enable-const to turn on use of const beyond that in XSI.
13354 echo "$as_me:13354: checking for extended use of const keyword" >&5
13355 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13356
13357 # Check whether --enable-const or --disable-const was given.
13358 if test "${enable_const+set}" = set; then
13359   enableval="$enable_const"
13360   with_ext_const=$enableval
13361 else
13362   with_ext_const=no
13363 fi;
13364 echo "$as_me:13364: result: $with_ext_const" >&5
13365 echo "${ECHO_T}$with_ext_const" >&6
13366 NCURSES_CONST='/*nothing*/'
13367 if test "$with_ext_const" = yes ; then
13368         NCURSES_CONST=const
13369 fi
13370
13371 ###############################################################################
13372 # These options are relatively safe to experiment with.
13373
13374 echo "$as_me:13374: checking if you want all development code" >&5
13375 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13376
13377 # Check whether --with-develop or --without-develop was given.
13378 if test "${with_develop+set}" = set; then
13379   withval="$with_develop"
13380   with_develop=$withval
13381 else
13382   with_develop=no
13383 fi;
13384 echo "$as_me:13384: result: $with_develop" >&5
13385 echo "${ECHO_T}$with_develop" >&6
13386
13387 ###############################################################################
13388 # These are just experimental, probably should not be in a package:
13389
13390 # This is still experimental (20080329), but should ultimately be moved to
13391 # the script-block --with-normal, etc.
13392
13393 echo "$as_me:13393: checking if you want to link with the pthread library" >&5
13394 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13395
13396 # Check whether --with-pthread or --without-pthread was given.
13397 if test "${with_pthread+set}" = set; then
13398   withval="$with_pthread"
13399   with_pthread=$withval
13400 else
13401   with_pthread=no
13402 fi;
13403 echo "$as_me:13403: result: $with_pthread" >&5
13404 echo "${ECHO_T}$with_pthread" >&6
13405
13406 if test "$with_pthread" != no ; then
13407         echo "$as_me:13407: checking for pthread.h" >&5
13408 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13409 if test "${ac_cv_header_pthread_h+set}" = set; then
13410   echo $ECHO_N "(cached) $ECHO_C" >&6
13411 else
13412   cat >conftest.$ac_ext <<_ACEOF
13413 #line 13413 "configure"
13414 #include "confdefs.h"
13415 #include <pthread.h>
13416 _ACEOF
13417 if { (eval echo "$as_me:13417: \"$ac_cpp conftest.$ac_ext\"") >&5
13418   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13419   ac_status=$?
13420   egrep -v '^ *\+' conftest.er1 >conftest.err
13421   rm -f conftest.er1
13422   cat conftest.err >&5
13423   echo "$as_me:13423: \$? = $ac_status" >&5
13424   (exit $ac_status); } >/dev/null; then
13425   if test -s conftest.err; then
13426     ac_cpp_err=$ac_c_preproc_warn_flag
13427   else
13428     ac_cpp_err=
13429   fi
13430 else
13431   ac_cpp_err=yes
13432 fi
13433 if test -z "$ac_cpp_err"; then
13434   ac_cv_header_pthread_h=yes
13435 else
13436   echo "$as_me: failed program was:" >&5
13437   cat conftest.$ac_ext >&5
13438   ac_cv_header_pthread_h=no
13439 fi
13440 rm -f conftest.err conftest.$ac_ext
13441 fi
13442 echo "$as_me:13442: result: $ac_cv_header_pthread_h" >&5
13443 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13444 if test $ac_cv_header_pthread_h = yes; then
13445
13446 cat >>confdefs.h <<\EOF
13447 #define HAVE_PTHREADS_H 1
13448 EOF
13449
13450         for cf_lib_pthread in pthread c_r
13451         do
13452             echo "$as_me:13452: checking if we can link with the $cf_lib_pthread library" >&5
13453 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13454             cf_save_LIBS="$LIBS"
13455
13456 cf_add_libs="$LIBS"
13457 # reverse order
13458 cf_add_0lib=
13459 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13460 # filter duplicates
13461 for cf_add_1lib in $cf_add_0lib; do
13462         for cf_add_2lib in $cf_add_libs; do
13463                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13464                         cf_add_1lib=
13465                         break
13466                 fi
13467         done
13468         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13469 done
13470 LIBS="$cf_add_libs"
13471
13472             cat >conftest.$ac_ext <<_ACEOF
13473 #line 13473 "configure"
13474 #include "confdefs.h"
13475
13476 #include <pthread.h>
13477
13478 int
13479 main (void)
13480 {
13481
13482                 int rc = pthread_create(0,0,0,0);
13483                 int r2 = pthread_mutexattr_settype(0, 0);
13484
13485   ;
13486   return 0;
13487 }
13488 _ACEOF
13489 rm -f conftest.$ac_objext conftest$ac_exeext
13490 if { (eval echo "$as_me:13490: \"$ac_link\"") >&5
13491   (eval $ac_link) 2>&5
13492   ac_status=$?
13493   echo "$as_me:13493: \$? = $ac_status" >&5
13494   (exit $ac_status); } &&
13495          { ac_try='test -s conftest$ac_exeext'
13496   { (eval echo "$as_me:13496: \"$ac_try\"") >&5
13497   (eval $ac_try) 2>&5
13498   ac_status=$?
13499   echo "$as_me:13499: \$? = $ac_status" >&5
13500   (exit $ac_status); }; }; then
13501   with_pthread=yes
13502 else
13503   echo "$as_me: failed program was:" >&5
13504 cat conftest.$ac_ext >&5
13505 with_pthread=no
13506 fi
13507 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13508             LIBS="$cf_save_LIBS"
13509             echo "$as_me:13509: result: $with_pthread" >&5
13510 echo "${ECHO_T}$with_pthread" >&6
13511             test "$with_pthread" = yes && break
13512         done
13513
13514         if test "$with_pthread" = yes ; then
13515
13516 cf_add_libs="$LIBS"
13517 # reverse order
13518 cf_add_0lib=
13519 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13520 # filter duplicates
13521 for cf_add_1lib in $cf_add_0lib; do
13522         for cf_add_2lib in $cf_add_libs; do
13523                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13524                         cf_add_1lib=
13525                         break
13526                 fi
13527         done
13528         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13529 done
13530 LIBS="$cf_add_libs"
13531
13532 cat >>confdefs.h <<\EOF
13533 #define HAVE_LIBPTHREADS 1
13534 EOF
13535
13536         else
13537             { { echo "$as_me:13537: error: Cannot link with pthread library" >&5
13538 echo "$as_me: error: Cannot link with pthread library" >&2;}
13539    { (exit 1); exit 1; }; }
13540         fi
13541
13542 fi
13543
13544 fi
13545
13546 echo "$as_me:13546: checking if you want to use weak-symbols for pthreads" >&5
13547 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13548
13549 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13550 if test "${enable_weak_symbols+set}" = set; then
13551   enableval="$enable_weak_symbols"
13552   use_weak_symbols=$withval
13553 else
13554   use_weak_symbols=no
13555 fi;
13556 echo "$as_me:13556: result: $use_weak_symbols" >&5
13557 echo "${ECHO_T}$use_weak_symbols" >&6
13558 if test "$use_weak_symbols" = yes ; then
13559
13560 echo "$as_me:13560: checking if $CC supports weak symbols" >&5
13561 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13562 if test "${cf_cv_weak_symbols+set}" = set; then
13563   echo $ECHO_N "(cached) $ECHO_C" >&6
13564 else
13565
13566 cat >conftest.$ac_ext <<_ACEOF
13567 #line 13567 "configure"
13568 #include "confdefs.h"
13569
13570 #include <stdio.h>
13571 int
13572 main (void)
13573 {
13574
13575 #if defined(__GNUC__)
13576 #  if defined __USE_ISOC99
13577 #    define _cat_pragma(exp)    _Pragma(#exp)
13578 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13579 #  else
13580 #    define _weak_pragma(exp)
13581 #  endif
13582 #  define _declare(name)        __extension__ extern __typeof__(name) name
13583 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13584 #endif
13585
13586 weak_symbol(fopen);
13587
13588   ;
13589   return 0;
13590 }
13591 _ACEOF
13592 rm -f conftest.$ac_objext
13593 if { (eval echo "$as_me:13593: \"$ac_compile\"") >&5
13594   (eval $ac_compile) 2>&5
13595   ac_status=$?
13596   echo "$as_me:13596: \$? = $ac_status" >&5
13597   (exit $ac_status); } &&
13598          { ac_try='test -s conftest.$ac_objext'
13599   { (eval echo "$as_me:13599: \"$ac_try\"") >&5
13600   (eval $ac_try) 2>&5
13601   ac_status=$?
13602   echo "$as_me:13602: \$? = $ac_status" >&5
13603   (exit $ac_status); }; }; then
13604   cf_cv_weak_symbols=yes
13605 else
13606   echo "$as_me: failed program was:" >&5
13607 cat conftest.$ac_ext >&5
13608 cf_cv_weak_symbols=no
13609 fi
13610 rm -f conftest.$ac_objext conftest.$ac_ext
13611
13612 fi
13613 echo "$as_me:13613: result: $cf_cv_weak_symbols" >&5
13614 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13615
13616 else
13617         cf_cv_weak_symbols=no
13618 fi
13619
13620 if test $cf_cv_weak_symbols = yes ; then
13621
13622 cat >>confdefs.h <<\EOF
13623 #define USE_WEAK_SYMBOLS 1
13624 EOF
13625
13626 fi
13627
13628 PTHREAD=
13629 if test "$with_pthread" = "yes" ; then
13630
13631 cat >>confdefs.h <<\EOF
13632 #define USE_PTHREADS 1
13633 EOF
13634
13635         enable_reentrant=yes
13636         if test $cf_cv_weak_symbols = yes ; then
13637                 PTHREAD=-lpthread
13638         fi
13639 fi
13640
13641 # OpenSUSE is installing ncurses6, using reentrant option.
13642 echo "$as_me:13642: checking for _nc_TABSIZE" >&5
13643 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13644 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13645   echo $ECHO_N "(cached) $ECHO_C" >&6
13646 else
13647   cat >conftest.$ac_ext <<_ACEOF
13648 #line 13648 "configure"
13649 #include "confdefs.h"
13650 #define _nc_TABSIZE autoconf_temporary
13651 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13652 #undef _nc_TABSIZE
13653
13654 #ifdef __cplusplus
13655 extern "C"
13656 #endif
13657
13658 /* We use char because int might match the return type of a gcc2
13659    builtin and then its argument prototype would still apply.  */
13660 char _nc_TABSIZE (void);
13661
13662 int
13663 main (void)
13664 {
13665
13666 /* The GNU C library defines stubs for functions which it implements
13667     to always fail with ENOSYS.  Some functions are actually named
13668     something starting with __ and the normal name is an alias.  */
13669 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13670 #error found stub for _nc_TABSIZE
13671 #endif
13672
13673         return _nc_TABSIZE ();
13674   ;
13675   return 0;
13676 }
13677 _ACEOF
13678 rm -f conftest.$ac_objext conftest$ac_exeext
13679 if { (eval echo "$as_me:13679: \"$ac_link\"") >&5
13680   (eval $ac_link) 2>&5
13681   ac_status=$?
13682   echo "$as_me:13682: \$? = $ac_status" >&5
13683   (exit $ac_status); } &&
13684          { ac_try='test -s conftest$ac_exeext'
13685   { (eval echo "$as_me:13685: \"$ac_try\"") >&5
13686   (eval $ac_try) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); }; }; then
13690   ac_cv_func__nc_TABSIZE=yes
13691 else
13692   echo "$as_me: failed program was:" >&5
13693 cat conftest.$ac_ext >&5
13694 ac_cv_func__nc_TABSIZE=no
13695 fi
13696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13697 fi
13698 echo "$as_me:13698: result: $ac_cv_func__nc_TABSIZE" >&5
13699 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13700 if test $ac_cv_func__nc_TABSIZE = yes; then
13701   assume_reentrant=yes
13702 else
13703   assume_reentrant=no
13704 fi
13705
13706 # Reentrant code has to be opaque; there's little advantage to making ncurses
13707 # opaque outside of that, so there is no --enable-opaque option.  We can use
13708 # this option without --with-pthreads, but this will be always set for
13709 # pthreads.
13710 echo "$as_me:13710: checking if you want experimental reentrant code" >&5
13711 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13712
13713 # Check whether --enable-reentrant or --disable-reentrant was given.
13714 if test "${enable_reentrant+set}" = set; then
13715   enableval="$enable_reentrant"
13716   with_reentrant=$enableval
13717 else
13718   with_reentrant=$assume_reentrant
13719 fi;
13720 echo "$as_me:13720: result: $with_reentrant" >&5
13721 echo "${ECHO_T}$with_reentrant" >&6
13722 if test "$with_reentrant" = yes ; then
13723         cf_cv_enable_reentrant=1
13724         if test $cf_cv_weak_symbols = yes ; then
13725
13726 # remove pthread library from $LIBS
13727 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13728
13729         elif test "$assume_reentrant" = no ; then
13730                 LIB_SUFFIX="t${LIB_SUFFIX}"
13731         fi
13732
13733 cat >>confdefs.h <<\EOF
13734 #define USE_REENTRANT 1
13735 EOF
13736
13737 else
13738         cf_cv_enable_reentrant=0
13739 fi
13740
13741 ### Allow using a different wrap-prefix
13742 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13743         echo "$as_me:13743: checking for prefix used to wrap public variables" >&5
13744 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13745
13746 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13747 if test "${with_wrap_prefix+set}" = set; then
13748   withval="$with_wrap_prefix"
13749   NCURSES_WRAP_PREFIX=$withval
13750 else
13751   NCURSES_WRAP_PREFIX=_nc_
13752 fi;
13753         echo "$as_me:13753: result: $NCURSES_WRAP_PREFIX" >&5
13754 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13755 else
13756         NCURSES_WRAP_PREFIX=_nc_
13757 fi
13758
13759 cat >>confdefs.h <<EOF
13760 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13761 EOF
13762
13763 ###############################################################################
13764
13765 ###     use option --disable-echo to suppress full display compiling commands
13766
13767 echo "$as_me:13767: checking if you want to see long compiling messages" >&5
13768 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13769
13770 # Check whether --enable-echo or --disable-echo was given.
13771 if test "${enable_echo+set}" = set; then
13772   enableval="$enable_echo"
13773   test "$enableval" != no && enableval=yes
13774         if test "$enableval" != "yes" ; then
13775
13776         ECHO_LT='--silent'
13777         ECHO_LD='@echo linking $@;'
13778         RULE_CC='@echo compiling $<'
13779         SHOW_CC='@echo compiling $@'
13780         ECHO_CC='@'
13781
13782         else
13783
13784         ECHO_LT=''
13785         ECHO_LD=''
13786         RULE_CC=''
13787         SHOW_CC=''
13788         ECHO_CC=''
13789
13790         fi
13791 else
13792   enableval=yes
13793
13794         ECHO_LT=''
13795         ECHO_LD=''
13796         RULE_CC=''
13797         SHOW_CC=''
13798         ECHO_CC=''
13799
13800 fi;
13801 echo "$as_me:13801: result: $enableval" >&5
13802 echo "${ECHO_T}$enableval" >&6
13803
13804 ###     use option --enable-warnings to turn on all gcc warnings
13805 echo "$as_me:13805: checking if you want to see compiler warnings" >&5
13806 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13807
13808 # Check whether --enable-warnings or --disable-warnings was given.
13809 if test "${enable_warnings+set}" = set; then
13810   enableval="$enable_warnings"
13811   with_warnings=$enableval
13812 fi;
13813 echo "$as_me:13813: result: $with_warnings" >&5
13814 echo "${ECHO_T}$with_warnings" >&6
13815
13816 if test "x$with_warnings" = "xyes"; then
13817
13818         ADAFLAGS="$ADAFLAGS -gnatg"
13819
13820 if test "x$have_x" = xyes; then
13821
13822 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
13823 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
13824 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
13825 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
13826 for cf_X_CFLAGS in $X_CFLAGS
13827 do
13828         case "x$cf_X_CFLAGS" in
13829         x-[IUD]*)
13830                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
13831                 ;;
13832         *)
13833                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
13834                 ;;
13835         esac
13836 done
13837
13838 cat >conftest.$ac_ext <<_ACEOF
13839 #line 13839 "configure"
13840 #include "confdefs.h"
13841
13842 #include <stdlib.h>
13843 #include <X11/Intrinsic.h>
13844
13845 int
13846 main (void)
13847 {
13848 String foo = malloc(1)
13849   ;
13850   return 0;
13851 }
13852 _ACEOF
13853 rm -f conftest.$ac_objext
13854 if { (eval echo "$as_me:13854: \"$ac_compile\"") >&5
13855   (eval $ac_compile) 2>&5
13856   ac_status=$?
13857   echo "$as_me:13857: \$? = $ac_status" >&5
13858   (exit $ac_status); } &&
13859          { ac_try='test -s conftest.$ac_objext'
13860   { (eval echo "$as_me:13860: \"$ac_try\"") >&5
13861   (eval $ac_try) 2>&5
13862   ac_status=$?
13863   echo "$as_me:13863: \$? = $ac_status" >&5
13864   (exit $ac_status); }; }; then
13865
13866 echo "$as_me:13866: checking for X11/Xt const-feature" >&5
13867 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
13868 if test "${cf_cv_const_x_string+set}" = set; then
13869   echo $ECHO_N "(cached) $ECHO_C" >&6
13870 else
13871
13872         cat >conftest.$ac_ext <<_ACEOF
13873 #line 13873 "configure"
13874 #include "confdefs.h"
13875
13876 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
13877 #undef  XTSTRINGDEFINES /* X11R5 and later */
13878 #include <stdlib.h>
13879 #include <X11/Intrinsic.h>
13880
13881 int
13882 main (void)
13883 {
13884 String foo = malloc(1); *foo = 0
13885   ;
13886   return 0;
13887 }
13888 _ACEOF
13889 rm -f conftest.$ac_objext
13890 if { (eval echo "$as_me:13890: \"$ac_compile\"") >&5
13891   (eval $ac_compile) 2>&5
13892   ac_status=$?
13893   echo "$as_me:13893: \$? = $ac_status" >&5
13894   (exit $ac_status); } &&
13895          { ac_try='test -s conftest.$ac_objext'
13896   { (eval echo "$as_me:13896: \"$ac_try\"") >&5
13897   (eval $ac_try) 2>&5
13898   ac_status=$?
13899   echo "$as_me:13899: \$? = $ac_status" >&5
13900   (exit $ac_status); }; }; then
13901
13902                         cf_cv_const_x_string=no
13903
13904 else
13905   echo "$as_me: failed program was:" >&5
13906 cat conftest.$ac_ext >&5
13907
13908                         cf_cv_const_x_string=yes
13909
13910 fi
13911 rm -f conftest.$ac_objext conftest.$ac_ext
13912
13913 fi
13914 echo "$as_me:13914: result: $cf_cv_const_x_string" >&5
13915 echo "${ECHO_T}$cf_cv_const_x_string" >&6
13916
13917 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
13918 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
13919 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
13920
13921 case $cf_cv_const_x_string in
13922 (no)
13923
13924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13925         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13926
13927         ;;
13928 (*)
13929
13930         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13931         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
13932
13933         ;;
13934 esac
13935
13936 else
13937   echo "$as_me: failed program was:" >&5
13938 cat conftest.$ac_ext >&5
13939 fi
13940 rm -f conftest.$ac_objext conftest.$ac_ext
13941  fi
13942 cat > conftest.$ac_ext <<EOF
13943 #line 13943 "${as_me:-configure}"
13944 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13945 EOF
13946 if test "$INTEL_COMPILER" = yes
13947 then
13948 # The "-wdXXX" options suppress warnings:
13949 # remark #1419: external declaration in primary source file
13950 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13951 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13952 # remark #193: zero used for undefined preprocessing identifier
13953 # remark #593: variable "curs_sb_left_arrow" was set but never used
13954 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13955 # remark #869: parameter "tw" was never referenced
13956 # remark #981: operands are evaluated in unspecified order
13957 # warning #279: controlling expression is constant
13958
13959         { echo "$as_me:13959: checking for $CC warning options..." >&5
13960 echo "$as_me: checking for $CC warning options..." >&6;}
13961         cf_save_CFLAGS="$CFLAGS"
13962         EXTRA_CFLAGS="-Wall"
13963         for cf_opt in \
13964                 wd1419 \
13965                 wd1683 \
13966                 wd1684 \
13967                 wd193 \
13968                 wd593 \
13969                 wd279 \
13970                 wd810 \
13971                 wd869 \
13972                 wd981
13973         do
13974                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13975                 if { (eval echo "$as_me:13975: \"$ac_compile\"") >&5
13976   (eval $ac_compile) 2>&5
13977   ac_status=$?
13978   echo "$as_me:13978: \$? = $ac_status" >&5
13979   (exit $ac_status); }; then
13980                         test -n "$verbose" && echo "$as_me:13980: result: ... -$cf_opt" >&5
13981 echo "${ECHO_T}... -$cf_opt" >&6
13982                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13983                 fi
13984         done
13985         CFLAGS="$cf_save_CFLAGS"
13986 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
13987 then
13988         { echo "$as_me:13988: checking for $CC warning options..." >&5
13989 echo "$as_me: checking for $CC warning options..." >&6;}
13990         cf_save_CFLAGS="$CFLAGS"
13991         EXTRA_CFLAGS=
13992         cf_warn_CONST=""
13993         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13994         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13995         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13996         for cf_opt in W Wall \
13997                 Wbad-function-cast \
13998                 Wcast-align \
13999                 Wcast-qual \
14000                 Wdeclaration-after-statement \
14001                 Wextra \
14002                 Winline \
14003                 Wmissing-declarations \
14004                 Wmissing-prototypes \
14005                 Wnested-externs \
14006                 Wpointer-arith \
14007                 Wshadow \
14008                 Wstrict-prototypes \
14009                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14010         do
14011                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14012                 if { (eval echo "$as_me:14012: \"$ac_compile\"") >&5
14013   (eval $ac_compile) 2>&5
14014   ac_status=$?
14015   echo "$as_me:14015: \$? = $ac_status" >&5
14016   (exit $ac_status); }; then
14017                         test -n "$verbose" && echo "$as_me:14017: result: ... -$cf_opt" >&5
14018 echo "${ECHO_T}... -$cf_opt" >&6
14019                         case $cf_opt in
14020                         (Winline)
14021                                 case $GCC_VERSION in
14022                                 ([34].*)
14023                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14024
14025 echo "${as_me:-configure}:14025: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14026
14027                                         continue;;
14028                                 esac
14029                                 ;;
14030                         (Wpointer-arith)
14031                                 case $GCC_VERSION in
14032                                 ([12].*)
14033                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14034
14035 echo "${as_me:-configure}:14035: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14036
14037                                         continue;;
14038                                 esac
14039                                 ;;
14040                         esac
14041                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14042                 fi
14043         done
14044         CFLAGS="$cf_save_CFLAGS"
14045 fi
14046 rm -rf conftest*
14047
14048 fi
14049
14050 if test "$GCC" = yes
14051 then
14052 cat > conftest.i <<EOF
14053 #ifndef GCC_PRINTF
14054 #define GCC_PRINTF 0
14055 #endif
14056 #ifndef GCC_SCANF
14057 #define GCC_SCANF 0
14058 #endif
14059 #ifndef GCC_NORETURN
14060 #define GCC_NORETURN /* nothing */
14061 #endif
14062 #ifndef GCC_UNUSED
14063 #define GCC_UNUSED /* nothing */
14064 #endif
14065 EOF
14066 if test "$GCC" = yes
14067 then
14068         { echo "$as_me:14068: checking for $CC __attribute__ directives..." >&5
14069 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14070 cat > conftest.$ac_ext <<EOF
14071 #line 14071 "${as_me:-configure}"
14072 #include "confdefs.h"
14073 #include "conftest.h"
14074 #include "conftest.i"
14075 #if     GCC_PRINTF
14076 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14077 #else
14078 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14079 #endif
14080 #if     GCC_SCANF
14081 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14082 #else
14083 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14084 #endif
14085 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14086 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14087 extern void foo(void) GCC_NORETURN;
14088 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14089 EOF
14090         cf_printf_attribute=no
14091         cf_scanf_attribute=no
14092         for cf_attribute in scanf printf unused noreturn
14093         do
14094
14095 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14096
14097                 cf_directive="__attribute__(($cf_attribute))"
14098                 echo "checking for $CC $cf_directive" 1>&5
14099
14100                 case $cf_attribute in
14101                 (printf)
14102                         cf_printf_attribute=yes
14103                         cat >conftest.h <<EOF
14104 #define GCC_$cf_ATTRIBUTE 1
14105 EOF
14106                         ;;
14107                 (scanf)
14108                         cf_scanf_attribute=yes
14109                         cat >conftest.h <<EOF
14110 #define GCC_$cf_ATTRIBUTE 1
14111 EOF
14112                         ;;
14113                 (*)
14114                         cat >conftest.h <<EOF
14115 #define GCC_$cf_ATTRIBUTE $cf_directive
14116 EOF
14117                         ;;
14118                 esac
14119
14120                 if { (eval echo "$as_me:14120: \"$ac_compile\"") >&5
14121   (eval $ac_compile) 2>&5
14122   ac_status=$?
14123   echo "$as_me:14123: \$? = $ac_status" >&5
14124   (exit $ac_status); }; then
14125                         test -n "$verbose" && echo "$as_me:14125: result: ... $cf_attribute" >&5
14126 echo "${ECHO_T}... $cf_attribute" >&6
14127                         cat conftest.h >>confdefs.h
14128                         case $cf_attribute in
14129                         (noreturn)
14130
14131 cat >>confdefs.h <<EOF
14132 #define GCC_NORETURN $cf_directive
14133 EOF
14134
14135                                 ;;
14136                         (printf)
14137                                 cf_value='/* nothing */'
14138                                 if test "$cf_printf_attribute" != no ; then
14139                                         cf_value='__attribute__((format(printf,fmt,var)))'
14140
14141 cat >>confdefs.h <<\EOF
14142 #define GCC_PRINTF 1
14143 EOF
14144
14145                                 fi
14146
14147 cat >>confdefs.h <<EOF
14148 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14149 EOF
14150
14151                                 ;;
14152                         (scanf)
14153                                 cf_value='/* nothing */'
14154                                 if test "$cf_scanf_attribute" != no ; then
14155                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14156
14157 cat >>confdefs.h <<\EOF
14158 #define GCC_SCANF 1
14159 EOF
14160
14161                                 fi
14162
14163 cat >>confdefs.h <<EOF
14164 #define GCC_SCANFLIKE(fmt,var) $cf_value
14165 EOF
14166
14167                                 ;;
14168                         (unused)
14169
14170 cat >>confdefs.h <<EOF
14171 #define GCC_UNUSED $cf_directive
14172 EOF
14173
14174                                 ;;
14175                         esac
14176                 fi
14177         done
14178 else
14179         fgrep define conftest.i >>confdefs.h
14180 fi
14181 rm -rf conftest*
14182 fi
14183
14184 ###     use option --enable-assertions to turn on generation of assertion code
14185 echo "$as_me:14185: checking if you want to enable runtime assertions" >&5
14186 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14187
14188 # Check whether --enable-assertions or --disable-assertions was given.
14189 if test "${enable_assertions+set}" = set; then
14190   enableval="$enable_assertions"
14191   with_assertions=$enableval
14192 else
14193   with_assertions=no
14194 fi;
14195 echo "$as_me:14195: result: $with_assertions" >&5
14196 echo "${ECHO_T}$with_assertions" >&6
14197 if test -n "$GCC"
14198 then
14199         if test "$with_assertions" = no
14200         then
14201                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14202         else
14203
14204         ADAFLAGS="$ADAFLAGS -gnata"
14205
14206         fi
14207 fi
14208
14209 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14210
14211 cat >>confdefs.h <<\EOF
14212 #define HAVE_NC_ALLOC_H 1
14213 EOF
14214
14215 ###     use option --enable-expanded to generate certain macros as functions
14216
14217 # Check whether --enable-expanded or --disable-expanded was given.
14218 if test "${enable_expanded+set}" = set; then
14219   enableval="$enable_expanded"
14220   test "$enableval" = yes &&
14221 cat >>confdefs.h <<\EOF
14222 #define NCURSES_EXPANDED 1
14223 EOF
14224
14225 fi;
14226
14227 ###     use option --disable-macros to suppress macros in favor of functions
14228
14229 # Check whether --enable-macros or --disable-macros was given.
14230 if test "${enable_macros+set}" = set; then
14231   enableval="$enable_macros"
14232   test "$enableval" = no &&
14233 cat >>confdefs.h <<\EOF
14234 #define NCURSES_NOMACROS 1
14235 EOF
14236
14237 fi;
14238
14239 # Normally we only add trace() to the debug-library.  Allow this to be
14240 # extended to all models of the ncurses library:
14241 cf_all_traces=no
14242 case "$CFLAGS $CPPFLAGS" in
14243 (*-DTRACE*)
14244         cf_all_traces=yes
14245         ;;
14246 esac
14247
14248 echo "$as_me:14248: checking whether to add trace feature to all models" >&5
14249 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14250
14251 # Check whether --with-trace or --without-trace was given.
14252 if test "${with_trace+set}" = set; then
14253   withval="$with_trace"
14254   cf_with_trace=$withval
14255 else
14256   cf_with_trace=$cf_all_traces
14257 fi;
14258 echo "$as_me:14258: result: $cf_with_trace" >&5
14259 echo "${ECHO_T}$cf_with_trace" >&6
14260
14261 if test "$cf_with_trace" = yes ; then
14262         ADA_TRACE=TRUE
14263
14264 cf_fix_cppflags=no
14265 cf_new_cflags=
14266 cf_new_cppflags=
14267 cf_new_extra_cppflags=
14268
14269 for cf_add_cflags in -DTRACE
14270 do
14271 case $cf_fix_cppflags in
14272 (no)
14273         case $cf_add_cflags in
14274         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14275                 case $cf_add_cflags in
14276                 (-D*)
14277                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14278
14279                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14280                                 && test -z "${cf_tst_cflags}" \
14281                                 && cf_fix_cppflags=yes
14282
14283                         if test $cf_fix_cppflags = yes ; then
14284
14285         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14286         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14287
14288                                 continue
14289                         elif test "${cf_tst_cflags}" = "\"'" ; then
14290
14291         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14292         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14293
14294                                 continue
14295                         fi
14296                         ;;
14297                 esac
14298                 case "$CPPFLAGS" in
14299                 (*$cf_add_cflags)
14300                         ;;
14301                 (*)
14302                         case $cf_add_cflags in
14303                         (-D*)
14304                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14305
14306 CPPFLAGS=`echo "$CPPFLAGS" | \
14307         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14308                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14309
14310                                 ;;
14311                         esac
14312
14313         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14314         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14315
14316                         ;;
14317                 esac
14318                 ;;
14319         (*)
14320
14321         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14322         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14323
14324                 ;;
14325         esac
14326         ;;
14327 (yes)
14328
14329         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14330         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14331
14332         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14333
14334         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14335                 && test -z "${cf_tst_cflags}" \
14336                 && cf_fix_cppflags=no
14337         ;;
14338 esac
14339 done
14340
14341 if test -n "$cf_new_cflags" ; then
14342
14343         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14344         CFLAGS="${CFLAGS}$cf_new_cflags"
14345
14346 fi
14347
14348 if test -n "$cf_new_cppflags" ; then
14349
14350         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14351         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14352
14353 fi
14354
14355 if test -n "$cf_new_extra_cppflags" ; then
14356
14357         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14358         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14359
14360 fi
14361
14362 else
14363         ADA_TRACE=FALSE
14364 fi
14365
14366 echo "$as_me:14366: checking if we want to use GNAT projects" >&5
14367 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14368
14369 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14370 if test "${enable_gnat_projects+set}" = set; then
14371   enableval="$enable_gnat_projects"
14372   test "$enableval" != no && enableval=yes
14373         if test "$enableval" != "yes" ; then
14374     enable_gnat_projects=no
14375         else
14376                 enable_gnat_projects=yes
14377         fi
14378 else
14379   enableval=yes
14380         enable_gnat_projects=yes
14381
14382 fi;
14383 echo "$as_me:14383: result: $enable_gnat_projects" >&5
14384 echo "${ECHO_T}$enable_gnat_projects" >&6
14385
14386 ###     Checks for libraries.
14387 case $cf_cv_system_name in
14388 (*mingw32*)
14389         ;;
14390 (*)
14391 echo "$as_me:14391: checking for gettimeofday" >&5
14392 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14393 if test "${ac_cv_func_gettimeofday+set}" = set; then
14394   echo $ECHO_N "(cached) $ECHO_C" >&6
14395 else
14396   cat >conftest.$ac_ext <<_ACEOF
14397 #line 14397 "configure"
14398 #include "confdefs.h"
14399 #define gettimeofday autoconf_temporary
14400 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14401 #undef gettimeofday
14402
14403 #ifdef __cplusplus
14404 extern "C"
14405 #endif
14406
14407 /* We use char because int might match the return type of a gcc2
14408    builtin and then its argument prototype would still apply.  */
14409 char gettimeofday (void);
14410
14411 int
14412 main (void)
14413 {
14414
14415 /* The GNU C library defines stubs for functions which it implements
14416     to always fail with ENOSYS.  Some functions are actually named
14417     something starting with __ and the normal name is an alias.  */
14418 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14419 #error found stub for gettimeofday
14420 #endif
14421
14422         return gettimeofday ();
14423   ;
14424   return 0;
14425 }
14426 _ACEOF
14427 rm -f conftest.$ac_objext conftest$ac_exeext
14428 if { (eval echo "$as_me:14428: \"$ac_link\"") >&5
14429   (eval $ac_link) 2>&5
14430   ac_status=$?
14431   echo "$as_me:14431: \$? = $ac_status" >&5
14432   (exit $ac_status); } &&
14433          { ac_try='test -s conftest$ac_exeext'
14434   { (eval echo "$as_me:14434: \"$ac_try\"") >&5
14435   (eval $ac_try) 2>&5
14436   ac_status=$?
14437   echo "$as_me:14437: \$? = $ac_status" >&5
14438   (exit $ac_status); }; }; then
14439   ac_cv_func_gettimeofday=yes
14440 else
14441   echo "$as_me: failed program was:" >&5
14442 cat conftest.$ac_ext >&5
14443 ac_cv_func_gettimeofday=no
14444 fi
14445 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14446 fi
14447 echo "$as_me:14447: result: $ac_cv_func_gettimeofday" >&5
14448 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14449 if test $ac_cv_func_gettimeofday = yes; then
14450   cat >>confdefs.h <<\EOF
14451 #define HAVE_GETTIMEOFDAY 1
14452 EOF
14453
14454 else
14455
14456 echo "$as_me:14456: checking for gettimeofday in -lbsd" >&5
14457 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14458 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14459   echo $ECHO_N "(cached) $ECHO_C" >&6
14460 else
14461   ac_check_lib_save_LIBS=$LIBS
14462 LIBS="-lbsd  $LIBS"
14463 cat >conftest.$ac_ext <<_ACEOF
14464 #line 14464 "configure"
14465 #include "confdefs.h"
14466
14467 /* Override any gcc2 internal prototype to avoid an error.  */
14468 #ifdef __cplusplus
14469 extern "C"
14470 #endif
14471 /* We use char because int might match the return type of a gcc2
14472    builtin and then its argument prototype would still apply.  */
14473 char gettimeofday ();
14474 int
14475 main (void)
14476 {
14477 gettimeofday ();
14478   ;
14479   return 0;
14480 }
14481 _ACEOF
14482 rm -f conftest.$ac_objext conftest$ac_exeext
14483 if { (eval echo "$as_me:14483: \"$ac_link\"") >&5
14484   (eval $ac_link) 2>&5
14485   ac_status=$?
14486   echo "$as_me:14486: \$? = $ac_status" >&5
14487   (exit $ac_status); } &&
14488          { ac_try='test -s conftest$ac_exeext'
14489   { (eval echo "$as_me:14489: \"$ac_try\"") >&5
14490   (eval $ac_try) 2>&5
14491   ac_status=$?
14492   echo "$as_me:14492: \$? = $ac_status" >&5
14493   (exit $ac_status); }; }; then
14494   ac_cv_lib_bsd_gettimeofday=yes
14495 else
14496   echo "$as_me: failed program was:" >&5
14497 cat conftest.$ac_ext >&5
14498 ac_cv_lib_bsd_gettimeofday=no
14499 fi
14500 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14501 LIBS=$ac_check_lib_save_LIBS
14502 fi
14503 echo "$as_me:14503: result: $ac_cv_lib_bsd_gettimeofday" >&5
14504 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14505 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14506
14507 cat >>confdefs.h <<\EOF
14508 #define HAVE_GETTIMEOFDAY 1
14509 EOF
14510
14511         LIBS="$LIBS -lbsd"
14512 fi
14513
14514 fi
14515         ;;
14516 esac
14517
14518 ###     Checks for header files.
14519 echo "$as_me:14519: checking for ANSI C header files" >&5
14520 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14521 if test "${ac_cv_header_stdc+set}" = set; then
14522   echo $ECHO_N "(cached) $ECHO_C" >&6
14523 else
14524   cat >conftest.$ac_ext <<_ACEOF
14525 #line 14525 "configure"
14526 #include "confdefs.h"
14527 #include <stdlib.h>
14528 #include <stdarg.h>
14529 #include <string.h>
14530 #include <float.h>
14531
14532 _ACEOF
14533 if { (eval echo "$as_me:14533: \"$ac_cpp conftest.$ac_ext\"") >&5
14534   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14535   ac_status=$?
14536   egrep -v '^ *\+' conftest.er1 >conftest.err
14537   rm -f conftest.er1
14538   cat conftest.err >&5
14539   echo "$as_me:14539: \$? = $ac_status" >&5
14540   (exit $ac_status); } >/dev/null; then
14541   if test -s conftest.err; then
14542     ac_cpp_err=$ac_c_preproc_warn_flag
14543   else
14544     ac_cpp_err=
14545   fi
14546 else
14547   ac_cpp_err=yes
14548 fi
14549 if test -z "$ac_cpp_err"; then
14550   ac_cv_header_stdc=yes
14551 else
14552   echo "$as_me: failed program was:" >&5
14553   cat conftest.$ac_ext >&5
14554   ac_cv_header_stdc=no
14555 fi
14556 rm -f conftest.err conftest.$ac_ext
14557
14558 if test $ac_cv_header_stdc = yes; then
14559   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14560   cat >conftest.$ac_ext <<_ACEOF
14561 #line 14561 "configure"
14562 #include "confdefs.h"
14563 #include <string.h>
14564
14565 _ACEOF
14566 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14567   egrep "memchr" >/dev/null 2>&1; then
14568   :
14569 else
14570   ac_cv_header_stdc=no
14571 fi
14572 rm -rf conftest*
14573
14574 fi
14575
14576 if test $ac_cv_header_stdc = yes; then
14577   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14578   cat >conftest.$ac_ext <<_ACEOF
14579 #line 14579 "configure"
14580 #include "confdefs.h"
14581 #include <stdlib.h>
14582
14583 _ACEOF
14584 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14585   egrep "free" >/dev/null 2>&1; then
14586   :
14587 else
14588   ac_cv_header_stdc=no
14589 fi
14590 rm -rf conftest*
14591
14592 fi
14593
14594 if test $ac_cv_header_stdc = yes; then
14595   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14596   if test "$cross_compiling" = yes; then
14597   :
14598 else
14599   cat >conftest.$ac_ext <<_ACEOF
14600 #line 14600 "configure"
14601 #include "confdefs.h"
14602 #include <ctype.h>
14603 #if ((' ' & 0x0FF) == 0x020)
14604 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14605 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14606 #else
14607 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14608                      || ('j' <= (c) && (c) <= 'r') \
14609                      || ('s' <= (c) && (c) <= 'z'))
14610 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14611 #endif
14612
14613 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14614 int
14615 main (void)
14616 {
14617   int i;
14618   for (i = 0; i < 256; i++)
14619     if (XOR (islower (i), ISLOWER (i))
14620         || toupper (i) != TOUPPER (i))
14621       $ac_main_return(2);
14622   $ac_main_return (0);
14623 }
14624 _ACEOF
14625 rm -f conftest$ac_exeext
14626 if { (eval echo "$as_me:14626: \"$ac_link\"") >&5
14627   (eval $ac_link) 2>&5
14628   ac_status=$?
14629   echo "$as_me:14629: \$? = $ac_status" >&5
14630   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14631   { (eval echo "$as_me:14631: \"$ac_try\"") >&5
14632   (eval $ac_try) 2>&5
14633   ac_status=$?
14634   echo "$as_me:14634: \$? = $ac_status" >&5
14635   (exit $ac_status); }; }; then
14636   :
14637 else
14638   echo "$as_me: program exited with status $ac_status" >&5
14639 echo "$as_me: failed program was:" >&5
14640 cat conftest.$ac_ext >&5
14641 ac_cv_header_stdc=no
14642 fi
14643 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14644 fi
14645 fi
14646 fi
14647 echo "$as_me:14647: result: $ac_cv_header_stdc" >&5
14648 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14649 if test $ac_cv_header_stdc = yes; then
14650
14651 cat >>confdefs.h <<\EOF
14652 #define STDC_HEADERS 1
14653 EOF
14654
14655 fi
14656
14657 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14658
14659 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14660                   inttypes.h stdint.h unistd.h
14661 do
14662 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14663 echo "$as_me:14663: checking for $ac_header" >&5
14664 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14665 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14666   echo $ECHO_N "(cached) $ECHO_C" >&6
14667 else
14668   cat >conftest.$ac_ext <<_ACEOF
14669 #line 14669 "configure"
14670 #include "confdefs.h"
14671 $ac_includes_default
14672 #include <$ac_header>
14673 _ACEOF
14674 rm -f conftest.$ac_objext
14675 if { (eval echo "$as_me:14675: \"$ac_compile\"") >&5
14676   (eval $ac_compile) 2>&5
14677   ac_status=$?
14678   echo "$as_me:14678: \$? = $ac_status" >&5
14679   (exit $ac_status); } &&
14680          { ac_try='test -s conftest.$ac_objext'
14681   { (eval echo "$as_me:14681: \"$ac_try\"") >&5
14682   (eval $ac_try) 2>&5
14683   ac_status=$?
14684   echo "$as_me:14684: \$? = $ac_status" >&5
14685   (exit $ac_status); }; }; then
14686   eval "$as_ac_Header=yes"
14687 else
14688   echo "$as_me: failed program was:" >&5
14689 cat conftest.$ac_ext >&5
14690 eval "$as_ac_Header=no"
14691 fi
14692 rm -f conftest.$ac_objext conftest.$ac_ext
14693 fi
14694 echo "$as_me:14694: result: `eval echo '${'$as_ac_Header'}'`" >&5
14695 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14696 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14697   cat >>confdefs.h <<EOF
14698 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14699 EOF
14700
14701 fi
14702 done
14703
14704 echo "$as_me:14704: checking for signed char" >&5
14705 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14706 if test "${ac_cv_type_signed_char+set}" = set; then
14707   echo $ECHO_N "(cached) $ECHO_C" >&6
14708 else
14709   cat >conftest.$ac_ext <<_ACEOF
14710 #line 14710 "configure"
14711 #include "confdefs.h"
14712 $ac_includes_default
14713 int
14714 main (void)
14715 {
14716 if ((signed char *) 0)
14717   return 0;
14718 if (sizeof (signed char))
14719   return 0;
14720   ;
14721   return 0;
14722 }
14723 _ACEOF
14724 rm -f conftest.$ac_objext
14725 if { (eval echo "$as_me:14725: \"$ac_compile\"") >&5
14726   (eval $ac_compile) 2>&5
14727   ac_status=$?
14728   echo "$as_me:14728: \$? = $ac_status" >&5
14729   (exit $ac_status); } &&
14730          { ac_try='test -s conftest.$ac_objext'
14731   { (eval echo "$as_me:14731: \"$ac_try\"") >&5
14732   (eval $ac_try) 2>&5
14733   ac_status=$?
14734   echo "$as_me:14734: \$? = $ac_status" >&5
14735   (exit $ac_status); }; }; then
14736   ac_cv_type_signed_char=yes
14737 else
14738   echo "$as_me: failed program was:" >&5
14739 cat conftest.$ac_ext >&5
14740 ac_cv_type_signed_char=no
14741 fi
14742 rm -f conftest.$ac_objext conftest.$ac_ext
14743 fi
14744 echo "$as_me:14744: result: $ac_cv_type_signed_char" >&5
14745 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14746
14747 echo "$as_me:14747: checking size of signed char" >&5
14748 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14749 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14750   echo $ECHO_N "(cached) $ECHO_C" >&6
14751 else
14752   if test "$ac_cv_type_signed_char" = yes; then
14753   if test "$cross_compiling" = yes; then
14754   # Depending upon the size, compute the lo and hi bounds.
14755 cat >conftest.$ac_ext <<_ACEOF
14756 #line 14756 "configure"
14757 #include "confdefs.h"
14758 $ac_includes_default
14759 int
14760 main (void)
14761 {
14762 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14763   ;
14764   return 0;
14765 }
14766 _ACEOF
14767 rm -f conftest.$ac_objext
14768 if { (eval echo "$as_me:14768: \"$ac_compile\"") >&5
14769   (eval $ac_compile) 2>&5
14770   ac_status=$?
14771   echo "$as_me:14771: \$? = $ac_status" >&5
14772   (exit $ac_status); } &&
14773          { ac_try='test -s conftest.$ac_objext'
14774   { (eval echo "$as_me:14774: \"$ac_try\"") >&5
14775   (eval $ac_try) 2>&5
14776   ac_status=$?
14777   echo "$as_me:14777: \$? = $ac_status" >&5
14778   (exit $ac_status); }; }; then
14779   ac_lo=0 ac_mid=0
14780   while :; do
14781     cat >conftest.$ac_ext <<_ACEOF
14782 #line 14782 "configure"
14783 #include "confdefs.h"
14784 $ac_includes_default
14785 int
14786 main (void)
14787 {
14788 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14789   ;
14790   return 0;
14791 }
14792 _ACEOF
14793 rm -f conftest.$ac_objext
14794 if { (eval echo "$as_me:14794: \"$ac_compile\"") >&5
14795   (eval $ac_compile) 2>&5
14796   ac_status=$?
14797   echo "$as_me:14797: \$? = $ac_status" >&5
14798   (exit $ac_status); } &&
14799          { ac_try='test -s conftest.$ac_objext'
14800   { (eval echo "$as_me:14800: \"$ac_try\"") >&5
14801   (eval $ac_try) 2>&5
14802   ac_status=$?
14803   echo "$as_me:14803: \$? = $ac_status" >&5
14804   (exit $ac_status); }; }; then
14805   ac_hi=$ac_mid; break
14806 else
14807   echo "$as_me: failed program was:" >&5
14808 cat conftest.$ac_ext >&5
14809 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14810 fi
14811 rm -f conftest.$ac_objext conftest.$ac_ext
14812   done
14813 else
14814   echo "$as_me: failed program was:" >&5
14815 cat conftest.$ac_ext >&5
14816 ac_hi=-1 ac_mid=-1
14817   while :; do
14818     cat >conftest.$ac_ext <<_ACEOF
14819 #line 14819 "configure"
14820 #include "confdefs.h"
14821 $ac_includes_default
14822 int
14823 main (void)
14824 {
14825 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14826   ;
14827   return 0;
14828 }
14829 _ACEOF
14830 rm -f conftest.$ac_objext
14831 if { (eval echo "$as_me:14831: \"$ac_compile\"") >&5
14832   (eval $ac_compile) 2>&5
14833   ac_status=$?
14834   echo "$as_me:14834: \$? = $ac_status" >&5
14835   (exit $ac_status); } &&
14836          { ac_try='test -s conftest.$ac_objext'
14837   { (eval echo "$as_me:14837: \"$ac_try\"") >&5
14838   (eval $ac_try) 2>&5
14839   ac_status=$?
14840   echo "$as_me:14840: \$? = $ac_status" >&5
14841   (exit $ac_status); }; }; then
14842   ac_lo=$ac_mid; break
14843 else
14844   echo "$as_me: failed program was:" >&5
14845 cat conftest.$ac_ext >&5
14846 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14847 fi
14848 rm -f conftest.$ac_objext conftest.$ac_ext
14849   done
14850 fi
14851 rm -f conftest.$ac_objext conftest.$ac_ext
14852 # Binary search between lo and hi bounds.
14853 while test "x$ac_lo" != "x$ac_hi"; do
14854   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14855   cat >conftest.$ac_ext <<_ACEOF
14856 #line 14856 "configure"
14857 #include "confdefs.h"
14858 $ac_includes_default
14859 int
14860 main (void)
14861 {
14862 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14863   ;
14864   return 0;
14865 }
14866 _ACEOF
14867 rm -f conftest.$ac_objext
14868 if { (eval echo "$as_me:14868: \"$ac_compile\"") >&5
14869   (eval $ac_compile) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit $ac_status); } &&
14873          { ac_try='test -s conftest.$ac_objext'
14874   { (eval echo "$as_me:14874: \"$ac_try\"") >&5
14875   (eval $ac_try) 2>&5
14876   ac_status=$?
14877   echo "$as_me:14877: \$? = $ac_status" >&5
14878   (exit $ac_status); }; }; then
14879   ac_hi=$ac_mid
14880 else
14881   echo "$as_me: failed program was:" >&5
14882 cat conftest.$ac_ext >&5
14883 ac_lo=`expr $ac_mid + 1`
14884 fi
14885 rm -f conftest.$ac_objext conftest.$ac_ext
14886 done
14887 ac_cv_sizeof_signed_char=$ac_lo
14888 else
14889   if test "$cross_compiling" = yes; then
14890   { { echo "$as_me:14890: error: cannot run test program while cross compiling" >&5
14891 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14892    { (exit 1); exit 1; }; }
14893 else
14894   cat >conftest.$ac_ext <<_ACEOF
14895 #line 14895 "configure"
14896 #include "confdefs.h"
14897 $ac_includes_default
14898 int
14899 main (void)
14900 {
14901 FILE *f = fopen ("conftest.val", "w");
14902 if (!f)
14903   $ac_main_return (1);
14904 fprintf (f, "%d", (sizeof (signed char)));
14905 fclose (f);
14906   ;
14907   return 0;
14908 }
14909 _ACEOF
14910 rm -f conftest$ac_exeext
14911 if { (eval echo "$as_me:14911: \"$ac_link\"") >&5
14912   (eval $ac_link) 2>&5
14913   ac_status=$?
14914   echo "$as_me:14914: \$? = $ac_status" >&5
14915   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14916   { (eval echo "$as_me:14916: \"$ac_try\"") >&5
14917   (eval $ac_try) 2>&5
14918   ac_status=$?
14919   echo "$as_me:14919: \$? = $ac_status" >&5
14920   (exit $ac_status); }; }; then
14921   ac_cv_sizeof_signed_char=`cat conftest.val`
14922 else
14923   echo "$as_me: program exited with status $ac_status" >&5
14924 echo "$as_me: failed program was:" >&5
14925 cat conftest.$ac_ext >&5
14926 fi
14927 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14928 fi
14929 fi
14930 rm -f conftest.val
14931 else
14932   ac_cv_sizeof_signed_char=0
14933 fi
14934 fi
14935 echo "$as_me:14935: result: $ac_cv_sizeof_signed_char" >&5
14936 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14937 cat >>confdefs.h <<EOF
14938 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14939 EOF
14940
14941 echo "$as_me:14941: checking for ANSI C header files" >&5
14942 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14943 if test "${ac_cv_header_stdc+set}" = set; then
14944   echo $ECHO_N "(cached) $ECHO_C" >&6
14945 else
14946   cat >conftest.$ac_ext <<_ACEOF
14947 #line 14947 "configure"
14948 #include "confdefs.h"
14949 #include <stdlib.h>
14950 #include <stdarg.h>
14951 #include <string.h>
14952 #include <float.h>
14953
14954 _ACEOF
14955 if { (eval echo "$as_me:14955: \"$ac_cpp conftest.$ac_ext\"") >&5
14956   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14957   ac_status=$?
14958   egrep -v '^ *\+' conftest.er1 >conftest.err
14959   rm -f conftest.er1
14960   cat conftest.err >&5
14961   echo "$as_me:14961: \$? = $ac_status" >&5
14962   (exit $ac_status); } >/dev/null; then
14963   if test -s conftest.err; then
14964     ac_cpp_err=$ac_c_preproc_warn_flag
14965   else
14966     ac_cpp_err=
14967   fi
14968 else
14969   ac_cpp_err=yes
14970 fi
14971 if test -z "$ac_cpp_err"; then
14972   ac_cv_header_stdc=yes
14973 else
14974   echo "$as_me: failed program was:" >&5
14975   cat conftest.$ac_ext >&5
14976   ac_cv_header_stdc=no
14977 fi
14978 rm -f conftest.err conftest.$ac_ext
14979
14980 if test $ac_cv_header_stdc = yes; then
14981   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14982   cat >conftest.$ac_ext <<_ACEOF
14983 #line 14983 "configure"
14984 #include "confdefs.h"
14985 #include <string.h>
14986
14987 _ACEOF
14988 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14989   egrep "memchr" >/dev/null 2>&1; then
14990   :
14991 else
14992   ac_cv_header_stdc=no
14993 fi
14994 rm -rf conftest*
14995
14996 fi
14997
14998 if test $ac_cv_header_stdc = yes; then
14999   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15000   cat >conftest.$ac_ext <<_ACEOF
15001 #line 15001 "configure"
15002 #include "confdefs.h"
15003 #include <stdlib.h>
15004
15005 _ACEOF
15006 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15007   egrep "free" >/dev/null 2>&1; then
15008   :
15009 else
15010   ac_cv_header_stdc=no
15011 fi
15012 rm -rf conftest*
15013
15014 fi
15015
15016 if test $ac_cv_header_stdc = yes; then
15017   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15018   if test "$cross_compiling" = yes; then
15019   :
15020 else
15021   cat >conftest.$ac_ext <<_ACEOF
15022 #line 15022 "configure"
15023 #include "confdefs.h"
15024 #include <ctype.h>
15025 #if ((' ' & 0x0FF) == 0x020)
15026 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15027 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15028 #else
15029 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15030                      || ('j' <= (c) && (c) <= 'r') \
15031                      || ('s' <= (c) && (c) <= 'z'))
15032 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15033 #endif
15034
15035 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15036 int
15037 main (void)
15038 {
15039   int i;
15040   for (i = 0; i < 256; i++)
15041     if (XOR (islower (i), ISLOWER (i))
15042         || toupper (i) != TOUPPER (i))
15043       $ac_main_return(2);
15044   $ac_main_return (0);
15045 }
15046 _ACEOF
15047 rm -f conftest$ac_exeext
15048 if { (eval echo "$as_me:15048: \"$ac_link\"") >&5
15049   (eval $ac_link) 2>&5
15050   ac_status=$?
15051   echo "$as_me:15051: \$? = $ac_status" >&5
15052   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15053   { (eval echo "$as_me:15053: \"$ac_try\"") >&5
15054   (eval $ac_try) 2>&5
15055   ac_status=$?
15056   echo "$as_me:15056: \$? = $ac_status" >&5
15057   (exit $ac_status); }; }; then
15058   :
15059 else
15060   echo "$as_me: program exited with status $ac_status" >&5
15061 echo "$as_me: failed program was:" >&5
15062 cat conftest.$ac_ext >&5
15063 ac_cv_header_stdc=no
15064 fi
15065 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15066 fi
15067 fi
15068 fi
15069 echo "$as_me:15069: result: $ac_cv_header_stdc" >&5
15070 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15071 if test $ac_cv_header_stdc = yes; then
15072
15073 cat >>confdefs.h <<\EOF
15074 #define STDC_HEADERS 1
15075 EOF
15076
15077 fi
15078
15079 ac_header_dirent=no
15080 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
15081   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
15082 echo "$as_me:15082: checking for $ac_hdr that defines DIR" >&5
15083 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
15084 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15085   echo $ECHO_N "(cached) $ECHO_C" >&6
15086 else
15087   cat >conftest.$ac_ext <<_ACEOF
15088 #line 15088 "configure"
15089 #include "confdefs.h"
15090 #include <sys/types.h>
15091 #include <$ac_hdr>
15092
15093 int
15094 main (void)
15095 {
15096 if ((DIR *) 0)
15097 return 0;
15098   ;
15099   return 0;
15100 }
15101 _ACEOF
15102 rm -f conftest.$ac_objext
15103 if { (eval echo "$as_me:15103: \"$ac_compile\"") >&5
15104   (eval $ac_compile) 2>&5
15105   ac_status=$?
15106   echo "$as_me:15106: \$? = $ac_status" >&5
15107   (exit $ac_status); } &&
15108          { ac_try='test -s conftest.$ac_objext'
15109   { (eval echo "$as_me:15109: \"$ac_try\"") >&5
15110   (eval $ac_try) 2>&5
15111   ac_status=$?
15112   echo "$as_me:15112: \$? = $ac_status" >&5
15113   (exit $ac_status); }; }; then
15114   eval "$as_ac_Header=yes"
15115 else
15116   echo "$as_me: failed program was:" >&5
15117 cat conftest.$ac_ext >&5
15118 eval "$as_ac_Header=no"
15119 fi
15120 rm -f conftest.$ac_objext conftest.$ac_ext
15121 fi
15122 echo "$as_me:15122: result: `eval echo '${'$as_ac_Header'}'`" >&5
15123 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15124 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15125   cat >>confdefs.h <<EOF
15126 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15127 EOF
15128
15129 ac_header_dirent=$ac_hdr; break
15130 fi
15131
15132 done
15133 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
15134 if test $ac_header_dirent = dirent.h; then
15135   echo "$as_me:15135: checking for opendir in -ldir" >&5
15136 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
15137 if test "${ac_cv_lib_dir_opendir+set}" = set; then
15138   echo $ECHO_N "(cached) $ECHO_C" >&6
15139 else
15140   ac_check_lib_save_LIBS=$LIBS
15141 LIBS="-ldir  $LIBS"
15142 cat >conftest.$ac_ext <<_ACEOF
15143 #line 15143 "configure"
15144 #include "confdefs.h"
15145
15146 /* Override any gcc2 internal prototype to avoid an error.  */
15147 #ifdef __cplusplus
15148 extern "C"
15149 #endif
15150 /* We use char because int might match the return type of a gcc2
15151    builtin and then its argument prototype would still apply.  */
15152 char opendir ();
15153 int
15154 main (void)
15155 {
15156 opendir ();
15157   ;
15158   return 0;
15159 }
15160 _ACEOF
15161 rm -f conftest.$ac_objext conftest$ac_exeext
15162 if { (eval echo "$as_me:15162: \"$ac_link\"") >&5
15163   (eval $ac_link) 2>&5
15164   ac_status=$?
15165   echo "$as_me:15165: \$? = $ac_status" >&5
15166   (exit $ac_status); } &&
15167          { ac_try='test -s conftest$ac_exeext'
15168   { (eval echo "$as_me:15168: \"$ac_try\"") >&5
15169   (eval $ac_try) 2>&5
15170   ac_status=$?
15171   echo "$as_me:15171: \$? = $ac_status" >&5
15172   (exit $ac_status); }; }; then
15173   ac_cv_lib_dir_opendir=yes
15174 else
15175   echo "$as_me: failed program was:" >&5
15176 cat conftest.$ac_ext >&5
15177 ac_cv_lib_dir_opendir=no
15178 fi
15179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15180 LIBS=$ac_check_lib_save_LIBS
15181 fi
15182 echo "$as_me:15182: result: $ac_cv_lib_dir_opendir" >&5
15183 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15184 if test $ac_cv_lib_dir_opendir = yes; then
15185   LIBS="$LIBS -ldir"
15186 fi
15187
15188 else
15189   echo "$as_me:15189: checking for opendir in -lx" >&5
15190 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15191 if test "${ac_cv_lib_x_opendir+set}" = set; then
15192   echo $ECHO_N "(cached) $ECHO_C" >&6
15193 else
15194   ac_check_lib_save_LIBS=$LIBS
15195 LIBS="-lx  $LIBS"
15196 cat >conftest.$ac_ext <<_ACEOF
15197 #line 15197 "configure"
15198 #include "confdefs.h"
15199
15200 /* Override any gcc2 internal prototype to avoid an error.  */
15201 #ifdef __cplusplus
15202 extern "C"
15203 #endif
15204 /* We use char because int might match the return type of a gcc2
15205    builtin and then its argument prototype would still apply.  */
15206 char opendir ();
15207 int
15208 main (void)
15209 {
15210 opendir ();
15211   ;
15212   return 0;
15213 }
15214 _ACEOF
15215 rm -f conftest.$ac_objext conftest$ac_exeext
15216 if { (eval echo "$as_me:15216: \"$ac_link\"") >&5
15217   (eval $ac_link) 2>&5
15218   ac_status=$?
15219   echo "$as_me:15219: \$? = $ac_status" >&5
15220   (exit $ac_status); } &&
15221          { ac_try='test -s conftest$ac_exeext'
15222   { (eval echo "$as_me:15222: \"$ac_try\"") >&5
15223   (eval $ac_try) 2>&5
15224   ac_status=$?
15225   echo "$as_me:15225: \$? = $ac_status" >&5
15226   (exit $ac_status); }; }; then
15227   ac_cv_lib_x_opendir=yes
15228 else
15229   echo "$as_me: failed program was:" >&5
15230 cat conftest.$ac_ext >&5
15231 ac_cv_lib_x_opendir=no
15232 fi
15233 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15234 LIBS=$ac_check_lib_save_LIBS
15235 fi
15236 echo "$as_me:15236: result: $ac_cv_lib_x_opendir" >&5
15237 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15238 if test $ac_cv_lib_x_opendir = yes; then
15239   LIBS="$LIBS -lx"
15240 fi
15241
15242 fi
15243
15244 echo "$as_me:15244: checking whether time.h and sys/time.h may both be included" >&5
15245 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15246 if test "${ac_cv_header_time+set}" = set; then
15247   echo $ECHO_N "(cached) $ECHO_C" >&6
15248 else
15249   cat >conftest.$ac_ext <<_ACEOF
15250 #line 15250 "configure"
15251 #include "confdefs.h"
15252 #include <sys/types.h>
15253 #include <sys/time.h>
15254 #include <time.h>
15255
15256 int
15257 main (void)
15258 {
15259 if ((struct tm *) 0)
15260 return 0;
15261   ;
15262   return 0;
15263 }
15264 _ACEOF
15265 rm -f conftest.$ac_objext
15266 if { (eval echo "$as_me:15266: \"$ac_compile\"") >&5
15267   (eval $ac_compile) 2>&5
15268   ac_status=$?
15269   echo "$as_me:15269: \$? = $ac_status" >&5
15270   (exit $ac_status); } &&
15271          { ac_try='test -s conftest.$ac_objext'
15272   { (eval echo "$as_me:15272: \"$ac_try\"") >&5
15273   (eval $ac_try) 2>&5
15274   ac_status=$?
15275   echo "$as_me:15275: \$? = $ac_status" >&5
15276   (exit $ac_status); }; }; then
15277   ac_cv_header_time=yes
15278 else
15279   echo "$as_me: failed program was:" >&5
15280 cat conftest.$ac_ext >&5
15281 ac_cv_header_time=no
15282 fi
15283 rm -f conftest.$ac_objext conftest.$ac_ext
15284 fi
15285 echo "$as_me:15285: result: $ac_cv_header_time" >&5
15286 echo "${ECHO_T}$ac_cv_header_time" >&6
15287 if test $ac_cv_header_time = yes; then
15288
15289 cat >>confdefs.h <<\EOF
15290 #define TIME_WITH_SYS_TIME 1
15291 EOF
15292
15293 fi
15294
15295 ###     checks for compiler characteristics
15296 ac_ext=c
15297 ac_cpp='$CPP $CPPFLAGS'
15298 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15299 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15300 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15301 ac_main_return=return
15302
15303 echo "$as_me:15303: checking for an ANSI C-conforming const" >&5
15304 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15305 if test "${ac_cv_c_const+set}" = set; then
15306   echo $ECHO_N "(cached) $ECHO_C" >&6
15307 else
15308   cat >conftest.$ac_ext <<_ACEOF
15309 #line 15309 "configure"
15310 #include "confdefs.h"
15311
15312 int
15313 main (void)
15314 {
15315 /* FIXME: Include the comments suggested by Paul. */
15316 #ifndef __cplusplus
15317   /* Ultrix mips cc rejects this.  */
15318   typedef int charset[2];
15319   const charset x;
15320   /* SunOS 4.1.1 cc rejects this.  */
15321   char const *const *ccp;
15322   char **p;
15323   /* NEC SVR4.0.2 mips cc rejects this.  */
15324   struct point {int x, y;};
15325   static struct point const zero = {0,0};
15326   /* AIX XL C 1.02.0.0 rejects this.
15327      It does not let you subtract one const X* pointer from another in
15328      an arm of an if-expression whose if-part is not a constant
15329      expression */
15330   const char *g = "string";
15331   ccp = &g + (g ? g-g : 0);
15332   /* HPUX 7.0 cc rejects these. */
15333   ++ccp;
15334   p = (char**) ccp;
15335   ccp = (char const *const *) p;
15336   { /* SCO 3.2v4 cc rejects this.  */
15337     char *t;
15338     char const *s = 0 ? (char *) 0 : (char const *) 0;
15339
15340     *t++ = 0;
15341   }
15342   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15343     int x[] = {25, 17};
15344     const int *foo = &x[0];
15345     ++foo;
15346   }
15347   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15348     typedef const int *iptr;
15349     iptr p = 0;
15350     ++p;
15351   }
15352   { /* AIX XL C 1.02.0.0 rejects this saying
15353        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15354     struct s { int j; const int *ap[3]; };
15355     struct s *b; b->j = 5;
15356   }
15357   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15358     const int foo = 10;
15359   }
15360 #endif
15361
15362   ;
15363   return 0;
15364 }
15365 _ACEOF
15366 rm -f conftest.$ac_objext
15367 if { (eval echo "$as_me:15367: \"$ac_compile\"") >&5
15368   (eval $ac_compile) 2>&5
15369   ac_status=$?
15370   echo "$as_me:15370: \$? = $ac_status" >&5
15371   (exit $ac_status); } &&
15372          { ac_try='test -s conftest.$ac_objext'
15373   { (eval echo "$as_me:15373: \"$ac_try\"") >&5
15374   (eval $ac_try) 2>&5
15375   ac_status=$?
15376   echo "$as_me:15376: \$? = $ac_status" >&5
15377   (exit $ac_status); }; }; then
15378   ac_cv_c_const=yes
15379 else
15380   echo "$as_me: failed program was:" >&5
15381 cat conftest.$ac_ext >&5
15382 ac_cv_c_const=no
15383 fi
15384 rm -f conftest.$ac_objext conftest.$ac_ext
15385 fi
15386 echo "$as_me:15386: result: $ac_cv_c_const" >&5
15387 echo "${ECHO_T}$ac_cv_c_const" >&6
15388 if test $ac_cv_c_const = no; then
15389
15390 cat >>confdefs.h <<\EOF
15391 #define const
15392 EOF
15393
15394 fi
15395
15396 ###     Checks for external-data
15397
15398 echo "$as_me:15398: checking if data-only library module links" >&5
15399 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15400 if test "${cf_cv_link_dataonly+set}" = set; then
15401   echo $ECHO_N "(cached) $ECHO_C" >&6
15402 else
15403
15404         rm -f conftest.a
15405         cat >conftest.$ac_ext <<EOF
15406 #line 15406 "configure"
15407 int     testdata[3] = { 123, 456, 789 };
15408 EOF
15409         if { (eval echo "$as_me:15409: \"$ac_compile\"") >&5
15410   (eval $ac_compile) 2>&5
15411   ac_status=$?
15412   echo "$as_me:15412: \$? = $ac_status" >&5
15413   (exit $ac_status); } ; then
15414                 mv conftest.o data.o && \
15415                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15416         fi
15417         rm -f conftest.$ac_ext data.o
15418         cat >conftest.$ac_ext <<EOF
15419 #line 15419 "configure"
15420 int     testfunc(void)
15421 {
15422 #if defined(NeXT)
15423         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15424 #else
15425         extern int testdata[3];
15426         return testdata[0] == 123
15427            &&  testdata[1] == 456
15428            &&  testdata[2] == 789;
15429 #endif
15430 }
15431 EOF
15432         if { (eval echo "$as_me:15432: \"$ac_compile\"") >&5
15433   (eval $ac_compile) 2>&5
15434   ac_status=$?
15435   echo "$as_me:15435: \$? = $ac_status" >&5
15436   (exit $ac_status); }; then
15437                 mv conftest.o func.o && \
15438                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15439         fi
15440         rm -f conftest.$ac_ext func.o
15441         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15442         cf_saveLIBS="$LIBS"
15443         LIBS="conftest.a $LIBS"
15444         if test "$cross_compiling" = yes; then
15445   cf_cv_link_dataonly=unknown
15446 else
15447   cat >conftest.$ac_ext <<_ACEOF
15448 #line 15448 "configure"
15449 #include "confdefs.h"
15450
15451         int main(void)
15452         {
15453                 extern int testfunc();
15454                 ${cf_cv_main_return:-return} (!testfunc());
15455         }
15456
15457 _ACEOF
15458 rm -f conftest$ac_exeext
15459 if { (eval echo "$as_me:15459: \"$ac_link\"") >&5
15460   (eval $ac_link) 2>&5
15461   ac_status=$?
15462   echo "$as_me:15462: \$? = $ac_status" >&5
15463   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15464   { (eval echo "$as_me:15464: \"$ac_try\"") >&5
15465   (eval $ac_try) 2>&5
15466   ac_status=$?
15467   echo "$as_me:15467: \$? = $ac_status" >&5
15468   (exit $ac_status); }; }; then
15469   cf_cv_link_dataonly=yes
15470 else
15471   echo "$as_me: program exited with status $ac_status" >&5
15472 echo "$as_me: failed program was:" >&5
15473 cat conftest.$ac_ext >&5
15474 cf_cv_link_dataonly=no
15475 fi
15476 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15477 fi
15478         LIBS="$cf_saveLIBS"
15479
15480 fi
15481
15482 echo "$as_me:15482: result: $cf_cv_link_dataonly" >&5
15483 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15484
15485 if test "$cf_cv_link_dataonly" = no ; then
15486
15487 cat >>confdefs.h <<\EOF
15488 #define BROKEN_LINKER 1
15489 EOF
15490
15491         BROKEN_LINKER=1
15492 fi
15493
15494 ###     Checks for library functions.
15495
15496 for ac_header in \
15497 unistd.h \
15498
15499 do
15500 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15501 echo "$as_me:15501: checking for $ac_header" >&5
15502 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15503 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15504   echo $ECHO_N "(cached) $ECHO_C" >&6
15505 else
15506   cat >conftest.$ac_ext <<_ACEOF
15507 #line 15507 "configure"
15508 #include "confdefs.h"
15509 #include <$ac_header>
15510 _ACEOF
15511 if { (eval echo "$as_me:15511: \"$ac_cpp conftest.$ac_ext\"") >&5
15512   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15513   ac_status=$?
15514   egrep -v '^ *\+' conftest.er1 >conftest.err
15515   rm -f conftest.er1
15516   cat conftest.err >&5
15517   echo "$as_me:15517: \$? = $ac_status" >&5
15518   (exit $ac_status); } >/dev/null; then
15519   if test -s conftest.err; then
15520     ac_cpp_err=$ac_c_preproc_warn_flag
15521   else
15522     ac_cpp_err=
15523   fi
15524 else
15525   ac_cpp_err=yes
15526 fi
15527 if test -z "$ac_cpp_err"; then
15528   eval "$as_ac_Header=yes"
15529 else
15530   echo "$as_me: failed program was:" >&5
15531   cat conftest.$ac_ext >&5
15532   eval "$as_ac_Header=no"
15533 fi
15534 rm -f conftest.err conftest.$ac_ext
15535 fi
15536 echo "$as_me:15536: result: `eval echo '${'$as_ac_Header'}'`" >&5
15537 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15538 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15539   cat >>confdefs.h <<EOF
15540 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15541 EOF
15542
15543 fi
15544 done
15545
15546 echo "$as_me:15546: checking for working mkstemp" >&5
15547 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15548 if test "${cf_cv_func_mkstemp+set}" = set; then
15549   echo $ECHO_N "(cached) $ECHO_C" >&6
15550 else
15551
15552 rm -rf conftest*
15553 if test "$cross_compiling" = yes; then
15554   cf_cv_func_mkstemp=maybe
15555 else
15556   cat >conftest.$ac_ext <<_ACEOF
15557 #line 15557 "configure"
15558 #include "confdefs.h"
15559
15560 #include <sys/types.h>
15561 #ifdef HAVE_UNISTD_H
15562 #include <unistd.h>
15563 #endif
15564 #include <stdlib.h>
15565 #include <stdio.h>
15566 #include <string.h>
15567 #include <sys/stat.h>
15568 int main(void)
15569 {
15570         char *tmpl = "conftestXXXXXX";
15571         char name[2][80];
15572         int n;
15573         int result = 0;
15574         int fd;
15575         struct stat sb;
15576
15577         umask(077);
15578         for (n = 0; n < 2; ++n) {
15579                 strcpy(name[n], tmpl);
15580                 if ((fd = mkstemp(name[n])) >= 0) {
15581                         if (!strcmp(name[n], tmpl)
15582                          || stat(name[n], &sb) != 0
15583                          || (sb.st_mode & S_IFMT) != S_IFREG
15584                          || (sb.st_mode & 077) != 0) {
15585                                 result = 1;
15586                         }
15587                         close(fd);
15588                 }
15589         }
15590         if (result == 0
15591          && !strcmp(name[0], name[1]))
15592                 result = 1;
15593         ${cf_cv_main_return:-return}(result);
15594 }
15595
15596 _ACEOF
15597 rm -f conftest$ac_exeext
15598 if { (eval echo "$as_me:15598: \"$ac_link\"") >&5
15599   (eval $ac_link) 2>&5
15600   ac_status=$?
15601   echo "$as_me:15601: \$? = $ac_status" >&5
15602   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15603   { (eval echo "$as_me:15603: \"$ac_try\"") >&5
15604   (eval $ac_try) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); }; }; then
15608   cf_cv_func_mkstemp=yes
15609
15610 else
15611   echo "$as_me: program exited with status $ac_status" >&5
15612 echo "$as_me: failed program was:" >&5
15613 cat conftest.$ac_ext >&5
15614 cf_cv_func_mkstemp=no
15615
15616 fi
15617 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15618 fi
15619
15620 fi
15621 echo "$as_me:15621: result: $cf_cv_func_mkstemp" >&5
15622 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15623 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15624         echo "$as_me:15624: checking for mkstemp" >&5
15625 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15626 if test "${ac_cv_func_mkstemp+set}" = set; then
15627   echo $ECHO_N "(cached) $ECHO_C" >&6
15628 else
15629   cat >conftest.$ac_ext <<_ACEOF
15630 #line 15630 "configure"
15631 #include "confdefs.h"
15632 #define mkstemp autoconf_temporary
15633 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15634 #undef mkstemp
15635
15636 #ifdef __cplusplus
15637 extern "C"
15638 #endif
15639
15640 /* We use char because int might match the return type of a gcc2
15641    builtin and then its argument prototype would still apply.  */
15642 char mkstemp (void);
15643
15644 int
15645 main (void)
15646 {
15647
15648 /* The GNU C library defines stubs for functions which it implements
15649     to always fail with ENOSYS.  Some functions are actually named
15650     something starting with __ and the normal name is an alias.  */
15651 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15652 #error found stub for mkstemp
15653 #endif
15654
15655         return mkstemp ();
15656   ;
15657   return 0;
15658 }
15659 _ACEOF
15660 rm -f conftest.$ac_objext conftest$ac_exeext
15661 if { (eval echo "$as_me:15661: \"$ac_link\"") >&5
15662   (eval $ac_link) 2>&5
15663   ac_status=$?
15664   echo "$as_me:15664: \$? = $ac_status" >&5
15665   (exit $ac_status); } &&
15666          { ac_try='test -s conftest$ac_exeext'
15667   { (eval echo "$as_me:15667: \"$ac_try\"") >&5
15668   (eval $ac_try) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); }; }; then
15672   ac_cv_func_mkstemp=yes
15673 else
15674   echo "$as_me: failed program was:" >&5
15675 cat conftest.$ac_ext >&5
15676 ac_cv_func_mkstemp=no
15677 fi
15678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15679 fi
15680 echo "$as_me:15680: result: $ac_cv_func_mkstemp" >&5
15681 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15682
15683 fi
15684 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15685
15686 cat >>confdefs.h <<\EOF
15687 #define HAVE_MKSTEMP 1
15688 EOF
15689
15690 fi
15691
15692 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15693         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15694         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15695 fi
15696
15697 cf_with_ada=yes
15698 if test "$cf_with_ada" != "no" ; then
15699
15700 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
15701 do
15702
15703 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15704
15705         unset ac_cv_path_cf_TEMP_gnat
15706         unset cf_TEMP_gnat
15707         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
15708 set dummy $cf_prog_gnat; ac_word=$2
15709 echo "$as_me:15709: checking for $ac_word" >&5
15710 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15711 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
15712   echo $ECHO_N "(cached) $ECHO_C" >&6
15713 else
15714   case $cf_TEMP_gnat in
15715   [\\/]* | ?:[\\/]*)
15716   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
15717   ;;
15718   *)
15719   ac_save_IFS=$IFS; IFS=$ac_path_separator
15720 ac_dummy="$PATH"
15721 for ac_dir in $ac_dummy; do
15722   IFS=$ac_save_IFS
15723   test -z "$ac_dir" && ac_dir=.
15724   if $as_executable_p "$ac_dir/$ac_word"; then
15725    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
15726    echo "$as_me:15726: found $ac_dir/$ac_word" >&5
15727    break
15728 fi
15729 done
15730
15731   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
15732   ;;
15733 esac
15734 fi
15735 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
15736
15737 if test -n "$cf_TEMP_gnat"; then
15738   echo "$as_me:15738: result: $cf_TEMP_gnat" >&5
15739 echo "${ECHO_T}$cf_TEMP_gnat" >&6
15740 else
15741   echo "$as_me:15741: result: no" >&5
15742 echo "${ECHO_T}no" >&6
15743 fi
15744
15745         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
15746
15747         if test "x$cf_TEMP_gnat" != xno; then
15748                 unset cf_cv_gnat_version
15749                 unset cf_TEMP_gnat
15750
15751 echo "$as_me:15751: checking for $cf_prog_gnat version" >&5
15752 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
15753 if test "${cf_cv_gnat_version+set}" = set; then
15754   echo $ECHO_N "(cached) $ECHO_C" >&6
15755 else
15756
15757 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
15758         grep '[0-9].[0-9][0-9]*' |\
15759         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15760
15761 fi
15762 echo "$as_me:15762: result: $cf_cv_gnat_version" >&5
15763 echo "${ECHO_T}$cf_cv_gnat_version" >&6
15764 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
15765 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
15766
15767         fi
15768         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
15769
15770         unset cf_TEMP_gnat
15771         unset cf_cv_gnat_version
15772         unset ac_cv_path_cf_TEMP_gnat
15773 done
15774
15775 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
15776         cf_ada_make=
15777         cf_cv_prog_gnat_correct=no
15778 else
15779         cf_ada_make=gnatmake
15780         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
15781                 # gprconfig is newer than gnatmake; we can continue...
15782                 cf_ada_config="##"
15783         else
15784                 rm -rf conftest* *~conftest*
15785                 if mkdir conftest.src
15786                 then
15787                         cf_ada_config=""
15788                         cd conftest.src
15789                         for cf_gprconfig in Ada C
15790                         do
15791                                 echo "$as_me:15791: checking for gprconfig name for $cf_gprconfig" >&5
15792 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15793                                 if test $cf_gprconfig = C
15794                                 then
15795                                         for cf_gprconfig_param in \
15796                                                 $cf_gprconfig,,,,GNATGCC \
15797                                                 $cf_gprconfig,,,,GCC \
15798                                                 $cf_gprconfig
15799                                         do
15800                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15801                                                 test -n "$cf_gprconfig_value" && break
15802                                         done
15803                                 else
15804                                         cf_gprconfig_param=$cf_gprconfig
15805                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15806                                 fi
15807                                 if test -n "$cf_gprconfig_value"
15808                                 then
15809                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15810                                         echo "$as_me:15810: result: $cf_gprconfig_value" >&5
15811 echo "${ECHO_T}$cf_gprconfig_value" >&6
15812                                 else
15813                                         echo "$as_me:15813: result: missing" >&5
15814 echo "${ECHO_T}missing" >&6
15815                                         cf_ada_config="#"
15816                                         break
15817                                 fi
15818                         done
15819                         cd ..
15820                         rm -rf conftest* *~conftest*
15821                 fi
15822         fi
15823         if test "x$cf_ada_config" != "x#"
15824         then
15825
15826 echo "$as_me:15826: checking for gnat version" >&5
15827 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15828 if test "${cf_cv_gnat_version+set}" = set; then
15829   echo $ECHO_N "(cached) $ECHO_C" >&6
15830 else
15831
15832 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
15833         grep '[0-9].[0-9][0-9]*' |\
15834         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15835
15836 fi
15837 echo "$as_me:15837: result: $cf_cv_gnat_version" >&5
15838 echo "${ECHO_T}$cf_cv_gnat_version" >&6
15839 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
15840
15841 case $cf_cv_gnat_version in
15842 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15843         cf_cv_prog_gnat_correct=yes
15844         ;;
15845 (*)
15846         { echo "$as_me:15846: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15847 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15848         cf_cv_prog_gnat_correct=no
15849         ;;
15850 esac
15851
15852                 # Extract the first word of "m4", so it can be a program name with args.
15853 set dummy m4; ac_word=$2
15854 echo "$as_me:15854: checking for $ac_word" >&5
15855 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15856 if test "${ac_cv_prog_M4_exists+set}" = set; then
15857   echo $ECHO_N "(cached) $ECHO_C" >&6
15858 else
15859   if test -n "$M4_exists"; then
15860   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15861 else
15862   ac_save_IFS=$IFS; IFS=$ac_path_separator
15863 ac_dummy="$PATH"
15864 for ac_dir in $ac_dummy; do
15865   IFS=$ac_save_IFS
15866   test -z "$ac_dir" && ac_dir=.
15867   $as_executable_p "$ac_dir/$ac_word" || continue
15868 ac_cv_prog_M4_exists="yes"
15869 echo "$as_me:15869: found $ac_dir/$ac_word" >&5
15870 break
15871 done
15872
15873   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15874 fi
15875 fi
15876 M4_exists=$ac_cv_prog_M4_exists
15877 if test -n "$M4_exists"; then
15878   echo "$as_me:15878: result: $M4_exists" >&5
15879 echo "${ECHO_T}$M4_exists" >&6
15880 else
15881   echo "$as_me:15881: result: no" >&5
15882 echo "${ECHO_T}no" >&6
15883 fi
15884
15885                 if test "$ac_cv_prog_M4_exists" = no; then
15886                         cf_cv_prog_gnat_correct=no
15887                         { echo "$as_me:15887: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
15888 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
15889                 fi
15890                 if test "$cf_cv_prog_gnat_correct" = yes; then
15891                         echo "$as_me:15891: checking if GNAT works" >&5
15892 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15893
15894 rm -rf conftest* *~conftest*
15895 cat >>conftest.ads <<CF_EOF
15896 procedure conftest;
15897 CF_EOF
15898 cat >>conftest.adb <<CF_EOF
15899 with Text_IO;
15900 with GNAT.OS_Lib;
15901 procedure conftest is
15902 begin
15903    Text_IO.Put ("Hello World");
15904    Text_IO.New_Line;
15905    GNAT.OS_Lib.OS_Exit (0);
15906 end conftest;
15907 CF_EOF
15908 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15909    if ( ./conftest 1>&5 2>&1 ) ; then
15910       cf_cv_prog_gnat_correct=yes
15911    else
15912       cf_cv_prog_gnat_correct=no
15913    fi
15914 else
15915    cf_cv_prog_gnat_correct=no
15916 fi
15917 rm -rf conftest* *~conftest*
15918
15919                         echo "$as_me:15919: result: $cf_cv_prog_gnat_correct" >&5
15920 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15921                 fi
15922         else
15923                 cf_cv_prog_gnat_correct=no
15924         fi
15925 fi
15926
15927         if test "$cf_cv_prog_gnat_correct" = yes; then
15928
15929         echo "$as_me:15929: checking optimization options for ADAFLAGS" >&5
15930 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15931         case "$CFLAGS" in
15932         (*-g*)
15933
15934         ADAFLAGS="$ADAFLAGS -g"
15935
15936                 ;;
15937         esac
15938         case "$CFLAGS" in
15939         (*-O*)
15940                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15941
15942         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15943
15944                 ;;
15945         esac
15946         echo "$as_me:15946: result: $ADAFLAGS" >&5
15947 echo "${ECHO_T}$ADAFLAGS" >&6
15948
15949 echo "$as_me:15949: checking if GNATPREP supports -T option" >&5
15950 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15951 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15952   echo $ECHO_N "(cached) $ECHO_C" >&6
15953 else
15954
15955 cf_cv_gnatprep_opt_t=no
15956 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15957
15958 fi
15959 echo "$as_me:15959: result: $cf_cv_gnatprep_opt_t" >&5
15960 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15961 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15962
15963 echo "$as_me:15963: checking if GNAT supports generics" >&5
15964 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15965 case $cf_cv_gnat_version in
15966 (3.[1-9]*|[4-9].*)
15967         cf_gnat_generics=yes
15968         ;;
15969 (*)
15970         cf_gnat_generics=no
15971         ;;
15972 esac
15973 echo "$as_me:15973: result: $cf_gnat_generics" >&5
15974 echo "${ECHO_T}$cf_gnat_generics" >&6
15975
15976 if test "$cf_gnat_generics" = yes
15977 then
15978         cf_compile_generics=generics
15979         cf_generic_objects="\${GENOBJS}"
15980 else
15981         cf_compile_generics=
15982         cf_generic_objects=
15983 fi
15984
15985 echo "$as_me:15985: checking if GNAT supports SIGINT" >&5
15986 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15987 if test "${cf_cv_gnat_sigint+set}" = set; then
15988   echo $ECHO_N "(cached) $ECHO_C" >&6
15989 else
15990
15991 rm -rf conftest* *~conftest*
15992 cat >>conftest.ads <<CF_EOF
15993 with Ada.Interrupts.Names;
15994
15995 package ConfTest is
15996
15997    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15998    pragma Unreserve_All_Interrupts;
15999    pragma Warnings (On);
16000
16001    protected Process is
16002       procedure Stop;
16003       function Continue return Boolean;
16004       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16005    private
16006       Done : Boolean := False;
16007    end Process;
16008
16009 end ConfTest;
16010 CF_EOF
16011 cat >>conftest.adb <<CF_EOF
16012 package body ConfTest is
16013    protected body Process is
16014       procedure Stop is
16015       begin
16016          Done := True;
16017       end Stop;
16018       function Continue return Boolean is
16019       begin
16020          return not Done;
16021       end Continue;
16022    end Process;
16023 end ConfTest;
16024 CF_EOF
16025 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16026       cf_cv_gnat_sigint=yes
16027 else
16028    cf_cv_gnat_sigint=no
16029 fi
16030 rm -rf conftest* *~conftest*
16031
16032 fi
16033 echo "$as_me:16033: result: $cf_cv_gnat_sigint" >&5
16034 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16035
16036 if test $cf_cv_gnat_sigint = yes ; then
16037         USE_GNAT_SIGINT=""
16038 else
16039         USE_GNAT_SIGINT="#"
16040 fi
16041
16042 cf_gnat_libraries=no
16043 cf_gnat_projects=no
16044
16045 if test "$enable_gnat_projects" != no ; then
16046 echo "$as_me:16046: checking if GNAT supports project files" >&5
16047 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16048 case $cf_cv_gnat_version in
16049 (3.[0-9]*)
16050         ;;
16051 (*)
16052         case $cf_cv_system_name in
16053         (cygwin*|msys*)
16054                 ;;
16055         (*)
16056                 rm -rf conftest* *~conftest*
16057                 if mkdir conftest.src conftest.bin conftest.lib
16058                 then
16059                         cd conftest.src
16060                         rm -rf conftest* *~conftest*
16061                         cat >>library.gpr <<CF_EOF
16062 project Library is
16063   Kind := External ("LIB_KIND");
16064   for Library_Name use "ConfTest";
16065   for Object_Dir use ".";
16066   for Library_ALI_Dir use External("LIBRARY_DIR");
16067   for Library_Version use External ("SONAME");
16068   for Library_Kind use Kind;
16069   for Library_Dir use External("BUILD_DIR");
16070   Source_Dir := External ("SOURCE_DIR");
16071   for Source_Dirs use (Source_Dir);
16072 end Library;
16073 CF_EOF
16074                         cat >>confpackage.ads <<CF_EOF
16075 package ConfPackage is
16076    procedure conftest;
16077 end ConfPackage;
16078 CF_EOF
16079                         cat >>confpackage.adb <<CF_EOF
16080 with Text_IO;
16081 package body ConfPackage is
16082    procedure conftest is
16083    begin
16084       Text_IO.Put ("Hello World");
16085       Text_IO.New_Line;
16086    end conftest;
16087 end ConfPackage;
16088 CF_EOF
16089                         if ( $cf_ada_make $ADAFLAGS \
16090                                         -Plibrary.gpr \
16091                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
16092                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
16093                                         -XSOURCE_DIR=`pwd` \
16094                                         -XSONAME=libConfTest.so.1 \
16095                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
16096                                 cf_gnat_projects=yes
16097                         fi
16098                         cd ..
16099                 fi
16100                 if test -f conftest.lib/confpackage.ali
16101                 then
16102                         cf_gnat_libraries=yes
16103                 fi
16104                 rm -rf conftest* *~conftest*
16105                 ;;
16106         esac
16107         ;;
16108 esac
16109 echo "$as_me:16109: result: $cf_gnat_projects" >&5
16110 echo "${ECHO_T}$cf_gnat_projects" >&6
16111 fi # enable_gnat_projects
16112
16113 if test $cf_gnat_projects = yes
16114 then
16115         echo "$as_me:16115: checking if GNAT supports libraries" >&5
16116 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
16117         echo "$as_me:16117: result: $cf_gnat_libraries" >&5
16118 echo "${ECHO_T}$cf_gnat_libraries" >&6
16119 fi
16120
16121 if test "$cf_gnat_projects" = yes
16122 then
16123         USE_OLD_MAKERULES="#"
16124         USE_GNAT_PROJECTS=""
16125 else
16126         USE_OLD_MAKERULES=""
16127         USE_GNAT_PROJECTS="#"
16128 fi
16129
16130 if test "$cf_gnat_libraries" = yes
16131 then
16132         USE_GNAT_LIBRARIES=""
16133 else
16134         USE_GNAT_LIBRARIES="#"
16135 fi
16136
16137 echo "$as_me:16137: checking for ada-compiler" >&5
16138 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
16139
16140 # Check whether --with-ada-compiler or --without-ada-compiler was given.
16141 if test "${with_ada_compiler+set}" = set; then
16142   withval="$with_ada_compiler"
16143   cf_ada_compiler=$withval
16144 else
16145   cf_ada_compiler=gnatmake
16146 fi;
16147
16148 echo "$as_me:16148: result: $cf_ada_compiler" >&5
16149 echo "${ECHO_T}$cf_ada_compiler" >&6
16150
16151                 cf_ada_package=terminal_interface
16152
16153 echo "$as_me:16153: checking for ada-include" >&5
16154 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
16155
16156 # Check whether --with-ada-include or --without-ada-include was given.
16157 if test "${with_ada_include+set}" = set; then
16158   withval="$with_ada_include"
16159
16160 else
16161   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
16162 fi; if test -n "$prefix/share/ada/adainclude" ; then
16163
16164 if test "x$prefix" != xNONE; then
16165         cf_path_syntax="$prefix"
16166 else
16167         cf_path_syntax="$ac_default_prefix"
16168 fi
16169
16170 case ".$withval" in
16171 (.\$\(*\)*|.\'*\'*)
16172         ;;
16173 (..|./*|.\\*)
16174         ;;
16175 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16176         ;;
16177 (.\${*prefix}*|.\${*dir}*)
16178         eval withval="$withval"
16179         case ".$withval" in
16180         (.NONE/*)
16181                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16182                 ;;
16183         esac
16184         ;;
16185 (.no|.NONE/*)
16186         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16187         ;;
16188 (*)
16189         { { echo "$as_me:16189: error: expected a pathname, not \"$withval\"" >&5
16190 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16191    { (exit 1); exit 1; }; }
16192         ;;
16193 esac
16194
16195 fi
16196 eval ADA_INCLUDE="$withval"
16197
16198 echo "$as_me:16198: result: $ADA_INCLUDE" >&5
16199 echo "${ECHO_T}$ADA_INCLUDE" >&6
16200
16201 echo "$as_me:16201: checking for ada-objects" >&5
16202 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
16203
16204 # Check whether --with-ada-objects or --without-ada-objects was given.
16205 if test "${with_ada_objects+set}" = set; then
16206   withval="$with_ada_objects"
16207
16208 else
16209   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16210 fi; if test -n "$prefix/lib/ada/adalib" ; then
16211
16212 if test "x$prefix" != xNONE; then
16213         cf_path_syntax="$prefix"
16214 else
16215         cf_path_syntax="$ac_default_prefix"
16216 fi
16217
16218 case ".$withval" in
16219 (.\$\(*\)*|.\'*\'*)
16220         ;;
16221 (..|./*|.\\*)
16222         ;;
16223 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16224         ;;
16225 (.\${*prefix}*|.\${*dir}*)
16226         eval withval="$withval"
16227         case ".$withval" in
16228         (.NONE/*)
16229                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16230                 ;;
16231         esac
16232         ;;
16233 (.no|.NONE/*)
16234         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16235         ;;
16236 (*)
16237         { { echo "$as_me:16237: error: expected a pathname, not \"$withval\"" >&5
16238 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16239    { (exit 1); exit 1; }; }
16240         ;;
16241 esac
16242
16243 fi
16244 eval ADA_OBJECTS="$withval"
16245
16246 echo "$as_me:16246: result: $ADA_OBJECTS" >&5
16247 echo "${ECHO_T}$ADA_OBJECTS" >&6
16248
16249 echo "$as_me:16249: checking if an Ada95 shared-library should be built" >&5
16250 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16251
16252 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16253 if test "${with_ada_sharedlib+set}" = set; then
16254   withval="$with_ada_sharedlib"
16255   with_ada_sharedlib=$withval
16256 else
16257   with_ada_sharedlib=no
16258 fi;
16259 echo "$as_me:16259: result: $with_ada_sharedlib" >&5
16260 echo "${ECHO_T}$with_ada_sharedlib" >&6
16261
16262 if test "x$with_ada_sharedlib" != xno
16263 then
16264         if test "x$cf_gnat_projects" != xyes
16265         then
16266                 { echo "$as_me:16266: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16267 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16268                 with_ada_sharedlib=no
16269         fi
16270 fi
16271
16272 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16273 MAKE_ADA_SHAREDLIB="#"
16274
16275 if test "x$with_ada_sharedlib" != xno
16276 then
16277         MAKE_ADA_SHAREDLIB=
16278         if test "x$with_ada_sharedlib" != xyes
16279         then
16280                 ADA_SHAREDLIB="$with_ada_sharedlib"
16281         fi
16282 fi
16283
16284                 # allow the Ada binding to be renamed
16285
16286 echo "$as_me:16286: checking for ada-libname" >&5
16287 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
16288
16289 # Check whether --with-ada-libname or --without-ada-libname was given.
16290 if test "${with_ada_libname+set}" = set; then
16291   withval="$with_ada_libname"
16292   ADA_LIBNAME=$withval
16293 else
16294   ADA_LIBNAME=AdaCurses
16295 fi;
16296 case "x$ADA_LIBNAME" in
16297 (x|xyes|xno)
16298         ADA_LIBNAME=AdaCurses
16299         ;;
16300 esac
16301
16302 echo "$as_me:16302: result: $ADA_LIBNAME" >&5
16303 echo "${ECHO_T}$ADA_LIBNAME" >&6
16304
16305         else
16306                 { { echo "$as_me:16306: error: No usable Ada compiler found" >&5
16307 echo "$as_me: error: No usable Ada compiler found" >&2;}
16308    { (exit 1); exit 1; }; }
16309         fi
16310 else
16311         { { echo "$as_me:16311: error: The Ada compiler is needed for this package" >&5
16312 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16313    { (exit 1); exit 1; }; }
16314 fi
16315
16316 ################################################################################
16317
16318 # not needed
16319 TINFO_LDFLAGS2=
16320
16321 TINFO_LIBS=
16322
16323 ### Construct the list of include-directories to be generated
16324
16325 if test "$srcdir" != "."; then
16326         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16327 fi
16328 CPPFLAGS="-I../include $CPPFLAGS"
16329 if test "$srcdir" != "."; then
16330         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16331 fi
16332 CPPFLAGS="-I. $CPPFLAGS"
16333
16334 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16335 if test "$srcdir" != "."; then
16336         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16337 fi
16338 if test "$GCC" != yes; then
16339         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16340 elif test "$includedir" != "/usr/include"; then
16341         if test "$includedir" = '${prefix}/include' ; then
16342                 if test x$prefix != x/usr ; then
16343                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16344                 fi
16345         else
16346                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16347         fi
16348 fi
16349
16350 ### Build up pieces for makefile rules
16351 echo "$as_me:16351: checking default library suffix" >&5
16352 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16353
16354         case $DFT_LWR_MODEL in
16355         (libtool) DFT_ARG_SUFFIX=''   ;;
16356         (normal)  DFT_ARG_SUFFIX=''   ;;
16357         (debug)   DFT_ARG_SUFFIX='_g' ;;
16358         (profile) DFT_ARG_SUFFIX='_p' ;;
16359         (shared)  DFT_ARG_SUFFIX=''   ;;
16360         esac
16361         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16362 echo "$as_me:16362: result: $DFT_ARG_SUFFIX" >&5
16363 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16364
16365 echo "$as_me:16365: checking default library-dependency suffix" >&5
16366 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16367
16368         case X$DFT_LWR_MODEL in
16369         (Xlibtool)
16370                 DFT_LIB_SUFFIX='.la'
16371                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16372                 ;;
16373         (Xdebug)
16374                 DFT_LIB_SUFFIX='_g.a'
16375                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16376                 ;;
16377         (Xprofile)
16378                 DFT_LIB_SUFFIX='_p.a'
16379                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16380                 ;;
16381         (Xshared)
16382                 case $cf_cv_system_name in
16383                 (aix[5-7]*)
16384                         DFT_LIB_SUFFIX='.so'
16385                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16386                         ;;
16387                 (cygwin*|msys*|mingw*)
16388                         DFT_LIB_SUFFIX='.dll'
16389                         DFT_DEP_SUFFIX='.dll.a'
16390                         ;;
16391                 (darwin*)
16392                         DFT_LIB_SUFFIX='.dylib'
16393                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16394                         ;;
16395                 (hpux*)
16396                         case $target in
16397                         (ia64*)
16398                                 DFT_LIB_SUFFIX='.so'
16399                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16400                                 ;;
16401                         (*)
16402                                 DFT_LIB_SUFFIX='.sl'
16403                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16404                                 ;;
16405                         esac
16406                         ;;
16407                 (*)
16408                         DFT_LIB_SUFFIX='.so'
16409                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16410                         ;;
16411                 esac
16412                 ;;
16413         (*)
16414                 DFT_LIB_SUFFIX='.a'
16415                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16416                 ;;
16417         esac
16418         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16419         then
16420                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16421                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16422         fi
16423 echo "$as_me:16423: result: $DFT_DEP_SUFFIX" >&5
16424 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16425
16426 echo "$as_me:16426: checking default object directory" >&5
16427 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16428
16429         case $DFT_LWR_MODEL in
16430         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16431         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16432         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16433         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16434         (shared)
16435                 case $cf_cv_system_name in
16436                 (cygwin|msys)
16437                         DFT_OBJ_SUBDIR='objects' ;;
16438                 (*)
16439                         DFT_OBJ_SUBDIR='obj_s' ;;
16440                 esac
16441         esac
16442 echo "$as_me:16442: result: $DFT_OBJ_SUBDIR" >&5
16443 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16444
16445 ### Set up low-level terminfo dependencies for makefiles.
16446
16447 if test "$DFT_LWR_MODEL" = shared ; then
16448         case $cf_cv_system_name in
16449         (cygwin*)
16450                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16451                 ;;
16452         (msys*)
16453                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16454                 ;;
16455         esac
16456 fi
16457
16458 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
16459
16460 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
16461
16462 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16463
16464 ### Construct the list of subdirectories for which we'll customize makefiles
16465 ### with the appropriate compile-rules.
16466
16467 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16468
16469 cat >>confdefs.h <<EOF
16470 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16471 EOF
16472
16473 ### Now that we're done running tests, add the compiler-warnings, if any
16474
16475 cf_fix_cppflags=no
16476 cf_new_cflags=
16477 cf_new_cppflags=
16478 cf_new_extra_cppflags=
16479
16480 for cf_add_cflags in $EXTRA_CFLAGS
16481 do
16482 case $cf_fix_cppflags in
16483 (no)
16484         case $cf_add_cflags in
16485         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16486                 case $cf_add_cflags in
16487                 (-D*)
16488                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16489
16490                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16491                                 && test -z "${cf_tst_cflags}" \
16492                                 && cf_fix_cppflags=yes
16493
16494                         if test $cf_fix_cppflags = yes ; then
16495
16496         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16497         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16498
16499                                 continue
16500                         elif test "${cf_tst_cflags}" = "\"'" ; then
16501
16502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16504
16505                                 continue
16506                         fi
16507                         ;;
16508                 esac
16509                 case "$CPPFLAGS" in
16510                 (*$cf_add_cflags)
16511                         ;;
16512                 (*)
16513                         case $cf_add_cflags in
16514                         (-D*)
16515                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16516
16517 CPPFLAGS=`echo "$CPPFLAGS" | \
16518         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16519                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16520
16521                                 ;;
16522                         esac
16523
16524         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16525         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16526
16527                         ;;
16528                 esac
16529                 ;;
16530         (*)
16531
16532         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16533         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16534
16535                 ;;
16536         esac
16537         ;;
16538 (yes)
16539
16540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16542
16543         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16544
16545         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16546                 && test -z "${cf_tst_cflags}" \
16547                 && cf_fix_cppflags=no
16548         ;;
16549 esac
16550 done
16551
16552 if test -n "$cf_new_cflags" ; then
16553
16554         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16555         CFLAGS="${CFLAGS}$cf_new_cflags"
16556
16557 fi
16558
16559 if test -n "$cf_new_cppflags" ; then
16560
16561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16562         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16563
16564 fi
16565
16566 if test -n "$cf_new_extra_cppflags" ; then
16567
16568         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16569         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16570
16571 fi
16572
16573 ################################################################################
16574
16575 TEST_ARG2=
16576
16577 TEST_LIBS2=
16578
16579 NCURSES_SHLIB2="sh -c"
16580
16581 ADA_SUBDIRS="include gen src doc"
16582 if test "x$cf_with_tests" != "xno" ; then
16583         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16584 fi
16585 for cf_dir in $ADA_SUBDIRS
16586 do
16587         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16588 done
16589
16590 NCURSES_TREE="#"
16591
16592 EXTERNAL_TREE=
16593
16594 # match layout used by make-tar.sh
16595 ADAHTML_DIR=../doc/ada
16596
16597 if test "x$cross_compiling" = xyes ; then
16598         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16599 else
16600         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16601 fi
16602
16603 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"
16604 ac_config_commands="$ac_config_commands default"
16605 cat >confcache <<\_ACEOF
16606 # This file is a shell script that caches the results of configure
16607 # tests run on this system so they can be shared between configure
16608 # scripts and configure runs, see configure's option --config-cache.
16609 # It is not useful on other systems.  If it contains results you don't
16610 # want to keep, you may remove or edit it.
16611 #
16612 # config.status only pays attention to the cache file if you give it
16613 # the --recheck option to rerun configure.
16614 #
16615 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16616 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16617 # following values.
16618
16619 _ACEOF
16620
16621 # The following way of writing the cache mishandles newlines in values,
16622 # but we know of no workaround that is simple, portable, and efficient.
16623 # So, don't put newlines in cache variables' values.
16624 # Ultrix sh set writes to stderr and can't be redirected directly,
16625 # and sets the high bit in the cache file unless we assign to the vars.
16626 {
16627   (set) 2>&1 |
16628     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16629     *ac_space=\ *)
16630       # `set' does not quote correctly, so add quotes (double-quote
16631       # substitution turns \\\\ into \\, and sed turns \\ into \).
16632       sed -n \
16633         "s/'/'\\\\''/g;
16634           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16635       ;;
16636     *)
16637       # `set' quotes correctly as required by POSIX, so do not add quotes.
16638       sed -n \
16639         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16640       ;;
16641     esac;
16642 } |
16643   sed '
16644      t clear
16645      : clear
16646      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16647      t end
16648      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16649      : end' >>confcache
16650 if cmp -s $cache_file confcache; then :; else
16651   if test -w $cache_file; then
16652     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16653     cat confcache >$cache_file
16654   else
16655     echo "not updating unwritable cache $cache_file"
16656   fi
16657 fi
16658 rm -f confcache
16659
16660 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16661 # Let make expand exec_prefix.
16662 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16663
16664 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16665 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16666 # trailing colons and then remove the whole line if VPATH becomes empty
16667 # (actually we leave an empty line to preserve line numbers).
16668 if test "x$srcdir" = x.; then
16669   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16670 s/:*\$(srcdir):*/:/;
16671 s/:*\${srcdir}:*/:/;
16672 s/:*@srcdir@:*/:/;
16673 s/^\([^=]*=[    ]*\):*/\1/;
16674 s/:*$//;
16675 s/^[^=]*=[      ]*$//;
16676 }'
16677 fi
16678
16679 DEFS=-DHAVE_CONFIG_H
16680
16681 : ${CONFIG_STATUS=./config.status}
16682 ac_clean_files_save=$ac_clean_files
16683 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16684 { echo "$as_me:16684: creating $CONFIG_STATUS" >&5
16685 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16686 cat >$CONFIG_STATUS <<_ACEOF
16687 #! $SHELL
16688 # Generated automatically by configure.
16689 # Run this file to recreate the current configuration.
16690 # Compiler output produced by configure, useful for debugging
16691 # configure, is in config.log if it exists.
16692
16693 debug=false
16694 SHELL=\${CONFIG_SHELL-$SHELL}
16695 ac_cs_invocation="\$0 \$@"
16696
16697 _ACEOF
16698
16699 cat >>$CONFIG_STATUS <<\_ACEOF
16700 # Be Bourne compatible
16701 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16702   emulate sh
16703   NULLCMD=:
16704 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16705   set -o posix
16706 fi
16707
16708 # Name of the executable.
16709 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16710
16711 if expr a : '\(a\)' >/dev/null 2>&1; then
16712   as_expr=expr
16713 else
16714   as_expr=false
16715 fi
16716
16717 rm -f conf$$ conf$$.exe conf$$.file
16718 echo >conf$$.file
16719 if ln -s conf$$.file conf$$ 2>/dev/null; then
16720   # We could just check for DJGPP; but this test a) works b) is more generic
16721   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16722   if test -f conf$$.exe; then
16723     # Don't use ln at all; we don't have any links
16724     as_ln_s='cp -p'
16725   else
16726     as_ln_s='ln -s'
16727   fi
16728 elif ln conf$$.file conf$$ 2>/dev/null; then
16729   as_ln_s=ln
16730 else
16731   as_ln_s='cp -p'
16732 fi
16733 rm -f conf$$ conf$$.exe conf$$.file
16734
16735 as_executable_p="test -f"
16736
16737 # Support unset when possible.
16738 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16739   as_unset=unset
16740 else
16741   as_unset=false
16742 fi
16743
16744 # NLS nuisances.
16745 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16746 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16747 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16748 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16749 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16750 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16751 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16752 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16753
16754 # IFS
16755 # We need space, tab and new line, in precisely that order.
16756 as_nl='
16757 '
16758 IFS="   $as_nl"
16759
16760 # CDPATH.
16761 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16762
16763 exec 6>&1
16764
16765 _ACEOF
16766
16767 # Files that config.status was made for.
16768 if test -n "$ac_config_files"; then
16769   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16770 fi
16771
16772 if test -n "$ac_config_headers"; then
16773   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16774 fi
16775
16776 if test -n "$ac_config_links"; then
16777   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16778 fi
16779
16780 if test -n "$ac_config_commands"; then
16781   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16782 fi
16783
16784 cat >>$CONFIG_STATUS <<\EOF
16785
16786 ac_cs_usage="\
16787 \`$as_me' instantiates files from templates according to the
16788 current configuration.
16789
16790 Usage: $0 [OPTIONS] [FILE]...
16791
16792   -h, --help       print this help, then exit
16793   -V, --version    print version number, then exit
16794   -d, --debug      don't remove temporary files
16795       --recheck    update $as_me by reconfiguring in the same conditions
16796   --file=FILE[:TEMPLATE]
16797                    instantiate the configuration file FILE
16798   --header=FILE[:TEMPLATE]
16799                    instantiate the configuration header FILE
16800
16801 Configuration files:
16802 $config_files
16803
16804 Configuration headers:
16805 $config_headers
16806
16807 Configuration commands:
16808 $config_commands
16809
16810 Report bugs to <dickey@invisible-island.net>."
16811 EOF
16812
16813 cat >>$CONFIG_STATUS <<EOF
16814 ac_cs_version="\\
16815 config.status
16816 configured by $0, generated by GNU Autoconf 2.52.20200111,
16817   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16818
16819 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16820 Free Software Foundation, Inc.
16821 This config.status script is free software; the Free Software Foundation
16822 gives unlimited permission to copy, distribute and modify it."
16823 srcdir=$srcdir
16824 INSTALL="$INSTALL"
16825 EOF
16826
16827 cat >>$CONFIG_STATUS <<\EOF
16828 # If no file are specified by the user, then we need to provide default
16829 # value.  By we need to know if files were specified by the user.
16830 ac_need_defaults=:
16831 while test $# != 0
16832 do
16833   case $1 in
16834   --*=*)
16835     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16836     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16837     shift
16838     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16839     shift
16840     ;;
16841   -*);;
16842   *) # This is not an option, so the user has probably given explicit
16843      # arguments.
16844      ac_need_defaults=false;;
16845   esac
16846
16847   case $1 in
16848   # Handling of the options.
16849 EOF
16850 cat >>$CONFIG_STATUS <<EOF
16851   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16852     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16853     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16854 EOF
16855 cat >>$CONFIG_STATUS <<\EOF
16856   --version | --vers* | -V )
16857     echo "$ac_cs_version"; exit 0 ;;
16858   --he | --h)
16859     # Conflict between --help and --header
16860     { { echo "$as_me:16860: error: ambiguous option: $1
16861 Try \`$0 --help' for more information." >&5
16862 echo "$as_me: error: ambiguous option: $1
16863 Try \`$0 --help' for more information." >&2;}
16864    { (exit 1); exit 1; }; };;
16865   --help | --hel | -h )
16866     echo "$ac_cs_usage"; exit 0 ;;
16867   --debug | --d* | -d )
16868     debug=: ;;
16869   --file | --fil | --fi | --f )
16870     shift
16871     CONFIG_FILES="$CONFIG_FILES $1"
16872     ac_need_defaults=false;;
16873   --header | --heade | --head | --hea )
16874     shift
16875     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16876     ac_need_defaults=false;;
16877
16878   # This is an error.
16879   -*) { { echo "$as_me:16879: error: unrecognized option: $1
16880 Try \`$0 --help' for more information." >&5
16881 echo "$as_me: error: unrecognized option: $1
16882 Try \`$0 --help' for more information." >&2;}
16883    { (exit 1); exit 1; }; } ;;
16884
16885   *) ac_config_targets="$ac_config_targets $1" ;;
16886
16887   esac
16888   shift
16889 done
16890
16891 exec 5>>config.log
16892 cat >&5 << _ACEOF
16893
16894 ## ----------------------- ##
16895 ## Running config.status.  ##
16896 ## ----------------------- ##
16897
16898 This file was extended by $as_me 2.52.20200111, executed with
16899   CONFIG_FILES    = $CONFIG_FILES
16900   CONFIG_HEADERS  = $CONFIG_HEADERS
16901   CONFIG_LINKS    = $CONFIG_LINKS
16902   CONFIG_COMMANDS = $CONFIG_COMMANDS
16903   > $ac_cs_invocation
16904 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16905
16906 _ACEOF
16907 EOF
16908
16909 cat >>$CONFIG_STATUS <<EOF
16910 #
16911 # INIT-COMMANDS section.
16912 #
16913
16914 ### Special initialization commands, used to pass information from the
16915 ### configuration-run into config.status
16916
16917 AWK="$AWK"
16918 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16919 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16920 LIB_NAME="$LIB_NAME"
16921 LIB_PREFIX="$LIB_PREFIX"
16922 LIB_SUFFIX="$LIB_SUFFIX"
16923 LN_S="$LN_S"
16924 NCURSES_MAJOR="$NCURSES_MAJOR"
16925 NCURSES_MINOR="$NCURSES_MINOR"
16926 NCURSES_PATCH="$NCURSES_PATCH"
16927 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16928 cf_cv_abi_version="$cf_cv_abi_version"
16929 cf_cv_rel_version="$cf_cv_rel_version"
16930 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16931 cf_cv_shared_soname='$cf_cv_shared_soname'
16932 cf_cv_shlib_version="$cf_cv_shlib_version"
16933 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16934 cf_cv_system_name="$cf_cv_system_name"
16935 host="$host"
16936 target="$target"
16937
16938 EOF
16939
16940 cat >>$CONFIG_STATUS <<\EOF
16941 for ac_config_target in $ac_config_targets
16942 do
16943   case "$ac_config_target" in
16944   # Handling of arguments.
16945   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16946   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
16947   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16948   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16949   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16950   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16951   *) { { echo "$as_me:16951: error: invalid argument: $ac_config_target" >&5
16952 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16953    { (exit 1); exit 1; }; };;
16954   esac
16955 done
16956
16957 # If the user did not use the arguments to specify the items to instantiate,
16958 # then the envvar interface is used.  Set only those that are not.
16959 # We use the long form for the default assignment because of an extremely
16960 # bizarre bug on SunOS 4.1.3.
16961 if $ac_need_defaults; then
16962   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16963   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16964   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16965 fi
16966
16967 # Create a temporary directory, and hook for its removal unless debugging.
16968 $debug ||
16969 {
16970   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16971   trap '{ (exit 1); exit 1; }' 1 2 13 15
16972 }
16973
16974 # Create a (secure) tmp directory for tmp files.
16975 : ${TMPDIR=/tmp}
16976 {
16977   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16978   test -n "$tmp" && test -d "$tmp"
16979 }  ||
16980 {
16981   tmp=$TMPDIR/cs$$-$RANDOM
16982   (umask 077 && mkdir $tmp)
16983 } ||
16984 {
16985    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16986    { (exit 1); exit 1; }
16987 }
16988
16989 EOF
16990
16991 cat >>$CONFIG_STATUS <<EOF
16992
16993 #
16994 # CONFIG_FILES section.
16995 #
16996
16997 # No need to generate the scripts if there are no CONFIG_FILES.
16998 # This happens for instance when ./config.status config.h
16999 if test -n "\$CONFIG_FILES"; then
17000   # Protect against being on the right side of a sed subst in config.status.
17001   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17002    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17003 s,@SHELL@,$SHELL,;t t
17004 s,@exec_prefix@,$exec_prefix,;t t
17005 s,@prefix@,$prefix,;t t
17006 s,@program_transform_name@,$program_transform_name,;t t
17007 s,@bindir@,$bindir,;t t
17008 s,@sbindir@,$sbindir,;t t
17009 s,@libexecdir@,$libexecdir,;t t
17010 s,@datarootdir@,$datarootdir,;t t
17011 s,@datadir@,$datadir,;t t
17012 s,@sysconfdir@,$sysconfdir,;t t
17013 s,@sharedstatedir@,$sharedstatedir,;t t
17014 s,@localstatedir@,$localstatedir,;t t
17015 s,@runstatedir@,$runstatedir,;t t
17016 s,@libdir@,$libdir,;t t
17017 s,@includedir@,$includedir,;t t
17018 s,@oldincludedir@,$oldincludedir,;t t
17019 s,@infodir@,$infodir,;t t
17020 s,@mandir@,$mandir,;t t
17021 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17022 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17023 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17024 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17025 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17026 s,@build_alias@,$build_alias,;t t
17027 s,@host_alias@,$host_alias,;t t
17028 s,@target_alias@,$target_alias,;t t
17029 s,@ECHO_C@,$ECHO_C,;t t
17030 s,@ECHO_N@,$ECHO_N,;t t
17031 s,@ECHO_T@,$ECHO_T,;t t
17032 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17033 s,@DEFS@,$DEFS,;t t
17034 s,@LIBS@,$LIBS,;t t
17035 s,@top_builddir@,$top_builddir,;t t
17036 s,@build@,$build,;t t
17037 s,@build_cpu@,$build_cpu,;t t
17038 s,@build_vendor@,$build_vendor,;t t
17039 s,@build_os@,$build_os,;t t
17040 s,@host@,$host,;t t
17041 s,@host_cpu@,$host_cpu,;t t
17042 s,@host_vendor@,$host_vendor,;t t
17043 s,@host_os@,$host_os,;t t
17044 s,@target@,$target,;t t
17045 s,@target_cpu@,$target_cpu,;t t
17046 s,@target_vendor@,$target_vendor,;t t
17047 s,@target_os@,$target_os,;t t
17048 s,@CC@,$CC,;t t
17049 s,@CFLAGS@,$CFLAGS,;t t
17050 s,@LDFLAGS@,$LDFLAGS,;t t
17051 s,@CPPFLAGS@,$CPPFLAGS,;t t
17052 s,@ac_ct_CC@,$ac_ct_CC,;t t
17053 s,@EXEEXT@,$EXEEXT,;t t
17054 s,@OBJEXT@,$OBJEXT,;t t
17055 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17056 s,@CPP@,$CPP,;t t
17057 s,@AWK@,$AWK,;t t
17058 s,@EGREP@,$EGREP,;t t
17059 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17060 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17061 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17062 s,@LN_S@,$LN_S,;t t
17063 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17064 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17065 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17066 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17067 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17068 s,@SET_MAKE@,$SET_MAKE,;t t
17069 s,@CTAGS@,$CTAGS,;t t
17070 s,@ETAGS@,$ETAGS,;t t
17071 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17072 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17073 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17074 s,@RANLIB@,$RANLIB,;t t
17075 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17076 s,@LD@,$LD,;t t
17077 s,@ac_ct_LD@,$ac_ct_LD,;t t
17078 s,@AR@,$AR,;t t
17079 s,@ac_ct_AR@,$ac_ct_AR,;t t
17080 s,@ARFLAGS@,$ARFLAGS,;t t
17081 s,@DESTDIR@,$DESTDIR,;t t
17082 s,@BUILD_CC@,$BUILD_CC,;t t
17083 s,@BUILD_CPP@,$BUILD_CPP,;t t
17084 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17085 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17086 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17087 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17088 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17089 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17090 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17091 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17092 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17093 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17094 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17095 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17096 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17097 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17098 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17099 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17100 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17101 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17102 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17103 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17104 s,@CC_G_OPT@,$CC_G_OPT,;t t
17105 s,@LD_MODEL@,$LD_MODEL,;t t
17106 s,@shlibdir@,$shlibdir,;t t
17107 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17108 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17109 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17110 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17111 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17112 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17113 s,@LINK_PROGS@,$LINK_PROGS,;t t
17114 s,@LINK_TESTS@,$LINK_TESTS,;t t
17115 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17116 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17117 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17118 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17119 s,@RPATH_LIST@,$RPATH_LIST,;t t
17120 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17121 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17122 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17123 s,@PTHREAD@,$PTHREAD,;t t
17124 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17125 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17126 s,@ECHO_LT@,$ECHO_LT,;t t
17127 s,@ECHO_LD@,$ECHO_LD,;t t
17128 s,@RULE_CC@,$RULE_CC,;t t
17129 s,@SHOW_CC@,$SHOW_CC,;t t
17130 s,@ECHO_CC@,$ECHO_CC,;t t
17131 s,@ADAFLAGS@,$ADAFLAGS,;t t
17132 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17133 s,@ADA_TRACE@,$ADA_TRACE,;t t
17134 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17135 s,@M4_exists@,$M4_exists,;t t
17136 s,@cf_ada_make@,$cf_ada_make,;t t
17137 s,@cf_ada_config@,$cf_ada_config,;t t
17138 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17139 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17140 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17141 s,@cf_compile_generics@,$cf_compile_generics,;t t
17142 s,@cf_generic_objects@,$cf_generic_objects,;t t
17143 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17144 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17145 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17146 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17147 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17148 s,@cf_ada_package@,$cf_ada_package,;t t
17149 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17150 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17151 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17152 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17153 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
17154 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17155 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17156 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17157 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17158 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17159 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17160 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17161 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17162 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17163 s,@TEST_ARG2@,$TEST_ARG2,;t t
17164 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17165 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17166 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17167 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17168 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17169 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17170 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17171 CEOF
17172
17173 EOF
17174
17175   cat >>$CONFIG_STATUS <<\EOF
17176   # Split the substitutions into bite-sized pieces for seds with
17177   # small command number limits, like on Digital OSF/1 and HP-UX.
17178   ac_max_sed_lines=48
17179   ac_sed_frag=1 # Number of current file.
17180   ac_beg=1 # First line for current file.
17181   ac_end=$ac_max_sed_lines # Line after last line for current file.
17182   ac_more_lines=:
17183   ac_sed_cmds=
17184   while $ac_more_lines; do
17185     if test $ac_beg -gt 1; then
17186       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17187     else
17188       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17189     fi
17190     if test ! -s $tmp/subs.frag; then
17191       ac_more_lines=false
17192     else
17193       # The purpose of the label and of the branching condition is to
17194       # speed up the sed processing (if there are no `@' at all, there
17195       # is no need to browse any of the substitutions).
17196       # These are the two extra sed commands mentioned above.
17197       (echo ':t
17198   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17199       # It is possible to make a multiline substitution using escaped newlines.
17200       # Ensure that we do not split the substitution between script fragments.
17201       ac_BEG=$ac_end
17202       ac_END=`expr $ac_end + $ac_max_sed_lines`
17203       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
17204       if test -s $tmp/subs.next; then
17205         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
17206         if test ! -s $tmp/subs.edit; then
17207           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
17208           if test ! -s $tmp/subs.edit; then
17209             if test $ac_beg -gt 1; then
17210               ac_end=`expr $ac_end - 1`
17211               continue
17212             fi
17213           fi
17214         fi
17215       fi
17216
17217       if test -z "$ac_sed_cmds"; then
17218         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17219       else
17220         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17221       fi
17222       ac_sed_frag=`expr $ac_sed_frag + 1`
17223       ac_beg=$ac_end
17224       ac_end=`expr $ac_end + $ac_max_sed_lines`
17225     fi
17226   done
17227   if test -z "$ac_sed_cmds"; then
17228     ac_sed_cmds=cat
17229   fi
17230 fi # test -n "$CONFIG_FILES"
17231
17232 EOF
17233 cat >>$CONFIG_STATUS <<\EOF
17234 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17235   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17236   case $ac_file in
17237   - | *:- | *:-:* ) # input from stdin
17238         cat >$tmp/stdin
17239         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17240         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17241   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17242         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17243   * )   ac_file_in=$ac_file.in ;;
17244   esac
17245
17246   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17247   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17248          X"$ac_file" : 'X\(//\)[^/]' \| \
17249          X"$ac_file" : 'X\(//\)$' \| \
17250          X"$ac_file" : 'X\(/\)' \| \
17251          .     : '\(.\)' 2>/dev/null ||
17252 echo X"$ac_file" |
17253     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17254           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17255           /^X\(\/\/\)$/{ s//\1/; q; }
17256           /^X\(\/\).*/{ s//\1/; q; }
17257           s/.*/./; q'`
17258   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17259     { case "$ac_dir" in
17260   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17261   *)                      as_incr_dir=.;;
17262 esac
17263 as_dummy="$ac_dir"
17264 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17265   case $as_mkdir_dir in
17266     # Skip DOS drivespec
17267     ?:) as_incr_dir=$as_mkdir_dir ;;
17268     *)
17269       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17270       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17271     ;;
17272   esac
17273 done; }
17274
17275     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17276     # A "../" for each directory in $ac_dir_suffix.
17277     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17278   else
17279     ac_dir_suffix= ac_dots=
17280   fi
17281
17282   case $srcdir in
17283   .)  ac_srcdir=.
17284       if test -z "$ac_dots"; then
17285          ac_top_srcdir=.
17286       else
17287          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17288       fi ;;
17289   [\\/]* | ?:[\\/]* )
17290       ac_srcdir=$srcdir$ac_dir_suffix;
17291       ac_top_srcdir=$srcdir ;;
17292   *) # Relative path.
17293     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17294     ac_top_srcdir=$ac_dots$srcdir ;;
17295   esac
17296
17297   case $INSTALL in
17298   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17299   *) ac_INSTALL=$ac_dots$INSTALL ;;
17300   esac
17301
17302   if test x"$ac_file" != x-; then
17303     { echo "$as_me:17303: creating $ac_file" >&5
17304 echo "$as_me: creating $ac_file" >&6;}
17305     rm -f "$ac_file"
17306   fi
17307   # Let's still pretend it is `configure' which instantiates (i.e., don't
17308   # use $as_me), people would be surprised to read:
17309   #    /* config.h.  Generated automatically by config.status.  */
17310   configure_input="Generated automatically from `echo $ac_file_in |
17311                                                  sed 's,.*/,,'` by configure."
17312
17313   # First look for the input files in the build tree, otherwise in the
17314   # src tree.
17315   ac_file_inputs=`IFS=:
17316     for f in $ac_file_in; do
17317       case $f in
17318       -) echo $tmp/stdin ;;
17319       [\\/$]*)
17320          # Absolute (can't be DOS-style, as IFS=:)
17321          test -f "$f" || { { echo "$as_me:17321: error: cannot find input file: $f" >&5
17322 echo "$as_me: error: cannot find input file: $f" >&2;}
17323    { (exit 1); exit 1; }; }
17324          echo $f;;
17325       *) # Relative
17326          if test -f "$f"; then
17327            # Build tree
17328            echo $f
17329          elif test -f "$srcdir/$f"; then
17330            # Source tree
17331            echo $srcdir/$f
17332          else
17333            # /dev/null tree
17334            { { echo "$as_me:17334: error: cannot find input file: $f" >&5
17335 echo "$as_me: error: cannot find input file: $f" >&2;}
17336    { (exit 1); exit 1; }; }
17337          fi;;
17338       esac
17339     done` || { (exit 1); exit 1; }
17340 EOF
17341 cat >>$CONFIG_STATUS <<\EOF
17342   ac_warn_datarootdir=no
17343   if test x"$ac_file" != x-; then
17344     for ac_item in $ac_file_inputs
17345     do
17346       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17347       if test -n "$ac_seen"; then
17348         ac_used=`grep '@datarootdir@' $ac_item`
17349         if test -z "$ac_used"; then
17350           { echo "$as_me:17350: WARNING: datarootdir was used implicitly but not set:
17351 $ac_seen" >&5
17352 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17353 $ac_seen" >&2;}
17354           ac_warn_datarootdir=yes
17355         fi
17356       fi
17357       ac_seen=`grep '${datarootdir}' $ac_item`
17358       if test -n "$ac_seen"; then
17359         { echo "$as_me:17359: WARNING: datarootdir was used explicitly but not set:
17360 $ac_seen" >&5
17361 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17362 $ac_seen" >&2;}
17363         ac_warn_datarootdir=yes
17364       fi
17365     done
17366   fi
17367
17368 if test "x$ac_warn_datarootdir" = xyes; then
17369   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17370 fi
17371
17372 EOF
17373 cat >>$CONFIG_STATUS <<EOF
17374   sed "$ac_vpsub
17375 $extrasub
17376 EOF
17377 cat >>$CONFIG_STATUS <<\EOF
17378 :t
17379 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17380 s,@configure_input@,$configure_input,;t t
17381 s,@srcdir@,$ac_srcdir,;t t
17382 s,@top_srcdir@,$ac_top_srcdir,;t t
17383 s,@INSTALL@,$ac_INSTALL,;t t
17384 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17385   rm -f $tmp/stdin
17386   if test x"$ac_file" != x-; then
17387     cp $tmp/out $ac_file
17388
17389     for ac_name in prefix exec_prefix datarootdir
17390     do
17391         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17392         if test -n "$ac_seen"; then
17393             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17394             if test -z "$ac_init"; then
17395               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17396               { echo "$as_me:17396: WARNING: Variable $ac_name is used but was not set:
17397 $ac_seen" >&5
17398 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17399 $ac_seen" >&2;}
17400             fi
17401         fi
17402     done
17403     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17404     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17405     if test -s $tmp/out; then
17406       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17407       { echo "$as_me:17407: WARNING: Some variables may not be substituted:
17408 $ac_seen" >&5
17409 echo "$as_me: WARNING: Some variables may not be substituted:
17410 $ac_seen" >&2;}
17411     fi
17412   else
17413     cat $tmp/out
17414   fi
17415   rm -f $tmp/out
17416
17417 done
17418 EOF
17419 cat >>$CONFIG_STATUS <<\EOF
17420
17421 #
17422 # CONFIG_HEADER section.
17423 #
17424
17425 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17426 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17427 #
17428 # ac_d sets the value in "#define NAME VALUE" lines.
17429 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17430 ac_dB='[        ].*$,\1#\2'
17431 ac_dC=' '
17432 ac_dD=',;t'
17433 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17434 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17435 ac_iB='\([      ]\),\1#\2define\3'
17436 ac_iC=' '
17437 ac_iD='\4,;t'
17438 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17439 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17440 ac_uB='$,\1#\2define\3'
17441 ac_uC=' '
17442 ac_uD=',;t'
17443
17444 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17445   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17446   case $ac_file in
17447   - | *:- | *:-:* ) # input from stdin
17448         cat >$tmp/stdin
17449         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17450         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17451   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17452         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17453   * )   ac_file_in=$ac_file.in ;;
17454   esac
17455
17456   test x"$ac_file" != x- && { echo "$as_me:17456: creating $ac_file" >&5
17457 echo "$as_me: creating $ac_file" >&6;}
17458
17459   # First look for the input files in the build tree, otherwise in the
17460   # src tree.
17461   ac_file_inputs=`IFS=:
17462     for f in $ac_file_in; do
17463       case $f in
17464       -) echo $tmp/stdin ;;
17465       [\\/$]*)
17466          # Absolute (can't be DOS-style, as IFS=:)
17467          test -f "$f" || { { echo "$as_me:17467: error: cannot find input file: $f" >&5
17468 echo "$as_me: error: cannot find input file: $f" >&2;}
17469    { (exit 1); exit 1; }; }
17470          echo $f;;
17471       *) # Relative
17472          if test -f "$f"; then
17473            # Build tree
17474            echo $f
17475          elif test -f "$srcdir/$f"; then
17476            # Source tree
17477            echo $srcdir/$f
17478          else
17479            # /dev/null tree
17480            { { echo "$as_me:17480: error: cannot find input file: $f" >&5
17481 echo "$as_me: error: cannot find input file: $f" >&2;}
17482    { (exit 1); exit 1; }; }
17483          fi;;
17484       esac
17485     done` || { (exit 1); exit 1; }
17486   # Remove the trailing spaces.
17487   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17488
17489 EOF
17490
17491 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17492 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17493 # be either 'cat' or 'sort'.
17494 cat confdefs.h | uniq >conftest.vals
17495
17496 # Break up conftest.vals because some shells have a limit on
17497 # the size of here documents, and old seds have small limits too.
17498
17499 rm -f conftest.tail
17500 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17501 while grep . conftest.vals >/dev/null
17502 do
17503   # Write chunks of a limited-size here document to conftest.frag.
17504   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17505   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17506   echo 'CEOF' >> $CONFIG_STATUS
17507   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17508   rm -f conftest.vals
17509   mv conftest.tail conftest.vals
17510 done
17511 rm -f conftest.vals
17512
17513 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17514 # marker @DEFS@.
17515 echo '  cat >> conftest.edit <<CEOF
17516 /@DEFS@/r conftest.frag
17517 /@DEFS@/d
17518 CEOF
17519 sed -f conftest.edit $tmp/in > $tmp/out
17520 rm -f $tmp/in
17521 mv $tmp/out $tmp/in
17522 rm -f conftest.edit conftest.frag
17523 ' >> $CONFIG_STATUS
17524
17525 cat >>$CONFIG_STATUS <<\EOF
17526   # Let's still pretend it is `configure' which instantiates (i.e., don't
17527   # use $as_me), people would be surprised to read:
17528   #    /* config.h.  Generated automatically by config.status.  */
17529   if test x"$ac_file" = x-; then
17530     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17531   else
17532     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17533   fi
17534   cat $tmp/in >>$tmp/config.h
17535   rm -f $tmp/in
17536   if test x"$ac_file" != x-; then
17537     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17538       { echo "$as_me:17538: $ac_file is unchanged" >&5
17539 echo "$as_me: $ac_file is unchanged" >&6;}
17540     else
17541       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17542          X"$ac_file" : 'X\(//\)[^/]' \| \
17543          X"$ac_file" : 'X\(//\)$' \| \
17544          X"$ac_file" : 'X\(/\)' \| \
17545          .     : '\(.\)' 2>/dev/null ||
17546 echo X"$ac_file" |
17547     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17548           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17549           /^X\(\/\/\)$/{ s//\1/; q; }
17550           /^X\(\/\).*/{ s//\1/; q; }
17551           s/.*/./; q'`
17552       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17553         { case "$ac_dir" in
17554   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17555   *)                      as_incr_dir=.;;
17556 esac
17557 as_dummy="$ac_dir"
17558 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17559   case $as_mkdir_dir in
17560     # Skip DOS drivespec
17561     ?:) as_incr_dir=$as_mkdir_dir ;;
17562     *)
17563       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17564       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17565     ;;
17566   esac
17567 done; }
17568
17569       fi
17570       rm -f $ac_file
17571       mv $tmp/config.h $ac_file
17572     fi
17573   else
17574     cat $tmp/config.h
17575     rm -f $tmp/config.h
17576   fi
17577 done
17578 EOF
17579 cat >>$CONFIG_STATUS <<\EOF
17580 #
17581 # CONFIG_COMMANDS section.
17582 #
17583 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17584   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17585   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17586
17587   case $ac_dest in
17588     default )
17589 if test -z "$USE_OLD_MAKERULES" ; then
17590         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17591 fi
17592  ;;
17593   esac
17594 done
17595 EOF
17596
17597 cat >>$CONFIG_STATUS <<\EOF
17598
17599 { (exit 0); exit 0; }
17600 EOF
17601 chmod +x $CONFIG_STATUS
17602 ac_clean_files=$ac_clean_files_save
17603
17604 # configure is writing to config.log, and then calls config.status.
17605 # config.status does its own redirection, appending to config.log.
17606 # Unfortunately, on DOS this fails, as config.log is still kept open
17607 # by configure, so config.status won't be able to write to it; its
17608 # output is simply discarded.  So we exec the FD to /dev/null,
17609 # effectively closing config.log, so it can be properly (re)opened and
17610 # appended to by config.status.  When coming back to configure, we
17611 # need to make the FD available again.
17612 if test "$no_create" != yes; then
17613   ac_cs_success=:
17614   exec 5>/dev/null
17615   $SHELL $CONFIG_STATUS || ac_cs_success=false
17616   exec 5>>config.log
17617   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17618   # would make configure fail if this is the last instruction.
17619   $ac_cs_success || { (exit 1); exit 1; }
17620 fi
17621 ${MAKE:-make} preinstall