]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20200321
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.76 .
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_CFLAGS="$CFLAGS"
4155                 cf_save_CPPFLAGS="$CPPFLAGS"
4156                 cf_save_LIBS="$LIBS"
4157
4158                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4159                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4160
4161                 # while -W for passing linker flags is prevalent, it is not "standard".
4162                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4163                 # incompatible _and_ non-standard -W option which gives an error.  Work
4164                 # around that pitfall.
4165                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4166                 (x*c[89]9@@*-W*)
4167
4168 cf_fix_cppflags=no
4169 cf_new_cflags=
4170 cf_new_cppflags=
4171 cf_new_extra_cppflags=
4172
4173 for cf_add_cflags in $cf_pkg_cflags
4174 do
4175 case $cf_fix_cppflags in
4176 (no)
4177         case $cf_add_cflags in
4178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4179                 case $cf_add_cflags in
4180                 (-D*)
4181                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4182
4183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4184                                 && test -z "${cf_tst_cflags}" \
4185                                 && cf_fix_cppflags=yes
4186
4187                         if test $cf_fix_cppflags = yes ; then
4188
4189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4191
4192                                 continue
4193                         elif test "${cf_tst_cflags}" = "\"'" ; then
4194
4195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4197
4198                                 continue
4199                         fi
4200                         ;;
4201                 esac
4202                 case "$CPPFLAGS" in
4203                 (*$cf_add_cflags)
4204                         ;;
4205                 (*)
4206                         case $cf_add_cflags in
4207                         (-D*)
4208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4209
4210 CPPFLAGS=`echo "$CPPFLAGS" | \
4211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4213
4214                                 ;;
4215                         esac
4216
4217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4219
4220                         ;;
4221                 esac
4222                 ;;
4223         (*)
4224
4225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4227
4228                 ;;
4229         esac
4230         ;;
4231 (yes)
4232
4233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4235
4236         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4237
4238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4239                 && test -z "${cf_tst_cflags}" \
4240                 && cf_fix_cppflags=no
4241         ;;
4242 esac
4243 done
4244
4245 if test -n "$cf_new_cflags" ; then
4246
4247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4248         CFLAGS="${CFLAGS}$cf_new_cflags"
4249
4250 fi
4251
4252 if test -n "$cf_new_cppflags" ; then
4253
4254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4256
4257 fi
4258
4259 if test -n "$cf_new_extra_cppflags" ; then
4260
4261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4263
4264 fi
4265
4266 cf_add_libs="$LIBS"
4267 # reverse order
4268 cf_add_0lib=
4269 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4270 # filter duplicates
4271 for cf_add_1lib in $cf_add_0lib; do
4272         for cf_add_2lib in $cf_add_libs; do
4273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4274                         cf_add_1lib=
4275                         break
4276                 fi
4277         done
4278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4279 done
4280 LIBS="$cf_add_libs"
4281
4282                         cat >conftest.$ac_ext <<_ACEOF
4283 #line 4283 "configure"
4284 #include "confdefs.h"
4285 #include <${cf_cv_ncurses_header:-curses.h}>
4286 int
4287 main (void)
4288 {
4289 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4290   ;
4291   return 0;
4292 }
4293 _ACEOF
4294 rm -f conftest.$ac_objext conftest$ac_exeext
4295 if { (eval echo "$as_me:4295: \"$ac_link\"") >&5
4296   (eval $ac_link) 2>&5
4297   ac_status=$?
4298   echo "$as_me:4298: \$? = $ac_status" >&5
4299   (exit $ac_status); } &&
4300          { ac_try='test -s conftest$ac_exeext'
4301   { (eval echo "$as_me:4301: \"$ac_try\"") >&5
4302   (eval $ac_try) 2>&5
4303   ac_status=$?
4304   echo "$as_me:4304: \$? = $ac_status" >&5
4305   (exit $ac_status); }; }; then
4306   if test "$cross_compiling" = yes; then
4307   cf_test_ncuconfig=maybe
4308 else
4309   cat >conftest.$ac_ext <<_ACEOF
4310 #line 4310 "configure"
4311 #include "confdefs.h"
4312 #include <${cf_cv_ncurses_header:-curses.h}>
4313                                         int main(void)
4314                                         { char *xx = curses_version(); return (xx == 0); }
4315 _ACEOF
4316 rm -f conftest$ac_exeext
4317 if { (eval echo "$as_me:4317: \"$ac_link\"") >&5
4318   (eval $ac_link) 2>&5
4319   ac_status=$?
4320   echo "$as_me:4320: \$? = $ac_status" >&5
4321   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4322   { (eval echo "$as_me:4322: \"$ac_try\"") >&5
4323   (eval $ac_try) 2>&5
4324   ac_status=$?
4325   echo "$as_me:4325: \$? = $ac_status" >&5
4326   (exit $ac_status); }; }; then
4327   cf_test_ncuconfig=yes
4328 else
4329   echo "$as_me: program exited with status $ac_status" >&5
4330 echo "$as_me: failed program was:" >&5
4331 cat conftest.$ac_ext >&5
4332 cf_test_ncuconfig=no
4333 fi
4334 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4335 fi
4336 else
4337   echo "$as_me: failed program was:" >&5
4338 cat conftest.$ac_ext >&5
4339 cf_test_ncuconfig=no
4340 fi
4341 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4342
4343                         CFLAGS="$cf_save_CFLAGS"
4344                         CPPFLAGS="$cf_save_CPPFLAGS"
4345                         LIBS="$cf_save_LIBS"
4346
4347                         if test "x$cf_test_ncuconfig" != xyes; then
4348                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4349                                 cf_pkg_cflags="$cf_temp"
4350                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4351                                 cf_pkg_libs="$cf_temp"
4352                         fi
4353                         ;;
4354                 esac
4355
4356 cf_fix_cppflags=no
4357 cf_new_cflags=
4358 cf_new_cppflags=
4359 cf_new_extra_cppflags=
4360
4361 for cf_add_cflags in $cf_pkg_cflags
4362 do
4363 case $cf_fix_cppflags in
4364 (no)
4365         case $cf_add_cflags in
4366         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4367                 case $cf_add_cflags in
4368                 (-D*)
4369                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4370
4371                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4372                                 && test -z "${cf_tst_cflags}" \
4373                                 && cf_fix_cppflags=yes
4374
4375                         if test $cf_fix_cppflags = yes ; then
4376
4377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4379
4380                                 continue
4381                         elif test "${cf_tst_cflags}" = "\"'" ; then
4382
4383         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4384         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4385
4386                                 continue
4387                         fi
4388                         ;;
4389                 esac
4390                 case "$CPPFLAGS" in
4391                 (*$cf_add_cflags)
4392                         ;;
4393                 (*)
4394                         case $cf_add_cflags in
4395                         (-D*)
4396                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4397
4398 CPPFLAGS=`echo "$CPPFLAGS" | \
4399         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4400                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4401
4402                                 ;;
4403                         esac
4404
4405         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4406         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4407
4408                         ;;
4409                 esac
4410                 ;;
4411         (*)
4412
4413         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4414         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4415
4416                 ;;
4417         esac
4418         ;;
4419 (yes)
4420
4421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4423
4424         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4425
4426         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4427                 && test -z "${cf_tst_cflags}" \
4428                 && cf_fix_cppflags=no
4429         ;;
4430 esac
4431 done
4432
4433 if test -n "$cf_new_cflags" ; then
4434
4435         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4436         CFLAGS="${CFLAGS}$cf_new_cflags"
4437
4438 fi
4439
4440 if test -n "$cf_new_cppflags" ; then
4441
4442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4443         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4444
4445 fi
4446
4447 if test -n "$cf_new_extra_cppflags" ; then
4448
4449         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4450         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4451
4452 fi
4453
4454 cf_add_libs="$LIBS"
4455 # reverse order
4456 cf_add_0lib=
4457 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4458 # filter duplicates
4459 for cf_add_1lib in $cf_add_0lib; do
4460         for cf_add_2lib in $cf_add_libs; do
4461                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4462                         cf_add_1lib=
4463                         break
4464                 fi
4465         done
4466         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4467 done
4468 LIBS="$cf_add_libs"
4469
4470                 cat >conftest.$ac_ext <<_ACEOF
4471 #line 4471 "configure"
4472 #include "confdefs.h"
4473 #include <${cf_cv_ncurses_header:-curses.h}>
4474 int
4475 main (void)
4476 {
4477 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4478   ;
4479   return 0;
4480 }
4481 _ACEOF
4482 rm -f conftest.$ac_objext conftest$ac_exeext
4483 if { (eval echo "$as_me:4483: \"$ac_link\"") >&5
4484   (eval $ac_link) 2>&5
4485   ac_status=$?
4486   echo "$as_me:4486: \$? = $ac_status" >&5
4487   (exit $ac_status); } &&
4488          { ac_try='test -s conftest$ac_exeext'
4489   { (eval echo "$as_me:4489: \"$ac_try\"") >&5
4490   (eval $ac_try) 2>&5
4491   ac_status=$?
4492   echo "$as_me:4492: \$? = $ac_status" >&5
4493   (exit $ac_status); }; }; then
4494   if test "$cross_compiling" = yes; then
4495   cf_have_ncuconfig=maybe
4496 else
4497   cat >conftest.$ac_ext <<_ACEOF
4498 #line 4498 "configure"
4499 #include "confdefs.h"
4500 #include <${cf_cv_ncurses_header:-curses.h}>
4501                                 int main(void)
4502                                 { char *xx = curses_version(); return (xx == 0); }
4503 _ACEOF
4504 rm -f conftest$ac_exeext
4505 if { (eval echo "$as_me:4505: \"$ac_link\"") >&5
4506   (eval $ac_link) 2>&5
4507   ac_status=$?
4508   echo "$as_me:4508: \$? = $ac_status" >&5
4509   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4510   { (eval echo "$as_me:4510: \"$ac_try\"") >&5
4511   (eval $ac_try) 2>&5
4512   ac_status=$?
4513   echo "$as_me:4513: \$? = $ac_status" >&5
4514   (exit $ac_status); }; }; then
4515   cf_have_ncuconfig=yes
4516 else
4517   echo "$as_me: program exited with status $ac_status" >&5
4518 echo "$as_me: failed program was:" >&5
4519 cat conftest.$ac_ext >&5
4520 cf_have_ncuconfig=no
4521 fi
4522 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4523 fi
4524 else
4525   echo "$as_me: failed program was:" >&5
4526 cat conftest.$ac_ext >&5
4527 cf_have_ncuconfig=no
4528 fi
4529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4530                 echo "$as_me:4530: result: $cf_have_ncuconfig" >&5
4531 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4532                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4533                 if test "$cf_have_ncuconfig" != "yes"
4534                 then
4535                         CPPFLAGS="$cf_save_CPPFLAGS"
4536                         LIBS="$cf_save_LIBS"
4537                         NCURSES_CONFIG_PKG=none
4538                 else
4539
4540 cat >>confdefs.h <<\EOF
4541 #define NCURSES 1
4542 EOF
4543
4544                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4545
4546 echo "$as_me:4546: checking for terminfo header" >&5
4547 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4548 if test "${cf_cv_term_header+set}" = set; then
4549   echo $ECHO_N "(cached) $ECHO_C" >&6
4550 else
4551
4552 case ${cf_cv_ncurses_header} in
4553 (*/ncurses.h|*/ncursesw.h)
4554         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4555         ;;
4556 (*)
4557         cf_term_header=term.h
4558         ;;
4559 esac
4560
4561 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4562 do
4563 cat >conftest.$ac_ext <<_ACEOF
4564 #line 4564 "configure"
4565 #include "confdefs.h"
4566 #include <stdio.h>
4567 #include <${cf_cv_ncurses_header:-curses.h}>
4568 #include <$cf_test>
4569
4570 int
4571 main (void)
4572 {
4573 int x = auto_left_margin; (void)x
4574   ;
4575   return 0;
4576 }
4577 _ACEOF
4578 rm -f conftest.$ac_objext
4579 if { (eval echo "$as_me:4579: \"$ac_compile\"") >&5
4580   (eval $ac_compile) 2>&5
4581   ac_status=$?
4582   echo "$as_me:4582: \$? = $ac_status" >&5
4583   (exit $ac_status); } &&
4584          { ac_try='test -s conftest.$ac_objext'
4585   { (eval echo "$as_me:4585: \"$ac_try\"") >&5
4586   (eval $ac_try) 2>&5
4587   ac_status=$?
4588   echo "$as_me:4588: \$? = $ac_status" >&5
4589   (exit $ac_status); }; }; then
4590
4591         cf_cv_term_header="$cf_test"
4592 else
4593   echo "$as_me: failed program was:" >&5
4594 cat conftest.$ac_ext >&5
4595
4596         cf_cv_term_header=unknown
4597
4598 fi
4599 rm -f conftest.$ac_objext conftest.$ac_ext
4600         test "$cf_cv_term_header" != unknown && break
4601 done
4602
4603 fi
4604 echo "$as_me:4604: result: $cf_cv_term_header" >&5
4605 echo "${ECHO_T}$cf_cv_term_header" >&6
4606
4607 # Set definitions to allow ifdef'ing to accommodate subdirectories
4608
4609 case $cf_cv_term_header in
4610 (*term.h)
4611
4612 cat >>confdefs.h <<\EOF
4613 #define HAVE_TERM_H 1
4614 EOF
4615
4616         ;;
4617 esac
4618
4619 case $cf_cv_term_header in
4620 (ncurses/term.h)
4621
4622 cat >>confdefs.h <<\EOF
4623 #define HAVE_NCURSES_TERM_H 1
4624 EOF
4625
4626         ;;
4627 (ncursesw/term.h)
4628
4629 cat >>confdefs.h <<\EOF
4630 #define HAVE_NCURSESW_TERM_H 1
4631 EOF
4632
4633         ;;
4634 esac
4635
4636                 fi
4637
4638         else
4639                 echo "$as_me:4639: result: no" >&5
4640 echo "${ECHO_T}no" >&6
4641                 NCURSES_CONFIG_PKG=none
4642         fi
4643 else
4644         NCURSES_CONFIG_PKG=none
4645 fi
4646
4647 if test "x$cf_have_ncuconfig" = "xno"; then
4648         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4649
4650 if test -n "$ac_tool_prefix"; then
4651   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4652   do
4653     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4654 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4655 echo "$as_me:4655: checking for $ac_word" >&5
4656 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4657 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4658   echo $ECHO_N "(cached) $ECHO_C" >&6
4659 else
4660   if test -n "$NCURSES_CONFIG"; then
4661   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4662 else
4663   ac_save_IFS=$IFS; IFS=$ac_path_separator
4664 ac_dummy="$PATH"
4665 for ac_dir in $ac_dummy; do
4666   IFS=$ac_save_IFS
4667   test -z "$ac_dir" && ac_dir=.
4668   $as_executable_p "$ac_dir/$ac_word" || continue
4669 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4670 echo "$as_me:4670: found $ac_dir/$ac_word" >&5
4671 break
4672 done
4673
4674 fi
4675 fi
4676 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4677 if test -n "$NCURSES_CONFIG"; then
4678   echo "$as_me:4678: result: $NCURSES_CONFIG" >&5
4679 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4680 else
4681   echo "$as_me:4681: result: no" >&5
4682 echo "${ECHO_T}no" >&6
4683 fi
4684
4685     test -n "$NCURSES_CONFIG" && break
4686   done
4687 fi
4688 if test -z "$NCURSES_CONFIG"; then
4689   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4690   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4691 do
4692   # Extract the first word of "$ac_prog", so it can be a program name with args.
4693 set dummy $ac_prog; ac_word=$2
4694 echo "$as_me:4694: checking for $ac_word" >&5
4695 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4696 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4697   echo $ECHO_N "(cached) $ECHO_C" >&6
4698 else
4699   if test -n "$ac_ct_NCURSES_CONFIG"; then
4700   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4701 else
4702   ac_save_IFS=$IFS; IFS=$ac_path_separator
4703 ac_dummy="$PATH"
4704 for ac_dir in $ac_dummy; do
4705   IFS=$ac_save_IFS
4706   test -z "$ac_dir" && ac_dir=.
4707   $as_executable_p "$ac_dir/$ac_word" || continue
4708 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4709 echo "$as_me:4709: found $ac_dir/$ac_word" >&5
4710 break
4711 done
4712
4713 fi
4714 fi
4715 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4716 if test -n "$ac_ct_NCURSES_CONFIG"; then
4717   echo "$as_me:4717: result: $ac_ct_NCURSES_CONFIG" >&5
4718 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4719 else
4720   echo "$as_me:4720: result: no" >&5
4721 echo "${ECHO_T}no" >&6
4722 fi
4723
4724   test -n "$ac_ct_NCURSES_CONFIG" && break
4725 done
4726 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4727
4728   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4729 fi
4730
4731         if test "$NCURSES_CONFIG" != none ; then
4732
4733 cf_fix_cppflags=no
4734 cf_new_cflags=
4735 cf_new_cppflags=
4736 cf_new_extra_cppflags=
4737
4738 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4739 do
4740 case $cf_fix_cppflags in
4741 (no)
4742         case $cf_add_cflags in
4743         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4744                 case $cf_add_cflags in
4745                 (-D*)
4746                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4747
4748                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4749                                 && test -z "${cf_tst_cflags}" \
4750                                 && cf_fix_cppflags=yes
4751
4752                         if test $cf_fix_cppflags = yes ; then
4753
4754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4756
4757                                 continue
4758                         elif test "${cf_tst_cflags}" = "\"'" ; then
4759
4760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4762
4763                                 continue
4764                         fi
4765                         ;;
4766                 esac
4767                 case "$CPPFLAGS" in
4768                 (*$cf_add_cflags)
4769                         ;;
4770                 (*)
4771                         case $cf_add_cflags in
4772                         (-D*)
4773                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4774
4775 CPPFLAGS=`echo "$CPPFLAGS" | \
4776         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4777                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4778
4779                                 ;;
4780                         esac
4781
4782         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4783         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4784
4785                         ;;
4786                 esac
4787                 ;;
4788         (*)
4789
4790         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4791         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4792
4793                 ;;
4794         esac
4795         ;;
4796 (yes)
4797
4798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4800
4801         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4802
4803         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4804                 && test -z "${cf_tst_cflags}" \
4805                 && cf_fix_cppflags=no
4806         ;;
4807 esac
4808 done
4809
4810 if test -n "$cf_new_cflags" ; then
4811
4812         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4813         CFLAGS="${CFLAGS}$cf_new_cflags"
4814
4815 fi
4816
4817 if test -n "$cf_new_cppflags" ; then
4818
4819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4820         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4821
4822 fi
4823
4824 if test -n "$cf_new_extra_cppflags" ; then
4825
4826         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4827         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4828
4829 fi
4830
4831 cf_add_libs="$LIBS"
4832 # reverse order
4833 cf_add_0lib=
4834 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4835 # filter duplicates
4836 for cf_add_1lib in $cf_add_0lib; do
4837         for cf_add_2lib in $cf_add_libs; do
4838                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4839                         cf_add_1lib=
4840                         break
4841                 fi
4842         done
4843         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4844 done
4845 LIBS="$cf_add_libs"
4846
4847                 # even with config script, some packages use no-override for curses.h
4848
4849 echo "$as_me:4849: checking if we have identified curses headers" >&5
4850 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4851 if test "${cf_cv_ncurses_header+set}" = set; then
4852   echo $ECHO_N "(cached) $ECHO_C" >&6
4853 else
4854
4855 cf_cv_ncurses_header=none
4856 for cf_header in \
4857         ncurses.h ncurses/ncurses.h \
4858         curses.h ncurses/curses.h
4859 do
4860 cat >conftest.$ac_ext <<_ACEOF
4861 #line 4861 "configure"
4862 #include "confdefs.h"
4863 #include <${cf_header}>
4864 int
4865 main (void)
4866 {
4867 initscr(); tgoto("?", 0,0)
4868   ;
4869   return 0;
4870 }
4871 _ACEOF
4872 rm -f conftest.$ac_objext
4873 if { (eval echo "$as_me:4873: \"$ac_compile\"") >&5
4874   (eval $ac_compile) 2>&5
4875   ac_status=$?
4876   echo "$as_me:4876: \$? = $ac_status" >&5
4877   (exit $ac_status); } &&
4878          { ac_try='test -s conftest.$ac_objext'
4879   { (eval echo "$as_me:4879: \"$ac_try\"") >&5
4880   (eval $ac_try) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit $ac_status); }; }; then
4884   cf_cv_ncurses_header=$cf_header; break
4885 else
4886   echo "$as_me: failed program was:" >&5
4887 cat conftest.$ac_ext >&5
4888 fi
4889 rm -f conftest.$ac_objext conftest.$ac_ext
4890 done
4891
4892 fi
4893 echo "$as_me:4893: result: $cf_cv_ncurses_header" >&5
4894 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4895
4896 if test "$cf_cv_ncurses_header" = none ; then
4897         { { echo "$as_me:4897: error: No curses header-files found" >&5
4898 echo "$as_me: error: No curses header-files found" >&2;}
4899    { (exit 1); exit 1; }; }
4900 fi
4901
4902 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4903
4904 for ac_header in $cf_cv_ncurses_header
4905 do
4906 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4907 echo "$as_me:4907: checking for $ac_header" >&5
4908 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4909 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4910   echo $ECHO_N "(cached) $ECHO_C" >&6
4911 else
4912   cat >conftest.$ac_ext <<_ACEOF
4913 #line 4913 "configure"
4914 #include "confdefs.h"
4915 #include <$ac_header>
4916 _ACEOF
4917 if { (eval echo "$as_me:4917: \"$ac_cpp conftest.$ac_ext\"") >&5
4918   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4919   ac_status=$?
4920   egrep -v '^ *\+' conftest.er1 >conftest.err
4921   rm -f conftest.er1
4922   cat conftest.err >&5
4923   echo "$as_me:4923: \$? = $ac_status" >&5
4924   (exit $ac_status); } >/dev/null; then
4925   if test -s conftest.err; then
4926     ac_cpp_err=$ac_c_preproc_warn_flag
4927   else
4928     ac_cpp_err=
4929   fi
4930 else
4931   ac_cpp_err=yes
4932 fi
4933 if test -z "$ac_cpp_err"; then
4934   eval "$as_ac_Header=yes"
4935 else
4936   echo "$as_me: failed program was:" >&5
4937   cat conftest.$ac_ext >&5
4938   eval "$as_ac_Header=no"
4939 fi
4940 rm -f conftest.err conftest.$ac_ext
4941 fi
4942 echo "$as_me:4942: result: `eval echo '${'$as_ac_Header'}'`" >&5
4943 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4944 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4945   cat >>confdefs.h <<EOF
4946 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4947 EOF
4948
4949 fi
4950 done
4951
4952 cat >>confdefs.h <<\EOF
4953 #define NCURSES 1
4954 EOF
4955
4956 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4957
4958                 cat >>confdefs.h <<EOF
4959 #define $cf_nculib_ROOT 1
4960 EOF
4961
4962                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4963
4964         else
4965
4966 cf_ncuhdr_root=ncurses
4967
4968 test -n "$cf_cv_curses_dir" && \
4969 test "$cf_cv_curses_dir" != "no" && { \
4970
4971 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4972   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4973   do
4974         while test $cf_add_incdir != /usr/include
4975         do
4976           if test -d $cf_add_incdir
4977           then
4978                 cf_have_incdir=no
4979                 if test -n "$CFLAGS$CPPFLAGS" ; then
4980                   # a loop is needed to ensure we can add subdirs of existing dirs
4981                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4982                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4983                           cf_have_incdir=yes; break
4984                         fi
4985                   done
4986                 fi
4987
4988                 if test "$cf_have_incdir" = no ; then
4989                   if test "$cf_add_incdir" = /usr/local/include ; then
4990                         if test "$GCC" = yes
4991                         then
4992                           cf_save_CPPFLAGS=$CPPFLAGS
4993
4994         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4995         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4996
4997                           cat >conftest.$ac_ext <<_ACEOF
4998 #line 4998 "configure"
4999 #include "confdefs.h"
5000 #include <stdio.h>
5001 int
5002 main (void)
5003 {
5004 printf("Hello")
5005   ;
5006   return 0;
5007 }
5008 _ACEOF
5009 rm -f conftest.$ac_objext
5010 if { (eval echo "$as_me:5010: \"$ac_compile\"") >&5
5011   (eval $ac_compile) 2>&5
5012   ac_status=$?
5013   echo "$as_me:5013: \$? = $ac_status" >&5
5014   (exit $ac_status); } &&
5015          { ac_try='test -s conftest.$ac_objext'
5016   { (eval echo "$as_me:5016: \"$ac_try\"") >&5
5017   (eval $ac_try) 2>&5
5018   ac_status=$?
5019   echo "$as_me:5019: \$? = $ac_status" >&5
5020   (exit $ac_status); }; }; then
5021   :
5022 else
5023   echo "$as_me: failed program was:" >&5
5024 cat conftest.$ac_ext >&5
5025 cf_have_incdir=yes
5026 fi
5027 rm -f conftest.$ac_objext conftest.$ac_ext
5028                           CPPFLAGS=$cf_save_CPPFLAGS
5029                         fi
5030                   fi
5031                 fi
5032
5033                 if test "$cf_have_incdir" = no ; then
5034                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5035
5036 echo "${as_me:-configure}:5036: testing adding $cf_add_incdir to include-path ..." 1>&5
5037
5038                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5039
5040                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5041                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5042                   cf_add_incdir="$cf_top_incdir"
5043                 else
5044                   break
5045                 fi
5046           else
5047                 break
5048           fi
5049         done
5050   done
5051 fi
5052
5053 }
5054
5055 echo "$as_me:5055: checking for $cf_ncuhdr_root header in include-path" >&5
5056 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5057 if test "${cf_cv_ncurses_h+set}" = set; then
5058   echo $ECHO_N "(cached) $ECHO_C" >&6
5059 else
5060
5061         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5062         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5063         for cf_header in $cf_header_list
5064         do
5065
5066         cat >conftest.$ac_ext <<_ACEOF
5067 #line 5067 "configure"
5068 #include "confdefs.h"
5069
5070 #include <$cf_header>
5071 int
5072 main (void)
5073 {
5074
5075 #ifdef NCURSES_VERSION
5076
5077 printf("%s\n", NCURSES_VERSION);
5078 #else
5079 #ifdef __NCURSES_H
5080 printf("old\n");
5081 #else
5082         make an error
5083 #endif
5084 #endif
5085
5086   ;
5087   return 0;
5088 }
5089 _ACEOF
5090 rm -f conftest.$ac_objext
5091 if { (eval echo "$as_me:5091: \"$ac_compile\"") >&5
5092   (eval $ac_compile) 2>&5
5093   ac_status=$?
5094   echo "$as_me:5094: \$? = $ac_status" >&5
5095   (exit $ac_status); } &&
5096          { ac_try='test -s conftest.$ac_objext'
5097   { (eval echo "$as_me:5097: \"$ac_try\"") >&5
5098   (eval $ac_try) 2>&5
5099   ac_status=$?
5100   echo "$as_me:5100: \$? = $ac_status" >&5
5101   (exit $ac_status); }; }; then
5102   cf_cv_ncurses_h=$cf_header
5103
5104 else
5105   echo "$as_me: failed program was:" >&5
5106 cat conftest.$ac_ext >&5
5107 cf_cv_ncurses_h=no
5108 fi
5109 rm -f conftest.$ac_objext conftest.$ac_ext
5110
5111                 test "$cf_cv_ncurses_h" != no && break
5112         done
5113
5114 fi
5115 echo "$as_me:5115: result: $cf_cv_ncurses_h" >&5
5116 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5117
5118 if test "$cf_cv_ncurses_h" != no ; then
5119         cf_cv_ncurses_header=$cf_cv_ncurses_h
5120 else
5121
5122 echo "$as_me:5122: checking for $cf_ncuhdr_root include-path" >&5
5123 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5124 if test "${cf_cv_ncurses_h2+set}" = set; then
5125   echo $ECHO_N "(cached) $ECHO_C" >&6
5126 else
5127
5128         test -n "$verbose" && echo
5129
5130 cf_search=
5131
5132 # collect the current set of include-directories from compiler flags
5133 cf_header_path_list=""
5134 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5135         for cf_header_path in $CPPFLAGS $CFLAGS
5136         do
5137                 case $cf_header_path in
5138                 (-I*)
5139                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5140
5141 test "x$cf_header_path" != "xNONE" && \
5142 test -d "$cf_header_path" && \
5143  {
5144         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5145         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5146         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5147         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5148         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5149         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"
5150 }
5151
5152                         cf_header_path_list="$cf_header_path_list $cf_search"
5153                         ;;
5154                 esac
5155         done
5156 fi
5157
5158 # add the variations for the package we are looking for
5159
5160 cf_search=
5161
5162 test "x$prefix" != "xNONE" && \
5163 test -d "$prefix" && \
5164  {
5165         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5166         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5167         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5168         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5169         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5170         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5171 }
5172
5173 for cf_subdir_prefix in \
5174         /usr \
5175         /usr/local \
5176         /usr/pkg \
5177         /opt \
5178         /opt/local \
5179         $HOME
5180 do
5181
5182 test "x$cf_subdir_prefix" != "x$prefix" && \
5183 test -d "$cf_subdir_prefix" && \
5184 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5185         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5186         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5187         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5188         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5189         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5190         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"
5191 }
5192
5193 done
5194
5195 test "$includedir" != NONE && \
5196 test "$includedir" != "/usr/include" && \
5197 test -d "$includedir" && {
5198         test -d $includedir &&    cf_search="$cf_search $includedir"
5199         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5200 }
5201
5202 test "$oldincludedir" != NONE && \
5203 test "$oldincludedir" != "/usr/include" && \
5204 test -d "$oldincludedir" && {
5205         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5206         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5207 }
5208
5209 cf_search="$cf_search $cf_header_path_list"
5210
5211         test -n "$verbose" && echo search path $cf_search
5212         cf_save2_CPPFLAGS="$CPPFLAGS"
5213         for cf_incdir in $cf_search
5214         do
5215
5216 if test -n "$cf_incdir" ; then
5217   for cf_add_incdir in $cf_incdir
5218   do
5219         while test $cf_add_incdir != /usr/include
5220         do
5221           if test -d $cf_add_incdir
5222           then
5223                 cf_have_incdir=no
5224                 if test -n "$CFLAGS$CPPFLAGS" ; then
5225                   # a loop is needed to ensure we can add subdirs of existing dirs
5226                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5227                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5228                           cf_have_incdir=yes; break
5229                         fi
5230                   done
5231                 fi
5232
5233                 if test "$cf_have_incdir" = no ; then
5234                   if test "$cf_add_incdir" = /usr/local/include ; then
5235                         if test "$GCC" = yes
5236                         then
5237                           cf_save_CPPFLAGS=$CPPFLAGS
5238
5239         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5240         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5241
5242                           cat >conftest.$ac_ext <<_ACEOF
5243 #line 5243 "configure"
5244 #include "confdefs.h"
5245 #include <stdio.h>
5246 int
5247 main (void)
5248 {
5249 printf("Hello")
5250   ;
5251   return 0;
5252 }
5253 _ACEOF
5254 rm -f conftest.$ac_objext
5255 if { (eval echo "$as_me:5255: \"$ac_compile\"") >&5
5256   (eval $ac_compile) 2>&5
5257   ac_status=$?
5258   echo "$as_me:5258: \$? = $ac_status" >&5
5259   (exit $ac_status); } &&
5260          { ac_try='test -s conftest.$ac_objext'
5261   { (eval echo "$as_me:5261: \"$ac_try\"") >&5
5262   (eval $ac_try) 2>&5
5263   ac_status=$?
5264   echo "$as_me:5264: \$? = $ac_status" >&5
5265   (exit $ac_status); }; }; then
5266   :
5267 else
5268   echo "$as_me: failed program was:" >&5
5269 cat conftest.$ac_ext >&5
5270 cf_have_incdir=yes
5271 fi
5272 rm -f conftest.$ac_objext conftest.$ac_ext
5273                           CPPFLAGS=$cf_save_CPPFLAGS
5274                         fi
5275                   fi
5276                 fi
5277
5278                 if test "$cf_have_incdir" = no ; then
5279                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5280
5281 echo "${as_me:-configure}:5281: testing adding $cf_add_incdir to include-path ..." 1>&5
5282
5283                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5284
5285                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5286                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5287                   cf_add_incdir="$cf_top_incdir"
5288                 else
5289                   break
5290                 fi
5291           else
5292                 break
5293           fi
5294         done
5295   done
5296 fi
5297
5298                 for cf_header in \
5299                         ncurses.h \
5300                         curses.h
5301                 do
5302
5303         cat >conftest.$ac_ext <<_ACEOF
5304 #line 5304 "configure"
5305 #include "confdefs.h"
5306
5307 #include <$cf_header>
5308 int
5309 main (void)
5310 {
5311
5312 #ifdef NCURSES_VERSION
5313
5314 printf("%s\n", NCURSES_VERSION);
5315 #else
5316 #ifdef __NCURSES_H
5317 printf("old\n");
5318 #else
5319         make an error
5320 #endif
5321 #endif
5322
5323   ;
5324   return 0;
5325 }
5326 _ACEOF
5327 rm -f conftest.$ac_objext
5328 if { (eval echo "$as_me:5328: \"$ac_compile\"") >&5
5329   (eval $ac_compile) 2>&5
5330   ac_status=$?
5331   echo "$as_me:5331: \$? = $ac_status" >&5
5332   (exit $ac_status); } &&
5333          { ac_try='test -s conftest.$ac_objext'
5334   { (eval echo "$as_me:5334: \"$ac_try\"") >&5
5335   (eval $ac_try) 2>&5
5336   ac_status=$?
5337   echo "$as_me:5337: \$? = $ac_status" >&5
5338   (exit $ac_status); }; }; then
5339   cf_cv_ncurses_h2=$cf_header
5340
5341 else
5342   echo "$as_me: failed program was:" >&5
5343 cat conftest.$ac_ext >&5
5344 cf_cv_ncurses_h2=no
5345 fi
5346 rm -f conftest.$ac_objext conftest.$ac_ext
5347
5348                         if test "$cf_cv_ncurses_h2" != no ; then
5349                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5350                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5351                                 break
5352                         fi
5353                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5354                 done
5355                 CPPFLAGS="$cf_save2_CPPFLAGS"
5356                 test "$cf_cv_ncurses_h2" != no && break
5357         done
5358         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5358: error: not found" >&5
5359 echo "$as_me: error: not found" >&2;}
5360    { (exit 1); exit 1; }; }
5361
5362 fi
5363 echo "$as_me:5363: result: $cf_cv_ncurses_h2" >&5
5364 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5365
5366         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5367         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5368         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5369                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5370         fi
5371
5372 if test -n "$cf_1st_incdir" ; then
5373   for cf_add_incdir in $cf_1st_incdir
5374   do
5375         while test $cf_add_incdir != /usr/include
5376         do
5377           if test -d $cf_add_incdir
5378           then
5379                 cf_have_incdir=no
5380                 if test -n "$CFLAGS$CPPFLAGS" ; then
5381                   # a loop is needed to ensure we can add subdirs of existing dirs
5382                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5383                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5384                           cf_have_incdir=yes; break
5385                         fi
5386                   done
5387                 fi
5388
5389                 if test "$cf_have_incdir" = no ; then
5390                   if test "$cf_add_incdir" = /usr/local/include ; then
5391                         if test "$GCC" = yes
5392                         then
5393                           cf_save_CPPFLAGS=$CPPFLAGS
5394
5395         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5396         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5397
5398                           cat >conftest.$ac_ext <<_ACEOF
5399 #line 5399 "configure"
5400 #include "confdefs.h"
5401 #include <stdio.h>
5402 int
5403 main (void)
5404 {
5405 printf("Hello")
5406   ;
5407   return 0;
5408 }
5409 _ACEOF
5410 rm -f conftest.$ac_objext
5411 if { (eval echo "$as_me:5411: \"$ac_compile\"") >&5
5412   (eval $ac_compile) 2>&5
5413   ac_status=$?
5414   echo "$as_me:5414: \$? = $ac_status" >&5
5415   (exit $ac_status); } &&
5416          { ac_try='test -s conftest.$ac_objext'
5417   { (eval echo "$as_me:5417: \"$ac_try\"") >&5
5418   (eval $ac_try) 2>&5
5419   ac_status=$?
5420   echo "$as_me:5420: \$? = $ac_status" >&5
5421   (exit $ac_status); }; }; then
5422   :
5423 else
5424   echo "$as_me: failed program was:" >&5
5425 cat conftest.$ac_ext >&5
5426 cf_have_incdir=yes
5427 fi
5428 rm -f conftest.$ac_objext conftest.$ac_ext
5429                           CPPFLAGS=$cf_save_CPPFLAGS
5430                         fi
5431                   fi
5432                 fi
5433
5434                 if test "$cf_have_incdir" = no ; then
5435                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5436
5437 echo "${as_me:-configure}:5437: testing adding $cf_add_incdir to include-path ..." 1>&5
5438
5439                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5440
5441                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5442                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5443                   cf_add_incdir="$cf_top_incdir"
5444                 else
5445                   break
5446                 fi
5447           else
5448                 break
5449           fi
5450         done
5451   done
5452 fi
5453
5454 fi
5455
5456 # Set definitions to allow ifdef'ing for ncurses.h
5457
5458 case $cf_cv_ncurses_header in
5459 (*ncurses.h)
5460
5461 cat >>confdefs.h <<\EOF
5462 #define HAVE_NCURSES_H 1
5463 EOF
5464
5465         ;;
5466 esac
5467
5468 case $cf_cv_ncurses_header in
5469 (ncurses/curses.h|ncurses/ncurses.h)
5470
5471 cat >>confdefs.h <<\EOF
5472 #define HAVE_NCURSES_NCURSES_H 1
5473 EOF
5474
5475         ;;
5476 (ncursesw/curses.h|ncursesw/ncurses.h)
5477
5478 cat >>confdefs.h <<\EOF
5479 #define HAVE_NCURSESW_NCURSES_H 1
5480 EOF
5481
5482         ;;
5483 esac
5484
5485 echo "$as_me:5485: checking for terminfo header" >&5
5486 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5487 if test "${cf_cv_term_header+set}" = set; then
5488   echo $ECHO_N "(cached) $ECHO_C" >&6
5489 else
5490
5491 case ${cf_cv_ncurses_header} in
5492 (*/ncurses.h|*/ncursesw.h)
5493         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5494         ;;
5495 (*)
5496         cf_term_header=term.h
5497         ;;
5498 esac
5499
5500 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5501 do
5502 cat >conftest.$ac_ext <<_ACEOF
5503 #line 5503 "configure"
5504 #include "confdefs.h"
5505 #include <stdio.h>
5506 #include <${cf_cv_ncurses_header:-curses.h}>
5507 #include <$cf_test>
5508
5509 int
5510 main (void)
5511 {
5512 int x = auto_left_margin; (void)x
5513   ;
5514   return 0;
5515 }
5516 _ACEOF
5517 rm -f conftest.$ac_objext
5518 if { (eval echo "$as_me:5518: \"$ac_compile\"") >&5
5519   (eval $ac_compile) 2>&5
5520   ac_status=$?
5521   echo "$as_me:5521: \$? = $ac_status" >&5
5522   (exit $ac_status); } &&
5523          { ac_try='test -s conftest.$ac_objext'
5524   { (eval echo "$as_me:5524: \"$ac_try\"") >&5
5525   (eval $ac_try) 2>&5
5526   ac_status=$?
5527   echo "$as_me:5527: \$? = $ac_status" >&5
5528   (exit $ac_status); }; }; then
5529
5530         cf_cv_term_header="$cf_test"
5531 else
5532   echo "$as_me: failed program was:" >&5
5533 cat conftest.$ac_ext >&5
5534
5535         cf_cv_term_header=unknown
5536
5537 fi
5538 rm -f conftest.$ac_objext conftest.$ac_ext
5539         test "$cf_cv_term_header" != unknown && break
5540 done
5541
5542 fi
5543 echo "$as_me:5543: result: $cf_cv_term_header" >&5
5544 echo "${ECHO_T}$cf_cv_term_header" >&6
5545
5546 # Set definitions to allow ifdef'ing to accommodate subdirectories
5547
5548 case $cf_cv_term_header in
5549 (*term.h)
5550
5551 cat >>confdefs.h <<\EOF
5552 #define HAVE_TERM_H 1
5553 EOF
5554
5555         ;;
5556 esac
5557
5558 case $cf_cv_term_header in
5559 (ncurses/term.h)
5560
5561 cat >>confdefs.h <<\EOF
5562 #define HAVE_NCURSES_TERM_H 1
5563 EOF
5564
5565         ;;
5566 (ncursesw/term.h)
5567
5568 cat >>confdefs.h <<\EOF
5569 #define HAVE_NCURSESW_TERM_H 1
5570 EOF
5571
5572         ;;
5573 esac
5574
5575 # some applications need this, but should check for NCURSES_VERSION
5576
5577 cat >>confdefs.h <<\EOF
5578 #define NCURSES 1
5579 EOF
5580
5581 echo "$as_me:5581: checking for ncurses version" >&5
5582 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5583 if test "${cf_cv_ncurses_version+set}" = set; then
5584   echo $ECHO_N "(cached) $ECHO_C" >&6
5585 else
5586
5587         cf_cv_ncurses_version=no
5588         cf_tempfile=out$$
5589         rm -f $cf_tempfile
5590         if test "$cross_compiling" = yes; then
5591
5592         # This will not work if the preprocessor splits the line after the
5593         # Autoconf token.  The 'unproto' program does that.
5594         cat > conftest.$ac_ext <<EOF
5595 #include <${cf_cv_ncurses_header:-curses.h}>
5596 #undef Autoconf
5597 #ifdef NCURSES_VERSION
5598 Autoconf NCURSES_VERSION
5599 #else
5600 #ifdef __NCURSES_H
5601 Autoconf "old"
5602 #endif
5603 ;
5604 #endif
5605 EOF
5606         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5607         { (eval echo "$as_me:5607: \"$cf_try\"") >&5
5608   (eval $cf_try) 2>&5
5609   ac_status=$?
5610   echo "$as_me:5610: \$? = $ac_status" >&5
5611   (exit $ac_status); }
5612         if test -f conftest.out ; then
5613                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5614                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5615                 rm -f conftest.out
5616         fi
5617
5618 else
5619   cat >conftest.$ac_ext <<_ACEOF
5620 #line 5620 "configure"
5621 #include "confdefs.h"
5622
5623 #include <${cf_cv_ncurses_header:-curses.h}>
5624 #include <stdio.h>
5625 int main(void)
5626 {
5627         FILE *fp = fopen("$cf_tempfile", "w");
5628 #ifdef NCURSES_VERSION
5629 # ifdef NCURSES_VERSION_PATCH
5630         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5631 # else
5632         fprintf(fp, "%s\n", NCURSES_VERSION);
5633 # endif
5634 #else
5635 # ifdef __NCURSES_H
5636         fprintf(fp, "old\n");
5637 # else
5638         make an error
5639 # endif
5640 #endif
5641         ${cf_cv_main_return:-return}(0);
5642 }
5643 _ACEOF
5644 rm -f conftest$ac_exeext
5645 if { (eval echo "$as_me:5645: \"$ac_link\"") >&5
5646   (eval $ac_link) 2>&5
5647   ac_status=$?
5648   echo "$as_me:5648: \$? = $ac_status" >&5
5649   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5650   { (eval echo "$as_me:5650: \"$ac_try\"") >&5
5651   (eval $ac_try) 2>&5
5652   ac_status=$?
5653   echo "$as_me:5653: \$? = $ac_status" >&5
5654   (exit $ac_status); }; }; then
5655
5656         cf_cv_ncurses_version=`cat $cf_tempfile`
5657 else
5658   echo "$as_me: program exited with status $ac_status" >&5
5659 echo "$as_me: failed program was:" >&5
5660 cat conftest.$ac_ext >&5
5661 fi
5662 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5663 fi
5664         rm -f $cf_tempfile
5665
5666 fi
5667 echo "$as_me:5667: result: $cf_cv_ncurses_version" >&5
5668 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5669 test "$cf_cv_ncurses_version" = no ||
5670 cat >>confdefs.h <<\EOF
5671 #define NCURSES 1
5672 EOF
5673
5674 cf_nculib_root=ncurses
5675         # This works, except for the special case where we find gpm, but
5676         # ncurses is in a nonstandard location via $LIBS, and we really want
5677         # to link gpm.
5678 cf_ncurses_LIBS=""
5679 cf_ncurses_SAVE="$LIBS"
5680 echo "$as_me:5680: checking for Gpm_Open in -lgpm" >&5
5681 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5682 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5683   echo $ECHO_N "(cached) $ECHO_C" >&6
5684 else
5685   ac_check_lib_save_LIBS=$LIBS
5686 LIBS="-lgpm  $LIBS"
5687 cat >conftest.$ac_ext <<_ACEOF
5688 #line 5688 "configure"
5689 #include "confdefs.h"
5690
5691 /* Override any gcc2 internal prototype to avoid an error.  */
5692 #ifdef __cplusplus
5693 extern "C"
5694 #endif
5695 /* We use char because int might match the return type of a gcc2
5696    builtin and then its argument prototype would still apply.  */
5697 char Gpm_Open ();
5698 int
5699 main (void)
5700 {
5701 Gpm_Open ();
5702   ;
5703   return 0;
5704 }
5705 _ACEOF
5706 rm -f conftest.$ac_objext conftest$ac_exeext
5707 if { (eval echo "$as_me:5707: \"$ac_link\"") >&5
5708   (eval $ac_link) 2>&5
5709   ac_status=$?
5710   echo "$as_me:5710: \$? = $ac_status" >&5
5711   (exit $ac_status); } &&
5712          { ac_try='test -s conftest$ac_exeext'
5713   { (eval echo "$as_me:5713: \"$ac_try\"") >&5
5714   (eval $ac_try) 2>&5
5715   ac_status=$?
5716   echo "$as_me:5716: \$? = $ac_status" >&5
5717   (exit $ac_status); }; }; then
5718   ac_cv_lib_gpm_Gpm_Open=yes
5719 else
5720   echo "$as_me: failed program was:" >&5
5721 cat conftest.$ac_ext >&5
5722 ac_cv_lib_gpm_Gpm_Open=no
5723 fi
5724 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5725 LIBS=$ac_check_lib_save_LIBS
5726 fi
5727 echo "$as_me:5727: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5728 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5729 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5730   echo "$as_me:5730: checking for initscr in -lgpm" >&5
5731 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5732 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5733   echo $ECHO_N "(cached) $ECHO_C" >&6
5734 else
5735   ac_check_lib_save_LIBS=$LIBS
5736 LIBS="-lgpm  $LIBS"
5737 cat >conftest.$ac_ext <<_ACEOF
5738 #line 5738 "configure"
5739 #include "confdefs.h"
5740
5741 /* Override any gcc2 internal prototype to avoid an error.  */
5742 #ifdef __cplusplus
5743 extern "C"
5744 #endif
5745 /* We use char because int might match the return type of a gcc2
5746    builtin and then its argument prototype would still apply.  */
5747 char initscr ();
5748 int
5749 main (void)
5750 {
5751 initscr ();
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext conftest$ac_exeext
5757 if { (eval echo "$as_me:5757: \"$ac_link\"") >&5
5758   (eval $ac_link) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest$ac_exeext'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit $ac_status); }; }; then
5768   ac_cv_lib_gpm_initscr=yes
5769 else
5770   echo "$as_me: failed program was:" >&5
5771 cat conftest.$ac_ext >&5
5772 ac_cv_lib_gpm_initscr=no
5773 fi
5774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5775 LIBS=$ac_check_lib_save_LIBS
5776 fi
5777 echo "$as_me:5777: result: $ac_cv_lib_gpm_initscr" >&5
5778 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5779 if test $ac_cv_lib_gpm_initscr = yes; then
5780   LIBS="$cf_ncurses_SAVE"
5781 else
5782   cf_ncurses_LIBS="-lgpm"
5783 fi
5784
5785 fi
5786
5787 case $host_os in
5788 (freebsd*)
5789         # This is only necessary if you are linking against an obsolete
5790         # version of ncurses (but it should do no harm, since it's static).
5791         if test "$cf_nculib_root" = ncurses ; then
5792                 echo "$as_me:5792: checking for tgoto in -lmytinfo" >&5
5793 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5794 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5795   echo $ECHO_N "(cached) $ECHO_C" >&6
5796 else
5797   ac_check_lib_save_LIBS=$LIBS
5798 LIBS="-lmytinfo  $LIBS"
5799 cat >conftest.$ac_ext <<_ACEOF
5800 #line 5800 "configure"
5801 #include "confdefs.h"
5802
5803 /* Override any gcc2 internal prototype to avoid an error.  */
5804 #ifdef __cplusplus
5805 extern "C"
5806 #endif
5807 /* We use char because int might match the return type of a gcc2
5808    builtin and then its argument prototype would still apply.  */
5809 char tgoto ();
5810 int
5811 main (void)
5812 {
5813 tgoto ();
5814   ;
5815   return 0;
5816 }
5817 _ACEOF
5818 rm -f conftest.$ac_objext conftest$ac_exeext
5819 if { (eval echo "$as_me:5819: \"$ac_link\"") >&5
5820   (eval $ac_link) 2>&5
5821   ac_status=$?
5822   echo "$as_me:5822: \$? = $ac_status" >&5
5823   (exit $ac_status); } &&
5824          { ac_try='test -s conftest$ac_exeext'
5825   { (eval echo "$as_me:5825: \"$ac_try\"") >&5
5826   (eval $ac_try) 2>&5
5827   ac_status=$?
5828   echo "$as_me:5828: \$? = $ac_status" >&5
5829   (exit $ac_status); }; }; then
5830   ac_cv_lib_mytinfo_tgoto=yes
5831 else
5832   echo "$as_me: failed program was:" >&5
5833 cat conftest.$ac_ext >&5
5834 ac_cv_lib_mytinfo_tgoto=no
5835 fi
5836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5837 LIBS=$ac_check_lib_save_LIBS
5838 fi
5839 echo "$as_me:5839: result: $ac_cv_lib_mytinfo_tgoto" >&5
5840 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5841 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5842   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5843 fi
5844
5845         fi
5846         ;;
5847 esac
5848
5849 cf_add_libs="$LIBS"
5850 # reverse order
5851 cf_add_0lib=
5852 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5853 # filter duplicates
5854 for cf_add_1lib in $cf_add_0lib; do
5855         for cf_add_2lib in $cf_add_libs; do
5856                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5857                         cf_add_1lib=
5858                         break
5859                 fi
5860         done
5861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5862 done
5863 LIBS="$cf_add_libs"
5864
5865 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5866 then
5867
5868 cf_add_libs="$LIBS"
5869 # reverse order
5870 cf_add_0lib=
5871 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5872 # filter duplicates
5873 for cf_add_1lib in $cf_add_0lib; do
5874         for cf_add_2lib in $cf_add_libs; do
5875                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5876                         cf_add_1lib=
5877                         break
5878                 fi
5879         done
5880         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5881 done
5882 LIBS="$cf_add_libs"
5883
5884 else
5885
5886         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5887         cf_libdir=""
5888         echo "$as_me:5888: checking for initscr" >&5
5889 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5890 if test "${ac_cv_func_initscr+set}" = set; then
5891   echo $ECHO_N "(cached) $ECHO_C" >&6
5892 else
5893   cat >conftest.$ac_ext <<_ACEOF
5894 #line 5894 "configure"
5895 #include "confdefs.h"
5896 #define initscr autoconf_temporary
5897 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5898 #undef initscr
5899
5900 #ifdef __cplusplus
5901 extern "C"
5902 #endif
5903
5904 /* We use char because int might match the return type of a gcc2
5905    builtin and then its argument prototype would still apply.  */
5906 char initscr (void);
5907
5908 int
5909 main (void)
5910 {
5911
5912 /* The GNU C library defines stubs for functions which it implements
5913     to always fail with ENOSYS.  Some functions are actually named
5914     something starting with __ and the normal name is an alias.  */
5915 #if defined (__stub_initscr) || defined (__stub___initscr)
5916 #error found stub for initscr
5917 #endif
5918
5919         return initscr ();
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f conftest.$ac_objext conftest$ac_exeext
5925 if { (eval echo "$as_me:5925: \"$ac_link\"") >&5
5926   (eval $ac_link) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); } &&
5930          { ac_try='test -s conftest$ac_exeext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936   ac_cv_func_initscr=yes
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat conftest.$ac_ext >&5
5940 ac_cv_func_initscr=no
5941 fi
5942 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5943 fi
5944 echo "$as_me:5944: result: $ac_cv_func_initscr" >&5
5945 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5946 if test $ac_cv_func_initscr = yes; then
5947   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5948 else
5949
5950                 cf_save_LIBS="$LIBS"
5951                 echo "$as_me:5951: checking for initscr in -l$cf_nculib_root" >&5
5952 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5953                 LIBS="-l$cf_nculib_root $LIBS"
5954                 cat >conftest.$ac_ext <<_ACEOF
5955 #line 5955 "configure"
5956 #include "confdefs.h"
5957 #include <${cf_cv_ncurses_header:-curses.h}>
5958 int
5959 main (void)
5960 {
5961 initscr()
5962   ;
5963   return 0;
5964 }
5965 _ACEOF
5966 rm -f conftest.$ac_objext conftest$ac_exeext
5967 if { (eval echo "$as_me:5967: \"$ac_link\"") >&5
5968   (eval $ac_link) 2>&5
5969   ac_status=$?
5970   echo "$as_me:5970: \$? = $ac_status" >&5
5971   (exit $ac_status); } &&
5972          { ac_try='test -s conftest$ac_exeext'
5973   { (eval echo "$as_me:5973: \"$ac_try\"") >&5
5974   (eval $ac_try) 2>&5
5975   ac_status=$?
5976   echo "$as_me:5976: \$? = $ac_status" >&5
5977   (exit $ac_status); }; }; then
5978   echo "$as_me:5978: result: yes" >&5
5979 echo "${ECHO_T}yes" >&6
5980                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5981
5982 else
5983   echo "$as_me: failed program was:" >&5
5984 cat conftest.$ac_ext >&5
5985 echo "$as_me:5985: result: no" >&5
5986 echo "${ECHO_T}no" >&6
5987
5988 cf_search=
5989 cf_library_path_list=""
5990 if test -n "${LDFLAGS}${LIBS}" ; then
5991         for cf_library_path in $LDFLAGS $LIBS
5992         do
5993                 case $cf_library_path in
5994                 (-L*)
5995                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5996
5997 test "x$cf_library_path" != "xNONE" && \
5998 test -d "$cf_library_path" && \
5999  {
6000         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6001         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6002         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6003         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6004         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6005         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"
6006 }
6007
6008                         cf_library_path_list="$cf_library_path_list $cf_search"
6009                         ;;
6010                 esac
6011         done
6012 fi
6013
6014 cf_search=
6015
6016 test "x$prefix" != "xNONE" && \
6017 test -d "$prefix" && \
6018  {
6019         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6020         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6021         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6022         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6023         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6024         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6025 }
6026
6027 for cf_subdir_prefix in \
6028         /usr \
6029         /usr/local \
6030         /usr/pkg \
6031         /opt \
6032         /opt/local \
6033         $HOME
6034 do
6035
6036 test "x$cf_subdir_prefix" != "x$prefix" && \
6037 test -d "$cf_subdir_prefix" && \
6038 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6039         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6040         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6041         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6042         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6043         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6044         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"
6045 }
6046
6047 done
6048
6049 cf_search="$cf_library_path_list $cf_search"
6050
6051                         for cf_libdir in $cf_search
6052                         do
6053                                 echo "$as_me:6053: checking for -l$cf_nculib_root in $cf_libdir" >&5
6054 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6055                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6056                                 cat >conftest.$ac_ext <<_ACEOF
6057 #line 6057 "configure"
6058 #include "confdefs.h"
6059 #include <${cf_cv_ncurses_header:-curses.h}>
6060 int
6061 main (void)
6062 {
6063 initscr()
6064   ;
6065   return 0;
6066 }
6067 _ACEOF
6068 rm -f conftest.$ac_objext conftest$ac_exeext
6069 if { (eval echo "$as_me:6069: \"$ac_link\"") >&5
6070   (eval $ac_link) 2>&5
6071   ac_status=$?
6072   echo "$as_me:6072: \$? = $ac_status" >&5
6073   (exit $ac_status); } &&
6074          { ac_try='test -s conftest$ac_exeext'
6075   { (eval echo "$as_me:6075: \"$ac_try\"") >&5
6076   (eval $ac_try) 2>&5
6077   ac_status=$?
6078   echo "$as_me:6078: \$? = $ac_status" >&5
6079   (exit $ac_status); }; }; then
6080   echo "$as_me:6080: result: yes" >&5
6081 echo "${ECHO_T}yes" >&6
6082                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6083                                          break
6084 else
6085   echo "$as_me: failed program was:" >&5
6086 cat conftest.$ac_ext >&5
6087 echo "$as_me:6087: result: no" >&5
6088 echo "${ECHO_T}no" >&6
6089                                          LIBS="$cf_save_LIBS"
6090 fi
6091 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6092                         done
6093
6094 fi
6095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6096
6097 fi
6098
6099 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6100
6101 if test $cf_found_library = no ; then
6102         { { echo "$as_me:6102: error: Cannot link $cf_nculib_root library" >&5
6103 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6104    { (exit 1); exit 1; }; }
6105 fi
6106
6107 fi
6108
6109 if test -n "$cf_ncurses_LIBS" ; then
6110         echo "$as_me:6110: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6111 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6112         cf_ncurses_SAVE="$LIBS"
6113         for p in $cf_ncurses_LIBS ; do
6114                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6115                 if test "$q" != "$LIBS" ; then
6116                         LIBS="$q"
6117                 fi
6118         done
6119         cat >conftest.$ac_ext <<_ACEOF
6120 #line 6120 "configure"
6121 #include "confdefs.h"
6122 #include <${cf_cv_ncurses_header:-curses.h}>
6123 int
6124 main (void)
6125 {
6126 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6127   ;
6128   return 0;
6129 }
6130 _ACEOF
6131 rm -f conftest.$ac_objext conftest$ac_exeext
6132 if { (eval echo "$as_me:6132: \"$ac_link\"") >&5
6133   (eval $ac_link) 2>&5
6134   ac_status=$?
6135   echo "$as_me:6135: \$? = $ac_status" >&5
6136   (exit $ac_status); } &&
6137          { ac_try='test -s conftest$ac_exeext'
6138   { (eval echo "$as_me:6138: \"$ac_try\"") >&5
6139   (eval $ac_try) 2>&5
6140   ac_status=$?
6141   echo "$as_me:6141: \$? = $ac_status" >&5
6142   (exit $ac_status); }; }; then
6143   echo "$as_me:6143: result: yes" >&5
6144 echo "${ECHO_T}yes" >&6
6145 else
6146   echo "$as_me: failed program was:" >&5
6147 cat conftest.$ac_ext >&5
6148 echo "$as_me:6148: result: no" >&5
6149 echo "${ECHO_T}no" >&6
6150                  LIBS="$cf_ncurses_SAVE"
6151 fi
6152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6153 fi
6154
6155 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6156
6157 cat >>confdefs.h <<EOF
6158 #define $cf_nculib_ROOT 1
6159 EOF
6160
6161         fi
6162 else
6163         NCURSES_CONFIG=none
6164 fi
6165
6166 echo "$as_me:6166: checking if you want wide-character code" >&5
6167 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6168
6169 # Check whether --enable-widec or --disable-widec was given.
6170 if test "${enable_widec+set}" = set; then
6171   enableval="$enable_widec"
6172   with_widec=$enableval
6173 else
6174   with_widec=no
6175 fi;
6176 echo "$as_me:6176: result: $with_widec" >&5
6177 echo "${ECHO_T}$with_widec" >&6
6178 if test "$with_widec" = yes ; then
6179
6180 echo "$as_me:6180: checking for multibyte character support" >&5
6181 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6182 if test "${cf_cv_utf8_lib+set}" = set; then
6183   echo $ECHO_N "(cached) $ECHO_C" >&6
6184 else
6185
6186         cf_save_LIBS="$LIBS"
6187         cat >conftest.$ac_ext <<_ACEOF
6188 #line 6188 "configure"
6189 #include "confdefs.h"
6190
6191 #include <stdlib.h>
6192 int
6193 main (void)
6194 {
6195 putwc(0,0);
6196   ;
6197   return 0;
6198 }
6199 _ACEOF
6200 rm -f conftest.$ac_objext conftest$ac_exeext
6201 if { (eval echo "$as_me:6201: \"$ac_link\"") >&5
6202   (eval $ac_link) 2>&5
6203   ac_status=$?
6204   echo "$as_me:6204: \$? = $ac_status" >&5
6205   (exit $ac_status); } &&
6206          { ac_try='test -s conftest$ac_exeext'
6207   { (eval echo "$as_me:6207: \"$ac_try\"") >&5
6208   (eval $ac_try) 2>&5
6209   ac_status=$?
6210   echo "$as_me:6210: \$? = $ac_status" >&5
6211   (exit $ac_status); }; }; then
6212   cf_cv_utf8_lib=yes
6213 else
6214   echo "$as_me: failed program was:" >&5
6215 cat conftest.$ac_ext >&5
6216
6217 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6218 # will be set on completion of the AC_TRY_LINK below.
6219 cf_cv_header_path_utf8=
6220 cf_cv_library_path_utf8=
6221
6222 echo "${as_me:-configure}:6222: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6223
6224 cf_save_LIBS="$LIBS"
6225
6226 cat >conftest.$ac_ext <<_ACEOF
6227 #line 6227 "configure"
6228 #include "confdefs.h"
6229
6230 #include <libutf8.h>
6231 int
6232 main (void)
6233 {
6234 putwc(0,0);
6235   ;
6236   return 0;
6237 }
6238 _ACEOF
6239 rm -f conftest.$ac_objext conftest$ac_exeext
6240 if { (eval echo "$as_me:6240: \"$ac_link\"") >&5
6241   (eval $ac_link) 2>&5
6242   ac_status=$?
6243   echo "$as_me:6243: \$? = $ac_status" >&5
6244   (exit $ac_status); } &&
6245          { ac_try='test -s conftest$ac_exeext'
6246   { (eval echo "$as_me:6246: \"$ac_try\"") >&5
6247   (eval $ac_try) 2>&5
6248   ac_status=$?
6249   echo "$as_me:6249: \$? = $ac_status" >&5
6250   (exit $ac_status); }; }; then
6251
6252         cf_cv_find_linkage_utf8=yes
6253         cf_cv_header_path_utf8=/usr/include
6254         cf_cv_library_path_utf8=/usr/lib
6255
6256 else
6257   echo "$as_me: failed program was:" >&5
6258 cat conftest.$ac_ext >&5
6259
6260 LIBS="-lutf8  $cf_save_LIBS"
6261
6262 cat >conftest.$ac_ext <<_ACEOF
6263 #line 6263 "configure"
6264 #include "confdefs.h"
6265
6266 #include <libutf8.h>
6267 int
6268 main (void)
6269 {
6270 putwc(0,0);
6271   ;
6272   return 0;
6273 }
6274 _ACEOF
6275 rm -f conftest.$ac_objext conftest$ac_exeext
6276 if { (eval echo "$as_me:6276: \"$ac_link\"") >&5
6277   (eval $ac_link) 2>&5
6278   ac_status=$?
6279   echo "$as_me:6279: \$? = $ac_status" >&5
6280   (exit $ac_status); } &&
6281          { ac_try='test -s conftest$ac_exeext'
6282   { (eval echo "$as_me:6282: \"$ac_try\"") >&5
6283   (eval $ac_try) 2>&5
6284   ac_status=$?
6285   echo "$as_me:6285: \$? = $ac_status" >&5
6286   (exit $ac_status); }; }; then
6287
6288         cf_cv_find_linkage_utf8=yes
6289         cf_cv_header_path_utf8=/usr/include
6290         cf_cv_library_path_utf8=/usr/lib
6291         cf_cv_library_file_utf8="-lutf8"
6292
6293 else
6294   echo "$as_me: failed program was:" >&5
6295 cat conftest.$ac_ext >&5
6296
6297         cf_cv_find_linkage_utf8=no
6298         LIBS="$cf_save_LIBS"
6299
6300         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6301
6302 echo "${as_me:-configure}:6302: testing find linkage for utf8 library ..." 1>&5
6303
6304 echo "${as_me:-configure}:6304: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6305
6306         cf_save_CPPFLAGS="$CPPFLAGS"
6307         cf_test_CPPFLAGS="$CPPFLAGS"
6308
6309 cf_search=
6310
6311 # collect the current set of include-directories from compiler flags
6312 cf_header_path_list=""
6313 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6314         for cf_header_path in $CPPFLAGS $CFLAGS
6315         do
6316                 case $cf_header_path in
6317                 (-I*)
6318                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6319
6320 test "x$cf_header_path" != "xNONE" && \
6321 test -d "$cf_header_path" && \
6322  {
6323         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6324         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6325         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6326         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6327         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6328         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6329 }
6330
6331                         cf_header_path_list="$cf_header_path_list $cf_search"
6332                         ;;
6333                 esac
6334         done
6335 fi
6336
6337 # add the variations for the package we are looking for
6338
6339 cf_search=
6340
6341 test "x$prefix" != "xNONE" && \
6342 test -d "$prefix" && \
6343  {
6344         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6345         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6346         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6347         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6348         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6349         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6350 }
6351
6352 for cf_subdir_prefix in \
6353         /usr \
6354         /usr/local \
6355         /usr/pkg \
6356         /opt \
6357         /opt/local \
6358         $HOME
6359 do
6360
6361 test "x$cf_subdir_prefix" != "x$prefix" && \
6362 test -d "$cf_subdir_prefix" && \
6363 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6364         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6365         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6366         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6367         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6368         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6369         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6370 }
6371
6372 done
6373
6374 test "$includedir" != NONE && \
6375 test "$includedir" != "/usr/include" && \
6376 test -d "$includedir" && {
6377         test -d $includedir &&    cf_search="$cf_search $includedir"
6378         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6379 }
6380
6381 test "$oldincludedir" != NONE && \
6382 test "$oldincludedir" != "/usr/include" && \
6383 test -d "$oldincludedir" && {
6384         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6385         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6386 }
6387
6388 cf_search="$cf_search $cf_header_path_list"
6389
6390         for cf_cv_header_path_utf8 in $cf_search
6391         do
6392                 if test -d $cf_cv_header_path_utf8 ; then
6393                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6394
6395 echo "${as_me:-configure}:6395: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6396
6397                         CPPFLAGS="$cf_save_CPPFLAGS"
6398
6399         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6400         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6401
6402                         cat >conftest.$ac_ext <<_ACEOF
6403 #line 6403 "configure"
6404 #include "confdefs.h"
6405
6406 #include <libutf8.h>
6407 int
6408 main (void)
6409 {
6410 putwc(0,0);
6411   ;
6412   return 0;
6413 }
6414 _ACEOF
6415 rm -f conftest.$ac_objext
6416 if { (eval echo "$as_me:6416: \"$ac_compile\"") >&5
6417   (eval $ac_compile) 2>&5
6418   ac_status=$?
6419   echo "$as_me:6419: \$? = $ac_status" >&5
6420   (exit $ac_status); } &&
6421          { ac_try='test -s conftest.$ac_objext'
6422   { (eval echo "$as_me:6422: \"$ac_try\"") >&5
6423   (eval $ac_try) 2>&5
6424   ac_status=$?
6425   echo "$as_me:6425: \$? = $ac_status" >&5
6426   (exit $ac_status); }; }; then
6427
6428                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6429
6430 echo "${as_me:-configure}:6430: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6431
6432                                 cf_cv_find_linkage_utf8=maybe
6433                                 cf_test_CPPFLAGS="$CPPFLAGS"
6434                                 break
6435 else
6436   echo "$as_me: failed program was:" >&5
6437 cat conftest.$ac_ext >&5
6438
6439                                 CPPFLAGS="$cf_save_CPPFLAGS"
6440
6441 fi
6442 rm -f conftest.$ac_objext conftest.$ac_ext
6443                 fi
6444         done
6445
6446         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6447
6448 echo "${as_me:-configure}:6448: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6449
6450                 cf_save_LIBS="$LIBS"
6451                 cf_save_LDFLAGS="$LDFLAGS"
6452
6453                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6454
6455 cf_search=
6456 cf_library_path_list=""
6457 if test -n "${LDFLAGS}${LIBS}" ; then
6458         for cf_library_path in $LDFLAGS $LIBS
6459         do
6460                 case $cf_library_path in
6461                 (-L*)
6462                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6463
6464 test "x$cf_library_path" != "xNONE" && \
6465 test -d "$cf_library_path" && \
6466  {
6467         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6468         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6469         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6470         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6471         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6472         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6473 }
6474
6475                         cf_library_path_list="$cf_library_path_list $cf_search"
6476                         ;;
6477                 esac
6478         done
6479 fi
6480
6481 cf_search=
6482
6483 test "x$prefix" != "xNONE" && \
6484 test -d "$prefix" && \
6485  {
6486         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6487         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6488         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6489         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6490         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6491         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6492 }
6493
6494 for cf_subdir_prefix in \
6495         /usr \
6496         /usr/local \
6497         /usr/pkg \
6498         /opt \
6499         /opt/local \
6500         $HOME
6501 do
6502
6503 test "x$cf_subdir_prefix" != "x$prefix" && \
6504 test -d "$cf_subdir_prefix" && \
6505 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6506         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6507         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6508         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6509         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6510         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6511         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6512 }
6513
6514 done
6515
6516 cf_search="$cf_library_path_list $cf_search"
6517
6518                         for cf_cv_library_path_utf8 in $cf_search
6519                         do
6520                                 if test -d $cf_cv_library_path_utf8 ; then
6521                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6522
6523 echo "${as_me:-configure}:6523: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6524
6525                                         CPPFLAGS="$cf_test_CPPFLAGS"
6526                                         LIBS="-lutf8  $cf_save_LIBS"
6527                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6528                                         cat >conftest.$ac_ext <<_ACEOF
6529 #line 6529 "configure"
6530 #include "confdefs.h"
6531
6532 #include <libutf8.h>
6533 int
6534 main (void)
6535 {
6536 putwc(0,0);
6537   ;
6538   return 0;
6539 }
6540 _ACEOF
6541 rm -f conftest.$ac_objext conftest$ac_exeext
6542 if { (eval echo "$as_me:6542: \"$ac_link\"") >&5
6543   (eval $ac_link) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); } &&
6547          { ac_try='test -s conftest$ac_exeext'
6548   { (eval echo "$as_me:6548: \"$ac_try\"") >&5
6549   (eval $ac_try) 2>&5
6550   ac_status=$?
6551   echo "$as_me:6551: \$? = $ac_status" >&5
6552   (exit $ac_status); }; }; then
6553
6554                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6555
6556 echo "${as_me:-configure}:6556: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6557
6558                                         cf_cv_find_linkage_utf8=yes
6559                                         cf_cv_library_file_utf8="-lutf8"
6560                                         break
6561 else
6562   echo "$as_me: failed program was:" >&5
6563 cat conftest.$ac_ext >&5
6564
6565                                         CPPFLAGS="$cf_save_CPPFLAGS"
6566                                         LIBS="$cf_save_LIBS"
6567                                         LDFLAGS="$cf_save_LDFLAGS"
6568
6569 fi
6570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6571                                 fi
6572                         done
6573                         CPPFLAGS="$cf_save_CPPFLAGS"
6574                         LDFLAGS="$cf_save_LDFLAGS"
6575                 fi
6576
6577         else
6578                 cf_cv_find_linkage_utf8=no
6579         fi
6580
6581 fi
6582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6583
6584 fi
6585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6586
6587 LIBS="$cf_save_LIBS"
6588
6589 if test "$cf_cv_find_linkage_utf8" = yes ; then
6590 cf_cv_utf8_lib=add-on
6591 else
6592 cf_cv_utf8_lib=no
6593 fi
6594
6595 fi
6596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6597 fi
6598 echo "$as_me:6598: result: $cf_cv_utf8_lib" >&5
6599 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6600
6601 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6602 # ncurses/ncursesw:
6603 if test "$cf_cv_utf8_lib" = "add-on" ; then
6604
6605 cat >>confdefs.h <<\EOF
6606 #define HAVE_LIBUTF8_H 1
6607 EOF
6608
6609 if test -n "$cf_cv_header_path_utf8" ; then
6610   for cf_add_incdir in $cf_cv_header_path_utf8
6611   do
6612         while test $cf_add_incdir != /usr/include
6613         do
6614           if test -d $cf_add_incdir
6615           then
6616                 cf_have_incdir=no
6617                 if test -n "$CFLAGS$CPPFLAGS" ; then
6618                   # a loop is needed to ensure we can add subdirs of existing dirs
6619                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6620                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6621                           cf_have_incdir=yes; break
6622                         fi
6623                   done
6624                 fi
6625
6626                 if test "$cf_have_incdir" = no ; then
6627                   if test "$cf_add_incdir" = /usr/local/include ; then
6628                         if test "$GCC" = yes
6629                         then
6630                           cf_save_CPPFLAGS=$CPPFLAGS
6631
6632         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6633         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6634
6635                           cat >conftest.$ac_ext <<_ACEOF
6636 #line 6636 "configure"
6637 #include "confdefs.h"
6638 #include <stdio.h>
6639 int
6640 main (void)
6641 {
6642 printf("Hello")
6643   ;
6644   return 0;
6645 }
6646 _ACEOF
6647 rm -f conftest.$ac_objext
6648 if { (eval echo "$as_me:6648: \"$ac_compile\"") >&5
6649   (eval $ac_compile) 2>&5
6650   ac_status=$?
6651   echo "$as_me:6651: \$? = $ac_status" >&5
6652   (exit $ac_status); } &&
6653          { ac_try='test -s conftest.$ac_objext'
6654   { (eval echo "$as_me:6654: \"$ac_try\"") >&5
6655   (eval $ac_try) 2>&5
6656   ac_status=$?
6657   echo "$as_me:6657: \$? = $ac_status" >&5
6658   (exit $ac_status); }; }; then
6659   :
6660 else
6661   echo "$as_me: failed program was:" >&5
6662 cat conftest.$ac_ext >&5
6663 cf_have_incdir=yes
6664 fi
6665 rm -f conftest.$ac_objext conftest.$ac_ext
6666                           CPPFLAGS=$cf_save_CPPFLAGS
6667                         fi
6668                   fi
6669                 fi
6670
6671                 if test "$cf_have_incdir" = no ; then
6672                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6673
6674 echo "${as_me:-configure}:6674: testing adding $cf_add_incdir to include-path ..." 1>&5
6675
6676                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6677
6678                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6679                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6680                   cf_add_incdir="$cf_top_incdir"
6681                 else
6682                   break
6683                 fi
6684           else
6685                 break
6686           fi
6687         done
6688   done
6689 fi
6690
6691 if test -n "$cf_cv_library_path_utf8" ; then
6692         for cf_add_libdir in $cf_cv_library_path_utf8
6693         do
6694                 if test $cf_add_libdir = /usr/lib ; then
6695                         :
6696                 elif test -d $cf_add_libdir
6697                 then
6698                         cf_have_libdir=no
6699                         if test -n "$LDFLAGS$LIBS" ; then
6700                                 # a loop is needed to ensure we can add subdirs of existing dirs
6701                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6702                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6703                                                 cf_have_libdir=yes; break
6704                                         fi
6705                                 done
6706                         fi
6707                         if test "$cf_have_libdir" = no ; then
6708                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6709
6710 echo "${as_me:-configure}:6710: testing adding $cf_add_libdir to library-path ..." 1>&5
6711
6712                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6713                         fi
6714                 fi
6715         done
6716 fi
6717
6718 cf_add_libs="$LIBS"
6719 # reverse order
6720 cf_add_0lib=
6721 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6722 # filter duplicates
6723 for cf_add_1lib in $cf_add_0lib; do
6724         for cf_add_2lib in $cf_add_libs; do
6725                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6726                         cf_add_1lib=
6727                         break
6728                 fi
6729         done
6730         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6731 done
6732 LIBS="$cf_add_libs"
6733
6734 fi
6735
6736 cf_ncuconfig_root=ncursesw
6737 cf_have_ncuconfig=no
6738
6739 if test "x${PKG_CONFIG:=none}" != xnone; then
6740         echo "$as_me:6740: checking pkg-config for $cf_ncuconfig_root" >&5
6741 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6742         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6743                 echo "$as_me:6743: result: yes" >&5
6744 echo "${ECHO_T}yes" >&6
6745
6746                 echo "$as_me:6746: checking if the $cf_ncuconfig_root package files work" >&5
6747 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6748                 cf_have_ncuconfig=unknown
6749
6750                 cf_save_CFLAGS="$CFLAGS"
6751                 cf_save_CPPFLAGS="$CPPFLAGS"
6752                 cf_save_LIBS="$LIBS"
6753
6754                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6755                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6756
6757                 # while -W for passing linker flags is prevalent, it is not "standard".
6758                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6759                 # incompatible _and_ non-standard -W option which gives an error.  Work
6760                 # around that pitfall.
6761                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6762                 (x*c[89]9@@*-W*)
6763
6764 cf_fix_cppflags=no
6765 cf_new_cflags=
6766 cf_new_cppflags=
6767 cf_new_extra_cppflags=
6768
6769 for cf_add_cflags in $cf_pkg_cflags
6770 do
6771 case $cf_fix_cppflags in
6772 (no)
6773         case $cf_add_cflags in
6774         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6775                 case $cf_add_cflags in
6776                 (-D*)
6777                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6778
6779                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6780                                 && test -z "${cf_tst_cflags}" \
6781                                 && cf_fix_cppflags=yes
6782
6783                         if test $cf_fix_cppflags = yes ; then
6784
6785         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6786         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6787
6788                                 continue
6789                         elif test "${cf_tst_cflags}" = "\"'" ; then
6790
6791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6793
6794                                 continue
6795                         fi
6796                         ;;
6797                 esac
6798                 case "$CPPFLAGS" in
6799                 (*$cf_add_cflags)
6800                         ;;
6801                 (*)
6802                         case $cf_add_cflags in
6803                         (-D*)
6804                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6805
6806 CPPFLAGS=`echo "$CPPFLAGS" | \
6807         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6808                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6809
6810                                 ;;
6811                         esac
6812
6813         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6814         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6815
6816                         ;;
6817                 esac
6818                 ;;
6819         (*)
6820
6821         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6822         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6823
6824                 ;;
6825         esac
6826         ;;
6827 (yes)
6828
6829         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6830         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6831
6832         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6833
6834         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6835                 && test -z "${cf_tst_cflags}" \
6836                 && cf_fix_cppflags=no
6837         ;;
6838 esac
6839 done
6840
6841 if test -n "$cf_new_cflags" ; then
6842
6843         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6844         CFLAGS="${CFLAGS}$cf_new_cflags"
6845
6846 fi
6847
6848 if test -n "$cf_new_cppflags" ; then
6849
6850         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6851         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6852
6853 fi
6854
6855 if test -n "$cf_new_extra_cppflags" ; then
6856
6857         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6858         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6859
6860 fi
6861
6862 cf_add_libs="$LIBS"
6863 # reverse order
6864 cf_add_0lib=
6865 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6866 # filter duplicates
6867 for cf_add_1lib in $cf_add_0lib; do
6868         for cf_add_2lib in $cf_add_libs; do
6869                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6870                         cf_add_1lib=
6871                         break
6872                 fi
6873         done
6874         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6875 done
6876 LIBS="$cf_add_libs"
6877
6878                         cat >conftest.$ac_ext <<_ACEOF
6879 #line 6879 "configure"
6880 #include "confdefs.h"
6881 #include <${cf_cv_ncurses_header:-curses.h}>
6882 int
6883 main (void)
6884 {
6885 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6886   ;
6887   return 0;
6888 }
6889 _ACEOF
6890 rm -f conftest.$ac_objext conftest$ac_exeext
6891 if { (eval echo "$as_me:6891: \"$ac_link\"") >&5
6892   (eval $ac_link) 2>&5
6893   ac_status=$?
6894   echo "$as_me:6894: \$? = $ac_status" >&5
6895   (exit $ac_status); } &&
6896          { ac_try='test -s conftest$ac_exeext'
6897   { (eval echo "$as_me:6897: \"$ac_try\"") >&5
6898   (eval $ac_try) 2>&5
6899   ac_status=$?
6900   echo "$as_me:6900: \$? = $ac_status" >&5
6901   (exit $ac_status); }; }; then
6902   if test "$cross_compiling" = yes; then
6903   cf_test_ncuconfig=maybe
6904 else
6905   cat >conftest.$ac_ext <<_ACEOF
6906 #line 6906 "configure"
6907 #include "confdefs.h"
6908 #include <${cf_cv_ncurses_header:-curses.h}>
6909                                         int main(void)
6910                                         { char *xx = curses_version(); return (xx == 0); }
6911 _ACEOF
6912 rm -f conftest$ac_exeext
6913 if { (eval echo "$as_me:6913: \"$ac_link\"") >&5
6914   (eval $ac_link) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6918   { (eval echo "$as_me:6918: \"$ac_try\"") >&5
6919   (eval $ac_try) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit $ac_status); }; }; then
6923   cf_test_ncuconfig=yes
6924 else
6925   echo "$as_me: program exited with status $ac_status" >&5
6926 echo "$as_me: failed program was:" >&5
6927 cat conftest.$ac_ext >&5
6928 cf_test_ncuconfig=no
6929 fi
6930 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6931 fi
6932 else
6933   echo "$as_me: failed program was:" >&5
6934 cat conftest.$ac_ext >&5
6935 cf_test_ncuconfig=no
6936 fi
6937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6938
6939                         CFLAGS="$cf_save_CFLAGS"
6940                         CPPFLAGS="$cf_save_CPPFLAGS"
6941                         LIBS="$cf_save_LIBS"
6942
6943                         if test "x$cf_test_ncuconfig" != xyes; then
6944                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
6945                                 cf_pkg_cflags="$cf_temp"
6946                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
6947                                 cf_pkg_libs="$cf_temp"
6948                         fi
6949                         ;;
6950                 esac
6951
6952 cf_fix_cppflags=no
6953 cf_new_cflags=
6954 cf_new_cppflags=
6955 cf_new_extra_cppflags=
6956
6957 for cf_add_cflags in $cf_pkg_cflags
6958 do
6959 case $cf_fix_cppflags in
6960 (no)
6961         case $cf_add_cflags in
6962         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6963                 case $cf_add_cflags in
6964                 (-D*)
6965                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6966
6967                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6968                                 && test -z "${cf_tst_cflags}" \
6969                                 && cf_fix_cppflags=yes
6970
6971                         if test $cf_fix_cppflags = yes ; then
6972
6973         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6974         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6975
6976                                 continue
6977                         elif test "${cf_tst_cflags}" = "\"'" ; then
6978
6979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6981
6982                                 continue
6983                         fi
6984                         ;;
6985                 esac
6986                 case "$CPPFLAGS" in
6987                 (*$cf_add_cflags)
6988                         ;;
6989                 (*)
6990                         case $cf_add_cflags in
6991                         (-D*)
6992                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6993
6994 CPPFLAGS=`echo "$CPPFLAGS" | \
6995         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6996                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6997
6998                                 ;;
6999                         esac
7000
7001         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7002         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7003
7004                         ;;
7005                 esac
7006                 ;;
7007         (*)
7008
7009         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7010         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7011
7012                 ;;
7013         esac
7014         ;;
7015 (yes)
7016
7017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7019
7020         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7021
7022         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7023                 && test -z "${cf_tst_cflags}" \
7024                 && cf_fix_cppflags=no
7025         ;;
7026 esac
7027 done
7028
7029 if test -n "$cf_new_cflags" ; then
7030
7031         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7032         CFLAGS="${CFLAGS}$cf_new_cflags"
7033
7034 fi
7035
7036 if test -n "$cf_new_cppflags" ; then
7037
7038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7039         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7040
7041 fi
7042
7043 if test -n "$cf_new_extra_cppflags" ; then
7044
7045         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7046         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7047
7048 fi
7049
7050 cf_add_libs="$LIBS"
7051 # reverse order
7052 cf_add_0lib=
7053 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7054 # filter duplicates
7055 for cf_add_1lib in $cf_add_0lib; do
7056         for cf_add_2lib in $cf_add_libs; do
7057                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7058                         cf_add_1lib=
7059                         break
7060                 fi
7061         done
7062         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7063 done
7064 LIBS="$cf_add_libs"
7065
7066                 cat >conftest.$ac_ext <<_ACEOF
7067 #line 7067 "configure"
7068 #include "confdefs.h"
7069 #include <${cf_cv_ncurses_header:-curses.h}>
7070 int
7071 main (void)
7072 {
7073 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7074   ;
7075   return 0;
7076 }
7077 _ACEOF
7078 rm -f conftest.$ac_objext conftest$ac_exeext
7079 if { (eval echo "$as_me:7079: \"$ac_link\"") >&5
7080   (eval $ac_link) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit $ac_status); } &&
7084          { ac_try='test -s conftest$ac_exeext'
7085   { (eval echo "$as_me:7085: \"$ac_try\"") >&5
7086   (eval $ac_try) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); }; }; then
7090   if test "$cross_compiling" = yes; then
7091   cf_have_ncuconfig=maybe
7092 else
7093   cat >conftest.$ac_ext <<_ACEOF
7094 #line 7094 "configure"
7095 #include "confdefs.h"
7096 #include <${cf_cv_ncurses_header:-curses.h}>
7097                                 int main(void)
7098                                 { char *xx = curses_version(); return (xx == 0); }
7099 _ACEOF
7100 rm -f conftest$ac_exeext
7101 if { (eval echo "$as_me:7101: \"$ac_link\"") >&5
7102   (eval $ac_link) 2>&5
7103   ac_status=$?
7104   echo "$as_me:7104: \$? = $ac_status" >&5
7105   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7106   { (eval echo "$as_me:7106: \"$ac_try\"") >&5
7107   (eval $ac_try) 2>&5
7108   ac_status=$?
7109   echo "$as_me:7109: \$? = $ac_status" >&5
7110   (exit $ac_status); }; }; then
7111   cf_have_ncuconfig=yes
7112 else
7113   echo "$as_me: program exited with status $ac_status" >&5
7114 echo "$as_me: failed program was:" >&5
7115 cat conftest.$ac_ext >&5
7116 cf_have_ncuconfig=no
7117 fi
7118 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7119 fi
7120 else
7121   echo "$as_me: failed program was:" >&5
7122 cat conftest.$ac_ext >&5
7123 cf_have_ncuconfig=no
7124 fi
7125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7126                 echo "$as_me:7126: result: $cf_have_ncuconfig" >&5
7127 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7128                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7129                 if test "$cf_have_ncuconfig" != "yes"
7130                 then
7131                         CPPFLAGS="$cf_save_CPPFLAGS"
7132                         LIBS="$cf_save_LIBS"
7133                         NCURSES_CONFIG_PKG=none
7134                 else
7135
7136 cat >>confdefs.h <<\EOF
7137 #define NCURSES 1
7138 EOF
7139
7140                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7141
7142 echo "$as_me:7142: checking for terminfo header" >&5
7143 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7144 if test "${cf_cv_term_header+set}" = set; then
7145   echo $ECHO_N "(cached) $ECHO_C" >&6
7146 else
7147
7148 case ${cf_cv_ncurses_header} in
7149 (*/ncurses.h|*/ncursesw.h)
7150         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7151         ;;
7152 (*)
7153         cf_term_header=term.h
7154         ;;
7155 esac
7156
7157 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7158 do
7159 cat >conftest.$ac_ext <<_ACEOF
7160 #line 7160 "configure"
7161 #include "confdefs.h"
7162 #include <stdio.h>
7163 #include <${cf_cv_ncurses_header:-curses.h}>
7164 #include <$cf_test>
7165
7166 int
7167 main (void)
7168 {
7169 int x = auto_left_margin; (void)x
7170   ;
7171   return 0;
7172 }
7173 _ACEOF
7174 rm -f conftest.$ac_objext
7175 if { (eval echo "$as_me:7175: \"$ac_compile\"") >&5
7176   (eval $ac_compile) 2>&5
7177   ac_status=$?
7178   echo "$as_me:7178: \$? = $ac_status" >&5
7179   (exit $ac_status); } &&
7180          { ac_try='test -s conftest.$ac_objext'
7181   { (eval echo "$as_me:7181: \"$ac_try\"") >&5
7182   (eval $ac_try) 2>&5
7183   ac_status=$?
7184   echo "$as_me:7184: \$? = $ac_status" >&5
7185   (exit $ac_status); }; }; then
7186
7187         cf_cv_term_header="$cf_test"
7188 else
7189   echo "$as_me: failed program was:" >&5
7190 cat conftest.$ac_ext >&5
7191
7192         cf_cv_term_header=unknown
7193
7194 fi
7195 rm -f conftest.$ac_objext conftest.$ac_ext
7196         test "$cf_cv_term_header" != unknown && break
7197 done
7198
7199 fi
7200 echo "$as_me:7200: result: $cf_cv_term_header" >&5
7201 echo "${ECHO_T}$cf_cv_term_header" >&6
7202
7203 # Set definitions to allow ifdef'ing to accommodate subdirectories
7204
7205 case $cf_cv_term_header in
7206 (*term.h)
7207
7208 cat >>confdefs.h <<\EOF
7209 #define HAVE_TERM_H 1
7210 EOF
7211
7212         ;;
7213 esac
7214
7215 case $cf_cv_term_header in
7216 (ncurses/term.h)
7217
7218 cat >>confdefs.h <<\EOF
7219 #define HAVE_NCURSES_TERM_H 1
7220 EOF
7221
7222         ;;
7223 (ncursesw/term.h)
7224
7225 cat >>confdefs.h <<\EOF
7226 #define HAVE_NCURSESW_TERM_H 1
7227 EOF
7228
7229         ;;
7230 esac
7231
7232                 fi
7233
7234         else
7235                 echo "$as_me:7235: result: no" >&5
7236 echo "${ECHO_T}no" >&6
7237                 NCURSES_CONFIG_PKG=none
7238         fi
7239 else
7240         NCURSES_CONFIG_PKG=none
7241 fi
7242
7243 if test "x$cf_have_ncuconfig" = "xno"; then
7244         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7245
7246 if test -n "$ac_tool_prefix"; then
7247   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7248   do
7249     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7250 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7251 echo "$as_me:7251: checking for $ac_word" >&5
7252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7253 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7254   echo $ECHO_N "(cached) $ECHO_C" >&6
7255 else
7256   if test -n "$NCURSES_CONFIG"; then
7257   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7258 else
7259   ac_save_IFS=$IFS; IFS=$ac_path_separator
7260 ac_dummy="$PATH"
7261 for ac_dir in $ac_dummy; do
7262   IFS=$ac_save_IFS
7263   test -z "$ac_dir" && ac_dir=.
7264   $as_executable_p "$ac_dir/$ac_word" || continue
7265 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7266 echo "$as_me:7266: found $ac_dir/$ac_word" >&5
7267 break
7268 done
7269
7270 fi
7271 fi
7272 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7273 if test -n "$NCURSES_CONFIG"; then
7274   echo "$as_me:7274: result: $NCURSES_CONFIG" >&5
7275 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7276 else
7277   echo "$as_me:7277: result: no" >&5
7278 echo "${ECHO_T}no" >&6
7279 fi
7280
7281     test -n "$NCURSES_CONFIG" && break
7282   done
7283 fi
7284 if test -z "$NCURSES_CONFIG"; then
7285   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7286   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7287 do
7288   # Extract the first word of "$ac_prog", so it can be a program name with args.
7289 set dummy $ac_prog; ac_word=$2
7290 echo "$as_me:7290: checking for $ac_word" >&5
7291 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7292 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7293   echo $ECHO_N "(cached) $ECHO_C" >&6
7294 else
7295   if test -n "$ac_ct_NCURSES_CONFIG"; then
7296   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7297 else
7298   ac_save_IFS=$IFS; IFS=$ac_path_separator
7299 ac_dummy="$PATH"
7300 for ac_dir in $ac_dummy; do
7301   IFS=$ac_save_IFS
7302   test -z "$ac_dir" && ac_dir=.
7303   $as_executable_p "$ac_dir/$ac_word" || continue
7304 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7305 echo "$as_me:7305: found $ac_dir/$ac_word" >&5
7306 break
7307 done
7308
7309 fi
7310 fi
7311 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7312 if test -n "$ac_ct_NCURSES_CONFIG"; then
7313   echo "$as_me:7313: result: $ac_ct_NCURSES_CONFIG" >&5
7314 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7315 else
7316   echo "$as_me:7316: result: no" >&5
7317 echo "${ECHO_T}no" >&6
7318 fi
7319
7320   test -n "$ac_ct_NCURSES_CONFIG" && break
7321 done
7322 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7323
7324   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7325 fi
7326
7327         if test "$NCURSES_CONFIG" != none ; then
7328
7329 cf_fix_cppflags=no
7330 cf_new_cflags=
7331 cf_new_cppflags=
7332 cf_new_extra_cppflags=
7333
7334 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7335 do
7336 case $cf_fix_cppflags in
7337 (no)
7338         case $cf_add_cflags in
7339         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7340                 case $cf_add_cflags in
7341                 (-D*)
7342                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7343
7344                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7345                                 && test -z "${cf_tst_cflags}" \
7346                                 && cf_fix_cppflags=yes
7347
7348                         if test $cf_fix_cppflags = yes ; then
7349
7350         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7351         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7352
7353                                 continue
7354                         elif test "${cf_tst_cflags}" = "\"'" ; then
7355
7356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7358
7359                                 continue
7360                         fi
7361                         ;;
7362                 esac
7363                 case "$CPPFLAGS" in
7364                 (*$cf_add_cflags)
7365                         ;;
7366                 (*)
7367                         case $cf_add_cflags in
7368                         (-D*)
7369                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7370
7371 CPPFLAGS=`echo "$CPPFLAGS" | \
7372         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7373                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7374
7375                                 ;;
7376                         esac
7377
7378         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7379         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7380
7381                         ;;
7382                 esac
7383                 ;;
7384         (*)
7385
7386         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7387         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7388
7389                 ;;
7390         esac
7391         ;;
7392 (yes)
7393
7394         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7395         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7396
7397         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7398
7399         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7400                 && test -z "${cf_tst_cflags}" \
7401                 && cf_fix_cppflags=no
7402         ;;
7403 esac
7404 done
7405
7406 if test -n "$cf_new_cflags" ; then
7407
7408         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7409         CFLAGS="${CFLAGS}$cf_new_cflags"
7410
7411 fi
7412
7413 if test -n "$cf_new_cppflags" ; then
7414
7415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7416         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7417
7418 fi
7419
7420 if test -n "$cf_new_extra_cppflags" ; then
7421
7422         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7423         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7424
7425 fi
7426
7427 cf_add_libs="$LIBS"
7428 # reverse order
7429 cf_add_0lib=
7430 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7431 # filter duplicates
7432 for cf_add_1lib in $cf_add_0lib; do
7433         for cf_add_2lib in $cf_add_libs; do
7434                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7435                         cf_add_1lib=
7436                         break
7437                 fi
7438         done
7439         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7440 done
7441 LIBS="$cf_add_libs"
7442
7443                 # even with config script, some packages use no-override for curses.h
7444
7445 echo "$as_me:7445: checking if we have identified curses headers" >&5
7446 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7447 if test "${cf_cv_ncurses_header+set}" = set; then
7448   echo $ECHO_N "(cached) $ECHO_C" >&6
7449 else
7450
7451 cf_cv_ncurses_header=none
7452 for cf_header in \
7453         ncurses.h ncursesw/ncurses.h \
7454         curses.h ncursesw/curses.h
7455 do
7456 cat >conftest.$ac_ext <<_ACEOF
7457 #line 7457 "configure"
7458 #include "confdefs.h"
7459 #include <${cf_header}>
7460 int
7461 main (void)
7462 {
7463 initscr(); tgoto("?", 0,0)
7464   ;
7465   return 0;
7466 }
7467 _ACEOF
7468 rm -f conftest.$ac_objext
7469 if { (eval echo "$as_me:7469: \"$ac_compile\"") >&5
7470   (eval $ac_compile) 2>&5
7471   ac_status=$?
7472   echo "$as_me:7472: \$? = $ac_status" >&5
7473   (exit $ac_status); } &&
7474          { ac_try='test -s conftest.$ac_objext'
7475   { (eval echo "$as_me:7475: \"$ac_try\"") >&5
7476   (eval $ac_try) 2>&5
7477   ac_status=$?
7478   echo "$as_me:7478: \$? = $ac_status" >&5
7479   (exit $ac_status); }; }; then
7480   cf_cv_ncurses_header=$cf_header; break
7481 else
7482   echo "$as_me: failed program was:" >&5
7483 cat conftest.$ac_ext >&5
7484 fi
7485 rm -f conftest.$ac_objext conftest.$ac_ext
7486 done
7487
7488 fi
7489 echo "$as_me:7489: result: $cf_cv_ncurses_header" >&5
7490 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7491
7492 if test "$cf_cv_ncurses_header" = none ; then
7493         { { echo "$as_me:7493: error: No curses header-files found" >&5
7494 echo "$as_me: error: No curses header-files found" >&2;}
7495    { (exit 1); exit 1; }; }
7496 fi
7497
7498 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7499
7500 for ac_header in $cf_cv_ncurses_header
7501 do
7502 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7503 echo "$as_me:7503: checking for $ac_header" >&5
7504 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7505 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7506   echo $ECHO_N "(cached) $ECHO_C" >&6
7507 else
7508   cat >conftest.$ac_ext <<_ACEOF
7509 #line 7509 "configure"
7510 #include "confdefs.h"
7511 #include <$ac_header>
7512 _ACEOF
7513 if { (eval echo "$as_me:7513: \"$ac_cpp conftest.$ac_ext\"") >&5
7514   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7515   ac_status=$?
7516   egrep -v '^ *\+' conftest.er1 >conftest.err
7517   rm -f conftest.er1
7518   cat conftest.err >&5
7519   echo "$as_me:7519: \$? = $ac_status" >&5
7520   (exit $ac_status); } >/dev/null; then
7521   if test -s conftest.err; then
7522     ac_cpp_err=$ac_c_preproc_warn_flag
7523   else
7524     ac_cpp_err=
7525   fi
7526 else
7527   ac_cpp_err=yes
7528 fi
7529 if test -z "$ac_cpp_err"; then
7530   eval "$as_ac_Header=yes"
7531 else
7532   echo "$as_me: failed program was:" >&5
7533   cat conftest.$ac_ext >&5
7534   eval "$as_ac_Header=no"
7535 fi
7536 rm -f conftest.err conftest.$ac_ext
7537 fi
7538 echo "$as_me:7538: result: `eval echo '${'$as_ac_Header'}'`" >&5
7539 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7540 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7541   cat >>confdefs.h <<EOF
7542 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7543 EOF
7544
7545 fi
7546 done
7547
7548 cat >>confdefs.h <<\EOF
7549 #define NCURSES 1
7550 EOF
7551
7552 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7553
7554                 cat >>confdefs.h <<EOF
7555 #define $cf_nculib_ROOT 1
7556 EOF
7557
7558                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7559
7560         else
7561
7562 cf_ncuhdr_root=ncursesw
7563
7564 test -n "$cf_cv_curses_dir" && \
7565 test "$cf_cv_curses_dir" != "no" && { \
7566
7567 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7568   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7569   do
7570         while test $cf_add_incdir != /usr/include
7571         do
7572           if test -d $cf_add_incdir
7573           then
7574                 cf_have_incdir=no
7575                 if test -n "$CFLAGS$CPPFLAGS" ; then
7576                   # a loop is needed to ensure we can add subdirs of existing dirs
7577                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7578                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7579                           cf_have_incdir=yes; break
7580                         fi
7581                   done
7582                 fi
7583
7584                 if test "$cf_have_incdir" = no ; then
7585                   if test "$cf_add_incdir" = /usr/local/include ; then
7586                         if test "$GCC" = yes
7587                         then
7588                           cf_save_CPPFLAGS=$CPPFLAGS
7589
7590         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7591         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7592
7593                           cat >conftest.$ac_ext <<_ACEOF
7594 #line 7594 "configure"
7595 #include "confdefs.h"
7596 #include <stdio.h>
7597 int
7598 main (void)
7599 {
7600 printf("Hello")
7601   ;
7602   return 0;
7603 }
7604 _ACEOF
7605 rm -f conftest.$ac_objext
7606 if { (eval echo "$as_me:7606: \"$ac_compile\"") >&5
7607   (eval $ac_compile) 2>&5
7608   ac_status=$?
7609   echo "$as_me:7609: \$? = $ac_status" >&5
7610   (exit $ac_status); } &&
7611          { ac_try='test -s conftest.$ac_objext'
7612   { (eval echo "$as_me:7612: \"$ac_try\"") >&5
7613   (eval $ac_try) 2>&5
7614   ac_status=$?
7615   echo "$as_me:7615: \$? = $ac_status" >&5
7616   (exit $ac_status); }; }; then
7617   :
7618 else
7619   echo "$as_me: failed program was:" >&5
7620 cat conftest.$ac_ext >&5
7621 cf_have_incdir=yes
7622 fi
7623 rm -f conftest.$ac_objext conftest.$ac_ext
7624                           CPPFLAGS=$cf_save_CPPFLAGS
7625                         fi
7626                   fi
7627                 fi
7628
7629                 if test "$cf_have_incdir" = no ; then
7630                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7631
7632 echo "${as_me:-configure}:7632: testing adding $cf_add_incdir to include-path ..." 1>&5
7633
7634                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7635
7636                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7637                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7638                   cf_add_incdir="$cf_top_incdir"
7639                 else
7640                   break
7641                 fi
7642           else
7643                 break
7644           fi
7645         done
7646   done
7647 fi
7648
7649 }
7650
7651 echo "$as_me:7651: checking for $cf_ncuhdr_root header in include-path" >&5
7652 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7653 if test "${cf_cv_ncurses_h+set}" = set; then
7654   echo $ECHO_N "(cached) $ECHO_C" >&6
7655 else
7656
7657         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7658         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7659         for cf_header in $cf_header_list
7660         do
7661
7662         cat >conftest.$ac_ext <<_ACEOF
7663 #line 7663 "configure"
7664 #include "confdefs.h"
7665
7666 #define _XOPEN_SOURCE_EXTENDED
7667 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7668 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7669
7670 #include <$cf_header>
7671 int
7672 main (void)
7673 {
7674
7675 #ifdef NCURSES_VERSION
7676
7677 #ifndef WACS_BSSB
7678         make an error
7679 #endif
7680
7681 printf("%s\n", NCURSES_VERSION);
7682 #else
7683 #ifdef __NCURSES_H
7684 printf("old\n");
7685 #else
7686         make an error
7687 #endif
7688 #endif
7689
7690   ;
7691   return 0;
7692 }
7693 _ACEOF
7694 rm -f conftest.$ac_objext
7695 if { (eval echo "$as_me:7695: \"$ac_compile\"") >&5
7696   (eval $ac_compile) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit $ac_status); } &&
7700          { ac_try='test -s conftest.$ac_objext'
7701   { (eval echo "$as_me:7701: \"$ac_try\"") >&5
7702   (eval $ac_try) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); }; }; then
7706   cf_cv_ncurses_h=$cf_header
7707
7708 else
7709   echo "$as_me: failed program was:" >&5
7710 cat conftest.$ac_ext >&5
7711 cf_cv_ncurses_h=no
7712 fi
7713 rm -f conftest.$ac_objext conftest.$ac_ext
7714
7715                 test "$cf_cv_ncurses_h" != no && break
7716         done
7717
7718 fi
7719 echo "$as_me:7719: result: $cf_cv_ncurses_h" >&5
7720 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7721
7722 if test "$cf_cv_ncurses_h" != no ; then
7723         cf_cv_ncurses_header=$cf_cv_ncurses_h
7724 else
7725
7726 echo "$as_me:7726: checking for $cf_ncuhdr_root include-path" >&5
7727 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7728 if test "${cf_cv_ncurses_h2+set}" = set; then
7729   echo $ECHO_N "(cached) $ECHO_C" >&6
7730 else
7731
7732         test -n "$verbose" && echo
7733
7734 cf_search=
7735
7736 # collect the current set of include-directories from compiler flags
7737 cf_header_path_list=""
7738 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7739         for cf_header_path in $CPPFLAGS $CFLAGS
7740         do
7741                 case $cf_header_path in
7742                 (-I*)
7743                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7744
7745 test "x$cf_header_path" != "xNONE" && \
7746 test -d "$cf_header_path" && \
7747  {
7748         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7749         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7750         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7751         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7752         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7753         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"
7754 }
7755
7756                         cf_header_path_list="$cf_header_path_list $cf_search"
7757                         ;;
7758                 esac
7759         done
7760 fi
7761
7762 # add the variations for the package we are looking for
7763
7764 cf_search=
7765
7766 test "x$prefix" != "xNONE" && \
7767 test -d "$prefix" && \
7768  {
7769         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7770         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7771         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7772         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7773         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7774         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7775 }
7776
7777 for cf_subdir_prefix in \
7778         /usr \
7779         /usr/local \
7780         /usr/pkg \
7781         /opt \
7782         /opt/local \
7783         $HOME
7784 do
7785
7786 test "x$cf_subdir_prefix" != "x$prefix" && \
7787 test -d "$cf_subdir_prefix" && \
7788 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7789         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7790         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7791         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7792         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7793         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7794         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"
7795 }
7796
7797 done
7798
7799 test "$includedir" != NONE && \
7800 test "$includedir" != "/usr/include" && \
7801 test -d "$includedir" && {
7802         test -d $includedir &&    cf_search="$cf_search $includedir"
7803         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7804 }
7805
7806 test "$oldincludedir" != NONE && \
7807 test "$oldincludedir" != "/usr/include" && \
7808 test -d "$oldincludedir" && {
7809         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7810         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7811 }
7812
7813 cf_search="$cf_search $cf_header_path_list"
7814
7815         test -n "$verbose" && echo search path $cf_search
7816         cf_save2_CPPFLAGS="$CPPFLAGS"
7817         for cf_incdir in $cf_search
7818         do
7819
7820 if test -n "$cf_incdir" ; then
7821   for cf_add_incdir in $cf_incdir
7822   do
7823         while test $cf_add_incdir != /usr/include
7824         do
7825           if test -d $cf_add_incdir
7826           then
7827                 cf_have_incdir=no
7828                 if test -n "$CFLAGS$CPPFLAGS" ; then
7829                   # a loop is needed to ensure we can add subdirs of existing dirs
7830                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7831                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7832                           cf_have_incdir=yes; break
7833                         fi
7834                   done
7835                 fi
7836
7837                 if test "$cf_have_incdir" = no ; then
7838                   if test "$cf_add_incdir" = /usr/local/include ; then
7839                         if test "$GCC" = yes
7840                         then
7841                           cf_save_CPPFLAGS=$CPPFLAGS
7842
7843         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7844         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7845
7846                           cat >conftest.$ac_ext <<_ACEOF
7847 #line 7847 "configure"
7848 #include "confdefs.h"
7849 #include <stdio.h>
7850 int
7851 main (void)
7852 {
7853 printf("Hello")
7854   ;
7855   return 0;
7856 }
7857 _ACEOF
7858 rm -f conftest.$ac_objext
7859 if { (eval echo "$as_me:7859: \"$ac_compile\"") >&5
7860   (eval $ac_compile) 2>&5
7861   ac_status=$?
7862   echo "$as_me:7862: \$? = $ac_status" >&5
7863   (exit $ac_status); } &&
7864          { ac_try='test -s conftest.$ac_objext'
7865   { (eval echo "$as_me:7865: \"$ac_try\"") >&5
7866   (eval $ac_try) 2>&5
7867   ac_status=$?
7868   echo "$as_me:7868: \$? = $ac_status" >&5
7869   (exit $ac_status); }; }; then
7870   :
7871 else
7872   echo "$as_me: failed program was:" >&5
7873 cat conftest.$ac_ext >&5
7874 cf_have_incdir=yes
7875 fi
7876 rm -f conftest.$ac_objext conftest.$ac_ext
7877                           CPPFLAGS=$cf_save_CPPFLAGS
7878                         fi
7879                   fi
7880                 fi
7881
7882                 if test "$cf_have_incdir" = no ; then
7883                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7884
7885 echo "${as_me:-configure}:7885: testing adding $cf_add_incdir to include-path ..." 1>&5
7886
7887                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7888
7889                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7890                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7891                   cf_add_incdir="$cf_top_incdir"
7892                 else
7893                   break
7894                 fi
7895           else
7896                 break
7897           fi
7898         done
7899   done
7900 fi
7901
7902                 for cf_header in \
7903                         ncurses.h \
7904                         curses.h
7905                 do
7906
7907         cat >conftest.$ac_ext <<_ACEOF
7908 #line 7908 "configure"
7909 #include "confdefs.h"
7910
7911 #include <$cf_header>
7912 int
7913 main (void)
7914 {
7915
7916 #ifdef NCURSES_VERSION
7917
7918 printf("%s\n", NCURSES_VERSION);
7919 #else
7920 #ifdef __NCURSES_H
7921 printf("old\n");
7922 #else
7923         make an error
7924 #endif
7925 #endif
7926
7927   ;
7928   return 0;
7929 }
7930 _ACEOF
7931 rm -f conftest.$ac_objext
7932 if { (eval echo "$as_me:7932: \"$ac_compile\"") >&5
7933   (eval $ac_compile) 2>&5
7934   ac_status=$?
7935   echo "$as_me:7935: \$? = $ac_status" >&5
7936   (exit $ac_status); } &&
7937          { ac_try='test -s conftest.$ac_objext'
7938   { (eval echo "$as_me:7938: \"$ac_try\"") >&5
7939   (eval $ac_try) 2>&5
7940   ac_status=$?
7941   echo "$as_me:7941: \$? = $ac_status" >&5
7942   (exit $ac_status); }; }; then
7943   cf_cv_ncurses_h2=$cf_header
7944
7945 else
7946   echo "$as_me: failed program was:" >&5
7947 cat conftest.$ac_ext >&5
7948 cf_cv_ncurses_h2=no
7949 fi
7950 rm -f conftest.$ac_objext conftest.$ac_ext
7951
7952                         if test "$cf_cv_ncurses_h2" != no ; then
7953                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7954                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7955                                 break
7956                         fi
7957                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7958                 done
7959                 CPPFLAGS="$cf_save2_CPPFLAGS"
7960                 test "$cf_cv_ncurses_h2" != no && break
7961         done
7962         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7962: error: not found" >&5
7963 echo "$as_me: error: not found" >&2;}
7964    { (exit 1); exit 1; }; }
7965
7966 fi
7967 echo "$as_me:7967: result: $cf_cv_ncurses_h2" >&5
7968 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7969
7970         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7971         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7972         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7973                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7974         fi
7975
7976 if test -n "$cf_1st_incdir" ; then
7977   for cf_add_incdir in $cf_1st_incdir
7978   do
7979         while test $cf_add_incdir != /usr/include
7980         do
7981           if test -d $cf_add_incdir
7982           then
7983                 cf_have_incdir=no
7984                 if test -n "$CFLAGS$CPPFLAGS" ; then
7985                   # a loop is needed to ensure we can add subdirs of existing dirs
7986                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7987                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7988                           cf_have_incdir=yes; break
7989                         fi
7990                   done
7991                 fi
7992
7993                 if test "$cf_have_incdir" = no ; then
7994                   if test "$cf_add_incdir" = /usr/local/include ; then
7995                         if test "$GCC" = yes
7996                         then
7997                           cf_save_CPPFLAGS=$CPPFLAGS
7998
7999         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8000         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8001
8002                           cat >conftest.$ac_ext <<_ACEOF
8003 #line 8003 "configure"
8004 #include "confdefs.h"
8005 #include <stdio.h>
8006 int
8007 main (void)
8008 {
8009 printf("Hello")
8010   ;
8011   return 0;
8012 }
8013 _ACEOF
8014 rm -f conftest.$ac_objext
8015 if { (eval echo "$as_me:8015: \"$ac_compile\"") >&5
8016   (eval $ac_compile) 2>&5
8017   ac_status=$?
8018   echo "$as_me:8018: \$? = $ac_status" >&5
8019   (exit $ac_status); } &&
8020          { ac_try='test -s conftest.$ac_objext'
8021   { (eval echo "$as_me:8021: \"$ac_try\"") >&5
8022   (eval $ac_try) 2>&5
8023   ac_status=$?
8024   echo "$as_me:8024: \$? = $ac_status" >&5
8025   (exit $ac_status); }; }; then
8026   :
8027 else
8028   echo "$as_me: failed program was:" >&5
8029 cat conftest.$ac_ext >&5
8030 cf_have_incdir=yes
8031 fi
8032 rm -f conftest.$ac_objext conftest.$ac_ext
8033                           CPPFLAGS=$cf_save_CPPFLAGS
8034                         fi
8035                   fi
8036                 fi
8037
8038                 if test "$cf_have_incdir" = no ; then
8039                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8040
8041 echo "${as_me:-configure}:8041: testing adding $cf_add_incdir to include-path ..." 1>&5
8042
8043                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8044
8045                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8046                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8047                   cf_add_incdir="$cf_top_incdir"
8048                 else
8049                   break
8050                 fi
8051           else
8052                 break
8053           fi
8054         done
8055   done
8056 fi
8057
8058 fi
8059
8060 # Set definitions to allow ifdef'ing for ncurses.h
8061
8062 case $cf_cv_ncurses_header in
8063 (*ncurses.h)
8064
8065 cat >>confdefs.h <<\EOF
8066 #define HAVE_NCURSES_H 1
8067 EOF
8068
8069         ;;
8070 esac
8071
8072 case $cf_cv_ncurses_header in
8073 (ncurses/curses.h|ncurses/ncurses.h)
8074
8075 cat >>confdefs.h <<\EOF
8076 #define HAVE_NCURSES_NCURSES_H 1
8077 EOF
8078
8079         ;;
8080 (ncursesw/curses.h|ncursesw/ncurses.h)
8081
8082 cat >>confdefs.h <<\EOF
8083 #define HAVE_NCURSESW_NCURSES_H 1
8084 EOF
8085
8086         ;;
8087 esac
8088
8089 echo "$as_me:8089: checking for terminfo header" >&5
8090 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8091 if test "${cf_cv_term_header+set}" = set; then
8092   echo $ECHO_N "(cached) $ECHO_C" >&6
8093 else
8094
8095 case ${cf_cv_ncurses_header} in
8096 (*/ncurses.h|*/ncursesw.h)
8097         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8098         ;;
8099 (*)
8100         cf_term_header=term.h
8101         ;;
8102 esac
8103
8104 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8105 do
8106 cat >conftest.$ac_ext <<_ACEOF
8107 #line 8107 "configure"
8108 #include "confdefs.h"
8109 #include <stdio.h>
8110 #include <${cf_cv_ncurses_header:-curses.h}>
8111 #include <$cf_test>
8112
8113 int
8114 main (void)
8115 {
8116 int x = auto_left_margin; (void)x
8117   ;
8118   return 0;
8119 }
8120 _ACEOF
8121 rm -f conftest.$ac_objext
8122 if { (eval echo "$as_me:8122: \"$ac_compile\"") >&5
8123   (eval $ac_compile) 2>&5
8124   ac_status=$?
8125   echo "$as_me:8125: \$? = $ac_status" >&5
8126   (exit $ac_status); } &&
8127          { ac_try='test -s conftest.$ac_objext'
8128   { (eval echo "$as_me:8128: \"$ac_try\"") >&5
8129   (eval $ac_try) 2>&5
8130   ac_status=$?
8131   echo "$as_me:8131: \$? = $ac_status" >&5
8132   (exit $ac_status); }; }; then
8133
8134         cf_cv_term_header="$cf_test"
8135 else
8136   echo "$as_me: failed program was:" >&5
8137 cat conftest.$ac_ext >&5
8138
8139         cf_cv_term_header=unknown
8140
8141 fi
8142 rm -f conftest.$ac_objext conftest.$ac_ext
8143         test "$cf_cv_term_header" != unknown && break
8144 done
8145
8146 fi
8147 echo "$as_me:8147: result: $cf_cv_term_header" >&5
8148 echo "${ECHO_T}$cf_cv_term_header" >&6
8149
8150 # Set definitions to allow ifdef'ing to accommodate subdirectories
8151
8152 case $cf_cv_term_header in
8153 (*term.h)
8154
8155 cat >>confdefs.h <<\EOF
8156 #define HAVE_TERM_H 1
8157 EOF
8158
8159         ;;
8160 esac
8161
8162 case $cf_cv_term_header in
8163 (ncurses/term.h)
8164
8165 cat >>confdefs.h <<\EOF
8166 #define HAVE_NCURSES_TERM_H 1
8167 EOF
8168
8169         ;;
8170 (ncursesw/term.h)
8171
8172 cat >>confdefs.h <<\EOF
8173 #define HAVE_NCURSESW_TERM_H 1
8174 EOF
8175
8176         ;;
8177 esac
8178
8179 # some applications need this, but should check for NCURSES_VERSION
8180
8181 cat >>confdefs.h <<\EOF
8182 #define NCURSES 1
8183 EOF
8184
8185 echo "$as_me:8185: checking for ncurses version" >&5
8186 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8187 if test "${cf_cv_ncurses_version+set}" = set; then
8188   echo $ECHO_N "(cached) $ECHO_C" >&6
8189 else
8190
8191         cf_cv_ncurses_version=no
8192         cf_tempfile=out$$
8193         rm -f $cf_tempfile
8194         if test "$cross_compiling" = yes; then
8195
8196         # This will not work if the preprocessor splits the line after the
8197         # Autoconf token.  The 'unproto' program does that.
8198         cat > conftest.$ac_ext <<EOF
8199 #include <${cf_cv_ncurses_header:-curses.h}>
8200 #undef Autoconf
8201 #ifdef NCURSES_VERSION
8202 Autoconf NCURSES_VERSION
8203 #else
8204 #ifdef __NCURSES_H
8205 Autoconf "old"
8206 #endif
8207 ;
8208 #endif
8209 EOF
8210         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8211         { (eval echo "$as_me:8211: \"$cf_try\"") >&5
8212   (eval $cf_try) 2>&5
8213   ac_status=$?
8214   echo "$as_me:8214: \$? = $ac_status" >&5
8215   (exit $ac_status); }
8216         if test -f conftest.out ; then
8217                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8218                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8219                 rm -f conftest.out
8220         fi
8221
8222 else
8223   cat >conftest.$ac_ext <<_ACEOF
8224 #line 8224 "configure"
8225 #include "confdefs.h"
8226
8227 #include <${cf_cv_ncurses_header:-curses.h}>
8228 #include <stdio.h>
8229 int main(void)
8230 {
8231         FILE *fp = fopen("$cf_tempfile", "w");
8232 #ifdef NCURSES_VERSION
8233 # ifdef NCURSES_VERSION_PATCH
8234         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8235 # else
8236         fprintf(fp, "%s\n", NCURSES_VERSION);
8237 # endif
8238 #else
8239 # ifdef __NCURSES_H
8240         fprintf(fp, "old\n");
8241 # else
8242         make an error
8243 # endif
8244 #endif
8245         ${cf_cv_main_return:-return}(0);
8246 }
8247 _ACEOF
8248 rm -f conftest$ac_exeext
8249 if { (eval echo "$as_me:8249: \"$ac_link\"") >&5
8250   (eval $ac_link) 2>&5
8251   ac_status=$?
8252   echo "$as_me:8252: \$? = $ac_status" >&5
8253   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8254   { (eval echo "$as_me:8254: \"$ac_try\"") >&5
8255   (eval $ac_try) 2>&5
8256   ac_status=$?
8257   echo "$as_me:8257: \$? = $ac_status" >&5
8258   (exit $ac_status); }; }; then
8259
8260         cf_cv_ncurses_version=`cat $cf_tempfile`
8261 else
8262   echo "$as_me: program exited with status $ac_status" >&5
8263 echo "$as_me: failed program was:" >&5
8264 cat conftest.$ac_ext >&5
8265 fi
8266 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8267 fi
8268         rm -f $cf_tempfile
8269
8270 fi
8271 echo "$as_me:8271: result: $cf_cv_ncurses_version" >&5
8272 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8273 test "$cf_cv_ncurses_version" = no ||
8274 cat >>confdefs.h <<\EOF
8275 #define NCURSES 1
8276 EOF
8277
8278 cf_nculib_root=ncursesw
8279         # This works, except for the special case where we find gpm, but
8280         # ncurses is in a nonstandard location via $LIBS, and we really want
8281         # to link gpm.
8282 cf_ncurses_LIBS=""
8283 cf_ncurses_SAVE="$LIBS"
8284 echo "$as_me:8284: checking for Gpm_Open in -lgpm" >&5
8285 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8286 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8287   echo $ECHO_N "(cached) $ECHO_C" >&6
8288 else
8289   ac_check_lib_save_LIBS=$LIBS
8290 LIBS="-lgpm  $LIBS"
8291 cat >conftest.$ac_ext <<_ACEOF
8292 #line 8292 "configure"
8293 #include "confdefs.h"
8294
8295 /* Override any gcc2 internal prototype to avoid an error.  */
8296 #ifdef __cplusplus
8297 extern "C"
8298 #endif
8299 /* We use char because int might match the return type of a gcc2
8300    builtin and then its argument prototype would still apply.  */
8301 char Gpm_Open ();
8302 int
8303 main (void)
8304 {
8305 Gpm_Open ();
8306   ;
8307   return 0;
8308 }
8309 _ACEOF
8310 rm -f conftest.$ac_objext conftest$ac_exeext
8311 if { (eval echo "$as_me:8311: \"$ac_link\"") >&5
8312   (eval $ac_link) 2>&5
8313   ac_status=$?
8314   echo "$as_me:8314: \$? = $ac_status" >&5
8315   (exit $ac_status); } &&
8316          { ac_try='test -s conftest$ac_exeext'
8317   { (eval echo "$as_me:8317: \"$ac_try\"") >&5
8318   (eval $ac_try) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit $ac_status); }; }; then
8322   ac_cv_lib_gpm_Gpm_Open=yes
8323 else
8324   echo "$as_me: failed program was:" >&5
8325 cat conftest.$ac_ext >&5
8326 ac_cv_lib_gpm_Gpm_Open=no
8327 fi
8328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8329 LIBS=$ac_check_lib_save_LIBS
8330 fi
8331 echo "$as_me:8331: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8332 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8333 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8334   echo "$as_me:8334: checking for initscr in -lgpm" >&5
8335 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8336 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8337   echo $ECHO_N "(cached) $ECHO_C" >&6
8338 else
8339   ac_check_lib_save_LIBS=$LIBS
8340 LIBS="-lgpm  $LIBS"
8341 cat >conftest.$ac_ext <<_ACEOF
8342 #line 8342 "configure"
8343 #include "confdefs.h"
8344
8345 /* Override any gcc2 internal prototype to avoid an error.  */
8346 #ifdef __cplusplus
8347 extern "C"
8348 #endif
8349 /* We use char because int might match the return type of a gcc2
8350    builtin and then its argument prototype would still apply.  */
8351 char initscr ();
8352 int
8353 main (void)
8354 {
8355 initscr ();
8356   ;
8357   return 0;
8358 }
8359 _ACEOF
8360 rm -f conftest.$ac_objext conftest$ac_exeext
8361 if { (eval echo "$as_me:8361: \"$ac_link\"") >&5
8362   (eval $ac_link) 2>&5
8363   ac_status=$?
8364   echo "$as_me:8364: \$? = $ac_status" >&5
8365   (exit $ac_status); } &&
8366          { ac_try='test -s conftest$ac_exeext'
8367   { (eval echo "$as_me:8367: \"$ac_try\"") >&5
8368   (eval $ac_try) 2>&5
8369   ac_status=$?
8370   echo "$as_me:8370: \$? = $ac_status" >&5
8371   (exit $ac_status); }; }; then
8372   ac_cv_lib_gpm_initscr=yes
8373 else
8374   echo "$as_me: failed program was:" >&5
8375 cat conftest.$ac_ext >&5
8376 ac_cv_lib_gpm_initscr=no
8377 fi
8378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8379 LIBS=$ac_check_lib_save_LIBS
8380 fi
8381 echo "$as_me:8381: result: $ac_cv_lib_gpm_initscr" >&5
8382 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8383 if test $ac_cv_lib_gpm_initscr = yes; then
8384   LIBS="$cf_ncurses_SAVE"
8385 else
8386   cf_ncurses_LIBS="-lgpm"
8387 fi
8388
8389 fi
8390
8391 case $host_os in
8392 (freebsd*)
8393         # This is only necessary if you are linking against an obsolete
8394         # version of ncurses (but it should do no harm, since it's static).
8395         if test "$cf_nculib_root" = ncurses ; then
8396                 echo "$as_me:8396: checking for tgoto in -lmytinfo" >&5
8397 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8398 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8399   echo $ECHO_N "(cached) $ECHO_C" >&6
8400 else
8401   ac_check_lib_save_LIBS=$LIBS
8402 LIBS="-lmytinfo  $LIBS"
8403 cat >conftest.$ac_ext <<_ACEOF
8404 #line 8404 "configure"
8405 #include "confdefs.h"
8406
8407 /* Override any gcc2 internal prototype to avoid an error.  */
8408 #ifdef __cplusplus
8409 extern "C"
8410 #endif
8411 /* We use char because int might match the return type of a gcc2
8412    builtin and then its argument prototype would still apply.  */
8413 char tgoto ();
8414 int
8415 main (void)
8416 {
8417 tgoto ();
8418   ;
8419   return 0;
8420 }
8421 _ACEOF
8422 rm -f conftest.$ac_objext conftest$ac_exeext
8423 if { (eval echo "$as_me:8423: \"$ac_link\"") >&5
8424   (eval $ac_link) 2>&5
8425   ac_status=$?
8426   echo "$as_me:8426: \$? = $ac_status" >&5
8427   (exit $ac_status); } &&
8428          { ac_try='test -s conftest$ac_exeext'
8429   { (eval echo "$as_me:8429: \"$ac_try\"") >&5
8430   (eval $ac_try) 2>&5
8431   ac_status=$?
8432   echo "$as_me:8432: \$? = $ac_status" >&5
8433   (exit $ac_status); }; }; then
8434   ac_cv_lib_mytinfo_tgoto=yes
8435 else
8436   echo "$as_me: failed program was:" >&5
8437 cat conftest.$ac_ext >&5
8438 ac_cv_lib_mytinfo_tgoto=no
8439 fi
8440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8441 LIBS=$ac_check_lib_save_LIBS
8442 fi
8443 echo "$as_me:8443: result: $ac_cv_lib_mytinfo_tgoto" >&5
8444 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8445 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8446   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8447 fi
8448
8449         fi
8450         ;;
8451 esac
8452
8453 cf_add_libs="$LIBS"
8454 # reverse order
8455 cf_add_0lib=
8456 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8457 # filter duplicates
8458 for cf_add_1lib in $cf_add_0lib; do
8459         for cf_add_2lib in $cf_add_libs; do
8460                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8461                         cf_add_1lib=
8462                         break
8463                 fi
8464         done
8465         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8466 done
8467 LIBS="$cf_add_libs"
8468
8469 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8470 then
8471
8472 cf_add_libs="$LIBS"
8473 # reverse order
8474 cf_add_0lib=
8475 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8476 # filter duplicates
8477 for cf_add_1lib in $cf_add_0lib; do
8478         for cf_add_2lib in $cf_add_libs; do
8479                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8480                         cf_add_1lib=
8481                         break
8482                 fi
8483         done
8484         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8485 done
8486 LIBS="$cf_add_libs"
8487
8488 else
8489
8490         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8491         cf_libdir=""
8492         echo "$as_me:8492: checking for initscr" >&5
8493 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8494 if test "${ac_cv_func_initscr+set}" = set; then
8495   echo $ECHO_N "(cached) $ECHO_C" >&6
8496 else
8497   cat >conftest.$ac_ext <<_ACEOF
8498 #line 8498 "configure"
8499 #include "confdefs.h"
8500 #define initscr autoconf_temporary
8501 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8502 #undef initscr
8503
8504 #ifdef __cplusplus
8505 extern "C"
8506 #endif
8507
8508 /* We use char because int might match the return type of a gcc2
8509    builtin and then its argument prototype would still apply.  */
8510 char initscr (void);
8511
8512 int
8513 main (void)
8514 {
8515
8516 /* The GNU C library defines stubs for functions which it implements
8517     to always fail with ENOSYS.  Some functions are actually named
8518     something starting with __ and the normal name is an alias.  */
8519 #if defined (__stub_initscr) || defined (__stub___initscr)
8520 #error found stub for initscr
8521 #endif
8522
8523         return initscr ();
8524   ;
8525   return 0;
8526 }
8527 _ACEOF
8528 rm -f conftest.$ac_objext conftest$ac_exeext
8529 if { (eval echo "$as_me:8529: \"$ac_link\"") >&5
8530   (eval $ac_link) 2>&5
8531   ac_status=$?
8532   echo "$as_me:8532: \$? = $ac_status" >&5
8533   (exit $ac_status); } &&
8534          { ac_try='test -s conftest$ac_exeext'
8535   { (eval echo "$as_me:8535: \"$ac_try\"") >&5
8536   (eval $ac_try) 2>&5
8537   ac_status=$?
8538   echo "$as_me:8538: \$? = $ac_status" >&5
8539   (exit $ac_status); }; }; then
8540   ac_cv_func_initscr=yes
8541 else
8542   echo "$as_me: failed program was:" >&5
8543 cat conftest.$ac_ext >&5
8544 ac_cv_func_initscr=no
8545 fi
8546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8547 fi
8548 echo "$as_me:8548: result: $ac_cv_func_initscr" >&5
8549 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8550 if test $ac_cv_func_initscr = yes; then
8551   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8552 else
8553
8554                 cf_save_LIBS="$LIBS"
8555                 echo "$as_me:8555: checking for initscr in -l$cf_nculib_root" >&5
8556 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8557                 LIBS="-l$cf_nculib_root $LIBS"
8558                 cat >conftest.$ac_ext <<_ACEOF
8559 #line 8559 "configure"
8560 #include "confdefs.h"
8561 #include <${cf_cv_ncurses_header:-curses.h}>
8562 int
8563 main (void)
8564 {
8565 initscr()
8566   ;
8567   return 0;
8568 }
8569 _ACEOF
8570 rm -f conftest.$ac_objext conftest$ac_exeext
8571 if { (eval echo "$as_me:8571: \"$ac_link\"") >&5
8572   (eval $ac_link) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit $ac_status); } &&
8576          { ac_try='test -s conftest$ac_exeext'
8577   { (eval echo "$as_me:8577: \"$ac_try\"") >&5
8578   (eval $ac_try) 2>&5
8579   ac_status=$?
8580   echo "$as_me:8580: \$? = $ac_status" >&5
8581   (exit $ac_status); }; }; then
8582   echo "$as_me:8582: result: yes" >&5
8583 echo "${ECHO_T}yes" >&6
8584                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8585
8586 else
8587   echo "$as_me: failed program was:" >&5
8588 cat conftest.$ac_ext >&5
8589 echo "$as_me:8589: result: no" >&5
8590 echo "${ECHO_T}no" >&6
8591
8592 cf_search=
8593 cf_library_path_list=""
8594 if test -n "${LDFLAGS}${LIBS}" ; then
8595         for cf_library_path in $LDFLAGS $LIBS
8596         do
8597                 case $cf_library_path in
8598                 (-L*)
8599                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8600
8601 test "x$cf_library_path" != "xNONE" && \
8602 test -d "$cf_library_path" && \
8603  {
8604         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8605         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8606         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8607         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8608         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8609         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"
8610 }
8611
8612                         cf_library_path_list="$cf_library_path_list $cf_search"
8613                         ;;
8614                 esac
8615         done
8616 fi
8617
8618 cf_search=
8619
8620 test "x$prefix" != "xNONE" && \
8621 test -d "$prefix" && \
8622  {
8623         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8624         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8625         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8626         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8627         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8628         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8629 }
8630
8631 for cf_subdir_prefix in \
8632         /usr \
8633         /usr/local \
8634         /usr/pkg \
8635         /opt \
8636         /opt/local \
8637         $HOME
8638 do
8639
8640 test "x$cf_subdir_prefix" != "x$prefix" && \
8641 test -d "$cf_subdir_prefix" && \
8642 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8643         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8644         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8645         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8646         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8647         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8648         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"
8649 }
8650
8651 done
8652
8653 cf_search="$cf_library_path_list $cf_search"
8654
8655                         for cf_libdir in $cf_search
8656                         do
8657                                 echo "$as_me:8657: checking for -l$cf_nculib_root in $cf_libdir" >&5
8658 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8659                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8660                                 cat >conftest.$ac_ext <<_ACEOF
8661 #line 8661 "configure"
8662 #include "confdefs.h"
8663 #include <${cf_cv_ncurses_header:-curses.h}>
8664 int
8665 main (void)
8666 {
8667 initscr()
8668   ;
8669   return 0;
8670 }
8671 _ACEOF
8672 rm -f conftest.$ac_objext conftest$ac_exeext
8673 if { (eval echo "$as_me:8673: \"$ac_link\"") >&5
8674   (eval $ac_link) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit $ac_status); } &&
8678          { ac_try='test -s conftest$ac_exeext'
8679   { (eval echo "$as_me:8679: \"$ac_try\"") >&5
8680   (eval $ac_try) 2>&5
8681   ac_status=$?
8682   echo "$as_me:8682: \$? = $ac_status" >&5
8683   (exit $ac_status); }; }; then
8684   echo "$as_me:8684: result: yes" >&5
8685 echo "${ECHO_T}yes" >&6
8686                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8687                                          break
8688 else
8689   echo "$as_me: failed program was:" >&5
8690 cat conftest.$ac_ext >&5
8691 echo "$as_me:8691: result: no" >&5
8692 echo "${ECHO_T}no" >&6
8693                                          LIBS="$cf_save_LIBS"
8694 fi
8695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8696                         done
8697
8698 fi
8699 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8700
8701 fi
8702
8703 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8704
8705 if test $cf_found_library = no ; then
8706         { { echo "$as_me:8706: error: Cannot link $cf_nculib_root library" >&5
8707 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8708    { (exit 1); exit 1; }; }
8709 fi
8710
8711 fi
8712
8713 if test -n "$cf_ncurses_LIBS" ; then
8714         echo "$as_me:8714: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8715 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8716         cf_ncurses_SAVE="$LIBS"
8717         for p in $cf_ncurses_LIBS ; do
8718                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8719                 if test "$q" != "$LIBS" ; then
8720                         LIBS="$q"
8721                 fi
8722         done
8723         cat >conftest.$ac_ext <<_ACEOF
8724 #line 8724 "configure"
8725 #include "confdefs.h"
8726 #include <${cf_cv_ncurses_header:-curses.h}>
8727 int
8728 main (void)
8729 {
8730 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8731   ;
8732   return 0;
8733 }
8734 _ACEOF
8735 rm -f conftest.$ac_objext conftest$ac_exeext
8736 if { (eval echo "$as_me:8736: \"$ac_link\"") >&5
8737   (eval $ac_link) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit $ac_status); } &&
8741          { ac_try='test -s conftest$ac_exeext'
8742   { (eval echo "$as_me:8742: \"$ac_try\"") >&5
8743   (eval $ac_try) 2>&5
8744   ac_status=$?
8745   echo "$as_me:8745: \$? = $ac_status" >&5
8746   (exit $ac_status); }; }; then
8747   echo "$as_me:8747: result: yes" >&5
8748 echo "${ECHO_T}yes" >&6
8749 else
8750   echo "$as_me: failed program was:" >&5
8751 cat conftest.$ac_ext >&5
8752 echo "$as_me:8752: result: no" >&5
8753 echo "${ECHO_T}no" >&6
8754                  LIBS="$cf_ncurses_SAVE"
8755 fi
8756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8757 fi
8758
8759 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8760
8761 cat >>confdefs.h <<EOF
8762 #define $cf_nculib_ROOT 1
8763 EOF
8764
8765         fi
8766 else
8767         NCURSES_CONFIG=none
8768 fi
8769
8770 else
8771
8772 cf_ncuconfig_root=ncurses
8773 cf_have_ncuconfig=no
8774
8775 if test "x${PKG_CONFIG:=none}" != xnone; then
8776         echo "$as_me:8776: checking pkg-config for $cf_ncuconfig_root" >&5
8777 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8778         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8779                 echo "$as_me:8779: result: yes" >&5
8780 echo "${ECHO_T}yes" >&6
8781
8782                 echo "$as_me:8782: checking if the $cf_ncuconfig_root package files work" >&5
8783 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8784                 cf_have_ncuconfig=unknown
8785
8786                 cf_save_CFLAGS="$CFLAGS"
8787                 cf_save_CPPFLAGS="$CPPFLAGS"
8788                 cf_save_LIBS="$LIBS"
8789
8790                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8791                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8792
8793                 # while -W for passing linker flags is prevalent, it is not "standard".
8794                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8795                 # incompatible _and_ non-standard -W option which gives an error.  Work
8796                 # around that pitfall.
8797                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8798                 (x*c[89]9@@*-W*)
8799
8800 cf_fix_cppflags=no
8801 cf_new_cflags=
8802 cf_new_cppflags=
8803 cf_new_extra_cppflags=
8804
8805 for cf_add_cflags in $cf_pkg_cflags
8806 do
8807 case $cf_fix_cppflags in
8808 (no)
8809         case $cf_add_cflags in
8810         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8811                 case $cf_add_cflags in
8812                 (-D*)
8813                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8814
8815                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8816                                 && test -z "${cf_tst_cflags}" \
8817                                 && cf_fix_cppflags=yes
8818
8819                         if test $cf_fix_cppflags = yes ; then
8820
8821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8823
8824                                 continue
8825                         elif test "${cf_tst_cflags}" = "\"'" ; then
8826
8827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8829
8830                                 continue
8831                         fi
8832                         ;;
8833                 esac
8834                 case "$CPPFLAGS" in
8835                 (*$cf_add_cflags)
8836                         ;;
8837                 (*)
8838                         case $cf_add_cflags in
8839                         (-D*)
8840                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8841
8842 CPPFLAGS=`echo "$CPPFLAGS" | \
8843         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8844                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8845
8846                                 ;;
8847                         esac
8848
8849         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8850         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8851
8852                         ;;
8853                 esac
8854                 ;;
8855         (*)
8856
8857         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8858         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8859
8860                 ;;
8861         esac
8862         ;;
8863 (yes)
8864
8865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8867
8868         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8869
8870         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8871                 && test -z "${cf_tst_cflags}" \
8872                 && cf_fix_cppflags=no
8873         ;;
8874 esac
8875 done
8876
8877 if test -n "$cf_new_cflags" ; then
8878
8879         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8880         CFLAGS="${CFLAGS}$cf_new_cflags"
8881
8882 fi
8883
8884 if test -n "$cf_new_cppflags" ; then
8885
8886         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8887         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8888
8889 fi
8890
8891 if test -n "$cf_new_extra_cppflags" ; then
8892
8893         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8894         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8895
8896 fi
8897
8898 cf_add_libs="$LIBS"
8899 # reverse order
8900 cf_add_0lib=
8901 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8902 # filter duplicates
8903 for cf_add_1lib in $cf_add_0lib; do
8904         for cf_add_2lib in $cf_add_libs; do
8905                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8906                         cf_add_1lib=
8907                         break
8908                 fi
8909         done
8910         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8911 done
8912 LIBS="$cf_add_libs"
8913
8914                         cat >conftest.$ac_ext <<_ACEOF
8915 #line 8915 "configure"
8916 #include "confdefs.h"
8917 #include <${cf_cv_ncurses_header:-curses.h}>
8918 int
8919 main (void)
8920 {
8921 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8922   ;
8923   return 0;
8924 }
8925 _ACEOF
8926 rm -f conftest.$ac_objext conftest$ac_exeext
8927 if { (eval echo "$as_me:8927: \"$ac_link\"") >&5
8928   (eval $ac_link) 2>&5
8929   ac_status=$?
8930   echo "$as_me:8930: \$? = $ac_status" >&5
8931   (exit $ac_status); } &&
8932          { ac_try='test -s conftest$ac_exeext'
8933   { (eval echo "$as_me:8933: \"$ac_try\"") >&5
8934   (eval $ac_try) 2>&5
8935   ac_status=$?
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit $ac_status); }; }; then
8938   if test "$cross_compiling" = yes; then
8939   cf_test_ncuconfig=maybe
8940 else
8941   cat >conftest.$ac_ext <<_ACEOF
8942 #line 8942 "configure"
8943 #include "confdefs.h"
8944 #include <${cf_cv_ncurses_header:-curses.h}>
8945                                         int main(void)
8946                                         { char *xx = curses_version(); return (xx == 0); }
8947 _ACEOF
8948 rm -f conftest$ac_exeext
8949 if { (eval echo "$as_me:8949: \"$ac_link\"") >&5
8950   (eval $ac_link) 2>&5
8951   ac_status=$?
8952   echo "$as_me:8952: \$? = $ac_status" >&5
8953   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8954   { (eval echo "$as_me:8954: \"$ac_try\"") >&5
8955   (eval $ac_try) 2>&5
8956   ac_status=$?
8957   echo "$as_me:8957: \$? = $ac_status" >&5
8958   (exit $ac_status); }; }; then
8959   cf_test_ncuconfig=yes
8960 else
8961   echo "$as_me: program exited with status $ac_status" >&5
8962 echo "$as_me: failed program was:" >&5
8963 cat conftest.$ac_ext >&5
8964 cf_test_ncuconfig=no
8965 fi
8966 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8967 fi
8968 else
8969   echo "$as_me: failed program was:" >&5
8970 cat conftest.$ac_ext >&5
8971 cf_test_ncuconfig=no
8972 fi
8973 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8974
8975                         CFLAGS="$cf_save_CFLAGS"
8976                         CPPFLAGS="$cf_save_CPPFLAGS"
8977                         LIBS="$cf_save_LIBS"
8978
8979                         if test "x$cf_test_ncuconfig" != xyes; then
8980                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8981                                 cf_pkg_cflags="$cf_temp"
8982                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8983                                 cf_pkg_libs="$cf_temp"
8984                         fi
8985                         ;;
8986                 esac
8987
8988 cf_fix_cppflags=no
8989 cf_new_cflags=
8990 cf_new_cppflags=
8991 cf_new_extra_cppflags=
8992
8993 for cf_add_cflags in $cf_pkg_cflags
8994 do
8995 case $cf_fix_cppflags in
8996 (no)
8997         case $cf_add_cflags in
8998         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8999                 case $cf_add_cflags in
9000                 (-D*)
9001                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9002
9003                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9004                                 && test -z "${cf_tst_cflags}" \
9005                                 && cf_fix_cppflags=yes
9006
9007                         if test $cf_fix_cppflags = yes ; then
9008
9009         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9010         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9011
9012                                 continue
9013                         elif test "${cf_tst_cflags}" = "\"'" ; then
9014
9015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9017
9018                                 continue
9019                         fi
9020                         ;;
9021                 esac
9022                 case "$CPPFLAGS" in
9023                 (*$cf_add_cflags)
9024                         ;;
9025                 (*)
9026                         case $cf_add_cflags in
9027                         (-D*)
9028                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9029
9030 CPPFLAGS=`echo "$CPPFLAGS" | \
9031         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9032                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9033
9034                                 ;;
9035                         esac
9036
9037         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9038         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9039
9040                         ;;
9041                 esac
9042                 ;;
9043         (*)
9044
9045         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9046         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9047
9048                 ;;
9049         esac
9050         ;;
9051 (yes)
9052
9053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9055
9056         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9057
9058         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9059                 && test -z "${cf_tst_cflags}" \
9060                 && cf_fix_cppflags=no
9061         ;;
9062 esac
9063 done
9064
9065 if test -n "$cf_new_cflags" ; then
9066
9067         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9068         CFLAGS="${CFLAGS}$cf_new_cflags"
9069
9070 fi
9071
9072 if test -n "$cf_new_cppflags" ; then
9073
9074         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9075         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9076
9077 fi
9078
9079 if test -n "$cf_new_extra_cppflags" ; then
9080
9081         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9082         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9083
9084 fi
9085
9086 cf_add_libs="$LIBS"
9087 # reverse order
9088 cf_add_0lib=
9089 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9090 # filter duplicates
9091 for cf_add_1lib in $cf_add_0lib; do
9092         for cf_add_2lib in $cf_add_libs; do
9093                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9094                         cf_add_1lib=
9095                         break
9096                 fi
9097         done
9098         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9099 done
9100 LIBS="$cf_add_libs"
9101
9102                 cat >conftest.$ac_ext <<_ACEOF
9103 #line 9103 "configure"
9104 #include "confdefs.h"
9105 #include <${cf_cv_ncurses_header:-curses.h}>
9106 int
9107 main (void)
9108 {
9109 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9110   ;
9111   return 0;
9112 }
9113 _ACEOF
9114 rm -f conftest.$ac_objext conftest$ac_exeext
9115 if { (eval echo "$as_me:9115: \"$ac_link\"") >&5
9116   (eval $ac_link) 2>&5
9117   ac_status=$?
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit $ac_status); } &&
9120          { ac_try='test -s conftest$ac_exeext'
9121   { (eval echo "$as_me:9121: \"$ac_try\"") >&5
9122   (eval $ac_try) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit $ac_status); }; }; then
9126   if test "$cross_compiling" = yes; then
9127   cf_have_ncuconfig=maybe
9128 else
9129   cat >conftest.$ac_ext <<_ACEOF
9130 #line 9130 "configure"
9131 #include "confdefs.h"
9132 #include <${cf_cv_ncurses_header:-curses.h}>
9133                                 int main(void)
9134                                 { char *xx = curses_version(); return (xx == 0); }
9135 _ACEOF
9136 rm -f conftest$ac_exeext
9137 if { (eval echo "$as_me:9137: \"$ac_link\"") >&5
9138   (eval $ac_link) 2>&5
9139   ac_status=$?
9140   echo "$as_me:9140: \$? = $ac_status" >&5
9141   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9142   { (eval echo "$as_me:9142: \"$ac_try\"") >&5
9143   (eval $ac_try) 2>&5
9144   ac_status=$?
9145   echo "$as_me:9145: \$? = $ac_status" >&5
9146   (exit $ac_status); }; }; then
9147   cf_have_ncuconfig=yes
9148 else
9149   echo "$as_me: program exited with status $ac_status" >&5
9150 echo "$as_me: failed program was:" >&5
9151 cat conftest.$ac_ext >&5
9152 cf_have_ncuconfig=no
9153 fi
9154 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9155 fi
9156 else
9157   echo "$as_me: failed program was:" >&5
9158 cat conftest.$ac_ext >&5
9159 cf_have_ncuconfig=no
9160 fi
9161 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9162                 echo "$as_me:9162: result: $cf_have_ncuconfig" >&5
9163 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9164                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9165                 if test "$cf_have_ncuconfig" != "yes"
9166                 then
9167                         CPPFLAGS="$cf_save_CPPFLAGS"
9168                         LIBS="$cf_save_LIBS"
9169                         NCURSES_CONFIG_PKG=none
9170                 else
9171
9172 cat >>confdefs.h <<\EOF
9173 #define NCURSES 1
9174 EOF
9175
9176                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9177
9178 echo "$as_me:9178: checking for terminfo header" >&5
9179 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9180 if test "${cf_cv_term_header+set}" = set; then
9181   echo $ECHO_N "(cached) $ECHO_C" >&6
9182 else
9183
9184 case ${cf_cv_ncurses_header} in
9185 (*/ncurses.h|*/ncursesw.h)
9186         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9187         ;;
9188 (*)
9189         cf_term_header=term.h
9190         ;;
9191 esac
9192
9193 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9194 do
9195 cat >conftest.$ac_ext <<_ACEOF
9196 #line 9196 "configure"
9197 #include "confdefs.h"
9198 #include <stdio.h>
9199 #include <${cf_cv_ncurses_header:-curses.h}>
9200 #include <$cf_test>
9201
9202 int
9203 main (void)
9204 {
9205 int x = auto_left_margin; (void)x
9206   ;
9207   return 0;
9208 }
9209 _ACEOF
9210 rm -f conftest.$ac_objext
9211 if { (eval echo "$as_me:9211: \"$ac_compile\"") >&5
9212   (eval $ac_compile) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit $ac_status); } &&
9216          { ac_try='test -s conftest.$ac_objext'
9217   { (eval echo "$as_me:9217: \"$ac_try\"") >&5
9218   (eval $ac_try) 2>&5
9219   ac_status=$?
9220   echo "$as_me:9220: \$? = $ac_status" >&5
9221   (exit $ac_status); }; }; then
9222
9223         cf_cv_term_header="$cf_test"
9224 else
9225   echo "$as_me: failed program was:" >&5
9226 cat conftest.$ac_ext >&5
9227
9228         cf_cv_term_header=unknown
9229
9230 fi
9231 rm -f conftest.$ac_objext conftest.$ac_ext
9232         test "$cf_cv_term_header" != unknown && break
9233 done
9234
9235 fi
9236 echo "$as_me:9236: result: $cf_cv_term_header" >&5
9237 echo "${ECHO_T}$cf_cv_term_header" >&6
9238
9239 # Set definitions to allow ifdef'ing to accommodate subdirectories
9240
9241 case $cf_cv_term_header in
9242 (*term.h)
9243
9244 cat >>confdefs.h <<\EOF
9245 #define HAVE_TERM_H 1
9246 EOF
9247
9248         ;;
9249 esac
9250
9251 case $cf_cv_term_header in
9252 (ncurses/term.h)
9253
9254 cat >>confdefs.h <<\EOF
9255 #define HAVE_NCURSES_TERM_H 1
9256 EOF
9257
9258         ;;
9259 (ncursesw/term.h)
9260
9261 cat >>confdefs.h <<\EOF
9262 #define HAVE_NCURSESW_TERM_H 1
9263 EOF
9264
9265         ;;
9266 esac
9267
9268                 fi
9269
9270         else
9271                 echo "$as_me:9271: result: no" >&5
9272 echo "${ECHO_T}no" >&6
9273                 NCURSES_CONFIG_PKG=none
9274         fi
9275 else
9276         NCURSES_CONFIG_PKG=none
9277 fi
9278
9279 if test "x$cf_have_ncuconfig" = "xno"; then
9280         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9281
9282 if test -n "$ac_tool_prefix"; then
9283   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9284   do
9285     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9286 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9287 echo "$as_me:9287: checking for $ac_word" >&5
9288 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9289 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9290   echo $ECHO_N "(cached) $ECHO_C" >&6
9291 else
9292   if test -n "$NCURSES_CONFIG"; then
9293   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9294 else
9295   ac_save_IFS=$IFS; IFS=$ac_path_separator
9296 ac_dummy="$PATH"
9297 for ac_dir in $ac_dummy; do
9298   IFS=$ac_save_IFS
9299   test -z "$ac_dir" && ac_dir=.
9300   $as_executable_p "$ac_dir/$ac_word" || continue
9301 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9302 echo "$as_me:9302: found $ac_dir/$ac_word" >&5
9303 break
9304 done
9305
9306 fi
9307 fi
9308 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9309 if test -n "$NCURSES_CONFIG"; then
9310   echo "$as_me:9310: result: $NCURSES_CONFIG" >&5
9311 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9312 else
9313   echo "$as_me:9313: result: no" >&5
9314 echo "${ECHO_T}no" >&6
9315 fi
9316
9317     test -n "$NCURSES_CONFIG" && break
9318   done
9319 fi
9320 if test -z "$NCURSES_CONFIG"; then
9321   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9322   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9323 do
9324   # Extract the first word of "$ac_prog", so it can be a program name with args.
9325 set dummy $ac_prog; ac_word=$2
9326 echo "$as_me:9326: checking for $ac_word" >&5
9327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9328 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9329   echo $ECHO_N "(cached) $ECHO_C" >&6
9330 else
9331   if test -n "$ac_ct_NCURSES_CONFIG"; then
9332   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9333 else
9334   ac_save_IFS=$IFS; IFS=$ac_path_separator
9335 ac_dummy="$PATH"
9336 for ac_dir in $ac_dummy; do
9337   IFS=$ac_save_IFS
9338   test -z "$ac_dir" && ac_dir=.
9339   $as_executable_p "$ac_dir/$ac_word" || continue
9340 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9341 echo "$as_me:9341: found $ac_dir/$ac_word" >&5
9342 break
9343 done
9344
9345 fi
9346 fi
9347 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9348 if test -n "$ac_ct_NCURSES_CONFIG"; then
9349   echo "$as_me:9349: result: $ac_ct_NCURSES_CONFIG" >&5
9350 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9351 else
9352   echo "$as_me:9352: result: no" >&5
9353 echo "${ECHO_T}no" >&6
9354 fi
9355
9356   test -n "$ac_ct_NCURSES_CONFIG" && break
9357 done
9358 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9359
9360   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9361 fi
9362
9363         if test "$NCURSES_CONFIG" != none ; then
9364
9365 cf_fix_cppflags=no
9366 cf_new_cflags=
9367 cf_new_cppflags=
9368 cf_new_extra_cppflags=
9369
9370 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9371 do
9372 case $cf_fix_cppflags in
9373 (no)
9374         case $cf_add_cflags in
9375         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9376                 case $cf_add_cflags in
9377                 (-D*)
9378                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9379
9380                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9381                                 && test -z "${cf_tst_cflags}" \
9382                                 && cf_fix_cppflags=yes
9383
9384                         if test $cf_fix_cppflags = yes ; then
9385
9386         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9387         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9388
9389                                 continue
9390                         elif test "${cf_tst_cflags}" = "\"'" ; then
9391
9392         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9393         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9394
9395                                 continue
9396                         fi
9397                         ;;
9398                 esac
9399                 case "$CPPFLAGS" in
9400                 (*$cf_add_cflags)
9401                         ;;
9402                 (*)
9403                         case $cf_add_cflags in
9404                         (-D*)
9405                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9406
9407 CPPFLAGS=`echo "$CPPFLAGS" | \
9408         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9409                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9410
9411                                 ;;
9412                         esac
9413
9414         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9415         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9416
9417                         ;;
9418                 esac
9419                 ;;
9420         (*)
9421
9422         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9423         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9424
9425                 ;;
9426         esac
9427         ;;
9428 (yes)
9429
9430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9432
9433         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9434
9435         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9436                 && test -z "${cf_tst_cflags}" \
9437                 && cf_fix_cppflags=no
9438         ;;
9439 esac
9440 done
9441
9442 if test -n "$cf_new_cflags" ; then
9443
9444         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9445         CFLAGS="${CFLAGS}$cf_new_cflags"
9446
9447 fi
9448
9449 if test -n "$cf_new_cppflags" ; then
9450
9451         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9452         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9453
9454 fi
9455
9456 if test -n "$cf_new_extra_cppflags" ; then
9457
9458         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9459         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9460
9461 fi
9462
9463 cf_add_libs="$LIBS"
9464 # reverse order
9465 cf_add_0lib=
9466 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9467 # filter duplicates
9468 for cf_add_1lib in $cf_add_0lib; do
9469         for cf_add_2lib in $cf_add_libs; do
9470                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9471                         cf_add_1lib=
9472                         break
9473                 fi
9474         done
9475         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9476 done
9477 LIBS="$cf_add_libs"
9478
9479                 # even with config script, some packages use no-override for curses.h
9480
9481 echo "$as_me:9481: checking if we have identified curses headers" >&5
9482 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9483 if test "${cf_cv_ncurses_header+set}" = set; then
9484   echo $ECHO_N "(cached) $ECHO_C" >&6
9485 else
9486
9487 cf_cv_ncurses_header=none
9488 for cf_header in \
9489         ncurses.h ncurses/ncurses.h \
9490         curses.h ncurses/curses.h
9491 do
9492 cat >conftest.$ac_ext <<_ACEOF
9493 #line 9493 "configure"
9494 #include "confdefs.h"
9495 #include <${cf_header}>
9496 int
9497 main (void)
9498 {
9499 initscr(); tgoto("?", 0,0)
9500   ;
9501   return 0;
9502 }
9503 _ACEOF
9504 rm -f conftest.$ac_objext
9505 if { (eval echo "$as_me:9505: \"$ac_compile\"") >&5
9506   (eval $ac_compile) 2>&5
9507   ac_status=$?
9508   echo "$as_me:9508: \$? = $ac_status" >&5
9509   (exit $ac_status); } &&
9510          { ac_try='test -s conftest.$ac_objext'
9511   { (eval echo "$as_me:9511: \"$ac_try\"") >&5
9512   (eval $ac_try) 2>&5
9513   ac_status=$?
9514   echo "$as_me:9514: \$? = $ac_status" >&5
9515   (exit $ac_status); }; }; then
9516   cf_cv_ncurses_header=$cf_header; break
9517 else
9518   echo "$as_me: failed program was:" >&5
9519 cat conftest.$ac_ext >&5
9520 fi
9521 rm -f conftest.$ac_objext conftest.$ac_ext
9522 done
9523
9524 fi
9525 echo "$as_me:9525: result: $cf_cv_ncurses_header" >&5
9526 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9527
9528 if test "$cf_cv_ncurses_header" = none ; then
9529         { { echo "$as_me:9529: error: No curses header-files found" >&5
9530 echo "$as_me: error: No curses header-files found" >&2;}
9531    { (exit 1); exit 1; }; }
9532 fi
9533
9534 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9535
9536 for ac_header in $cf_cv_ncurses_header
9537 do
9538 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9539 echo "$as_me:9539: checking for $ac_header" >&5
9540 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9541 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9542   echo $ECHO_N "(cached) $ECHO_C" >&6
9543 else
9544   cat >conftest.$ac_ext <<_ACEOF
9545 #line 9545 "configure"
9546 #include "confdefs.h"
9547 #include <$ac_header>
9548 _ACEOF
9549 if { (eval echo "$as_me:9549: \"$ac_cpp conftest.$ac_ext\"") >&5
9550   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9551   ac_status=$?
9552   egrep -v '^ *\+' conftest.er1 >conftest.err
9553   rm -f conftest.er1
9554   cat conftest.err >&5
9555   echo "$as_me:9555: \$? = $ac_status" >&5
9556   (exit $ac_status); } >/dev/null; then
9557   if test -s conftest.err; then
9558     ac_cpp_err=$ac_c_preproc_warn_flag
9559   else
9560     ac_cpp_err=
9561   fi
9562 else
9563   ac_cpp_err=yes
9564 fi
9565 if test -z "$ac_cpp_err"; then
9566   eval "$as_ac_Header=yes"
9567 else
9568   echo "$as_me: failed program was:" >&5
9569   cat conftest.$ac_ext >&5
9570   eval "$as_ac_Header=no"
9571 fi
9572 rm -f conftest.err conftest.$ac_ext
9573 fi
9574 echo "$as_me:9574: result: `eval echo '${'$as_ac_Header'}'`" >&5
9575 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9576 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9577   cat >>confdefs.h <<EOF
9578 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9579 EOF
9580
9581 fi
9582 done
9583
9584 cat >>confdefs.h <<\EOF
9585 #define NCURSES 1
9586 EOF
9587
9588 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9589
9590                 cat >>confdefs.h <<EOF
9591 #define $cf_nculib_ROOT 1
9592 EOF
9593
9594                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9595
9596         else
9597
9598 cf_ncuhdr_root=ncurses
9599
9600 test -n "$cf_cv_curses_dir" && \
9601 test "$cf_cv_curses_dir" != "no" && { \
9602
9603 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9604   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9605   do
9606         while test $cf_add_incdir != /usr/include
9607         do
9608           if test -d $cf_add_incdir
9609           then
9610                 cf_have_incdir=no
9611                 if test -n "$CFLAGS$CPPFLAGS" ; then
9612                   # a loop is needed to ensure we can add subdirs of existing dirs
9613                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9614                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9615                           cf_have_incdir=yes; break
9616                         fi
9617                   done
9618                 fi
9619
9620                 if test "$cf_have_incdir" = no ; then
9621                   if test "$cf_add_incdir" = /usr/local/include ; then
9622                         if test "$GCC" = yes
9623                         then
9624                           cf_save_CPPFLAGS=$CPPFLAGS
9625
9626         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9627         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9628
9629                           cat >conftest.$ac_ext <<_ACEOF
9630 #line 9630 "configure"
9631 #include "confdefs.h"
9632 #include <stdio.h>
9633 int
9634 main (void)
9635 {
9636 printf("Hello")
9637   ;
9638   return 0;
9639 }
9640 _ACEOF
9641 rm -f conftest.$ac_objext
9642 if { (eval echo "$as_me:9642: \"$ac_compile\"") >&5
9643   (eval $ac_compile) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); } &&
9647          { ac_try='test -s conftest.$ac_objext'
9648   { (eval echo "$as_me:9648: \"$ac_try\"") >&5
9649   (eval $ac_try) 2>&5
9650   ac_status=$?
9651   echo "$as_me:9651: \$? = $ac_status" >&5
9652   (exit $ac_status); }; }; then
9653   :
9654 else
9655   echo "$as_me: failed program was:" >&5
9656 cat conftest.$ac_ext >&5
9657 cf_have_incdir=yes
9658 fi
9659 rm -f conftest.$ac_objext conftest.$ac_ext
9660                           CPPFLAGS=$cf_save_CPPFLAGS
9661                         fi
9662                   fi
9663                 fi
9664
9665                 if test "$cf_have_incdir" = no ; then
9666                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9667
9668 echo "${as_me:-configure}:9668: testing adding $cf_add_incdir to include-path ..." 1>&5
9669
9670                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9671
9672                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9673                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9674                   cf_add_incdir="$cf_top_incdir"
9675                 else
9676                   break
9677                 fi
9678           else
9679                 break
9680           fi
9681         done
9682   done
9683 fi
9684
9685 }
9686
9687 echo "$as_me:9687: checking for $cf_ncuhdr_root header in include-path" >&5
9688 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9689 if test "${cf_cv_ncurses_h+set}" = set; then
9690   echo $ECHO_N "(cached) $ECHO_C" >&6
9691 else
9692
9693         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9694         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9695         for cf_header in $cf_header_list
9696         do
9697
9698         cat >conftest.$ac_ext <<_ACEOF
9699 #line 9699 "configure"
9700 #include "confdefs.h"
9701
9702 #include <$cf_header>
9703 int
9704 main (void)
9705 {
9706
9707 #ifdef NCURSES_VERSION
9708
9709 printf("%s\n", NCURSES_VERSION);
9710 #else
9711 #ifdef __NCURSES_H
9712 printf("old\n");
9713 #else
9714         make an error
9715 #endif
9716 #endif
9717
9718   ;
9719   return 0;
9720 }
9721 _ACEOF
9722 rm -f conftest.$ac_objext
9723 if { (eval echo "$as_me:9723: \"$ac_compile\"") >&5
9724   (eval $ac_compile) 2>&5
9725   ac_status=$?
9726   echo "$as_me:9726: \$? = $ac_status" >&5
9727   (exit $ac_status); } &&
9728          { ac_try='test -s conftest.$ac_objext'
9729   { (eval echo "$as_me:9729: \"$ac_try\"") >&5
9730   (eval $ac_try) 2>&5
9731   ac_status=$?
9732   echo "$as_me:9732: \$? = $ac_status" >&5
9733   (exit $ac_status); }; }; then
9734   cf_cv_ncurses_h=$cf_header
9735
9736 else
9737   echo "$as_me: failed program was:" >&5
9738 cat conftest.$ac_ext >&5
9739 cf_cv_ncurses_h=no
9740 fi
9741 rm -f conftest.$ac_objext conftest.$ac_ext
9742
9743                 test "$cf_cv_ncurses_h" != no && break
9744         done
9745
9746 fi
9747 echo "$as_me:9747: result: $cf_cv_ncurses_h" >&5
9748 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9749
9750 if test "$cf_cv_ncurses_h" != no ; then
9751         cf_cv_ncurses_header=$cf_cv_ncurses_h
9752 else
9753
9754 echo "$as_me:9754: checking for $cf_ncuhdr_root include-path" >&5
9755 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9756 if test "${cf_cv_ncurses_h2+set}" = set; then
9757   echo $ECHO_N "(cached) $ECHO_C" >&6
9758 else
9759
9760         test -n "$verbose" && echo
9761
9762 cf_search=
9763
9764 # collect the current set of include-directories from compiler flags
9765 cf_header_path_list=""
9766 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9767         for cf_header_path in $CPPFLAGS $CFLAGS
9768         do
9769                 case $cf_header_path in
9770                 (-I*)
9771                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9772
9773 test "x$cf_header_path" != "xNONE" && \
9774 test -d "$cf_header_path" && \
9775  {
9776         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9777         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9778         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9779         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9780         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9781         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"
9782 }
9783
9784                         cf_header_path_list="$cf_header_path_list $cf_search"
9785                         ;;
9786                 esac
9787         done
9788 fi
9789
9790 # add the variations for the package we are looking for
9791
9792 cf_search=
9793
9794 test "x$prefix" != "xNONE" && \
9795 test -d "$prefix" && \
9796  {
9797         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9798         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9799         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9800         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9801         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9802         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9803 }
9804
9805 for cf_subdir_prefix in \
9806         /usr \
9807         /usr/local \
9808         /usr/pkg \
9809         /opt \
9810         /opt/local \
9811         $HOME
9812 do
9813
9814 test "x$cf_subdir_prefix" != "x$prefix" && \
9815 test -d "$cf_subdir_prefix" && \
9816 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9817         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9818         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9819         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9820         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9821         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9822         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"
9823 }
9824
9825 done
9826
9827 test "$includedir" != NONE && \
9828 test "$includedir" != "/usr/include" && \
9829 test -d "$includedir" && {
9830         test -d $includedir &&    cf_search="$cf_search $includedir"
9831         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9832 }
9833
9834 test "$oldincludedir" != NONE && \
9835 test "$oldincludedir" != "/usr/include" && \
9836 test -d "$oldincludedir" && {
9837         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9838         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9839 }
9840
9841 cf_search="$cf_search $cf_header_path_list"
9842
9843         test -n "$verbose" && echo search path $cf_search
9844         cf_save2_CPPFLAGS="$CPPFLAGS"
9845         for cf_incdir in $cf_search
9846         do
9847
9848 if test -n "$cf_incdir" ; then
9849   for cf_add_incdir in $cf_incdir
9850   do
9851         while test $cf_add_incdir != /usr/include
9852         do
9853           if test -d $cf_add_incdir
9854           then
9855                 cf_have_incdir=no
9856                 if test -n "$CFLAGS$CPPFLAGS" ; then
9857                   # a loop is needed to ensure we can add subdirs of existing dirs
9858                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9859                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9860                           cf_have_incdir=yes; break
9861                         fi
9862                   done
9863                 fi
9864
9865                 if test "$cf_have_incdir" = no ; then
9866                   if test "$cf_add_incdir" = /usr/local/include ; then
9867                         if test "$GCC" = yes
9868                         then
9869                           cf_save_CPPFLAGS=$CPPFLAGS
9870
9871         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9872         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9873
9874                           cat >conftest.$ac_ext <<_ACEOF
9875 #line 9875 "configure"
9876 #include "confdefs.h"
9877 #include <stdio.h>
9878 int
9879 main (void)
9880 {
9881 printf("Hello")
9882   ;
9883   return 0;
9884 }
9885 _ACEOF
9886 rm -f conftest.$ac_objext
9887 if { (eval echo "$as_me:9887: \"$ac_compile\"") >&5
9888   (eval $ac_compile) 2>&5
9889   ac_status=$?
9890   echo "$as_me:9890: \$? = $ac_status" >&5
9891   (exit $ac_status); } &&
9892          { ac_try='test -s conftest.$ac_objext'
9893   { (eval echo "$as_me:9893: \"$ac_try\"") >&5
9894   (eval $ac_try) 2>&5
9895   ac_status=$?
9896   echo "$as_me:9896: \$? = $ac_status" >&5
9897   (exit $ac_status); }; }; then
9898   :
9899 else
9900   echo "$as_me: failed program was:" >&5
9901 cat conftest.$ac_ext >&5
9902 cf_have_incdir=yes
9903 fi
9904 rm -f conftest.$ac_objext conftest.$ac_ext
9905                           CPPFLAGS=$cf_save_CPPFLAGS
9906                         fi
9907                   fi
9908                 fi
9909
9910                 if test "$cf_have_incdir" = no ; then
9911                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9912
9913 echo "${as_me:-configure}:9913: testing adding $cf_add_incdir to include-path ..." 1>&5
9914
9915                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9916
9917                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9918                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9919                   cf_add_incdir="$cf_top_incdir"
9920                 else
9921                   break
9922                 fi
9923           else
9924                 break
9925           fi
9926         done
9927   done
9928 fi
9929
9930                 for cf_header in \
9931                         ncurses.h \
9932                         curses.h
9933                 do
9934
9935         cat >conftest.$ac_ext <<_ACEOF
9936 #line 9936 "configure"
9937 #include "confdefs.h"
9938
9939 #include <$cf_header>
9940 int
9941 main (void)
9942 {
9943
9944 #ifdef NCURSES_VERSION
9945
9946 printf("%s\n", NCURSES_VERSION);
9947 #else
9948 #ifdef __NCURSES_H
9949 printf("old\n");
9950 #else
9951         make an error
9952 #endif
9953 #endif
9954
9955   ;
9956   return 0;
9957 }
9958 _ACEOF
9959 rm -f conftest.$ac_objext
9960 if { (eval echo "$as_me:9960: \"$ac_compile\"") >&5
9961   (eval $ac_compile) 2>&5
9962   ac_status=$?
9963   echo "$as_me:9963: \$? = $ac_status" >&5
9964   (exit $ac_status); } &&
9965          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_ncurses_h2=$cf_header
9972
9973 else
9974   echo "$as_me: failed program was:" >&5
9975 cat conftest.$ac_ext >&5
9976 cf_cv_ncurses_h2=no
9977 fi
9978 rm -f conftest.$ac_objext conftest.$ac_ext
9979
9980                         if test "$cf_cv_ncurses_h2" != no ; then
9981                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9982                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9983                                 break
9984                         fi
9985                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9986                 done
9987                 CPPFLAGS="$cf_save2_CPPFLAGS"
9988                 test "$cf_cv_ncurses_h2" != no && break
9989         done
9990         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9990: error: not found" >&5
9991 echo "$as_me: error: not found" >&2;}
9992    { (exit 1); exit 1; }; }
9993
9994 fi
9995 echo "$as_me:9995: result: $cf_cv_ncurses_h2" >&5
9996 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9997
9998         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9999         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10000         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10001                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10002         fi
10003
10004 if test -n "$cf_1st_incdir" ; then
10005   for cf_add_incdir in $cf_1st_incdir
10006   do
10007         while test $cf_add_incdir != /usr/include
10008         do
10009           if test -d $cf_add_incdir
10010           then
10011                 cf_have_incdir=no
10012                 if test -n "$CFLAGS$CPPFLAGS" ; then
10013                   # a loop is needed to ensure we can add subdirs of existing dirs
10014                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10015                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10016                           cf_have_incdir=yes; break
10017                         fi
10018                   done
10019                 fi
10020
10021                 if test "$cf_have_incdir" = no ; then
10022                   if test "$cf_add_incdir" = /usr/local/include ; then
10023                         if test "$GCC" = yes
10024                         then
10025                           cf_save_CPPFLAGS=$CPPFLAGS
10026
10027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10028         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10029
10030                           cat >conftest.$ac_ext <<_ACEOF
10031 #line 10031 "configure"
10032 #include "confdefs.h"
10033 #include <stdio.h>
10034 int
10035 main (void)
10036 {
10037 printf("Hello")
10038   ;
10039   return 0;
10040 }
10041 _ACEOF
10042 rm -f conftest.$ac_objext
10043 if { (eval echo "$as_me:10043: \"$ac_compile\"") >&5
10044   (eval $ac_compile) 2>&5
10045   ac_status=$?
10046   echo "$as_me:10046: \$? = $ac_status" >&5
10047   (exit $ac_status); } &&
10048          { ac_try='test -s conftest.$ac_objext'
10049   { (eval echo "$as_me:10049: \"$ac_try\"") >&5
10050   (eval $ac_try) 2>&5
10051   ac_status=$?
10052   echo "$as_me:10052: \$? = $ac_status" >&5
10053   (exit $ac_status); }; }; then
10054   :
10055 else
10056   echo "$as_me: failed program was:" >&5
10057 cat conftest.$ac_ext >&5
10058 cf_have_incdir=yes
10059 fi
10060 rm -f conftest.$ac_objext conftest.$ac_ext
10061                           CPPFLAGS=$cf_save_CPPFLAGS
10062                         fi
10063                   fi
10064                 fi
10065
10066                 if test "$cf_have_incdir" = no ; then
10067                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10068
10069 echo "${as_me:-configure}:10069: testing adding $cf_add_incdir to include-path ..." 1>&5
10070
10071                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10072
10073                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10074                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10075                   cf_add_incdir="$cf_top_incdir"
10076                 else
10077                   break
10078                 fi
10079           else
10080                 break
10081           fi
10082         done
10083   done
10084 fi
10085
10086 fi
10087
10088 # Set definitions to allow ifdef'ing for ncurses.h
10089
10090 case $cf_cv_ncurses_header in
10091 (*ncurses.h)
10092
10093 cat >>confdefs.h <<\EOF
10094 #define HAVE_NCURSES_H 1
10095 EOF
10096
10097         ;;
10098 esac
10099
10100 case $cf_cv_ncurses_header in
10101 (ncurses/curses.h|ncurses/ncurses.h)
10102
10103 cat >>confdefs.h <<\EOF
10104 #define HAVE_NCURSES_NCURSES_H 1
10105 EOF
10106
10107         ;;
10108 (ncursesw/curses.h|ncursesw/ncurses.h)
10109
10110 cat >>confdefs.h <<\EOF
10111 #define HAVE_NCURSESW_NCURSES_H 1
10112 EOF
10113
10114         ;;
10115 esac
10116
10117 echo "$as_me:10117: checking for terminfo header" >&5
10118 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10119 if test "${cf_cv_term_header+set}" = set; then
10120   echo $ECHO_N "(cached) $ECHO_C" >&6
10121 else
10122
10123 case ${cf_cv_ncurses_header} in
10124 (*/ncurses.h|*/ncursesw.h)
10125         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10126         ;;
10127 (*)
10128         cf_term_header=term.h
10129         ;;
10130 esac
10131
10132 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10133 do
10134 cat >conftest.$ac_ext <<_ACEOF
10135 #line 10135 "configure"
10136 #include "confdefs.h"
10137 #include <stdio.h>
10138 #include <${cf_cv_ncurses_header:-curses.h}>
10139 #include <$cf_test>
10140
10141 int
10142 main (void)
10143 {
10144 int x = auto_left_margin; (void)x
10145   ;
10146   return 0;
10147 }
10148 _ACEOF
10149 rm -f conftest.$ac_objext
10150 if { (eval echo "$as_me:10150: \"$ac_compile\"") >&5
10151   (eval $ac_compile) 2>&5
10152   ac_status=$?
10153   echo "$as_me:10153: \$? = $ac_status" >&5
10154   (exit $ac_status); } &&
10155          { ac_try='test -s conftest.$ac_objext'
10156   { (eval echo "$as_me:10156: \"$ac_try\"") >&5
10157   (eval $ac_try) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit $ac_status); }; }; then
10161
10162         cf_cv_term_header="$cf_test"
10163 else
10164   echo "$as_me: failed program was:" >&5
10165 cat conftest.$ac_ext >&5
10166
10167         cf_cv_term_header=unknown
10168
10169 fi
10170 rm -f conftest.$ac_objext conftest.$ac_ext
10171         test "$cf_cv_term_header" != unknown && break
10172 done
10173
10174 fi
10175 echo "$as_me:10175: result: $cf_cv_term_header" >&5
10176 echo "${ECHO_T}$cf_cv_term_header" >&6
10177
10178 # Set definitions to allow ifdef'ing to accommodate subdirectories
10179
10180 case $cf_cv_term_header in
10181 (*term.h)
10182
10183 cat >>confdefs.h <<\EOF
10184 #define HAVE_TERM_H 1
10185 EOF
10186
10187         ;;
10188 esac
10189
10190 case $cf_cv_term_header in
10191 (ncurses/term.h)
10192
10193 cat >>confdefs.h <<\EOF
10194 #define HAVE_NCURSES_TERM_H 1
10195 EOF
10196
10197         ;;
10198 (ncursesw/term.h)
10199
10200 cat >>confdefs.h <<\EOF
10201 #define HAVE_NCURSESW_TERM_H 1
10202 EOF
10203
10204         ;;
10205 esac
10206
10207 # some applications need this, but should check for NCURSES_VERSION
10208
10209 cat >>confdefs.h <<\EOF
10210 #define NCURSES 1
10211 EOF
10212
10213 echo "$as_me:10213: checking for ncurses version" >&5
10214 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10215 if test "${cf_cv_ncurses_version+set}" = set; then
10216   echo $ECHO_N "(cached) $ECHO_C" >&6
10217 else
10218
10219         cf_cv_ncurses_version=no
10220         cf_tempfile=out$$
10221         rm -f $cf_tempfile
10222         if test "$cross_compiling" = yes; then
10223
10224         # This will not work if the preprocessor splits the line after the
10225         # Autoconf token.  The 'unproto' program does that.
10226         cat > conftest.$ac_ext <<EOF
10227 #include <${cf_cv_ncurses_header:-curses.h}>
10228 #undef Autoconf
10229 #ifdef NCURSES_VERSION
10230 Autoconf NCURSES_VERSION
10231 #else
10232 #ifdef __NCURSES_H
10233 Autoconf "old"
10234 #endif
10235 ;
10236 #endif
10237 EOF
10238         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10239         { (eval echo "$as_me:10239: \"$cf_try\"") >&5
10240   (eval $cf_try) 2>&5
10241   ac_status=$?
10242   echo "$as_me:10242: \$? = $ac_status" >&5
10243   (exit $ac_status); }
10244         if test -f conftest.out ; then
10245                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10246                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10247                 rm -f conftest.out
10248         fi
10249
10250 else
10251   cat >conftest.$ac_ext <<_ACEOF
10252 #line 10252 "configure"
10253 #include "confdefs.h"
10254
10255 #include <${cf_cv_ncurses_header:-curses.h}>
10256 #include <stdio.h>
10257 int main(void)
10258 {
10259         FILE *fp = fopen("$cf_tempfile", "w");
10260 #ifdef NCURSES_VERSION
10261 # ifdef NCURSES_VERSION_PATCH
10262         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10263 # else
10264         fprintf(fp, "%s\n", NCURSES_VERSION);
10265 # endif
10266 #else
10267 # ifdef __NCURSES_H
10268         fprintf(fp, "old\n");
10269 # else
10270         make an error
10271 # endif
10272 #endif
10273         ${cf_cv_main_return:-return}(0);
10274 }
10275 _ACEOF
10276 rm -f conftest$ac_exeext
10277 if { (eval echo "$as_me:10277: \"$ac_link\"") >&5
10278   (eval $ac_link) 2>&5
10279   ac_status=$?
10280   echo "$as_me:10280: \$? = $ac_status" >&5
10281   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10282   { (eval echo "$as_me:10282: \"$ac_try\"") >&5
10283   (eval $ac_try) 2>&5
10284   ac_status=$?
10285   echo "$as_me:10285: \$? = $ac_status" >&5
10286   (exit $ac_status); }; }; then
10287
10288         cf_cv_ncurses_version=`cat $cf_tempfile`
10289 else
10290   echo "$as_me: program exited with status $ac_status" >&5
10291 echo "$as_me: failed program was:" >&5
10292 cat conftest.$ac_ext >&5
10293 fi
10294 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10295 fi
10296         rm -f $cf_tempfile
10297
10298 fi
10299 echo "$as_me:10299: result: $cf_cv_ncurses_version" >&5
10300 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10301 test "$cf_cv_ncurses_version" = no ||
10302 cat >>confdefs.h <<\EOF
10303 #define NCURSES 1
10304 EOF
10305
10306 cf_nculib_root=ncurses
10307         # This works, except for the special case where we find gpm, but
10308         # ncurses is in a nonstandard location via $LIBS, and we really want
10309         # to link gpm.
10310 cf_ncurses_LIBS=""
10311 cf_ncurses_SAVE="$LIBS"
10312 echo "$as_me:10312: checking for Gpm_Open in -lgpm" >&5
10313 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10314 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10315   echo $ECHO_N "(cached) $ECHO_C" >&6
10316 else
10317   ac_check_lib_save_LIBS=$LIBS
10318 LIBS="-lgpm  $LIBS"
10319 cat >conftest.$ac_ext <<_ACEOF
10320 #line 10320 "configure"
10321 #include "confdefs.h"
10322
10323 /* Override any gcc2 internal prototype to avoid an error.  */
10324 #ifdef __cplusplus
10325 extern "C"
10326 #endif
10327 /* We use char because int might match the return type of a gcc2
10328    builtin and then its argument prototype would still apply.  */
10329 char Gpm_Open ();
10330 int
10331 main (void)
10332 {
10333 Gpm_Open ();
10334   ;
10335   return 0;
10336 }
10337 _ACEOF
10338 rm -f conftest.$ac_objext conftest$ac_exeext
10339 if { (eval echo "$as_me:10339: \"$ac_link\"") >&5
10340   (eval $ac_link) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); } &&
10344          { ac_try='test -s conftest$ac_exeext'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); }; }; then
10350   ac_cv_lib_gpm_Gpm_Open=yes
10351 else
10352   echo "$as_me: failed program was:" >&5
10353 cat conftest.$ac_ext >&5
10354 ac_cv_lib_gpm_Gpm_Open=no
10355 fi
10356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10357 LIBS=$ac_check_lib_save_LIBS
10358 fi
10359 echo "$as_me:10359: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10360 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10361 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10362   echo "$as_me:10362: checking for initscr in -lgpm" >&5
10363 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10364 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10365   echo $ECHO_N "(cached) $ECHO_C" >&6
10366 else
10367   ac_check_lib_save_LIBS=$LIBS
10368 LIBS="-lgpm  $LIBS"
10369 cat >conftest.$ac_ext <<_ACEOF
10370 #line 10370 "configure"
10371 #include "confdefs.h"
10372
10373 /* Override any gcc2 internal prototype to avoid an error.  */
10374 #ifdef __cplusplus
10375 extern "C"
10376 #endif
10377 /* We use char because int might match the return type of a gcc2
10378    builtin and then its argument prototype would still apply.  */
10379 char initscr ();
10380 int
10381 main (void)
10382 {
10383 initscr ();
10384   ;
10385   return 0;
10386 }
10387 _ACEOF
10388 rm -f conftest.$ac_objext conftest$ac_exeext
10389 if { (eval echo "$as_me:10389: \"$ac_link\"") >&5
10390   (eval $ac_link) 2>&5
10391   ac_status=$?
10392   echo "$as_me:10392: \$? = $ac_status" >&5
10393   (exit $ac_status); } &&
10394          { ac_try='test -s conftest$ac_exeext'
10395   { (eval echo "$as_me:10395: \"$ac_try\"") >&5
10396   (eval $ac_try) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); }; }; then
10400   ac_cv_lib_gpm_initscr=yes
10401 else
10402   echo "$as_me: failed program was:" >&5
10403 cat conftest.$ac_ext >&5
10404 ac_cv_lib_gpm_initscr=no
10405 fi
10406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10407 LIBS=$ac_check_lib_save_LIBS
10408 fi
10409 echo "$as_me:10409: result: $ac_cv_lib_gpm_initscr" >&5
10410 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10411 if test $ac_cv_lib_gpm_initscr = yes; then
10412   LIBS="$cf_ncurses_SAVE"
10413 else
10414   cf_ncurses_LIBS="-lgpm"
10415 fi
10416
10417 fi
10418
10419 case $host_os in
10420 (freebsd*)
10421         # This is only necessary if you are linking against an obsolete
10422         # version of ncurses (but it should do no harm, since it's static).
10423         if test "$cf_nculib_root" = ncurses ; then
10424                 echo "$as_me:10424: checking for tgoto in -lmytinfo" >&5
10425 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10426 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10427   echo $ECHO_N "(cached) $ECHO_C" >&6
10428 else
10429   ac_check_lib_save_LIBS=$LIBS
10430 LIBS="-lmytinfo  $LIBS"
10431 cat >conftest.$ac_ext <<_ACEOF
10432 #line 10432 "configure"
10433 #include "confdefs.h"
10434
10435 /* Override any gcc2 internal prototype to avoid an error.  */
10436 #ifdef __cplusplus
10437 extern "C"
10438 #endif
10439 /* We use char because int might match the return type of a gcc2
10440    builtin and then its argument prototype would still apply.  */
10441 char tgoto ();
10442 int
10443 main (void)
10444 {
10445 tgoto ();
10446   ;
10447   return 0;
10448 }
10449 _ACEOF
10450 rm -f conftest.$ac_objext conftest$ac_exeext
10451 if { (eval echo "$as_me:10451: \"$ac_link\"") >&5
10452   (eval $ac_link) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); } &&
10456          { ac_try='test -s conftest$ac_exeext'
10457   { (eval echo "$as_me:10457: \"$ac_try\"") >&5
10458   (eval $ac_try) 2>&5
10459   ac_status=$?
10460   echo "$as_me:10460: \$? = $ac_status" >&5
10461   (exit $ac_status); }; }; then
10462   ac_cv_lib_mytinfo_tgoto=yes
10463 else
10464   echo "$as_me: failed program was:" >&5
10465 cat conftest.$ac_ext >&5
10466 ac_cv_lib_mytinfo_tgoto=no
10467 fi
10468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10469 LIBS=$ac_check_lib_save_LIBS
10470 fi
10471 echo "$as_me:10471: result: $ac_cv_lib_mytinfo_tgoto" >&5
10472 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10473 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10474   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10475 fi
10476
10477         fi
10478         ;;
10479 esac
10480
10481 cf_add_libs="$LIBS"
10482 # reverse order
10483 cf_add_0lib=
10484 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10485 # filter duplicates
10486 for cf_add_1lib in $cf_add_0lib; do
10487         for cf_add_2lib in $cf_add_libs; do
10488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10489                         cf_add_1lib=
10490                         break
10491                 fi
10492         done
10493         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10494 done
10495 LIBS="$cf_add_libs"
10496
10497 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10498 then
10499
10500 cf_add_libs="$LIBS"
10501 # reverse order
10502 cf_add_0lib=
10503 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10504 # filter duplicates
10505 for cf_add_1lib in $cf_add_0lib; do
10506         for cf_add_2lib in $cf_add_libs; do
10507                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10508                         cf_add_1lib=
10509                         break
10510                 fi
10511         done
10512         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10513 done
10514 LIBS="$cf_add_libs"
10515
10516 else
10517
10518         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10519         cf_libdir=""
10520         echo "$as_me:10520: checking for initscr" >&5
10521 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10522 if test "${ac_cv_func_initscr+set}" = set; then
10523   echo $ECHO_N "(cached) $ECHO_C" >&6
10524 else
10525   cat >conftest.$ac_ext <<_ACEOF
10526 #line 10526 "configure"
10527 #include "confdefs.h"
10528 #define initscr autoconf_temporary
10529 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10530 #undef initscr
10531
10532 #ifdef __cplusplus
10533 extern "C"
10534 #endif
10535
10536 /* We use char because int might match the return type of a gcc2
10537    builtin and then its argument prototype would still apply.  */
10538 char initscr (void);
10539
10540 int
10541 main (void)
10542 {
10543
10544 /* The GNU C library defines stubs for functions which it implements
10545     to always fail with ENOSYS.  Some functions are actually named
10546     something starting with __ and the normal name is an alias.  */
10547 #if defined (__stub_initscr) || defined (__stub___initscr)
10548 #error found stub for initscr
10549 #endif
10550
10551         return initscr ();
10552   ;
10553   return 0;
10554 }
10555 _ACEOF
10556 rm -f conftest.$ac_objext conftest$ac_exeext
10557 if { (eval echo "$as_me:10557: \"$ac_link\"") >&5
10558   (eval $ac_link) 2>&5
10559   ac_status=$?
10560   echo "$as_me:10560: \$? = $ac_status" >&5
10561   (exit $ac_status); } &&
10562          { ac_try='test -s conftest$ac_exeext'
10563   { (eval echo "$as_me:10563: \"$ac_try\"") >&5
10564   (eval $ac_try) 2>&5
10565   ac_status=$?
10566   echo "$as_me:10566: \$? = $ac_status" >&5
10567   (exit $ac_status); }; }; then
10568   ac_cv_func_initscr=yes
10569 else
10570   echo "$as_me: failed program was:" >&5
10571 cat conftest.$ac_ext >&5
10572 ac_cv_func_initscr=no
10573 fi
10574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10575 fi
10576 echo "$as_me:10576: result: $ac_cv_func_initscr" >&5
10577 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10578 if test $ac_cv_func_initscr = yes; then
10579   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10580 else
10581
10582                 cf_save_LIBS="$LIBS"
10583                 echo "$as_me:10583: checking for initscr in -l$cf_nculib_root" >&5
10584 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10585                 LIBS="-l$cf_nculib_root $LIBS"
10586                 cat >conftest.$ac_ext <<_ACEOF
10587 #line 10587 "configure"
10588 #include "confdefs.h"
10589 #include <${cf_cv_ncurses_header:-curses.h}>
10590 int
10591 main (void)
10592 {
10593 initscr()
10594   ;
10595   return 0;
10596 }
10597 _ACEOF
10598 rm -f conftest.$ac_objext conftest$ac_exeext
10599 if { (eval echo "$as_me:10599: \"$ac_link\"") >&5
10600   (eval $ac_link) 2>&5
10601   ac_status=$?
10602   echo "$as_me:10602: \$? = $ac_status" >&5
10603   (exit $ac_status); } &&
10604          { ac_try='test -s conftest$ac_exeext'
10605   { (eval echo "$as_me:10605: \"$ac_try\"") >&5
10606   (eval $ac_try) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit $ac_status); }; }; then
10610   echo "$as_me:10610: result: yes" >&5
10611 echo "${ECHO_T}yes" >&6
10612                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10613
10614 else
10615   echo "$as_me: failed program was:" >&5
10616 cat conftest.$ac_ext >&5
10617 echo "$as_me:10617: result: no" >&5
10618 echo "${ECHO_T}no" >&6
10619
10620 cf_search=
10621 cf_library_path_list=""
10622 if test -n "${LDFLAGS}${LIBS}" ; then
10623         for cf_library_path in $LDFLAGS $LIBS
10624         do
10625                 case $cf_library_path in
10626                 (-L*)
10627                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10628
10629 test "x$cf_library_path" != "xNONE" && \
10630 test -d "$cf_library_path" && \
10631  {
10632         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10633         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10634         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10635         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10636         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10637         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"
10638 }
10639
10640                         cf_library_path_list="$cf_library_path_list $cf_search"
10641                         ;;
10642                 esac
10643         done
10644 fi
10645
10646 cf_search=
10647
10648 test "x$prefix" != "xNONE" && \
10649 test -d "$prefix" && \
10650  {
10651         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10652         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10653         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10654         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10655         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10656         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10657 }
10658
10659 for cf_subdir_prefix in \
10660         /usr \
10661         /usr/local \
10662         /usr/pkg \
10663         /opt \
10664         /opt/local \
10665         $HOME
10666 do
10667
10668 test "x$cf_subdir_prefix" != "x$prefix" && \
10669 test -d "$cf_subdir_prefix" && \
10670 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10671         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10672         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10673         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10674         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10675         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10676         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"
10677 }
10678
10679 done
10680
10681 cf_search="$cf_library_path_list $cf_search"
10682
10683                         for cf_libdir in $cf_search
10684                         do
10685                                 echo "$as_me:10685: checking for -l$cf_nculib_root in $cf_libdir" >&5
10686 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10687                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10688                                 cat >conftest.$ac_ext <<_ACEOF
10689 #line 10689 "configure"
10690 #include "confdefs.h"
10691 #include <${cf_cv_ncurses_header:-curses.h}>
10692 int
10693 main (void)
10694 {
10695 initscr()
10696   ;
10697   return 0;
10698 }
10699 _ACEOF
10700 rm -f conftest.$ac_objext conftest$ac_exeext
10701 if { (eval echo "$as_me:10701: \"$ac_link\"") >&5
10702   (eval $ac_link) 2>&5
10703   ac_status=$?
10704   echo "$as_me:10704: \$? = $ac_status" >&5
10705   (exit $ac_status); } &&
10706          { ac_try='test -s conftest$ac_exeext'
10707   { (eval echo "$as_me:10707: \"$ac_try\"") >&5
10708   (eval $ac_try) 2>&5
10709   ac_status=$?
10710   echo "$as_me:10710: \$? = $ac_status" >&5
10711   (exit $ac_status); }; }; then
10712   echo "$as_me:10712: result: yes" >&5
10713 echo "${ECHO_T}yes" >&6
10714                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10715                                          break
10716 else
10717   echo "$as_me: failed program was:" >&5
10718 cat conftest.$ac_ext >&5
10719 echo "$as_me:10719: result: no" >&5
10720 echo "${ECHO_T}no" >&6
10721                                          LIBS="$cf_save_LIBS"
10722 fi
10723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10724                         done
10725
10726 fi
10727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10728
10729 fi
10730
10731 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10732
10733 if test $cf_found_library = no ; then
10734         { { echo "$as_me:10734: error: Cannot link $cf_nculib_root library" >&5
10735 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10736    { (exit 1); exit 1; }; }
10737 fi
10738
10739 fi
10740
10741 if test -n "$cf_ncurses_LIBS" ; then
10742         echo "$as_me:10742: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10743 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10744         cf_ncurses_SAVE="$LIBS"
10745         for p in $cf_ncurses_LIBS ; do
10746                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10747                 if test "$q" != "$LIBS" ; then
10748                         LIBS="$q"
10749                 fi
10750         done
10751         cat >conftest.$ac_ext <<_ACEOF
10752 #line 10752 "configure"
10753 #include "confdefs.h"
10754 #include <${cf_cv_ncurses_header:-curses.h}>
10755 int
10756 main (void)
10757 {
10758 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10759   ;
10760   return 0;
10761 }
10762 _ACEOF
10763 rm -f conftest.$ac_objext conftest$ac_exeext
10764 if { (eval echo "$as_me:10764: \"$ac_link\"") >&5
10765   (eval $ac_link) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit $ac_status); } &&
10769          { ac_try='test -s conftest$ac_exeext'
10770   { (eval echo "$as_me:10770: \"$ac_try\"") >&5
10771   (eval $ac_try) 2>&5
10772   ac_status=$?
10773   echo "$as_me:10773: \$? = $ac_status" >&5
10774   (exit $ac_status); }; }; then
10775   echo "$as_me:10775: result: yes" >&5
10776 echo "${ECHO_T}yes" >&6
10777 else
10778   echo "$as_me: failed program was:" >&5
10779 cat conftest.$ac_ext >&5
10780 echo "$as_me:10780: result: no" >&5
10781 echo "${ECHO_T}no" >&6
10782                  LIBS="$cf_ncurses_SAVE"
10783 fi
10784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10785 fi
10786
10787 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10788
10789 cat >>confdefs.h <<EOF
10790 #define $cf_nculib_ROOT 1
10791 EOF
10792
10793         fi
10794 else
10795         NCURSES_CONFIG=none
10796 fi
10797
10798 fi
10799
10800 if test "$NCURSES_CONFIG_PKG" != none ; then
10801         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10802
10803         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10804         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10805         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10806
10807         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10808         if test -z "$cf_cv_abi_version"
10809         then
10810                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10811         fi
10812
10813 elif test "$NCURSES_CONFIG" != none ; then
10814
10815         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10816
10817         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10818         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10819         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10820
10821         # ABI version is not available from headers
10822         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10823
10824 else
10825
10826         for cf_name in MAJOR MINOR PATCH
10827         do
10828         cat >conftest.$ac_ext <<CF_EOF
10829         #include <${cf_cv_ncurses_header:-curses.h}>
10830         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10831 CF_EOF
10832                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10833                 { (eval echo "$as_me:10833: \"$cf_try\"") >&5
10834   (eval $cf_try) 2>&5
10835   ac_status=$?
10836   echo "$as_me:10836: \$? = $ac_status" >&5
10837   (exit $ac_status); }
10838                 if test -f conftest.out ; then
10839                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10840                         eval NCURSES_$cf_name=\"$cf_result\"
10841                         # cat conftest.$ac_ext
10842                         # cat conftest.out
10843                 fi
10844         done
10845
10846         cf_cv_abi_version=${NCURSES_MAJOR}
10847
10848 fi
10849
10850 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10851
10852 cf_cv_timestamp=`date`
10853
10854 echo "$as_me:10854: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10855 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10856
10857 echo "$as_me:10857: checking if you want to have a library-prefix" >&5
10858 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10859
10860 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10861 if test "${with_lib_prefix+set}" = set; then
10862   withval="$with_lib_prefix"
10863   with_lib_prefix=$withval
10864 else
10865   with_lib_prefix=auto
10866 fi;
10867 echo "$as_me:10867: result: $with_lib_prefix" >&5
10868 echo "${ECHO_T}$with_lib_prefix" >&6
10869
10870 if test $with_lib_prefix = auto
10871 then
10872
10873         case $cf_cv_system_name in
10874         (OS/2*|os2*)
10875                 if test "$DFT_LWR_MODEL" = libtool; then
10876                         LIB_PREFIX='lib'
10877                 else
10878                         LIB_PREFIX=''
10879                 fi
10880                 ;;
10881         (*)     LIB_PREFIX='lib'
10882                 ;;
10883         esac
10884 cf_prefix=$LIB_PREFIX
10885
10886 elif test $with_lib_prefix = no
10887 then
10888         LIB_PREFIX=
10889 else
10890         LIB_PREFIX=$with_lib_prefix
10891 fi
10892
10893 LIB_SUFFIX=
10894
10895 ###############################################################################
10896
10897 if test X"$CC_G_OPT" = X"" ; then
10898         CC_G_OPT='-g'
10899         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10900 fi
10901
10902 echo "$as_me:10902: checking for default loader flags" >&5
10903 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10904 case $DFT_LWR_MODEL in
10905 (normal)  LD_MODEL=''   ;;
10906 (debug)   LD_MODEL=$CC_G_OPT ;;
10907 (profile) LD_MODEL='-pg';;
10908 (shared)  LD_MODEL=''   ;;
10909 esac
10910 echo "$as_me:10910: result: $LD_MODEL" >&5
10911 echo "${ECHO_T}$LD_MODEL" >&6
10912
10913 LD_RPATH_OPT=
10914 if test "x$cf_cv_enable_rpath" != xno
10915 then
10916         echo "$as_me:10916: checking for an rpath option" >&5
10917 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10918         case $cf_cv_system_name in
10919         (irix*)
10920                 if test "$GCC" = yes; then
10921                         LD_RPATH_OPT="-Wl,-rpath,"
10922                 else
10923                         LD_RPATH_OPT="-rpath "
10924                 fi
10925                 ;;
10926         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10927                 LD_RPATH_OPT="-Wl,-rpath,"
10928                 ;;
10929         (openbsd[2-9].*|mirbsd*)
10930                 LD_RPATH_OPT="-Wl,-rpath,"
10931                 ;;
10932         (dragonfly*)
10933                 LD_RPATH_OPT="-rpath "
10934                 ;;
10935         (netbsd*)
10936                 LD_RPATH_OPT="-Wl,-rpath,"
10937                 ;;
10938         (osf*|mls+*)
10939                 LD_RPATH_OPT="-rpath "
10940                 ;;
10941         (solaris2*)
10942                 LD_RPATH_OPT="-R"
10943                 ;;
10944         (*)
10945                 ;;
10946         esac
10947         echo "$as_me:10947: result: $LD_RPATH_OPT" >&5
10948 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10949
10950         case "x$LD_RPATH_OPT" in
10951         (x-R*)
10952                 echo "$as_me:10952: checking if we need a space after rpath option" >&5
10953 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10954                 cf_save_LIBS="$LIBS"
10955
10956 cf_add_libs="$LIBS"
10957 # reverse order
10958 cf_add_0lib=
10959 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10960 # filter duplicates
10961 for cf_add_1lib in $cf_add_0lib; do
10962         for cf_add_2lib in $cf_add_libs; do
10963                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10964                         cf_add_1lib=
10965                         break
10966                 fi
10967         done
10968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10969 done
10970 LIBS="$cf_add_libs"
10971
10972                 cat >conftest.$ac_ext <<_ACEOF
10973 #line 10973 "configure"
10974 #include "confdefs.h"
10975
10976 int
10977 main (void)
10978 {
10979
10980   ;
10981   return 0;
10982 }
10983 _ACEOF
10984 rm -f conftest.$ac_objext conftest$ac_exeext
10985 if { (eval echo "$as_me:10985: \"$ac_link\"") >&5
10986   (eval $ac_link) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); } &&
10990          { ac_try='test -s conftest$ac_exeext'
10991   { (eval echo "$as_me:10991: \"$ac_try\"") >&5
10992   (eval $ac_try) 2>&5
10993   ac_status=$?
10994   echo "$as_me:10994: \$? = $ac_status" >&5
10995   (exit $ac_status); }; }; then
10996   cf_rpath_space=no
10997 else
10998   echo "$as_me: failed program was:" >&5
10999 cat conftest.$ac_ext >&5
11000 cf_rpath_space=yes
11001 fi
11002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11003                 LIBS="$cf_save_LIBS"
11004                 echo "$as_me:11004: result: $cf_rpath_space" >&5
11005 echo "${ECHO_T}$cf_rpath_space" >&6
11006                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11007                 ;;
11008         esac
11009 fi
11010
11011         RM_SHARED_OPTS=
11012         LOCAL_LDFLAGS=
11013         LOCAL_LDFLAGS2=
11014         LD_SHARED_OPTS=
11015         INSTALL_LIB="-m 644"
11016         : ${rel_builddir:=.}
11017
11018         shlibdir=$libdir
11019
11020         MAKE_DLLS="#"
11021
11022         cf_cv_do_symlinks=no
11023         cf_ld_rpath_opt=
11024         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11025
11026         echo "$as_me:11026: checking if release/abi version should be used for shared libs" >&5
11027 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11028
11029 # Check whether --with-shlib-version or --without-shlib-version was given.
11030 if test "${with_shlib_version+set}" = set; then
11031   withval="$with_shlib_version"
11032   test -z "$withval" && withval=auto
11033         case $withval in
11034         (yes)
11035                 cf_cv_shlib_version=auto
11036                 ;;
11037         (rel|abi|auto)
11038                 cf_cv_shlib_version=$withval
11039                 ;;
11040         (*)
11041                 echo "$as_me:11041: result: $withval" >&5
11042 echo "${ECHO_T}$withval" >&6
11043                 { { echo "$as_me:11043: error: option value must be one of: rel, abi, or auto" >&5
11044 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11045    { (exit 1); exit 1; }; }
11046                 ;;
11047         esac
11048
11049 else
11050   cf_cv_shlib_version=auto
11051 fi;
11052         echo "$as_me:11052: result: $cf_cv_shlib_version" >&5
11053 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11054
11055         cf_cv_rm_so_locs=no
11056         cf_try_cflags=
11057
11058         # Some less-capable ports of gcc support only -fpic
11059         CC_SHARED_OPTS=
11060
11061         cf_try_fPIC=no
11062         if test "$GCC" = yes
11063         then
11064                 cf_try_fPIC=yes
11065         else
11066                 case $cf_cv_system_name in
11067                 (*linux*)       # e.g., PGI compiler
11068                         cf_try_fPIC=yes
11069                         ;;
11070                 esac
11071         fi
11072
11073         if test "$cf_try_fPIC" = yes
11074         then
11075                 echo "$as_me:11075: checking which $CC option to use" >&5
11076 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11077                 cf_save_CFLAGS="$CFLAGS"
11078                 for CC_SHARED_OPTS in -fPIC -fpic ''
11079                 do
11080                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11081                         cat >conftest.$ac_ext <<_ACEOF
11082 #line 11082 "configure"
11083 #include "confdefs.h"
11084 #include <stdio.h>
11085 int
11086 main (void)
11087 {
11088 int x = 1
11089   ;
11090   return 0;
11091 }
11092 _ACEOF
11093 rm -f conftest.$ac_objext
11094 if { (eval echo "$as_me:11094: \"$ac_compile\"") >&5
11095   (eval $ac_compile) 2>&5
11096   ac_status=$?
11097   echo "$as_me:11097: \$? = $ac_status" >&5
11098   (exit $ac_status); } &&
11099          { ac_try='test -s conftest.$ac_objext'
11100   { (eval echo "$as_me:11100: \"$ac_try\"") >&5
11101   (eval $ac_try) 2>&5
11102   ac_status=$?
11103   echo "$as_me:11103: \$? = $ac_status" >&5
11104   (exit $ac_status); }; }; then
11105   break
11106 else
11107   echo "$as_me: failed program was:" >&5
11108 cat conftest.$ac_ext >&5
11109 fi
11110 rm -f conftest.$ac_objext conftest.$ac_ext
11111                 done
11112                 echo "$as_me:11112: result: $CC_SHARED_OPTS" >&5
11113 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11114                 CFLAGS="$cf_save_CFLAGS"
11115         fi
11116
11117         cf_cv_shlib_version_infix=no
11118
11119         case $cf_cv_system_name in
11120         (aix4.3-9*|aix[5-7]*)
11121                 if test "$GCC" = yes; then
11122                         CC_SHARED_OPTS='-Wl,-brtl'
11123                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11124                 else
11125                         CC_SHARED_OPTS='-brtl'
11126                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11127                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11128                 fi
11129                 ;;
11130         (beos*)
11131                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11132                 ;;
11133         (cygwin*)
11134                 CC_SHARED_OPTS=
11135                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11136                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11137                 cf_cv_shlib_version=cygdll
11138                 cf_cv_shlib_version_infix=cygdll
11139                 shlibdir=$bindir
11140                 MAKE_DLLS=
11141                 cat >mk_shared_lib.sh <<-CF_EOF
11142                 #!$SHELL
11143                 SHARED_LIB=\$1
11144                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11145                 shift
11146                 cat <<-EOF
11147                 Linking shared library
11148                 ** SHARED_LIB \$SHARED_LIB
11149                 ** IMPORT_LIB \$IMPORT_LIB
11150 EOF
11151                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11152 CF_EOF
11153                 chmod +x mk_shared_lib.sh
11154                 ;;
11155         (msys*)
11156                 CC_SHARED_OPTS=
11157                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11158                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11159                 cf_cv_shlib_version=msysdll
11160                 cf_cv_shlib_version_infix=msysdll
11161                 shlibdir=$bindir
11162                 MAKE_DLLS=
11163                 cat >mk_shared_lib.sh <<-CF_EOF
11164                 #!$SHELL
11165                 SHARED_LIB=\$1
11166                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11167                 shift
11168                 cat <<-EOF
11169                 Linking shared library
11170                 ** SHARED_LIB \$SHARED_LIB
11171                 ** IMPORT_LIB \$IMPORT_LIB
11172 EOF
11173                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11174 CF_EOF
11175                 chmod +x mk_shared_lib.sh
11176                 ;;
11177         (darwin*)
11178                 cf_try_cflags="no-cpp-precomp"
11179                 CC_SHARED_OPTS="-dynamic"
11180                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11181                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11182                 cf_cv_shlib_version_infix=yes
11183                 echo "$as_me:11183: checking if ld -search_paths_first works" >&5
11184 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11185 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11186   echo $ECHO_N "(cached) $ECHO_C" >&6
11187 else
11188
11189                         cf_save_LDFLAGS=$LDFLAGS
11190                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11191                         cat >conftest.$ac_ext <<_ACEOF
11192 #line 11192 "configure"
11193 #include "confdefs.h"
11194
11195 int
11196 main (void)
11197 {
11198 int i;
11199   ;
11200   return 0;
11201 }
11202 _ACEOF
11203 rm -f conftest.$ac_objext conftest$ac_exeext
11204 if { (eval echo "$as_me:11204: \"$ac_link\"") >&5
11205   (eval $ac_link) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); } &&
11209          { ac_try='test -s conftest$ac_exeext'
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_ldflags_search_paths_first=yes
11216 else
11217   echo "$as_me: failed program was:" >&5
11218 cat conftest.$ac_ext >&5
11219 cf_cv_ldflags_search_paths_first=no
11220 fi
11221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11222                                 LDFLAGS=$cf_save_LDFLAGS
11223 fi
11224 echo "$as_me:11224: result: $cf_cv_ldflags_search_paths_first" >&5
11225 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11226                 if test $cf_cv_ldflags_search_paths_first = yes; then
11227                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11228                 fi
11229                 ;;
11230         (hpux[7-8]*)
11231                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11232                 if test "$GCC" != yes; then
11233                         CC_SHARED_OPTS='+Z'
11234                 fi
11235                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11236                 INSTALL_LIB="-m 555"
11237                 ;;
11238         (hpux*)
11239                 # (tested with gcc 2.7.2 -- I don't have c89)
11240                 if test "$GCC" = yes; then
11241                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11242                 else
11243                         CC_SHARED_OPTS='+Z'
11244                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11245                 fi
11246                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11247                 # HP-UX shared libraries must be executable, and should be
11248                 # readonly to exploit a quirk in the memory manager.
11249                 INSTALL_LIB="-m 555"
11250                 ;;
11251         (interix*)
11252                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11253                 if test "$cf_cv_shlib_version" = rel; then
11254                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11255                 else
11256                         cf_shared_soname='`basename $@`'
11257                 fi
11258                 CC_SHARED_OPTS=
11259                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11260                 ;;
11261         (irix*)
11262                 if test "$cf_cv_enable_rpath" = yes ; then
11263                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11264                 fi
11265                 # tested with IRIX 5.2 and 'cc'.
11266                 if test "$GCC" != yes; then
11267                         CC_SHARED_OPTS='-KPIC'
11268                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11269                 else
11270                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11271                 fi
11272                 cf_cv_rm_so_locs=yes
11273                 ;;
11274         (linux*|gnu*|k*bsd*-gnu)
11275                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11276                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11277                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11278                 fi
11279                 if test "$cf_cv_enable_rpath" = yes ; then
11280                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11281                 fi
11282
11283         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11284         if test "$cf_cv_shlib_version" = rel; then
11285                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11286         else
11287                 cf_cv_shared_soname='`basename $@`'
11288         fi
11289
11290                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11291                 ;;
11292         (mingw*msvc*)
11293                 cf_cv_shlib_version=mingw
11294                 cf_cv_shlib_version_infix=mingw
11295                 shlibdir=$bindir
11296                 MAKE_DLLS=
11297                 if test "$DFT_LWR_MODEL" = "shared" ; then
11298                         LOCAL_LDFLAGS="-link -dll"
11299                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11300                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11301                 fi
11302                 CC_SHARED_OPTS=
11303                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh  ${LD} ${CFLAGS}'
11304                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11305                 cat >mk_shared_lib.sh <<-CF_EOF
11306                 #!$SHELL
11307                 SHARED_LIB=\
11308                 IMPORT_LIB=\`echo "\" | sed -e 's/0-9*\.dll$\.dll.a/'\`
11309                 shift
11310                 my_ld=\
11311                 shift
11312                 cat <<-EOF
11313                 Linking shared library
11314                 ** SHARED LIB \$SHARED_LIB
11315                 ** IMPORT_LIB \$IMPORT_LIB
11316 EOF
11317                 args=\$(echo \ | sed -E "s#-l(\w*)#lib\1.a#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11318                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11319                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11320 CF_EOF
11321                 chmod +x mk_shared_lib.sh
11322                 ;;
11323         (mingw*)
11324                 cf_cv_shlib_version=mingw
11325                 cf_cv_shlib_version_infix=mingw
11326                 shlibdir=$bindir
11327                 MAKE_DLLS=
11328                 if test "$DFT_LWR_MODEL" = "shared" ; then
11329                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11330                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11331                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11332                 fi
11333                 CC_SHARED_OPTS=
11334                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11335                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11336                 cat >mk_shared_lib.sh <<-CF_EOF
11337                 #!$SHELL
11338                 SHARED_LIB=\$1
11339                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11340                 shift
11341                 cat <<-EOF
11342                 Linking shared library
11343                 ** SHARED_LIB \$SHARED_LIB
11344                 ** IMPORT_LIB \$IMPORT_LIB
11345 EOF
11346                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11347 CF_EOF
11348                 chmod +x mk_shared_lib.sh
11349                 ;;
11350         (openbsd[2-9].*|mirbsd*)
11351                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11352                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11353                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11354                 fi
11355                 if test "$cf_cv_enable_rpath" = yes ; then
11356                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11357                 fi
11358                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11359
11360         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11361         if test "$cf_cv_shlib_version" = rel; then
11362                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11363         else
11364                 cf_cv_shared_soname='`basename $@`'
11365         fi
11366
11367                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11368                 ;;
11369         (nto-qnx*|openbsd*|freebsd[12].*)
11370                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11371                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11372                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11373                 ;;
11374         (dragonfly*|freebsd*)
11375                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11376                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11377                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11378                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11379                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11380                 fi
11381
11382         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11383         if test "$cf_cv_shlib_version" = rel; then
11384                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11385         else
11386                 cf_cv_shared_soname='`basename $@`'
11387         fi
11388
11389                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11390                 ;;
11391         (netbsd*)
11392                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11393                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11394                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11395                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11396                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11397                         if test "$cf_cv_shlib_version" = auto; then
11398                         if test -f /usr/libexec/ld.elf_so; then
11399                                 cf_cv_shlib_version=abi
11400                         else
11401                                 cf_cv_shlib_version=rel
11402                         fi
11403                         fi
11404
11405         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11406         if test "$cf_cv_shlib_version" = rel; then
11407                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11408         else
11409                 cf_cv_shared_soname='`basename $@`'
11410         fi
11411
11412                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11413                 else
11414                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
11415                 fi
11416                 ;;
11417         (osf*|mls+*)
11418                 # tested with OSF/1 V3.2 and 'cc'
11419                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11420                 # link with shared libs).
11421                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11422                 case $host_os in
11423                 (osf4*)
11424                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11425                         ;;
11426                 esac
11427                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11428                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11429                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11430                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11431                 fi
11432                 cf_cv_rm_so_locs=yes
11433                 ;;
11434         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11435                 # tested with osr5.0.5
11436                 if test "$GCC" != yes; then
11437                         CC_SHARED_OPTS='-belf -KPIC'
11438                 fi
11439                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11440                 if test "$cf_cv_enable_rpath" = yes ; then
11441                         # only way is to set LD_RUN_PATH but no switch for it
11442                         RUN_PATH=$libdir
11443                 fi
11444                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11445                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11446                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11447                 ;;
11448         (sunos4*)
11449                 # tested with SunOS 4.1.1 and gcc 2.7.0
11450                 if test "$GCC" != yes; then
11451                         CC_SHARED_OPTS='-KPIC'
11452                 fi
11453                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11454                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11455                 ;;
11456         (solaris2*)
11457                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11458                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11459                 if test "$DFT_LWR_MODEL" = "shared" ; then
11460                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11461                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11462                 fi
11463                 if test "$cf_cv_enable_rpath" = yes ; then
11464                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11465                 fi
11466
11467         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11468         if test "$cf_cv_shlib_version" = rel; then
11469                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11470         else
11471                 cf_cv_shared_soname='`basename $@`'
11472         fi
11473
11474                 if test "$GCC" != yes; then
11475                         cf_save_CFLAGS="$CFLAGS"
11476                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11477                         do
11478                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11479                                 cat >conftest.$ac_ext <<_ACEOF
11480 #line 11480 "configure"
11481 #include "confdefs.h"
11482 #include <stdio.h>
11483 int
11484 main (void)
11485 {
11486 printf("Hello\n");
11487   ;
11488   return 0;
11489 }
11490 _ACEOF
11491 rm -f conftest.$ac_objext
11492 if { (eval echo "$as_me:11492: \"$ac_compile\"") >&5
11493   (eval $ac_compile) 2>&5
11494   ac_status=$?
11495   echo "$as_me:11495: \$? = $ac_status" >&5
11496   (exit $ac_status); } &&
11497          { ac_try='test -s conftest.$ac_objext'
11498   { (eval echo "$as_me:11498: \"$ac_try\"") >&5
11499   (eval $ac_try) 2>&5
11500   ac_status=$?
11501   echo "$as_me:11501: \$? = $ac_status" >&5
11502   (exit $ac_status); }; }; then
11503   break
11504 else
11505   echo "$as_me: failed program was:" >&5
11506 cat conftest.$ac_ext >&5
11507 fi
11508 rm -f conftest.$ac_objext conftest.$ac_ext
11509                         done
11510                         CFLAGS="$cf_save_CFLAGS"
11511                         CC_SHARED_OPTS=$cf_shared_opts
11512                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11513                 else
11514                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11515                 fi
11516                 ;;
11517         (sysv5uw7*|unix_sv*)
11518                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11519                 if test "$GCC" != yes; then
11520                         CC_SHARED_OPTS='-KPIC'
11521                 fi
11522                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11523                 ;;
11524         (*)
11525                 CC_SHARED_OPTS='unknown'
11526                 MK_SHARED_LIB='echo unknown'
11527                 ;;
11528         esac
11529
11530         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11531         case "$cf_cv_shlib_version" in
11532         (rel|abi)
11533                 case "$MK_SHARED_LIB" in
11534                 (*'-o $@')
11535                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11536                         ;;
11537                 (*)
11538                         { echo "$as_me:11538: WARNING: ignored --with-shlib-version" >&5
11539 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11540                         ;;
11541                 esac
11542                 ;;
11543         esac
11544
11545         if test -n "$cf_try_cflags"
11546         then
11547 cat > conftest.$ac_ext <<EOF
11548 #line 11548 "${as_me:-configure}"
11549 #include <stdio.h>
11550 int main(int argc, char *argv[])
11551 {
11552         printf("hello\n");
11553         return (argv[argc-1] == 0) ;
11554 }
11555 EOF
11556                 cf_save_CFLAGS="$CFLAGS"
11557                 for cf_opt in $cf_try_cflags
11558                 do
11559                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11560                         echo "$as_me:11560: checking if CFLAGS option -$cf_opt works" >&5
11561 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11562                         if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5
11563   (eval $ac_compile) 2>&5
11564   ac_status=$?
11565   echo "$as_me:11565: \$? = $ac_status" >&5
11566   (exit $ac_status); }; then
11567                                 echo "$as_me:11567: result: yes" >&5
11568 echo "${ECHO_T}yes" >&6
11569                                 cf_save_CFLAGS="$CFLAGS"
11570                         else
11571                                 echo "$as_me:11571: result: no" >&5
11572 echo "${ECHO_T}no" >&6
11573                         fi
11574                 done
11575                 CFLAGS="$cf_save_CFLAGS"
11576         fi
11577
11578         # RPATH_LIST is a colon-separated list of directories
11579         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11580         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11581
11582         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11583
11584         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11585
11586 echo "${as_me:-configure}:11586: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11587
11588         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11589
11590 echo "${as_me:-configure}:11590: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11591
11592 # The test/sample programs in the original tree link using rpath option.
11593 # Make it optional for packagers.
11594 if test -n "$LOCAL_LDFLAGS"
11595 then
11596         echo "$as_me:11596: checking if you want to link sample programs with rpath option" >&5
11597 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11598
11599 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11600 if test "${enable_rpath_link+set}" = set; then
11601   enableval="$enable_rpath_link"
11602   with_rpath_link=$enableval
11603 else
11604   with_rpath_link=yes
11605 fi;
11606         echo "$as_me:11606: result: $with_rpath_link" >&5
11607 echo "${ECHO_T}$with_rpath_link" >&6
11608         if test "$with_rpath_link" = no
11609         then
11610                 LOCAL_LDFLAGS=
11611                 LOCAL_LDFLAGS2=
11612         fi
11613 fi
11614
11615 ###############################################################################
11616
11617 ###   use option --enable-broken-linker to force on use of broken-linker support
11618
11619 echo "$as_me:11619: checking if you want broken-linker support code" >&5
11620 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11621
11622 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11623 if test "${enable_broken_linker+set}" = set; then
11624   enableval="$enable_broken_linker"
11625   with_broken_linker=$enableval
11626 else
11627   with_broken_linker=no
11628 fi;
11629 echo "$as_me:11629: result: $with_broken_linker" >&5
11630 echo "${ECHO_T}$with_broken_linker" >&6
11631
11632 : ${BROKEN_LINKER:=0}
11633 if test "x$with_broken_linker" = xyes ; then
11634
11635 cat >>confdefs.h <<\EOF
11636 #define BROKEN_LINKER 1
11637 EOF
11638
11639         BROKEN_LINKER=1
11640 fi
11641
11642 # Check to define _XOPEN_SOURCE "automatically"
11643
11644 echo "$as_me:11644: checking if the POSIX test-macros are already defined" >&5
11645 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11646 if test "${cf_cv_posix_visible+set}" = set; then
11647   echo $ECHO_N "(cached) $ECHO_C" >&6
11648 else
11649
11650 cat >conftest.$ac_ext <<_ACEOF
11651 #line 11651 "configure"
11652 #include "confdefs.h"
11653 #include <stdio.h>
11654 int
11655 main (void)
11656 {
11657
11658 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11659         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11660         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11661         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11662 #error conflicting symbols found
11663 #endif
11664
11665   ;
11666   return 0;
11667 }
11668 _ACEOF
11669 rm -f conftest.$ac_objext
11670 if { (eval echo "$as_me:11670: \"$ac_compile\"") >&5
11671   (eval $ac_compile) 2>&5
11672   ac_status=$?
11673   echo "$as_me:11673: \$? = $ac_status" >&5
11674   (exit $ac_status); } &&
11675          { ac_try='test -s conftest.$ac_objext'
11676   { (eval echo "$as_me:11676: \"$ac_try\"") >&5
11677   (eval $ac_try) 2>&5
11678   ac_status=$?
11679   echo "$as_me:11679: \$? = $ac_status" >&5
11680   (exit $ac_status); }; }; then
11681   cf_cv_posix_visible=no
11682 else
11683   echo "$as_me: failed program was:" >&5
11684 cat conftest.$ac_ext >&5
11685 cf_cv_posix_visible=yes
11686 fi
11687 rm -f conftest.$ac_objext conftest.$ac_ext
11688
11689 fi
11690 echo "$as_me:11690: result: $cf_cv_posix_visible" >&5
11691 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11692
11693 if test "$cf_cv_posix_visible" = no; then
11694
11695 cf_XOPEN_SOURCE=600
11696 cf_POSIX_C_SOURCE=199506L
11697 cf_xopen_source=
11698
11699 case $host_os in
11700 (aix[4-7]*)
11701         cf_xopen_source="-D_ALL_SOURCE"
11702         ;;
11703 (msys)
11704         cf_XOPEN_SOURCE=600
11705         ;;
11706 (darwin[0-8].*)
11707         cf_xopen_source="-D_APPLE_C_SOURCE"
11708         ;;
11709 (darwin*)
11710         cf_xopen_source="-D_DARWIN_C_SOURCE"
11711         cf_XOPEN_SOURCE=
11712         ;;
11713 (freebsd*|dragonfly*|midnightbsd*)
11714         # 5.x headers associate
11715         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11716         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11717         cf_POSIX_C_SOURCE=200112L
11718         cf_XOPEN_SOURCE=600
11719         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11720         ;;
11721 (hpux11*)
11722         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11723         ;;
11724 (hpux*)
11725         cf_xopen_source="-D_HPUX_SOURCE"
11726         ;;
11727 (irix[56].*)
11728         cf_xopen_source="-D_SGI_SOURCE"
11729         cf_XOPEN_SOURCE=
11730         ;;
11731 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11732
11733 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11734
11735 echo "$as_me:11735: checking if this is the GNU C library" >&5
11736 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11737 if test "${cf_cv_gnu_library+set}" = set; then
11738   echo $ECHO_N "(cached) $ECHO_C" >&6
11739 else
11740
11741 cat >conftest.$ac_ext <<_ACEOF
11742 #line 11742 "configure"
11743 #include "confdefs.h"
11744 #include <sys/types.h>
11745 int
11746 main (void)
11747 {
11748
11749         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11750                 return 0;
11751         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11752                 return 0;
11753         #else
11754         #       error not GNU C library
11755         #endif
11756   ;
11757   return 0;
11758 }
11759 _ACEOF
11760 rm -f conftest.$ac_objext
11761 if { (eval echo "$as_me:11761: \"$ac_compile\"") >&5
11762   (eval $ac_compile) 2>&5
11763   ac_status=$?
11764   echo "$as_me:11764: \$? = $ac_status" >&5
11765   (exit $ac_status); } &&
11766          { ac_try='test -s conftest.$ac_objext'
11767   { (eval echo "$as_me:11767: \"$ac_try\"") >&5
11768   (eval $ac_try) 2>&5
11769   ac_status=$?
11770   echo "$as_me:11770: \$? = $ac_status" >&5
11771   (exit $ac_status); }; }; then
11772   cf_cv_gnu_library=yes
11773 else
11774   echo "$as_me: failed program was:" >&5
11775 cat conftest.$ac_ext >&5
11776 cf_cv_gnu_library=no
11777 fi
11778 rm -f conftest.$ac_objext conftest.$ac_ext
11779
11780 fi
11781 echo "$as_me:11781: result: $cf_cv_gnu_library" >&5
11782 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11783
11784 if test x$cf_cv_gnu_library = xyes; then
11785
11786         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11787         # was changed to help a little.  newlib incorporated the change about 4
11788         # years later.
11789         echo "$as_me:11789: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11790 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11791 if test "${cf_cv_gnu_library_219+set}" = set; then
11792   echo $ECHO_N "(cached) $ECHO_C" >&6
11793 else
11794
11795                 cf_save="$CPPFLAGS"
11796
11797         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11798         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11799
11800                 cat >conftest.$ac_ext <<_ACEOF
11801 #line 11801 "configure"
11802 #include "confdefs.h"
11803 #include <sys/types.h>
11804 int
11805 main (void)
11806 {
11807
11808                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11809                                 return 0;
11810                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11811                                 return 0;
11812                         #else
11813                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11814                         #endif
11815   ;
11816   return 0;
11817 }
11818 _ACEOF
11819 rm -f conftest.$ac_objext
11820 if { (eval echo "$as_me:11820: \"$ac_compile\"") >&5
11821   (eval $ac_compile) 2>&5
11822   ac_status=$?
11823   echo "$as_me:11823: \$? = $ac_status" >&5
11824   (exit $ac_status); } &&
11825          { ac_try='test -s conftest.$ac_objext'
11826   { (eval echo "$as_me:11826: \"$ac_try\"") >&5
11827   (eval $ac_try) 2>&5
11828   ac_status=$?
11829   echo "$as_me:11829: \$? = $ac_status" >&5
11830   (exit $ac_status); }; }; then
11831   cf_cv_gnu_library_219=yes
11832 else
11833   echo "$as_me: failed program was:" >&5
11834 cat conftest.$ac_ext >&5
11835 cf_cv_gnu_library_219=no
11836 fi
11837 rm -f conftest.$ac_objext conftest.$ac_ext
11838                 CPPFLAGS="$cf_save"
11839
11840 fi
11841 echo "$as_me:11841: result: $cf_cv_gnu_library_219" >&5
11842 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11843
11844         if test "x$cf_cv_gnu_library_219" = xyes; then
11845                 cf_save="$CPPFLAGS"
11846                 echo "$as_me:11846: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11847 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11848 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11849   echo $ECHO_N "(cached) $ECHO_C" >&6
11850 else
11851
11852 cf_fix_cppflags=no
11853 cf_new_cflags=
11854 cf_new_cppflags=
11855 cf_new_extra_cppflags=
11856
11857 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11858 do
11859 case $cf_fix_cppflags in
11860 (no)
11861         case $cf_add_cflags in
11862         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11863                 case $cf_add_cflags in
11864                 (-D*)
11865                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11866
11867                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11868                                 && test -z "${cf_tst_cflags}" \
11869                                 && cf_fix_cppflags=yes
11870
11871                         if test $cf_fix_cppflags = yes ; then
11872
11873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11875
11876                                 continue
11877                         elif test "${cf_tst_cflags}" = "\"'" ; then
11878
11879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11881
11882                                 continue
11883                         fi
11884                         ;;
11885                 esac
11886                 case "$CPPFLAGS" in
11887                 (*$cf_add_cflags)
11888                         ;;
11889                 (*)
11890                         case $cf_add_cflags in
11891                         (-D*)
11892                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11893
11894 CPPFLAGS=`echo "$CPPFLAGS" | \
11895         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11896                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11897
11898                                 ;;
11899                         esac
11900
11901         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11902         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11903
11904                         ;;
11905                 esac
11906                 ;;
11907         (*)
11908
11909         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11910         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11911
11912                 ;;
11913         esac
11914         ;;
11915 (yes)
11916
11917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11919
11920         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11921
11922         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11923                 && test -z "${cf_tst_cflags}" \
11924                 && cf_fix_cppflags=no
11925         ;;
11926 esac
11927 done
11928
11929 if test -n "$cf_new_cflags" ; then
11930
11931         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11932         CFLAGS="${CFLAGS}$cf_new_cflags"
11933
11934 fi
11935
11936 if test -n "$cf_new_cppflags" ; then
11937
11938         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11939         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11940
11941 fi
11942
11943 if test -n "$cf_new_extra_cppflags" ; then
11944
11945         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11946         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11947
11948 fi
11949
11950                         cat >conftest.$ac_ext <<_ACEOF
11951 #line 11951 "configure"
11952 #include "confdefs.h"
11953
11954                                 #include <limits.h>
11955                                 #include <sys/types.h>
11956
11957 int
11958 main (void)
11959 {
11960
11961                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11962                                         return 0;
11963                                 #else
11964                                 #       error GNU C library is too old
11965                                 #endif
11966   ;
11967   return 0;
11968 }
11969 _ACEOF
11970 rm -f conftest.$ac_objext
11971 if { (eval echo "$as_me:11971: \"$ac_compile\"") >&5
11972   (eval $ac_compile) 2>&5
11973   ac_status=$?
11974   echo "$as_me:11974: \$? = $ac_status" >&5
11975   (exit $ac_status); } &&
11976          { ac_try='test -s conftest.$ac_objext'
11977   { (eval echo "$as_me:11977: \"$ac_try\"") >&5
11978   (eval $ac_try) 2>&5
11979   ac_status=$?
11980   echo "$as_me:11980: \$? = $ac_status" >&5
11981   (exit $ac_status); }; }; then
11982   cf_cv_gnu_dftsrc_219=yes
11983 else
11984   echo "$as_me: failed program was:" >&5
11985 cat conftest.$ac_ext >&5
11986 cf_cv_gnu_dftsrc_219=no
11987 fi
11988 rm -f conftest.$ac_objext conftest.$ac_ext
11989
11990 fi
11991 echo "$as_me:11991: result: $cf_cv_gnu_dftsrc_219" >&5
11992 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11993                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11994         else
11995                 cf_cv_gnu_dftsrc_219=maybe
11996         fi
11997
11998         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11999
12000                 echo "$as_me:12000: checking if we must define _GNU_SOURCE" >&5
12001 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12002 if test "${cf_cv_gnu_source+set}" = set; then
12003   echo $ECHO_N "(cached) $ECHO_C" >&6
12004 else
12005
12006                 cat >conftest.$ac_ext <<_ACEOF
12007 #line 12007 "configure"
12008 #include "confdefs.h"
12009 #include <sys/types.h>
12010 int
12011 main (void)
12012 {
12013
12014                         #ifndef _XOPEN_SOURCE
12015                         #error  expected _XOPEN_SOURCE to be defined
12016                         #endif
12017   ;
12018   return 0;
12019 }
12020 _ACEOF
12021 rm -f conftest.$ac_objext
12022 if { (eval echo "$as_me:12022: \"$ac_compile\"") >&5
12023   (eval $ac_compile) 2>&5
12024   ac_status=$?
12025   echo "$as_me:12025: \$? = $ac_status" >&5
12026   (exit $ac_status); } &&
12027          { ac_try='test -s conftest.$ac_objext'
12028   { (eval echo "$as_me:12028: \"$ac_try\"") >&5
12029   (eval $ac_try) 2>&5
12030   ac_status=$?
12031   echo "$as_me:12031: \$? = $ac_status" >&5
12032   (exit $ac_status); }; }; then
12033   cf_cv_gnu_source=no
12034 else
12035   echo "$as_me: failed program was:" >&5
12036 cat conftest.$ac_ext >&5
12037 cf_save="$CPPFLAGS"
12038
12039 cf_fix_cppflags=no
12040 cf_new_cflags=
12041 cf_new_cppflags=
12042 cf_new_extra_cppflags=
12043
12044 for cf_add_cflags in -D_GNU_SOURCE
12045 do
12046 case $cf_fix_cppflags in
12047 (no)
12048         case $cf_add_cflags in
12049         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12050                 case $cf_add_cflags in
12051                 (-D*)
12052                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12053
12054                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12055                                 && test -z "${cf_tst_cflags}" \
12056                                 && cf_fix_cppflags=yes
12057
12058                         if test $cf_fix_cppflags = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
12065
12066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12068
12069                                 continue
12070                         fi
12071                         ;;
12072                 esac
12073                 case "$CPPFLAGS" in
12074                 (*$cf_add_cflags)
12075                         ;;
12076                 (*)
12077                         case $cf_add_cflags in
12078                         (-D*)
12079                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12080
12081 CPPFLAGS=`echo "$CPPFLAGS" | \
12082         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12083                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12084
12085                                 ;;
12086                         esac
12087
12088         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12089         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12090
12091                         ;;
12092                 esac
12093                 ;;
12094         (*)
12095
12096         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12097         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12098
12099                 ;;
12100         esac
12101         ;;
12102 (yes)
12103
12104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12106
12107         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12108
12109         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12110                 && test -z "${cf_tst_cflags}" \
12111                 && cf_fix_cppflags=no
12112         ;;
12113 esac
12114 done
12115
12116 if test -n "$cf_new_cflags" ; then
12117
12118         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12119         CFLAGS="${CFLAGS}$cf_new_cflags"
12120
12121 fi
12122
12123 if test -n "$cf_new_cppflags" ; then
12124
12125         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12126         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12127
12128 fi
12129
12130 if test -n "$cf_new_extra_cppflags" ; then
12131
12132         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12133         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12134
12135 fi
12136
12137                          cat >conftest.$ac_ext <<_ACEOF
12138 #line 12138 "configure"
12139 #include "confdefs.h"
12140 #include <sys/types.h>
12141 int
12142 main (void)
12143 {
12144
12145                                 #ifdef _XOPEN_SOURCE
12146                                 #error  expected _XOPEN_SOURCE to be undefined
12147                                 #endif
12148   ;
12149   return 0;
12150 }
12151 _ACEOF
12152 rm -f conftest.$ac_objext
12153 if { (eval echo "$as_me:12153: \"$ac_compile\"") >&5
12154   (eval $ac_compile) 2>&5
12155   ac_status=$?
12156   echo "$as_me:12156: \$? = $ac_status" >&5
12157   (exit $ac_status); } &&
12158          { ac_try='test -s conftest.$ac_objext'
12159   { (eval echo "$as_me:12159: \"$ac_try\"") >&5
12160   (eval $ac_try) 2>&5
12161   ac_status=$?
12162   echo "$as_me:12162: \$? = $ac_status" >&5
12163   (exit $ac_status); }; }; then
12164   cf_cv_gnu_source=no
12165 else
12166   echo "$as_me: failed program was:" >&5
12167 cat conftest.$ac_ext >&5
12168 cf_cv_gnu_source=yes
12169 fi
12170 rm -f conftest.$ac_objext conftest.$ac_ext
12171                         CPPFLAGS="$cf_save"
12172
12173 fi
12174 rm -f conftest.$ac_objext conftest.$ac_ext
12175
12176 fi
12177 echo "$as_me:12177: result: $cf_cv_gnu_source" >&5
12178 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12179
12180                 if test "$cf_cv_gnu_source" = yes
12181                 then
12182                 echo "$as_me:12182: checking if we should also define _DEFAULT_SOURCE" >&5
12183 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12184 if test "${cf_cv_default_source+set}" = set; then
12185   echo $ECHO_N "(cached) $ECHO_C" >&6
12186 else
12187
12188         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12189         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12190
12191                         cat >conftest.$ac_ext <<_ACEOF
12192 #line 12192 "configure"
12193 #include "confdefs.h"
12194 #include <sys/types.h>
12195 int
12196 main (void)
12197 {
12198
12199                                 #ifdef _DEFAULT_SOURCE
12200                                 #error  expected _DEFAULT_SOURCE to be undefined
12201                                 #endif
12202   ;
12203   return 0;
12204 }
12205 _ACEOF
12206 rm -f conftest.$ac_objext
12207 if { (eval echo "$as_me:12207: \"$ac_compile\"") >&5
12208   (eval $ac_compile) 2>&5
12209   ac_status=$?
12210   echo "$as_me:12210: \$? = $ac_status" >&5
12211   (exit $ac_status); } &&
12212          { ac_try='test -s conftest.$ac_objext'
12213   { (eval echo "$as_me:12213: \"$ac_try\"") >&5
12214   (eval $ac_try) 2>&5
12215   ac_status=$?
12216   echo "$as_me:12216: \$? = $ac_status" >&5
12217   (exit $ac_status); }; }; then
12218   cf_cv_default_source=no
12219 else
12220   echo "$as_me: failed program was:" >&5
12221 cat conftest.$ac_ext >&5
12222 cf_cv_default_source=yes
12223 fi
12224 rm -f conftest.$ac_objext conftest.$ac_ext
12225
12226 fi
12227 echo "$as_me:12227: result: $cf_cv_default_source" >&5
12228 echo "${ECHO_T}$cf_cv_default_source" >&6
12229                         if test "$cf_cv_default_source" = yes
12230                         then
12231
12232         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12233         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12234
12235                         fi
12236                 fi
12237         fi
12238
12239 fi
12240
12241         ;;
12242 (minix*)
12243         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12244         ;;
12245 (mirbsd*)
12246         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12247         cf_XOPEN_SOURCE=
12248
12249 if test "$cf_cv_posix_visible" = no; then
12250
12251 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12252
12253 cf_save_CFLAGS="$CFLAGS"
12254 cf_save_CPPFLAGS="$CPPFLAGS"
12255
12256 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12257         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12258                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12259
12260 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12261         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12262                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12263
12264 echo "$as_me:12264: checking if we should define _POSIX_C_SOURCE" >&5
12265 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12266 if test "${cf_cv_posix_c_source+set}" = set; then
12267   echo $ECHO_N "(cached) $ECHO_C" >&6
12268 else
12269
12270 echo "${as_me:-configure}:12270: testing if the symbol is already defined go no further ..." 1>&5
12271
12272         cat >conftest.$ac_ext <<_ACEOF
12273 #line 12273 "configure"
12274 #include "confdefs.h"
12275 #include <sys/types.h>
12276 int
12277 main (void)
12278 {
12279
12280 #ifndef _POSIX_C_SOURCE
12281 make an error
12282 #endif
12283   ;
12284   return 0;
12285 }
12286 _ACEOF
12287 rm -f conftest.$ac_objext
12288 if { (eval echo "$as_me:12288: \"$ac_compile\"") >&5
12289   (eval $ac_compile) 2>&5
12290   ac_status=$?
12291   echo "$as_me:12291: \$? = $ac_status" >&5
12292   (exit $ac_status); } &&
12293          { ac_try='test -s conftest.$ac_objext'
12294   { (eval echo "$as_me:12294: \"$ac_try\"") >&5
12295   (eval $ac_try) 2>&5
12296   ac_status=$?
12297   echo "$as_me:12297: \$? = $ac_status" >&5
12298   (exit $ac_status); }; }; then
12299   cf_cv_posix_c_source=no
12300 else
12301   echo "$as_me: failed program was:" >&5
12302 cat conftest.$ac_ext >&5
12303 cf_want_posix_source=no
12304          case .$cf_POSIX_C_SOURCE in
12305          (.[12]??*)
12306                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12307                 ;;
12308          (.2)
12309                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12310                 cf_want_posix_source=yes
12311                 ;;
12312          (.*)
12313                 cf_want_posix_source=yes
12314                 ;;
12315          esac
12316          if test "$cf_want_posix_source" = yes ; then
12317                 cat >conftest.$ac_ext <<_ACEOF
12318 #line 12318 "configure"
12319 #include "confdefs.h"
12320 #include <sys/types.h>
12321 int
12322 main (void)
12323 {
12324
12325 #ifdef _POSIX_SOURCE
12326 make an error
12327 #endif
12328   ;
12329   return 0;
12330 }
12331 _ACEOF
12332 rm -f conftest.$ac_objext
12333 if { (eval echo "$as_me:12333: \"$ac_compile\"") >&5
12334   (eval $ac_compile) 2>&5
12335   ac_status=$?
12336   echo "$as_me:12336: \$? = $ac_status" >&5
12337   (exit $ac_status); } &&
12338          { ac_try='test -s conftest.$ac_objext'
12339   { (eval echo "$as_me:12339: \"$ac_try\"") >&5
12340   (eval $ac_try) 2>&5
12341   ac_status=$?
12342   echo "$as_me:12342: \$? = $ac_status" >&5
12343   (exit $ac_status); }; }; then
12344   :
12345 else
12346   echo "$as_me: failed program was:" >&5
12347 cat conftest.$ac_ext >&5
12348 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12349 fi
12350 rm -f conftest.$ac_objext conftest.$ac_ext
12351          fi
12352
12353 echo "${as_me:-configure}:12353: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12354
12355          CFLAGS="$cf_trim_CFLAGS"
12356          CPPFLAGS="$cf_trim_CPPFLAGS"
12357
12358         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12359         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12360
12361 echo "${as_me:-configure}:12361: testing if the second compile does not leave our definition intact error ..." 1>&5
12362
12363          cat >conftest.$ac_ext <<_ACEOF
12364 #line 12364 "configure"
12365 #include "confdefs.h"
12366 #include <sys/types.h>
12367 int
12368 main (void)
12369 {
12370
12371 #ifndef _POSIX_C_SOURCE
12372 make an error
12373 #endif
12374   ;
12375   return 0;
12376 }
12377 _ACEOF
12378 rm -f conftest.$ac_objext
12379 if { (eval echo "$as_me:12379: \"$ac_compile\"") >&5
12380   (eval $ac_compile) 2>&5
12381   ac_status=$?
12382   echo "$as_me:12382: \$? = $ac_status" >&5
12383   (exit $ac_status); } &&
12384          { ac_try='test -s conftest.$ac_objext'
12385   { (eval echo "$as_me:12385: \"$ac_try\"") >&5
12386   (eval $ac_try) 2>&5
12387   ac_status=$?
12388   echo "$as_me:12388: \$? = $ac_status" >&5
12389   (exit $ac_status); }; }; then
12390   :
12391 else
12392   echo "$as_me: failed program was:" >&5
12393 cat conftest.$ac_ext >&5
12394 cf_cv_posix_c_source=no
12395 fi
12396 rm -f conftest.$ac_objext conftest.$ac_ext
12397          CFLAGS="$cf_save_CFLAGS"
12398          CPPFLAGS="$cf_save_CPPFLAGS"
12399
12400 fi
12401 rm -f conftest.$ac_objext conftest.$ac_ext
12402
12403 fi
12404 echo "$as_me:12404: result: $cf_cv_posix_c_source" >&5
12405 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12406
12407 if test "$cf_cv_posix_c_source" != no ; then
12408         CFLAGS="$cf_trim_CFLAGS"
12409         CPPFLAGS="$cf_trim_CPPFLAGS"
12410
12411 cf_fix_cppflags=no
12412 cf_new_cflags=
12413 cf_new_cppflags=
12414 cf_new_extra_cppflags=
12415
12416 for cf_add_cflags in $cf_cv_posix_c_source
12417 do
12418 case $cf_fix_cppflags in
12419 (no)
12420         case $cf_add_cflags in
12421         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12422                 case $cf_add_cflags in
12423                 (-D*)
12424                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12425
12426                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12427                                 && test -z "${cf_tst_cflags}" \
12428                                 && cf_fix_cppflags=yes
12429
12430                         if test $cf_fix_cppflags = yes ; then
12431
12432         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12433         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12434
12435                                 continue
12436                         elif test "${cf_tst_cflags}" = "\"'" ; then
12437
12438         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12439         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12440
12441                                 continue
12442                         fi
12443                         ;;
12444                 esac
12445                 case "$CPPFLAGS" in
12446                 (*$cf_add_cflags)
12447                         ;;
12448                 (*)
12449                         case $cf_add_cflags in
12450                         (-D*)
12451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12452
12453 CPPFLAGS=`echo "$CPPFLAGS" | \
12454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12456
12457                                 ;;
12458                         esac
12459
12460         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12461         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12462
12463                         ;;
12464                 esac
12465                 ;;
12466         (*)
12467
12468         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12469         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12470
12471                 ;;
12472         esac
12473         ;;
12474 (yes)
12475
12476         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12477         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12478
12479         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12480
12481         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12482                 && test -z "${cf_tst_cflags}" \
12483                 && cf_fix_cppflags=no
12484         ;;
12485 esac
12486 done
12487
12488 if test -n "$cf_new_cflags" ; then
12489
12490         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12491         CFLAGS="${CFLAGS}$cf_new_cflags"
12492
12493 fi
12494
12495 if test -n "$cf_new_cppflags" ; then
12496
12497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12498         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12499
12500 fi
12501
12502 if test -n "$cf_new_extra_cppflags" ; then
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 fi # cf_cv_posix_visible
12512
12513         ;;
12514 (netbsd*)
12515         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12516         ;;
12517 (openbsd[4-9]*)
12518         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12519         cf_xopen_source="-D_BSD_SOURCE"
12520         cf_XOPEN_SOURCE=600
12521         ;;
12522 (openbsd*)
12523         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12524         ;;
12525 (osf[45]*)
12526         cf_xopen_source="-D_OSF_SOURCE"
12527         ;;
12528 (nto-qnx*)
12529         cf_xopen_source="-D_QNX_SOURCE"
12530         ;;
12531 (sco*)
12532         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12533         ;;
12534 (solaris2.*)
12535         cf_xopen_source="-D__EXTENSIONS__"
12536         cf_cv_xopen_source=broken
12537         ;;
12538 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12539         cf_XOPEN_SOURCE=
12540         cf_POSIX_C_SOURCE=
12541         ;;
12542 (*)
12543
12544 echo "$as_me:12544: checking if we should define _XOPEN_SOURCE" >&5
12545 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12546 if test "${cf_cv_xopen_source+set}" = set; then
12547   echo $ECHO_N "(cached) $ECHO_C" >&6
12548 else
12549
12550         cat >conftest.$ac_ext <<_ACEOF
12551 #line 12551 "configure"
12552 #include "confdefs.h"
12553
12554 #include <stdlib.h>
12555 #include <string.h>
12556 #include <sys/types.h>
12557
12558 int
12559 main (void)
12560 {
12561
12562 #ifndef _XOPEN_SOURCE
12563 make an error
12564 #endif
12565   ;
12566   return 0;
12567 }
12568 _ACEOF
12569 rm -f conftest.$ac_objext
12570 if { (eval echo "$as_me:12570: \"$ac_compile\"") >&5
12571   (eval $ac_compile) 2>&5
12572   ac_status=$?
12573   echo "$as_me:12573: \$? = $ac_status" >&5
12574   (exit $ac_status); } &&
12575          { ac_try='test -s conftest.$ac_objext'
12576   { (eval echo "$as_me:12576: \"$ac_try\"") >&5
12577   (eval $ac_try) 2>&5
12578   ac_status=$?
12579   echo "$as_me:12579: \$? = $ac_status" >&5
12580   (exit $ac_status); }; }; then
12581   cf_cv_xopen_source=no
12582 else
12583   echo "$as_me: failed program was:" >&5
12584 cat conftest.$ac_ext >&5
12585 cf_save="$CPPFLAGS"
12586
12587         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12588         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12589
12590          cat >conftest.$ac_ext <<_ACEOF
12591 #line 12591 "configure"
12592 #include "confdefs.h"
12593
12594 #include <stdlib.h>
12595 #include <string.h>
12596 #include <sys/types.h>
12597
12598 int
12599 main (void)
12600 {
12601
12602 #ifdef _XOPEN_SOURCE
12603 make an error
12604 #endif
12605   ;
12606   return 0;
12607 }
12608 _ACEOF
12609 rm -f conftest.$ac_objext
12610 if { (eval echo "$as_me:12610: \"$ac_compile\"") >&5
12611   (eval $ac_compile) 2>&5
12612   ac_status=$?
12613   echo "$as_me:12613: \$? = $ac_status" >&5
12614   (exit $ac_status); } &&
12615          { ac_try='test -s conftest.$ac_objext'
12616   { (eval echo "$as_me:12616: \"$ac_try\"") >&5
12617   (eval $ac_try) 2>&5
12618   ac_status=$?
12619   echo "$as_me:12619: \$? = $ac_status" >&5
12620   (exit $ac_status); }; }; then
12621   cf_cv_xopen_source=no
12622 else
12623   echo "$as_me: failed program was:" >&5
12624 cat conftest.$ac_ext >&5
12625 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12626 fi
12627 rm -f conftest.$ac_objext conftest.$ac_ext
12628         CPPFLAGS="$cf_save"
12629
12630 fi
12631 rm -f conftest.$ac_objext conftest.$ac_ext
12632
12633 fi
12634 echo "$as_me:12634: result: $cf_cv_xopen_source" >&5
12635 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12636
12637 if test "$cf_cv_xopen_source" != no ; then
12638
12639 CFLAGS=`echo "$CFLAGS" | \
12640         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12641                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12642
12643 CPPFLAGS=`echo "$CPPFLAGS" | \
12644         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12645                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12646
12647         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12648
12649 cf_fix_cppflags=no
12650 cf_new_cflags=
12651 cf_new_cppflags=
12652 cf_new_extra_cppflags=
12653
12654 for cf_add_cflags in $cf_temp_xopen_source
12655 do
12656 case $cf_fix_cppflags in
12657 (no)
12658         case $cf_add_cflags in
12659         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12660                 case $cf_add_cflags in
12661                 (-D*)
12662                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12663
12664                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12665                                 && test -z "${cf_tst_cflags}" \
12666                                 && cf_fix_cppflags=yes
12667
12668                         if test $cf_fix_cppflags = yes ; then
12669
12670         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12671         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12672
12673                                 continue
12674                         elif test "${cf_tst_cflags}" = "\"'" ; then
12675
12676         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12677         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12678
12679                                 continue
12680                         fi
12681                         ;;
12682                 esac
12683                 case "$CPPFLAGS" in
12684                 (*$cf_add_cflags)
12685                         ;;
12686                 (*)
12687                         case $cf_add_cflags in
12688                         (-D*)
12689                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12690
12691 CPPFLAGS=`echo "$CPPFLAGS" | \
12692         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12693                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12694
12695                                 ;;
12696                         esac
12697
12698         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12699         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12700
12701                         ;;
12702                 esac
12703                 ;;
12704         (*)
12705
12706         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12707         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12708
12709                 ;;
12710         esac
12711         ;;
12712 (yes)
12713
12714         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12715         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12716
12717         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12718
12719         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12720                 && test -z "${cf_tst_cflags}" \
12721                 && cf_fix_cppflags=no
12722         ;;
12723 esac
12724 done
12725
12726 if test -n "$cf_new_cflags" ; then
12727
12728         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12729         CFLAGS="${CFLAGS}$cf_new_cflags"
12730
12731 fi
12732
12733 if test -n "$cf_new_cppflags" ; then
12734
12735         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12736         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12737
12738 fi
12739
12740 if test -n "$cf_new_extra_cppflags" ; then
12741
12742         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12743         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12744
12745 fi
12746
12747 fi
12748
12749 if test "$cf_cv_posix_visible" = no; then
12750
12751 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12752
12753 cf_save_CFLAGS="$CFLAGS"
12754 cf_save_CPPFLAGS="$CPPFLAGS"
12755
12756 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12757         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12758                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12759
12760 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12761         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12762                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12763
12764 echo "$as_me:12764: checking if we should define _POSIX_C_SOURCE" >&5
12765 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12766 if test "${cf_cv_posix_c_source+set}" = set; then
12767   echo $ECHO_N "(cached) $ECHO_C" >&6
12768 else
12769
12770 echo "${as_me:-configure}:12770: testing if the symbol is already defined go no further ..." 1>&5
12771
12772         cat >conftest.$ac_ext <<_ACEOF
12773 #line 12773 "configure"
12774 #include "confdefs.h"
12775 #include <sys/types.h>
12776 int
12777 main (void)
12778 {
12779
12780 #ifndef _POSIX_C_SOURCE
12781 make an error
12782 #endif
12783   ;
12784   return 0;
12785 }
12786 _ACEOF
12787 rm -f conftest.$ac_objext
12788 if { (eval echo "$as_me:12788: \"$ac_compile\"") >&5
12789   (eval $ac_compile) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit $ac_status); } &&
12793          { ac_try='test -s conftest.$ac_objext'
12794   { (eval echo "$as_me:12794: \"$ac_try\"") >&5
12795   (eval $ac_try) 2>&5
12796   ac_status=$?
12797   echo "$as_me:12797: \$? = $ac_status" >&5
12798   (exit $ac_status); }; }; then
12799   cf_cv_posix_c_source=no
12800 else
12801   echo "$as_me: failed program was:" >&5
12802 cat conftest.$ac_ext >&5
12803 cf_want_posix_source=no
12804          case .$cf_POSIX_C_SOURCE in
12805          (.[12]??*)
12806                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12807                 ;;
12808          (.2)
12809                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12810                 cf_want_posix_source=yes
12811                 ;;
12812          (.*)
12813                 cf_want_posix_source=yes
12814                 ;;
12815          esac
12816          if test "$cf_want_posix_source" = yes ; then
12817                 cat >conftest.$ac_ext <<_ACEOF
12818 #line 12818 "configure"
12819 #include "confdefs.h"
12820 #include <sys/types.h>
12821 int
12822 main (void)
12823 {
12824
12825 #ifdef _POSIX_SOURCE
12826 make an error
12827 #endif
12828   ;
12829   return 0;
12830 }
12831 _ACEOF
12832 rm -f conftest.$ac_objext
12833 if { (eval echo "$as_me:12833: \"$ac_compile\"") >&5
12834   (eval $ac_compile) 2>&5
12835   ac_status=$?
12836   echo "$as_me:12836: \$? = $ac_status" >&5
12837   (exit $ac_status); } &&
12838          { ac_try='test -s conftest.$ac_objext'
12839   { (eval echo "$as_me:12839: \"$ac_try\"") >&5
12840   (eval $ac_try) 2>&5
12841   ac_status=$?
12842   echo "$as_me:12842: \$? = $ac_status" >&5
12843   (exit $ac_status); }; }; then
12844   :
12845 else
12846   echo "$as_me: failed program was:" >&5
12847 cat conftest.$ac_ext >&5
12848 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12849 fi
12850 rm -f conftest.$ac_objext conftest.$ac_ext
12851          fi
12852
12853 echo "${as_me:-configure}:12853: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12854
12855          CFLAGS="$cf_trim_CFLAGS"
12856          CPPFLAGS="$cf_trim_CPPFLAGS"
12857
12858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12859         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12860
12861 echo "${as_me:-configure}:12861: testing if the second compile does not leave our definition intact error ..." 1>&5
12862
12863          cat >conftest.$ac_ext <<_ACEOF
12864 #line 12864 "configure"
12865 #include "confdefs.h"
12866 #include <sys/types.h>
12867 int
12868 main (void)
12869 {
12870
12871 #ifndef _POSIX_C_SOURCE
12872 make an error
12873 #endif
12874   ;
12875   return 0;
12876 }
12877 _ACEOF
12878 rm -f conftest.$ac_objext
12879 if { (eval echo "$as_me:12879: \"$ac_compile\"") >&5
12880   (eval $ac_compile) 2>&5
12881   ac_status=$?
12882   echo "$as_me:12882: \$? = $ac_status" >&5
12883   (exit $ac_status); } &&
12884          { ac_try='test -s conftest.$ac_objext'
12885   { (eval echo "$as_me:12885: \"$ac_try\"") >&5
12886   (eval $ac_try) 2>&5
12887   ac_status=$?
12888   echo "$as_me:12888: \$? = $ac_status" >&5
12889   (exit $ac_status); }; }; then
12890   :
12891 else
12892   echo "$as_me: failed program was:" >&5
12893 cat conftest.$ac_ext >&5
12894 cf_cv_posix_c_source=no
12895 fi
12896 rm -f conftest.$ac_objext conftest.$ac_ext
12897          CFLAGS="$cf_save_CFLAGS"
12898          CPPFLAGS="$cf_save_CPPFLAGS"
12899
12900 fi
12901 rm -f conftest.$ac_objext conftest.$ac_ext
12902
12903 fi
12904 echo "$as_me:12904: result: $cf_cv_posix_c_source" >&5
12905 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12906
12907 if test "$cf_cv_posix_c_source" != no ; then
12908         CFLAGS="$cf_trim_CFLAGS"
12909         CPPFLAGS="$cf_trim_CPPFLAGS"
12910
12911 cf_fix_cppflags=no
12912 cf_new_cflags=
12913 cf_new_cppflags=
12914 cf_new_extra_cppflags=
12915
12916 for cf_add_cflags in $cf_cv_posix_c_source
12917 do
12918 case $cf_fix_cppflags in
12919 (no)
12920         case $cf_add_cflags in
12921         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12922                 case $cf_add_cflags in
12923                 (-D*)
12924                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12925
12926                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12927                                 && test -z "${cf_tst_cflags}" \
12928                                 && cf_fix_cppflags=yes
12929
12930                         if test $cf_fix_cppflags = yes ; then
12931
12932         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12933         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12934
12935                                 continue
12936                         elif test "${cf_tst_cflags}" = "\"'" ; then
12937
12938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12940
12941                                 continue
12942                         fi
12943                         ;;
12944                 esac
12945                 case "$CPPFLAGS" in
12946                 (*$cf_add_cflags)
12947                         ;;
12948                 (*)
12949                         case $cf_add_cflags in
12950                         (-D*)
12951                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12952
12953 CPPFLAGS=`echo "$CPPFLAGS" | \
12954         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12955                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12956
12957                                 ;;
12958                         esac
12959
12960         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12961         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12962
12963                         ;;
12964                 esac
12965                 ;;
12966         (*)
12967
12968         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12969         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12970
12971                 ;;
12972         esac
12973         ;;
12974 (yes)
12975
12976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12978
12979         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12980
12981         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12982                 && test -z "${cf_tst_cflags}" \
12983                 && cf_fix_cppflags=no
12984         ;;
12985 esac
12986 done
12987
12988 if test -n "$cf_new_cflags" ; then
12989
12990         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12991         CFLAGS="${CFLAGS}$cf_new_cflags"
12992
12993 fi
12994
12995 if test -n "$cf_new_cppflags" ; then
12996
12997         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12998         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12999
13000 fi
13001
13002 if test -n "$cf_new_extra_cppflags" ; then
13003
13004         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13005         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13006
13007 fi
13008
13009 fi
13010
13011 fi # cf_cv_posix_visible
13012
13013         ;;
13014 esac
13015
13016 if test -n "$cf_xopen_source" ; then
13017
13018 cf_fix_cppflags=no
13019 cf_new_cflags=
13020 cf_new_cppflags=
13021 cf_new_extra_cppflags=
13022
13023 for cf_add_cflags in $cf_xopen_source
13024 do
13025 case $cf_fix_cppflags in
13026 (no)
13027         case $cf_add_cflags in
13028         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13029                 case $cf_add_cflags in
13030                 (-D*)
13031                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13032
13033                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13034                                 && test -z "${cf_tst_cflags}" \
13035                                 && cf_fix_cppflags=yes
13036
13037                         if test $cf_fix_cppflags = yes ; then
13038
13039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13041
13042                                 continue
13043                         elif test "${cf_tst_cflags}" = "\"'" ; then
13044
13045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13047
13048                                 continue
13049                         fi
13050                         ;;
13051                 esac
13052                 case "$CPPFLAGS" in
13053                 (*$cf_add_cflags)
13054                         ;;
13055                 (*)
13056                         case $cf_add_cflags in
13057                         (-D*)
13058                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13059
13060 CPPFLAGS=`echo "$CPPFLAGS" | \
13061         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13062                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13063
13064                                 ;;
13065                         esac
13066
13067         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13068         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13069
13070                         ;;
13071                 esac
13072                 ;;
13073         (*)
13074
13075         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13076         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13077
13078                 ;;
13079         esac
13080         ;;
13081 (yes)
13082
13083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13085
13086         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13087
13088         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13089                 && test -z "${cf_tst_cflags}" \
13090                 && cf_fix_cppflags=no
13091         ;;
13092 esac
13093 done
13094
13095 if test -n "$cf_new_cflags" ; then
13096         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13097
13098 echo "${as_me:-configure}:13098: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13099
13100         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13101         CFLAGS="${CFLAGS}$cf_new_cflags"
13102
13103 fi
13104
13105 if test -n "$cf_new_cppflags" ; then
13106         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13107
13108 echo "${as_me:-configure}:13108: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13109
13110         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13111         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13112
13113 fi
13114
13115 if test -n "$cf_new_extra_cppflags" ; then
13116         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13117
13118 echo "${as_me:-configure}:13118: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13119
13120         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13121         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13122
13123 fi
13124
13125 fi
13126
13127 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13128         echo "$as_me:13128: checking if _XOPEN_SOURCE really is set" >&5
13129 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13130         cat >conftest.$ac_ext <<_ACEOF
13131 #line 13131 "configure"
13132 #include "confdefs.h"
13133 #include <stdlib.h>
13134 int
13135 main (void)
13136 {
13137
13138 #ifndef _XOPEN_SOURCE
13139 make an error
13140 #endif
13141   ;
13142   return 0;
13143 }
13144 _ACEOF
13145 rm -f conftest.$ac_objext
13146 if { (eval echo "$as_me:13146: \"$ac_compile\"") >&5
13147   (eval $ac_compile) 2>&5
13148   ac_status=$?
13149   echo "$as_me:13149: \$? = $ac_status" >&5
13150   (exit $ac_status); } &&
13151          { ac_try='test -s conftest.$ac_objext'
13152   { (eval echo "$as_me:13152: \"$ac_try\"") >&5
13153   (eval $ac_try) 2>&5
13154   ac_status=$?
13155   echo "$as_me:13155: \$? = $ac_status" >&5
13156   (exit $ac_status); }; }; then
13157   cf_XOPEN_SOURCE_set=yes
13158 else
13159   echo "$as_me: failed program was:" >&5
13160 cat conftest.$ac_ext >&5
13161 cf_XOPEN_SOURCE_set=no
13162 fi
13163 rm -f conftest.$ac_objext conftest.$ac_ext
13164         echo "$as_me:13164: result: $cf_XOPEN_SOURCE_set" >&5
13165 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13166         if test $cf_XOPEN_SOURCE_set = yes
13167         then
13168                 cat >conftest.$ac_ext <<_ACEOF
13169 #line 13169 "configure"
13170 #include "confdefs.h"
13171 #include <stdlib.h>
13172 int
13173 main (void)
13174 {
13175
13176 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13177 make an error
13178 #endif
13179   ;
13180   return 0;
13181 }
13182 _ACEOF
13183 rm -f conftest.$ac_objext
13184 if { (eval echo "$as_me:13184: \"$ac_compile\"") >&5
13185   (eval $ac_compile) 2>&5
13186   ac_status=$?
13187   echo "$as_me:13187: \$? = $ac_status" >&5
13188   (exit $ac_status); } &&
13189          { ac_try='test -s conftest.$ac_objext'
13190   { (eval echo "$as_me:13190: \"$ac_try\"") >&5
13191   (eval $ac_try) 2>&5
13192   ac_status=$?
13193   echo "$as_me:13193: \$? = $ac_status" >&5
13194   (exit $ac_status); }; }; then
13195   cf_XOPEN_SOURCE_set_ok=yes
13196 else
13197   echo "$as_me: failed program was:" >&5
13198 cat conftest.$ac_ext >&5
13199 cf_XOPEN_SOURCE_set_ok=no
13200 fi
13201 rm -f conftest.$ac_objext conftest.$ac_ext
13202                 if test $cf_XOPEN_SOURCE_set_ok = no
13203                 then
13204                         { echo "$as_me:13204: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13205 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13206                 fi
13207         else
13208
13209 echo "$as_me:13209: checking if we should define _XOPEN_SOURCE" >&5
13210 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13211 if test "${cf_cv_xopen_source+set}" = set; then
13212   echo $ECHO_N "(cached) $ECHO_C" >&6
13213 else
13214
13215         cat >conftest.$ac_ext <<_ACEOF
13216 #line 13216 "configure"
13217 #include "confdefs.h"
13218
13219 #include <stdlib.h>
13220 #include <string.h>
13221 #include <sys/types.h>
13222
13223 int
13224 main (void)
13225 {
13226
13227 #ifndef _XOPEN_SOURCE
13228 make an error
13229 #endif
13230   ;
13231   return 0;
13232 }
13233 _ACEOF
13234 rm -f conftest.$ac_objext
13235 if { (eval echo "$as_me:13235: \"$ac_compile\"") >&5
13236   (eval $ac_compile) 2>&5
13237   ac_status=$?
13238   echo "$as_me:13238: \$? = $ac_status" >&5
13239   (exit $ac_status); } &&
13240          { ac_try='test -s conftest.$ac_objext'
13241   { (eval echo "$as_me:13241: \"$ac_try\"") >&5
13242   (eval $ac_try) 2>&5
13243   ac_status=$?
13244   echo "$as_me:13244: \$? = $ac_status" >&5
13245   (exit $ac_status); }; }; then
13246   cf_cv_xopen_source=no
13247 else
13248   echo "$as_me: failed program was:" >&5
13249 cat conftest.$ac_ext >&5
13250 cf_save="$CPPFLAGS"
13251
13252         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13253         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13254
13255          cat >conftest.$ac_ext <<_ACEOF
13256 #line 13256 "configure"
13257 #include "confdefs.h"
13258
13259 #include <stdlib.h>
13260 #include <string.h>
13261 #include <sys/types.h>
13262
13263 int
13264 main (void)
13265 {
13266
13267 #ifdef _XOPEN_SOURCE
13268 make an error
13269 #endif
13270   ;
13271   return 0;
13272 }
13273 _ACEOF
13274 rm -f conftest.$ac_objext
13275 if { (eval echo "$as_me:13275: \"$ac_compile\"") >&5
13276   (eval $ac_compile) 2>&5
13277   ac_status=$?
13278   echo "$as_me:13278: \$? = $ac_status" >&5
13279   (exit $ac_status); } &&
13280          { ac_try='test -s conftest.$ac_objext'
13281   { (eval echo "$as_me:13281: \"$ac_try\"") >&5
13282   (eval $ac_try) 2>&5
13283   ac_status=$?
13284   echo "$as_me:13284: \$? = $ac_status" >&5
13285   (exit $ac_status); }; }; then
13286   cf_cv_xopen_source=no
13287 else
13288   echo "$as_me: failed program was:" >&5
13289 cat conftest.$ac_ext >&5
13290 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13291 fi
13292 rm -f conftest.$ac_objext conftest.$ac_ext
13293         CPPFLAGS="$cf_save"
13294
13295 fi
13296 rm -f conftest.$ac_objext conftest.$ac_ext
13297
13298 fi
13299 echo "$as_me:13299: result: $cf_cv_xopen_source" >&5
13300 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13301
13302 if test "$cf_cv_xopen_source" != no ; then
13303
13304 CFLAGS=`echo "$CFLAGS" | \
13305         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13306                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13307
13308 CPPFLAGS=`echo "$CPPFLAGS" | \
13309         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13310                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13311
13312         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13313
13314 cf_fix_cppflags=no
13315 cf_new_cflags=
13316 cf_new_cppflags=
13317 cf_new_extra_cppflags=
13318
13319 for cf_add_cflags in $cf_temp_xopen_source
13320 do
13321 case $cf_fix_cppflags in
13322 (no)
13323         case $cf_add_cflags in
13324         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13325                 case $cf_add_cflags in
13326                 (-D*)
13327                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13328
13329                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13330                                 && test -z "${cf_tst_cflags}" \
13331                                 && cf_fix_cppflags=yes
13332
13333                         if test $cf_fix_cppflags = yes ; then
13334
13335         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13336         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13337
13338                                 continue
13339                         elif test "${cf_tst_cflags}" = "\"'" ; then
13340
13341         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13342         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13343
13344                                 continue
13345                         fi
13346                         ;;
13347                 esac
13348                 case "$CPPFLAGS" in
13349                 (*$cf_add_cflags)
13350                         ;;
13351                 (*)
13352                         case $cf_add_cflags in
13353                         (-D*)
13354                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13355
13356 CPPFLAGS=`echo "$CPPFLAGS" | \
13357         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13358                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13359
13360                                 ;;
13361                         esac
13362
13363         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13364         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13365
13366                         ;;
13367                 esac
13368                 ;;
13369         (*)
13370
13371         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13372         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13373
13374                 ;;
13375         esac
13376         ;;
13377 (yes)
13378
13379         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13380         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13381
13382         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13383
13384         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13385                 && test -z "${cf_tst_cflags}" \
13386                 && cf_fix_cppflags=no
13387         ;;
13388 esac
13389 done
13390
13391 if test -n "$cf_new_cflags" ; then
13392
13393         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13394         CFLAGS="${CFLAGS}$cf_new_cflags"
13395
13396 fi
13397
13398 if test -n "$cf_new_cppflags" ; then
13399
13400         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13401         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13402
13403 fi
13404
13405 if test -n "$cf_new_extra_cppflags" ; then
13406
13407         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13408         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13409
13410 fi
13411
13412 fi
13413
13414         fi
13415 fi
13416 fi # cf_cv_posix_visible
13417
13418 # Check whether --enable-largefile or --disable-largefile was given.
13419 if test "${enable_largefile+set}" = set; then
13420   enableval="$enable_largefile"
13421
13422 fi;
13423 if test "$enable_largefile" != no; then
13424
13425   echo "$as_me:13425: checking for special C compiler options needed for large files" >&5
13426 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13427 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13428   echo $ECHO_N "(cached) $ECHO_C" >&6
13429 else
13430   ac_cv_sys_largefile_CC=no
13431      if test "$GCC" != yes; then
13432        ac_save_CC=$CC
13433        while :; do
13434          # IRIX 6.2 and later do not support large files by default,
13435          # so use the C compiler's -n32 option if that helps.
13436          cat >conftest.$ac_ext <<_ACEOF
13437 #line 13437 "configure"
13438 #include "confdefs.h"
13439 #include <sys/types.h>
13440  /* Check that off_t can represent 2**63 - 1 correctly.
13441     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13442     since some C++ compilers masquerading as C compilers
13443     incorrectly reject 9223372036854775807.  */
13444 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13445   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13446                        && LARGE_OFF_T % 2147483647 == 1)
13447                       ? 1 : -1];
13448 int
13449 main (void)
13450 {
13451
13452   ;
13453   return 0;
13454 }
13455 _ACEOF
13456          rm -f conftest.$ac_objext
13457 if { (eval echo "$as_me:13457: \"$ac_compile\"") >&5
13458   (eval $ac_compile) 2>&5
13459   ac_status=$?
13460   echo "$as_me:13460: \$? = $ac_status" >&5
13461   (exit $ac_status); } &&
13462          { ac_try='test -s conftest.$ac_objext'
13463   { (eval echo "$as_me:13463: \"$ac_try\"") >&5
13464   (eval $ac_try) 2>&5
13465   ac_status=$?
13466   echo "$as_me:13466: \$? = $ac_status" >&5
13467   (exit $ac_status); }; }; then
13468   break
13469 else
13470   echo "$as_me: failed program was:" >&5
13471 cat conftest.$ac_ext >&5
13472 fi
13473 rm -f conftest.$ac_objext
13474          CC="$CC -n32"
13475          rm -f conftest.$ac_objext
13476 if { (eval echo "$as_me:13476: \"$ac_compile\"") >&5
13477   (eval $ac_compile) 2>&5
13478   ac_status=$?
13479   echo "$as_me:13479: \$? = $ac_status" >&5
13480   (exit $ac_status); } &&
13481          { ac_try='test -s conftest.$ac_objext'
13482   { (eval echo "$as_me:13482: \"$ac_try\"") >&5
13483   (eval $ac_try) 2>&5
13484   ac_status=$?
13485   echo "$as_me:13485: \$? = $ac_status" >&5
13486   (exit $ac_status); }; }; then
13487   ac_cv_sys_largefile_CC=' -n32'; break
13488 else
13489   echo "$as_me: failed program was:" >&5
13490 cat conftest.$ac_ext >&5
13491 fi
13492 rm -f conftest.$ac_objext
13493          break
13494        done
13495        CC=$ac_save_CC
13496        rm -f conftest.$ac_ext
13497     fi
13498 fi
13499 echo "$as_me:13499: result: $ac_cv_sys_largefile_CC" >&5
13500 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13501   if test "$ac_cv_sys_largefile_CC" != no; then
13502     CC=$CC$ac_cv_sys_largefile_CC
13503   fi
13504
13505   echo "$as_me:13505: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13506 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13507 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13508   echo $ECHO_N "(cached) $ECHO_C" >&6
13509 else
13510   while :; do
13511   ac_cv_sys_file_offset_bits=no
13512   cat >conftest.$ac_ext <<_ACEOF
13513 #line 13513 "configure"
13514 #include "confdefs.h"
13515 #include <sys/types.h>
13516  /* Check that off_t can represent 2**63 - 1 correctly.
13517     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13518     since some C++ compilers masquerading as C compilers
13519     incorrectly reject 9223372036854775807.  */
13520 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13521   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13522                        && LARGE_OFF_T % 2147483647 == 1)
13523                       ? 1 : -1];
13524 int
13525 main (void)
13526 {
13527
13528   ;
13529   return 0;
13530 }
13531 _ACEOF
13532 rm -f conftest.$ac_objext
13533 if { (eval echo "$as_me:13533: \"$ac_compile\"") >&5
13534   (eval $ac_compile) 2>&5
13535   ac_status=$?
13536   echo "$as_me:13536: \$? = $ac_status" >&5
13537   (exit $ac_status); } &&
13538          { ac_try='test -s conftest.$ac_objext'
13539   { (eval echo "$as_me:13539: \"$ac_try\"") >&5
13540   (eval $ac_try) 2>&5
13541   ac_status=$?
13542   echo "$as_me:13542: \$? = $ac_status" >&5
13543   (exit $ac_status); }; }; then
13544   break
13545 else
13546   echo "$as_me: failed program was:" >&5
13547 cat conftest.$ac_ext >&5
13548 fi
13549 rm -f conftest.$ac_objext conftest.$ac_ext
13550   cat >conftest.$ac_ext <<_ACEOF
13551 #line 13551 "configure"
13552 #include "confdefs.h"
13553 #define _FILE_OFFSET_BITS 64
13554 #include <sys/types.h>
13555  /* Check that off_t can represent 2**63 - 1 correctly.
13556     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13557     since some C++ compilers masquerading as C compilers
13558     incorrectly reject 9223372036854775807.  */
13559 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13560   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13561                        && LARGE_OFF_T % 2147483647 == 1)
13562                       ? 1 : -1];
13563 int
13564 main (void)
13565 {
13566
13567   ;
13568   return 0;
13569 }
13570 _ACEOF
13571 rm -f conftest.$ac_objext
13572 if { (eval echo "$as_me:13572: \"$ac_compile\"") >&5
13573   (eval $ac_compile) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit $ac_status); } &&
13577          { ac_try='test -s conftest.$ac_objext'
13578   { (eval echo "$as_me:13578: \"$ac_try\"") >&5
13579   (eval $ac_try) 2>&5
13580   ac_status=$?
13581   echo "$as_me:13581: \$? = $ac_status" >&5
13582   (exit $ac_status); }; }; then
13583   ac_cv_sys_file_offset_bits=64; break
13584 else
13585   echo "$as_me: failed program was:" >&5
13586 cat conftest.$ac_ext >&5
13587 fi
13588 rm -f conftest.$ac_objext conftest.$ac_ext
13589   break
13590 done
13591 fi
13592 echo "$as_me:13592: result: $ac_cv_sys_file_offset_bits" >&5
13593 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13594 if test "$ac_cv_sys_file_offset_bits" != no; then
13595
13596 cat >>confdefs.h <<EOF
13597 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13598 EOF
13599
13600 fi
13601 rm -rf conftest*
13602   echo "$as_me:13602: checking for _LARGE_FILES value needed for large files" >&5
13603 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13604 if test "${ac_cv_sys_large_files+set}" = set; then
13605   echo $ECHO_N "(cached) $ECHO_C" >&6
13606 else
13607   while :; do
13608   ac_cv_sys_large_files=no
13609   cat >conftest.$ac_ext <<_ACEOF
13610 #line 13610 "configure"
13611 #include "confdefs.h"
13612 #include <sys/types.h>
13613  /* Check that off_t can represent 2**63 - 1 correctly.
13614     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13615     since some C++ compilers masquerading as C compilers
13616     incorrectly reject 9223372036854775807.  */
13617 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13618   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13619                        && LARGE_OFF_T % 2147483647 == 1)
13620                       ? 1 : -1];
13621 int
13622 main (void)
13623 {
13624
13625   ;
13626   return 0;
13627 }
13628 _ACEOF
13629 rm -f conftest.$ac_objext
13630 if { (eval echo "$as_me:13630: \"$ac_compile\"") >&5
13631   (eval $ac_compile) 2>&5
13632   ac_status=$?
13633   echo "$as_me:13633: \$? = $ac_status" >&5
13634   (exit $ac_status); } &&
13635          { ac_try='test -s conftest.$ac_objext'
13636   { (eval echo "$as_me:13636: \"$ac_try\"") >&5
13637   (eval $ac_try) 2>&5
13638   ac_status=$?
13639   echo "$as_me:13639: \$? = $ac_status" >&5
13640   (exit $ac_status); }; }; then
13641   break
13642 else
13643   echo "$as_me: failed program was:" >&5
13644 cat conftest.$ac_ext >&5
13645 fi
13646 rm -f conftest.$ac_objext conftest.$ac_ext
13647   cat >conftest.$ac_ext <<_ACEOF
13648 #line 13648 "configure"
13649 #include "confdefs.h"
13650 #define _LARGE_FILES 1
13651 #include <sys/types.h>
13652  /* Check that off_t can represent 2**63 - 1 correctly.
13653     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13654     since some C++ compilers masquerading as C compilers
13655     incorrectly reject 9223372036854775807.  */
13656 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13657   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13658                        && LARGE_OFF_T % 2147483647 == 1)
13659                       ? 1 : -1];
13660 int
13661 main (void)
13662 {
13663
13664   ;
13665   return 0;
13666 }
13667 _ACEOF
13668 rm -f conftest.$ac_objext
13669 if { (eval echo "$as_me:13669: \"$ac_compile\"") >&5
13670   (eval $ac_compile) 2>&5
13671   ac_status=$?
13672   echo "$as_me:13672: \$? = $ac_status" >&5
13673   (exit $ac_status); } &&
13674          { ac_try='test -s conftest.$ac_objext'
13675   { (eval echo "$as_me:13675: \"$ac_try\"") >&5
13676   (eval $ac_try) 2>&5
13677   ac_status=$?
13678   echo "$as_me:13678: \$? = $ac_status" >&5
13679   (exit $ac_status); }; }; then
13680   ac_cv_sys_large_files=1; break
13681 else
13682   echo "$as_me: failed program was:" >&5
13683 cat conftest.$ac_ext >&5
13684 fi
13685 rm -f conftest.$ac_objext conftest.$ac_ext
13686   break
13687 done
13688 fi
13689 echo "$as_me:13689: result: $ac_cv_sys_large_files" >&5
13690 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13691 if test "$ac_cv_sys_large_files" != no; then
13692
13693 cat >>confdefs.h <<EOF
13694 #define _LARGE_FILES $ac_cv_sys_large_files
13695 EOF
13696
13697 fi
13698 rm -rf conftest*
13699 fi
13700
13701         if test "$enable_largefile" != no ; then
13702         echo "$as_me:13702: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13703 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13704 if test "${ac_cv_sys_largefile_source+set}" = set; then
13705   echo $ECHO_N "(cached) $ECHO_C" >&6
13706 else
13707   while :; do
13708   ac_cv_sys_largefile_source=no
13709   cat >conftest.$ac_ext <<_ACEOF
13710 #line 13710 "configure"
13711 #include "confdefs.h"
13712 #include <stdio.h>
13713 int
13714 main (void)
13715 {
13716 return !fseeko;
13717   ;
13718   return 0;
13719 }
13720 _ACEOF
13721 rm -f conftest.$ac_objext
13722 if { (eval echo "$as_me:13722: \"$ac_compile\"") >&5
13723   (eval $ac_compile) 2>&5
13724   ac_status=$?
13725   echo "$as_me:13725: \$? = $ac_status" >&5
13726   (exit $ac_status); } &&
13727          { ac_try='test -s conftest.$ac_objext'
13728   { (eval echo "$as_me:13728: \"$ac_try\"") >&5
13729   (eval $ac_try) 2>&5
13730   ac_status=$?
13731   echo "$as_me:13731: \$? = $ac_status" >&5
13732   (exit $ac_status); }; }; then
13733   break
13734 else
13735   echo "$as_me: failed program was:" >&5
13736 cat conftest.$ac_ext >&5
13737 fi
13738 rm -f conftest.$ac_objext conftest.$ac_ext
13739   cat >conftest.$ac_ext <<_ACEOF
13740 #line 13740 "configure"
13741 #include "confdefs.h"
13742 #define _LARGEFILE_SOURCE 1
13743 #include <stdio.h>
13744 int
13745 main (void)
13746 {
13747 return !fseeko;
13748   ;
13749   return 0;
13750 }
13751 _ACEOF
13752 rm -f conftest.$ac_objext
13753 if { (eval echo "$as_me:13753: \"$ac_compile\"") >&5
13754   (eval $ac_compile) 2>&5
13755   ac_status=$?
13756   echo "$as_me:13756: \$? = $ac_status" >&5
13757   (exit $ac_status); } &&
13758          { ac_try='test -s conftest.$ac_objext'
13759   { (eval echo "$as_me:13759: \"$ac_try\"") >&5
13760   (eval $ac_try) 2>&5
13761   ac_status=$?
13762   echo "$as_me:13762: \$? = $ac_status" >&5
13763   (exit $ac_status); }; }; then
13764   ac_cv_sys_largefile_source=1; break
13765 else
13766   echo "$as_me: failed program was:" >&5
13767 cat conftest.$ac_ext >&5
13768 fi
13769 rm -f conftest.$ac_objext conftest.$ac_ext
13770   break
13771 done
13772 fi
13773 echo "$as_me:13773: result: $ac_cv_sys_largefile_source" >&5
13774 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13775 if test "$ac_cv_sys_largefile_source" != no; then
13776
13777 cat >>confdefs.h <<EOF
13778 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13779 EOF
13780
13781 fi
13782 rm -rf conftest*
13783
13784 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13785 # in glibc 2.1.3, but that breaks too many other things.
13786 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13787 echo "$as_me:13787: checking for fseeko" >&5
13788 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13789 if test "${ac_cv_func_fseeko+set}" = set; then
13790   echo $ECHO_N "(cached) $ECHO_C" >&6
13791 else
13792   cat >conftest.$ac_ext <<_ACEOF
13793 #line 13793 "configure"
13794 #include "confdefs.h"
13795 #include <stdio.h>
13796 int
13797 main (void)
13798 {
13799 return fseeko && fseeko (stdin, 0, 0);
13800   ;
13801   return 0;
13802 }
13803 _ACEOF
13804 rm -f conftest.$ac_objext conftest$ac_exeext
13805 if { (eval echo "$as_me:13805: \"$ac_link\"") >&5
13806   (eval $ac_link) 2>&5
13807   ac_status=$?
13808   echo "$as_me:13808: \$? = $ac_status" >&5
13809   (exit $ac_status); } &&
13810          { ac_try='test -s conftest$ac_exeext'
13811   { (eval echo "$as_me:13811: \"$ac_try\"") >&5
13812   (eval $ac_try) 2>&5
13813   ac_status=$?
13814   echo "$as_me:13814: \$? = $ac_status" >&5
13815   (exit $ac_status); }; }; then
13816   ac_cv_func_fseeko=yes
13817 else
13818   echo "$as_me: failed program was:" >&5
13819 cat conftest.$ac_ext >&5
13820 ac_cv_func_fseeko=no
13821 fi
13822 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13823 fi
13824 echo "$as_me:13824: result: $ac_cv_func_fseeko" >&5
13825 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13826 if test $ac_cv_func_fseeko = yes; then
13827
13828 cat >>confdefs.h <<\EOF
13829 #define HAVE_FSEEKO 1
13830 EOF
13831
13832 fi
13833
13834         # Normally we would collect these definitions in the config.h,
13835         # but (like _XOPEN_SOURCE), some environments rely on having these
13836         # defined before any of the system headers are included.  Another
13837         # case comes up with C++, e.g., on AIX the compiler compiles the
13838         # header files by themselves before looking at the body files it is
13839         # told to compile.  For ncurses, those header files do not include
13840         # the config.h
13841         if test "$ac_cv_sys_large_files" != no
13842         then
13843
13844         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13845         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13846
13847         fi
13848         if test "$ac_cv_sys_largefile_source" != no
13849         then
13850
13851         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13852         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13853
13854         fi
13855         if test "$ac_cv_sys_file_offset_bits" != no
13856         then
13857
13858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13859         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13860
13861         fi
13862
13863         echo "$as_me:13863: checking whether to use struct dirent64" >&5
13864 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13865 if test "${cf_cv_struct_dirent64+set}" = set; then
13866   echo $ECHO_N "(cached) $ECHO_C" >&6
13867 else
13868
13869                 cat >conftest.$ac_ext <<_ACEOF
13870 #line 13870 "configure"
13871 #include "confdefs.h"
13872
13873 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13874 #include <sys/types.h>
13875 #include <dirent.h>
13876
13877 int
13878 main (void)
13879 {
13880
13881                 /* if transitional largefile support is setup, this is true */
13882                 extern struct dirent64 * readdir(DIR *);
13883                 struct dirent64 *x = readdir((DIR *)0);
13884                 struct dirent *y = readdir((DIR *)0);
13885                 int z = x - y;
13886                 (void)z;
13887
13888   ;
13889   return 0;
13890 }
13891 _ACEOF
13892 rm -f conftest.$ac_objext
13893 if { (eval echo "$as_me:13893: \"$ac_compile\"") >&5
13894   (eval $ac_compile) 2>&5
13895   ac_status=$?
13896   echo "$as_me:13896: \$? = $ac_status" >&5
13897   (exit $ac_status); } &&
13898          { ac_try='test -s conftest.$ac_objext'
13899   { (eval echo "$as_me:13899: \"$ac_try\"") >&5
13900   (eval $ac_try) 2>&5
13901   ac_status=$?
13902   echo "$as_me:13902: \$? = $ac_status" >&5
13903   (exit $ac_status); }; }; then
13904   cf_cv_struct_dirent64=yes
13905 else
13906   echo "$as_me: failed program was:" >&5
13907 cat conftest.$ac_ext >&5
13908 cf_cv_struct_dirent64=no
13909 fi
13910 rm -f conftest.$ac_objext conftest.$ac_ext
13911
13912 fi
13913 echo "$as_me:13913: result: $cf_cv_struct_dirent64" >&5
13914 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13915         test "$cf_cv_struct_dirent64" = yes &&
13916 cat >>confdefs.h <<\EOF
13917 #define HAVE_STRUCT_DIRENT64 1
13918 EOF
13919
13920         fi
13921
13922 ### Enable compiling-in rcs id's
13923 echo "$as_me:13923: checking if RCS identifiers should be compiled-in" >&5
13924 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13925
13926 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13927 if test "${with_rcs_ids+set}" = set; then
13928   withval="$with_rcs_ids"
13929   with_rcs_ids=$withval
13930 else
13931   with_rcs_ids=no
13932 fi;
13933 echo "$as_me:13933: result: $with_rcs_ids" >&5
13934 echo "${ECHO_T}$with_rcs_ids" >&6
13935 test "$with_rcs_ids" = yes &&
13936 cat >>confdefs.h <<\EOF
13937 #define USE_RCS_IDS 1
13938 EOF
13939
13940 ###############################################################################
13941
13942 ### Note that some functions (such as const) are normally disabled anyway.
13943 echo "$as_me:13943: checking if you want to build with function extensions" >&5
13944 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13945
13946 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13947 if test "${enable_ext_funcs+set}" = set; then
13948   enableval="$enable_ext_funcs"
13949   with_ext_funcs=$enableval
13950 else
13951   with_ext_funcs=yes
13952 fi;
13953 echo "$as_me:13953: result: $with_ext_funcs" >&5
13954 echo "${ECHO_T}$with_ext_funcs" >&6
13955 if test "$with_ext_funcs" = yes ; then
13956         NCURSES_EXT_FUNCS=1
13957
13958 cat >>confdefs.h <<\EOF
13959 #define HAVE_USE_DEFAULT_COLORS 1
13960 EOF
13961
13962 cat >>confdefs.h <<\EOF
13963 #define NCURSES_EXT_FUNCS 1
13964 EOF
13965
13966 else
13967         NCURSES_EXT_FUNCS=0
13968 fi
13969
13970 ###   use option --enable-const to turn on use of const beyond that in XSI.
13971 echo "$as_me:13971: checking for extended use of const keyword" >&5
13972 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13973
13974 # Check whether --enable-const or --disable-const was given.
13975 if test "${enable_const+set}" = set; then
13976   enableval="$enable_const"
13977   with_ext_const=$enableval
13978 else
13979   with_ext_const=no
13980 fi;
13981 echo "$as_me:13981: result: $with_ext_const" >&5
13982 echo "${ECHO_T}$with_ext_const" >&6
13983 NCURSES_CONST='/*nothing*/'
13984 if test "$with_ext_const" = yes ; then
13985         NCURSES_CONST=const
13986 fi
13987
13988 ###############################################################################
13989 # These options are relatively safe to experiment with.
13990
13991 echo "$as_me:13991: checking if you want all development code" >&5
13992 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13993
13994 # Check whether --with-develop or --without-develop was given.
13995 if test "${with_develop+set}" = set; then
13996   withval="$with_develop"
13997   with_develop=$withval
13998 else
13999   with_develop=no
14000 fi;
14001 echo "$as_me:14001: result: $with_develop" >&5
14002 echo "${ECHO_T}$with_develop" >&6
14003
14004 ###############################################################################
14005 # These are just experimental, probably should not be in a package:
14006
14007 # This is still experimental (20080329), but should ultimately be moved to
14008 # the script-block --with-normal, etc.
14009
14010 echo "$as_me:14010: checking if you want to link with the pthread library" >&5
14011 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14012
14013 # Check whether --with-pthread or --without-pthread was given.
14014 if test "${with_pthread+set}" = set; then
14015   withval="$with_pthread"
14016   with_pthread=$withval
14017 else
14018   with_pthread=no
14019 fi;
14020 echo "$as_me:14020: result: $with_pthread" >&5
14021 echo "${ECHO_T}$with_pthread" >&6
14022
14023 if test "$with_pthread" != no ; then
14024         echo "$as_me:14024: checking for pthread.h" >&5
14025 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14026 if test "${ac_cv_header_pthread_h+set}" = set; then
14027   echo $ECHO_N "(cached) $ECHO_C" >&6
14028 else
14029   cat >conftest.$ac_ext <<_ACEOF
14030 #line 14030 "configure"
14031 #include "confdefs.h"
14032 #include <pthread.h>
14033 _ACEOF
14034 if { (eval echo "$as_me:14034: \"$ac_cpp conftest.$ac_ext\"") >&5
14035   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14036   ac_status=$?
14037   egrep -v '^ *\+' conftest.er1 >conftest.err
14038   rm -f conftest.er1
14039   cat conftest.err >&5
14040   echo "$as_me:14040: \$? = $ac_status" >&5
14041   (exit $ac_status); } >/dev/null; then
14042   if test -s conftest.err; then
14043     ac_cpp_err=$ac_c_preproc_warn_flag
14044   else
14045     ac_cpp_err=
14046   fi
14047 else
14048   ac_cpp_err=yes
14049 fi
14050 if test -z "$ac_cpp_err"; then
14051   ac_cv_header_pthread_h=yes
14052 else
14053   echo "$as_me: failed program was:" >&5
14054   cat conftest.$ac_ext >&5
14055   ac_cv_header_pthread_h=no
14056 fi
14057 rm -f conftest.err conftest.$ac_ext
14058 fi
14059 echo "$as_me:14059: result: $ac_cv_header_pthread_h" >&5
14060 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14061 if test $ac_cv_header_pthread_h = yes; then
14062
14063 cat >>confdefs.h <<\EOF
14064 #define HAVE_PTHREADS_H 1
14065 EOF
14066
14067         for cf_lib_pthread in pthread c_r
14068         do
14069             echo "$as_me:14069: checking if we can link with the $cf_lib_pthread library" >&5
14070 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14071             cf_save_LIBS="$LIBS"
14072
14073 cf_add_libs="$LIBS"
14074 # reverse order
14075 cf_add_0lib=
14076 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14077 # filter duplicates
14078 for cf_add_1lib in $cf_add_0lib; do
14079         for cf_add_2lib in $cf_add_libs; do
14080                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14081                         cf_add_1lib=
14082                         break
14083                 fi
14084         done
14085         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14086 done
14087 LIBS="$cf_add_libs"
14088
14089             cat >conftest.$ac_ext <<_ACEOF
14090 #line 14090 "configure"
14091 #include "confdefs.h"
14092
14093 #include <pthread.h>
14094
14095 int
14096 main (void)
14097 {
14098
14099                 int rc = pthread_create(0,0,0,0);
14100                 int r2 = pthread_mutexattr_settype(0, 0);
14101
14102   ;
14103   return 0;
14104 }
14105 _ACEOF
14106 rm -f conftest.$ac_objext conftest$ac_exeext
14107 if { (eval echo "$as_me:14107: \"$ac_link\"") >&5
14108   (eval $ac_link) 2>&5
14109   ac_status=$?
14110   echo "$as_me:14110: \$? = $ac_status" >&5
14111   (exit $ac_status); } &&
14112          { ac_try='test -s conftest$ac_exeext'
14113   { (eval echo "$as_me:14113: \"$ac_try\"") >&5
14114   (eval $ac_try) 2>&5
14115   ac_status=$?
14116   echo "$as_me:14116: \$? = $ac_status" >&5
14117   (exit $ac_status); }; }; then
14118   with_pthread=yes
14119 else
14120   echo "$as_me: failed program was:" >&5
14121 cat conftest.$ac_ext >&5
14122 with_pthread=no
14123 fi
14124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14125             LIBS="$cf_save_LIBS"
14126             echo "$as_me:14126: result: $with_pthread" >&5
14127 echo "${ECHO_T}$with_pthread" >&6
14128             test "$with_pthread" = yes && break
14129         done
14130
14131         if test "$with_pthread" = yes ; then
14132
14133 cf_add_libs="$LIBS"
14134 # reverse order
14135 cf_add_0lib=
14136 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14137 # filter duplicates
14138 for cf_add_1lib in $cf_add_0lib; do
14139         for cf_add_2lib in $cf_add_libs; do
14140                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14141                         cf_add_1lib=
14142                         break
14143                 fi
14144         done
14145         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14146 done
14147 LIBS="$cf_add_libs"
14148
14149 cat >>confdefs.h <<\EOF
14150 #define HAVE_LIBPTHREADS 1
14151 EOF
14152
14153         else
14154             { { echo "$as_me:14154: error: Cannot link with pthread library" >&5
14155 echo "$as_me: error: Cannot link with pthread library" >&2;}
14156    { (exit 1); exit 1; }; }
14157         fi
14158
14159 fi
14160
14161 fi
14162
14163 echo "$as_me:14163: checking if you want to use weak-symbols for pthreads" >&5
14164 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14165
14166 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14167 if test "${enable_weak_symbols+set}" = set; then
14168   enableval="$enable_weak_symbols"
14169   use_weak_symbols=$withval
14170 else
14171   use_weak_symbols=no
14172 fi;
14173 echo "$as_me:14173: result: $use_weak_symbols" >&5
14174 echo "${ECHO_T}$use_weak_symbols" >&6
14175 if test "$use_weak_symbols" = yes ; then
14176
14177 echo "$as_me:14177: checking if $CC supports weak symbols" >&5
14178 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14179 if test "${cf_cv_weak_symbols+set}" = set; then
14180   echo $ECHO_N "(cached) $ECHO_C" >&6
14181 else
14182
14183 cat >conftest.$ac_ext <<_ACEOF
14184 #line 14184 "configure"
14185 #include "confdefs.h"
14186
14187 #include <stdio.h>
14188 int
14189 main (void)
14190 {
14191
14192 #if defined(__GNUC__)
14193 #  if defined __USE_ISOC99
14194 #    define _cat_pragma(exp)    _Pragma(#exp)
14195 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14196 #  else
14197 #    define _weak_pragma(exp)
14198 #  endif
14199 #  define _declare(name)        __extension__ extern __typeof__(name) name
14200 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14201 #endif
14202
14203 weak_symbol(fopen);
14204
14205   ;
14206   return 0;
14207 }
14208 _ACEOF
14209 rm -f conftest.$ac_objext
14210 if { (eval echo "$as_me:14210: \"$ac_compile\"") >&5
14211   (eval $ac_compile) 2>&5
14212   ac_status=$?
14213   echo "$as_me:14213: \$? = $ac_status" >&5
14214   (exit $ac_status); } &&
14215          { ac_try='test -s conftest.$ac_objext'
14216   { (eval echo "$as_me:14216: \"$ac_try\"") >&5
14217   (eval $ac_try) 2>&5
14218   ac_status=$?
14219   echo "$as_me:14219: \$? = $ac_status" >&5
14220   (exit $ac_status); }; }; then
14221   cf_cv_weak_symbols=yes
14222 else
14223   echo "$as_me: failed program was:" >&5
14224 cat conftest.$ac_ext >&5
14225 cf_cv_weak_symbols=no
14226 fi
14227 rm -f conftest.$ac_objext conftest.$ac_ext
14228
14229 fi
14230 echo "$as_me:14230: result: $cf_cv_weak_symbols" >&5
14231 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14232
14233 else
14234         cf_cv_weak_symbols=no
14235 fi
14236
14237 if test $cf_cv_weak_symbols = yes ; then
14238
14239 cat >>confdefs.h <<\EOF
14240 #define USE_WEAK_SYMBOLS 1
14241 EOF
14242
14243 fi
14244
14245 PTHREAD=
14246 if test "$with_pthread" = "yes" ; then
14247
14248 cat >>confdefs.h <<\EOF
14249 #define USE_PTHREADS 1
14250 EOF
14251
14252         enable_reentrant=yes
14253         if test $cf_cv_weak_symbols = yes ; then
14254                 PTHREAD=-lpthread
14255         fi
14256 fi
14257
14258 # OpenSUSE is installing ncurses6, using reentrant option.
14259 echo "$as_me:14259: checking for _nc_TABSIZE" >&5
14260 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14261 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14262   echo $ECHO_N "(cached) $ECHO_C" >&6
14263 else
14264   cat >conftest.$ac_ext <<_ACEOF
14265 #line 14265 "configure"
14266 #include "confdefs.h"
14267 #define _nc_TABSIZE autoconf_temporary
14268 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14269 #undef _nc_TABSIZE
14270
14271 #ifdef __cplusplus
14272 extern "C"
14273 #endif
14274
14275 /* We use char because int might match the return type of a gcc2
14276    builtin and then its argument prototype would still apply.  */
14277 char _nc_TABSIZE (void);
14278
14279 int
14280 main (void)
14281 {
14282
14283 /* The GNU C library defines stubs for functions which it implements
14284     to always fail with ENOSYS.  Some functions are actually named
14285     something starting with __ and the normal name is an alias.  */
14286 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14287 #error found stub for _nc_TABSIZE
14288 #endif
14289
14290         return _nc_TABSIZE ();
14291   ;
14292   return 0;
14293 }
14294 _ACEOF
14295 rm -f conftest.$ac_objext conftest$ac_exeext
14296 if { (eval echo "$as_me:14296: \"$ac_link\"") >&5
14297   (eval $ac_link) 2>&5
14298   ac_status=$?
14299   echo "$as_me:14299: \$? = $ac_status" >&5
14300   (exit $ac_status); } &&
14301          { ac_try='test -s conftest$ac_exeext'
14302   { (eval echo "$as_me:14302: \"$ac_try\"") >&5
14303   (eval $ac_try) 2>&5
14304   ac_status=$?
14305   echo "$as_me:14305: \$? = $ac_status" >&5
14306   (exit $ac_status); }; }; then
14307   ac_cv_func__nc_TABSIZE=yes
14308 else
14309   echo "$as_me: failed program was:" >&5
14310 cat conftest.$ac_ext >&5
14311 ac_cv_func__nc_TABSIZE=no
14312 fi
14313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14314 fi
14315 echo "$as_me:14315: result: $ac_cv_func__nc_TABSIZE" >&5
14316 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14317 if test $ac_cv_func__nc_TABSIZE = yes; then
14318   assume_reentrant=yes
14319 else
14320   assume_reentrant=no
14321 fi
14322
14323 # Reentrant code has to be opaque; there's little advantage to making ncurses
14324 # opaque outside of that, so there is no --enable-opaque option.  We can use
14325 # this option without --with-pthreads, but this will be always set for
14326 # pthreads.
14327 echo "$as_me:14327: checking if you want experimental reentrant code" >&5
14328 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14329
14330 # Check whether --enable-reentrant or --disable-reentrant was given.
14331 if test "${enable_reentrant+set}" = set; then
14332   enableval="$enable_reentrant"
14333   with_reentrant=$enableval
14334 else
14335   with_reentrant=$assume_reentrant
14336 fi;
14337 echo "$as_me:14337: result: $with_reentrant" >&5
14338 echo "${ECHO_T}$with_reentrant" >&6
14339 if test "$with_reentrant" = yes ; then
14340         cf_cv_enable_reentrant=1
14341         if test $cf_cv_weak_symbols = yes ; then
14342
14343 # remove pthread library from $LIBS
14344 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14345
14346         elif test "$assume_reentrant" = no ; then
14347                 LIB_SUFFIX="t${LIB_SUFFIX}"
14348         fi
14349
14350 cat >>confdefs.h <<\EOF
14351 #define USE_REENTRANT 1
14352 EOF
14353
14354 else
14355         cf_cv_enable_reentrant=0
14356 fi
14357
14358 ### Allow using a different wrap-prefix
14359 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14360         echo "$as_me:14360: checking for prefix used to wrap public variables" >&5
14361 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14362
14363 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14364 if test "${with_wrap_prefix+set}" = set; then
14365   withval="$with_wrap_prefix"
14366   NCURSES_WRAP_PREFIX=$withval
14367 else
14368   NCURSES_WRAP_PREFIX=_nc_
14369 fi;
14370         echo "$as_me:14370: result: $NCURSES_WRAP_PREFIX" >&5
14371 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14372 else
14373         NCURSES_WRAP_PREFIX=_nc_
14374 fi
14375
14376 cat >>confdefs.h <<EOF
14377 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14378 EOF
14379
14380 ###############################################################################
14381
14382 ###     use option --disable-echo to suppress full display compiling commands
14383
14384 echo "$as_me:14384: checking if you want to see long compiling messages" >&5
14385 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14386
14387 # Check whether --enable-echo or --disable-echo was given.
14388 if test "${enable_echo+set}" = set; then
14389   enableval="$enable_echo"
14390   test "$enableval" != no && enableval=yes
14391         if test "$enableval" != "yes" ; then
14392
14393         ECHO_LT='--silent'
14394         ECHO_LD='@echo linking $@;'
14395         RULE_CC='@echo compiling $<'
14396         SHOW_CC='@echo compiling $@'
14397         ECHO_CC='@'
14398
14399         else
14400
14401         ECHO_LT=''
14402         ECHO_LD=''
14403         RULE_CC=''
14404         SHOW_CC=''
14405         ECHO_CC=''
14406
14407         fi
14408 else
14409   enableval=yes
14410
14411         ECHO_LT=''
14412         ECHO_LD=''
14413         RULE_CC=''
14414         SHOW_CC=''
14415         ECHO_CC=''
14416
14417 fi;
14418 echo "$as_me:14418: result: $enableval" >&5
14419 echo "${ECHO_T}$enableval" >&6
14420
14421 ###     use option --enable-warnings to turn on all gcc warnings
14422 echo "$as_me:14422: checking if you want to see compiler warnings" >&5
14423 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14424
14425 # Check whether --enable-warnings or --disable-warnings was given.
14426 if test "${enable_warnings+set}" = set; then
14427   enableval="$enable_warnings"
14428   with_warnings=$enableval
14429 fi;
14430 echo "$as_me:14430: result: $with_warnings" >&5
14431 echo "${ECHO_T}$with_warnings" >&6
14432
14433 if test "x$with_warnings" = "xyes"; then
14434
14435         ADAFLAGS="$ADAFLAGS -gnatg"
14436
14437 if test "x$have_x" = xyes; then
14438
14439 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14440 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14441 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14442 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14443 for cf_X_CFLAGS in $X_CFLAGS
14444 do
14445         case "x$cf_X_CFLAGS" in
14446         x-[IUD]*)
14447                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14448                 ;;
14449         *)
14450                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14451                 ;;
14452         esac
14453 done
14454
14455 cat >conftest.$ac_ext <<_ACEOF
14456 #line 14456 "configure"
14457 #include "confdefs.h"
14458
14459 #include <stdlib.h>
14460 #include <X11/Intrinsic.h>
14461
14462 int
14463 main (void)
14464 {
14465 String foo = malloc(1); (void)foo
14466   ;
14467   return 0;
14468 }
14469 _ACEOF
14470 rm -f conftest.$ac_objext
14471 if { (eval echo "$as_me:14471: \"$ac_compile\"") >&5
14472   (eval $ac_compile) 2>&5
14473   ac_status=$?
14474   echo "$as_me:14474: \$? = $ac_status" >&5
14475   (exit $ac_status); } &&
14476          { ac_try='test -s conftest.$ac_objext'
14477   { (eval echo "$as_me:14477: \"$ac_try\"") >&5
14478   (eval $ac_try) 2>&5
14479   ac_status=$?
14480   echo "$as_me:14480: \$? = $ac_status" >&5
14481   (exit $ac_status); }; }; then
14482
14483 echo "$as_me:14483: checking for X11/Xt const-feature" >&5
14484 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14485 if test "${cf_cv_const_x_string+set}" = set; then
14486   echo $ECHO_N "(cached) $ECHO_C" >&6
14487 else
14488
14489         cat >conftest.$ac_ext <<_ACEOF
14490 #line 14490 "configure"
14491 #include "confdefs.h"
14492
14493 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14494 #undef  XTSTRINGDEFINES /* X11R5 and later */
14495 #include <stdlib.h>
14496 #include <X11/Intrinsic.h>
14497
14498 int
14499 main (void)
14500 {
14501 String foo = malloc(1); *foo = 0
14502   ;
14503   return 0;
14504 }
14505 _ACEOF
14506 rm -f conftest.$ac_objext
14507 if { (eval echo "$as_me:14507: \"$ac_compile\"") >&5
14508   (eval $ac_compile) 2>&5
14509   ac_status=$?
14510   echo "$as_me:14510: \$? = $ac_status" >&5
14511   (exit $ac_status); } &&
14512          { ac_try='test -s conftest.$ac_objext'
14513   { (eval echo "$as_me:14513: \"$ac_try\"") >&5
14514   (eval $ac_try) 2>&5
14515   ac_status=$?
14516   echo "$as_me:14516: \$? = $ac_status" >&5
14517   (exit $ac_status); }; }; then
14518
14519                         cf_cv_const_x_string=no
14520
14521 else
14522   echo "$as_me: failed program was:" >&5
14523 cat conftest.$ac_ext >&5
14524
14525                         cf_cv_const_x_string=yes
14526
14527 fi
14528 rm -f conftest.$ac_objext conftest.$ac_ext
14529
14530 fi
14531 echo "$as_me:14531: result: $cf_cv_const_x_string" >&5
14532 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14533
14534 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14535 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14536 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14537
14538 case $cf_cv_const_x_string in
14539 (no)
14540
14541         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14542         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14543
14544         ;;
14545 (*)
14546
14547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14548         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14549
14550         ;;
14551 esac
14552
14553 else
14554   echo "$as_me: failed program was:" >&5
14555 cat conftest.$ac_ext >&5
14556 fi
14557 rm -f conftest.$ac_objext conftest.$ac_ext
14558  fi
14559 cat > conftest.$ac_ext <<EOF
14560 #line 14560 "${as_me:-configure}"
14561 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14562 EOF
14563 if test "$INTEL_COMPILER" = yes
14564 then
14565 # The "-wdXXX" options suppress warnings:
14566 # remark #1419: external declaration in primary source file
14567 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14568 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14569 # remark #193: zero used for undefined preprocessing identifier
14570 # remark #593: variable "curs_sb_left_arrow" was set but never used
14571 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14572 # remark #869: parameter "tw" was never referenced
14573 # remark #981: operands are evaluated in unspecified order
14574 # warning #279: controlling expression is constant
14575
14576         { echo "$as_me:14576: checking for $CC warning options..." >&5
14577 echo "$as_me: checking for $CC warning options..." >&6;}
14578         cf_save_CFLAGS="$CFLAGS"
14579         EXTRA_CFLAGS="-Wall"
14580         for cf_opt in \
14581                 wd1419 \
14582                 wd1683 \
14583                 wd1684 \
14584                 wd193 \
14585                 wd593 \
14586                 wd279 \
14587                 wd810 \
14588                 wd869 \
14589                 wd981
14590         do
14591                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14592                 if { (eval echo "$as_me:14592: \"$ac_compile\"") >&5
14593   (eval $ac_compile) 2>&5
14594   ac_status=$?
14595   echo "$as_me:14595: \$? = $ac_status" >&5
14596   (exit $ac_status); }; then
14597                         test -n "$verbose" && echo "$as_me:14597: result: ... -$cf_opt" >&5
14598 echo "${ECHO_T}... -$cf_opt" >&6
14599                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14600                 fi
14601         done
14602         CFLAGS="$cf_save_CFLAGS"
14603 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14604 then
14605         { echo "$as_me:14605: checking for $CC warning options..." >&5
14606 echo "$as_me: checking for $CC warning options..." >&6;}
14607         cf_save_CFLAGS="$CFLAGS"
14608         EXTRA_CFLAGS=
14609         cf_warn_CONST=""
14610         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14611         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14612         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14613         for cf_opt in W Wall \
14614                 Wbad-function-cast \
14615                 Wcast-align \
14616                 Wcast-qual \
14617                 Wdeclaration-after-statement \
14618                 Wextra \
14619                 Winline \
14620                 Wmissing-declarations \
14621                 Wmissing-prototypes \
14622                 Wnested-externs \
14623                 Wpointer-arith \
14624                 Wshadow \
14625                 Wstrict-prototypes \
14626                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14627         do
14628                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14629                 if { (eval echo "$as_me:14629: \"$ac_compile\"") >&5
14630   (eval $ac_compile) 2>&5
14631   ac_status=$?
14632   echo "$as_me:14632: \$? = $ac_status" >&5
14633   (exit $ac_status); }; then
14634                         test -n "$verbose" && echo "$as_me:14634: result: ... -$cf_opt" >&5
14635 echo "${ECHO_T}... -$cf_opt" >&6
14636                         case $cf_opt in
14637                         (Winline)
14638                                 case $GCC_VERSION in
14639                                 ([34].*)
14640                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14641
14642 echo "${as_me:-configure}:14642: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14643
14644                                         continue;;
14645                                 esac
14646                                 ;;
14647                         (Wpointer-arith)
14648                                 case $GCC_VERSION in
14649                                 ([12].*)
14650                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14651
14652 echo "${as_me:-configure}:14652: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14653
14654                                         continue;;
14655                                 esac
14656                                 ;;
14657                         esac
14658                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14659                 fi
14660         done
14661         CFLAGS="$cf_save_CFLAGS"
14662 fi
14663 rm -rf conftest*
14664
14665 fi
14666
14667 if test "$GCC" = yes
14668 then
14669 cat > conftest.i <<EOF
14670 #ifndef GCC_PRINTF
14671 #define GCC_PRINTF 0
14672 #endif
14673 #ifndef GCC_SCANF
14674 #define GCC_SCANF 0
14675 #endif
14676 #ifndef GCC_NORETURN
14677 #define GCC_NORETURN /* nothing */
14678 #endif
14679 #ifndef GCC_UNUSED
14680 #define GCC_UNUSED /* nothing */
14681 #endif
14682 EOF
14683 if test "$GCC" = yes
14684 then
14685         { echo "$as_me:14685: checking for $CC __attribute__ directives..." >&5
14686 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14687 cat > conftest.$ac_ext <<EOF
14688 #line 14688 "${as_me:-configure}"
14689 #include "confdefs.h"
14690 #include "conftest.h"
14691 #include "conftest.i"
14692 #if     GCC_PRINTF
14693 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14694 #else
14695 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14696 #endif
14697 #if     GCC_SCANF
14698 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14699 #else
14700 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14701 #endif
14702 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14703 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14704 extern void foo(void) GCC_NORETURN;
14705 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
14706 EOF
14707         cf_printf_attribute=no
14708         cf_scanf_attribute=no
14709         for cf_attribute in scanf printf unused noreturn
14710         do
14711
14712 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14713
14714                 cf_directive="__attribute__(($cf_attribute))"
14715                 echo "checking for $CC $cf_directive" 1>&5
14716
14717                 case $cf_attribute in
14718                 (printf)
14719                         cf_printf_attribute=yes
14720                         cat >conftest.h <<EOF
14721 #define GCC_$cf_ATTRIBUTE 1
14722 EOF
14723                         ;;
14724                 (scanf)
14725                         cf_scanf_attribute=yes
14726                         cat >conftest.h <<EOF
14727 #define GCC_$cf_ATTRIBUTE 1
14728 EOF
14729                         ;;
14730                 (*)
14731                         cat >conftest.h <<EOF
14732 #define GCC_$cf_ATTRIBUTE $cf_directive
14733 EOF
14734                         ;;
14735                 esac
14736
14737                 if { (eval echo "$as_me:14737: \"$ac_compile\"") >&5
14738   (eval $ac_compile) 2>&5
14739   ac_status=$?
14740   echo "$as_me:14740: \$? = $ac_status" >&5
14741   (exit $ac_status); }; then
14742                         test -n "$verbose" && echo "$as_me:14742: result: ... $cf_attribute" >&5
14743 echo "${ECHO_T}... $cf_attribute" >&6
14744                         cat conftest.h >>confdefs.h
14745                         case $cf_attribute in
14746                         (noreturn)
14747
14748 cat >>confdefs.h <<EOF
14749 #define GCC_NORETURN $cf_directive
14750 EOF
14751
14752                                 ;;
14753                         (printf)
14754                                 cf_value='/* nothing */'
14755                                 if test "$cf_printf_attribute" != no ; then
14756                                         cf_value='__attribute__((format(printf,fmt,var)))'
14757
14758 cat >>confdefs.h <<\EOF
14759 #define GCC_PRINTF 1
14760 EOF
14761
14762                                 fi
14763
14764 cat >>confdefs.h <<EOF
14765 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14766 EOF
14767
14768                                 ;;
14769                         (scanf)
14770                                 cf_value='/* nothing */'
14771                                 if test "$cf_scanf_attribute" != no ; then
14772                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14773
14774 cat >>confdefs.h <<\EOF
14775 #define GCC_SCANF 1
14776 EOF
14777
14778                                 fi
14779
14780 cat >>confdefs.h <<EOF
14781 #define GCC_SCANFLIKE(fmt,var) $cf_value
14782 EOF
14783
14784                                 ;;
14785                         (unused)
14786
14787 cat >>confdefs.h <<EOF
14788 #define GCC_UNUSED $cf_directive
14789 EOF
14790
14791                                 ;;
14792                         esac
14793                 fi
14794         done
14795 else
14796         fgrep define conftest.i >>confdefs.h
14797 fi
14798 rm -rf conftest*
14799 fi
14800
14801 ###     use option --enable-assertions to turn on generation of assertion code
14802 echo "$as_me:14802: checking if you want to enable runtime assertions" >&5
14803 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14804
14805 # Check whether --enable-assertions or --disable-assertions was given.
14806 if test "${enable_assertions+set}" = set; then
14807   enableval="$enable_assertions"
14808   with_assertions=$enableval
14809 else
14810   with_assertions=no
14811 fi;
14812 echo "$as_me:14812: result: $with_assertions" >&5
14813 echo "${ECHO_T}$with_assertions" >&6
14814 if test -n "$GCC"
14815 then
14816         if test "$with_assertions" = no
14817         then
14818                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14819         else
14820
14821         ADAFLAGS="$ADAFLAGS -gnata"
14822
14823         fi
14824 fi
14825
14826 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14827
14828 cat >>confdefs.h <<\EOF
14829 #define HAVE_NC_ALLOC_H 1
14830 EOF
14831
14832 ###     use option --enable-expanded to generate certain macros as functions
14833
14834 # Check whether --enable-expanded or --disable-expanded was given.
14835 if test "${enable_expanded+set}" = set; then
14836   enableval="$enable_expanded"
14837   test "$enableval" = yes &&
14838 cat >>confdefs.h <<\EOF
14839 #define NCURSES_EXPANDED 1
14840 EOF
14841
14842 fi;
14843
14844 ###     use option --disable-macros to suppress macros in favor of functions
14845
14846 # Check whether --enable-macros or --disable-macros was given.
14847 if test "${enable_macros+set}" = set; then
14848   enableval="$enable_macros"
14849   test "$enableval" = no &&
14850 cat >>confdefs.h <<\EOF
14851 #define NCURSES_NOMACROS 1
14852 EOF
14853
14854 fi;
14855
14856 # Normally we only add trace() to the debug-library.  Allow this to be
14857 # extended to all models of the ncurses library:
14858 cf_all_traces=no
14859 case "$CFLAGS $CPPFLAGS" in
14860 (*-DTRACE*)
14861         cf_all_traces=yes
14862         ;;
14863 esac
14864
14865 echo "$as_me:14865: checking whether to add trace feature to all models" >&5
14866 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14867
14868 # Check whether --with-trace or --without-trace was given.
14869 if test "${with_trace+set}" = set; then
14870   withval="$with_trace"
14871   cf_with_trace=$withval
14872 else
14873   cf_with_trace=$cf_all_traces
14874 fi;
14875 echo "$as_me:14875: result: $cf_with_trace" >&5
14876 echo "${ECHO_T}$cf_with_trace" >&6
14877
14878 if test "$cf_with_trace" = yes ; then
14879         ADA_TRACE=TRUE
14880
14881 cf_fix_cppflags=no
14882 cf_new_cflags=
14883 cf_new_cppflags=
14884 cf_new_extra_cppflags=
14885
14886 for cf_add_cflags in -DTRACE
14887 do
14888 case $cf_fix_cppflags in
14889 (no)
14890         case $cf_add_cflags in
14891         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14892                 case $cf_add_cflags in
14893                 (-D*)
14894                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14895
14896                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14897                                 && test -z "${cf_tst_cflags}" \
14898                                 && cf_fix_cppflags=yes
14899
14900                         if test $cf_fix_cppflags = yes ; then
14901
14902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14904
14905                                 continue
14906                         elif test "${cf_tst_cflags}" = "\"'" ; then
14907
14908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14910
14911                                 continue
14912                         fi
14913                         ;;
14914                 esac
14915                 case "$CPPFLAGS" in
14916                 (*$cf_add_cflags)
14917                         ;;
14918                 (*)
14919                         case $cf_add_cflags in
14920                         (-D*)
14921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14922
14923 CPPFLAGS=`echo "$CPPFLAGS" | \
14924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14926
14927                                 ;;
14928                         esac
14929
14930         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14931         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14932
14933                         ;;
14934                 esac
14935                 ;;
14936         (*)
14937
14938         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14939         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14940
14941                 ;;
14942         esac
14943         ;;
14944 (yes)
14945
14946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14948
14949         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14950
14951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14952                 && test -z "${cf_tst_cflags}" \
14953                 && cf_fix_cppflags=no
14954         ;;
14955 esac
14956 done
14957
14958 if test -n "$cf_new_cflags" ; then
14959
14960         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14961         CFLAGS="${CFLAGS}$cf_new_cflags"
14962
14963 fi
14964
14965 if test -n "$cf_new_cppflags" ; then
14966
14967         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14968         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14969
14970 fi
14971
14972 if test -n "$cf_new_extra_cppflags" ; then
14973
14974         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14975         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14976
14977 fi
14978
14979 else
14980         ADA_TRACE=FALSE
14981 fi
14982
14983 echo "$as_me:14983: checking if we want to use GNAT projects" >&5
14984 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14985
14986 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14987 if test "${enable_gnat_projects+set}" = set; then
14988   enableval="$enable_gnat_projects"
14989   test "$enableval" != no && enableval=yes
14990         if test "$enableval" != "yes" ; then
14991     enable_gnat_projects=no
14992         else
14993                 enable_gnat_projects=yes
14994         fi
14995 else
14996   enableval=yes
14997         enable_gnat_projects=yes
14998
14999 fi;
15000 echo "$as_me:15000: result: $enable_gnat_projects" >&5
15001 echo "${ECHO_T}$enable_gnat_projects" >&6
15002
15003 ###     Checks for libraries.
15004 case $cf_cv_system_name in
15005 (*mingw32*)
15006         ;;
15007 (*)
15008 echo "$as_me:15008: checking for gettimeofday" >&5
15009 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15010 if test "${ac_cv_func_gettimeofday+set}" = set; then
15011   echo $ECHO_N "(cached) $ECHO_C" >&6
15012 else
15013   cat >conftest.$ac_ext <<_ACEOF
15014 #line 15014 "configure"
15015 #include "confdefs.h"
15016 #define gettimeofday autoconf_temporary
15017 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15018 #undef gettimeofday
15019
15020 #ifdef __cplusplus
15021 extern "C"
15022 #endif
15023
15024 /* We use char because int might match the return type of a gcc2
15025    builtin and then its argument prototype would still apply.  */
15026 char gettimeofday (void);
15027
15028 int
15029 main (void)
15030 {
15031
15032 /* The GNU C library defines stubs for functions which it implements
15033     to always fail with ENOSYS.  Some functions are actually named
15034     something starting with __ and the normal name is an alias.  */
15035 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15036 #error found stub for gettimeofday
15037 #endif
15038
15039         return gettimeofday ();
15040   ;
15041   return 0;
15042 }
15043 _ACEOF
15044 rm -f conftest.$ac_objext conftest$ac_exeext
15045 if { (eval echo "$as_me:15045: \"$ac_link\"") >&5
15046   (eval $ac_link) 2>&5
15047   ac_status=$?
15048   echo "$as_me:15048: \$? = $ac_status" >&5
15049   (exit $ac_status); } &&
15050          { ac_try='test -s conftest$ac_exeext'
15051   { (eval echo "$as_me:15051: \"$ac_try\"") >&5
15052   (eval $ac_try) 2>&5
15053   ac_status=$?
15054   echo "$as_me:15054: \$? = $ac_status" >&5
15055   (exit $ac_status); }; }; then
15056   ac_cv_func_gettimeofday=yes
15057 else
15058   echo "$as_me: failed program was:" >&5
15059 cat conftest.$ac_ext >&5
15060 ac_cv_func_gettimeofday=no
15061 fi
15062 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15063 fi
15064 echo "$as_me:15064: result: $ac_cv_func_gettimeofday" >&5
15065 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15066 if test $ac_cv_func_gettimeofday = yes; then
15067   cat >>confdefs.h <<\EOF
15068 #define HAVE_GETTIMEOFDAY 1
15069 EOF
15070
15071 else
15072
15073 echo "$as_me:15073: checking for gettimeofday in -lbsd" >&5
15074 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15075 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15076   echo $ECHO_N "(cached) $ECHO_C" >&6
15077 else
15078   ac_check_lib_save_LIBS=$LIBS
15079 LIBS="-lbsd  $LIBS"
15080 cat >conftest.$ac_ext <<_ACEOF
15081 #line 15081 "configure"
15082 #include "confdefs.h"
15083
15084 /* Override any gcc2 internal prototype to avoid an error.  */
15085 #ifdef __cplusplus
15086 extern "C"
15087 #endif
15088 /* We use char because int might match the return type of a gcc2
15089    builtin and then its argument prototype would still apply.  */
15090 char gettimeofday ();
15091 int
15092 main (void)
15093 {
15094 gettimeofday ();
15095   ;
15096   return 0;
15097 }
15098 _ACEOF
15099 rm -f conftest.$ac_objext conftest$ac_exeext
15100 if { (eval echo "$as_me:15100: \"$ac_link\"") >&5
15101   (eval $ac_link) 2>&5
15102   ac_status=$?
15103   echo "$as_me:15103: \$? = $ac_status" >&5
15104   (exit $ac_status); } &&
15105          { ac_try='test -s conftest$ac_exeext'
15106   { (eval echo "$as_me:15106: \"$ac_try\"") >&5
15107   (eval $ac_try) 2>&5
15108   ac_status=$?
15109   echo "$as_me:15109: \$? = $ac_status" >&5
15110   (exit $ac_status); }; }; then
15111   ac_cv_lib_bsd_gettimeofday=yes
15112 else
15113   echo "$as_me: failed program was:" >&5
15114 cat conftest.$ac_ext >&5
15115 ac_cv_lib_bsd_gettimeofday=no
15116 fi
15117 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15118 LIBS=$ac_check_lib_save_LIBS
15119 fi
15120 echo "$as_me:15120: result: $ac_cv_lib_bsd_gettimeofday" >&5
15121 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15122 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15123
15124 cat >>confdefs.h <<\EOF
15125 #define HAVE_GETTIMEOFDAY 1
15126 EOF
15127
15128         LIBS="$LIBS -lbsd"
15129 fi
15130
15131 fi
15132         ;;
15133 esac
15134
15135 ###     Checks for header files.
15136 echo "$as_me:15136: checking for ANSI C header files" >&5
15137 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15138 if test "${ac_cv_header_stdc+set}" = set; then
15139   echo $ECHO_N "(cached) $ECHO_C" >&6
15140 else
15141   cat >conftest.$ac_ext <<_ACEOF
15142 #line 15142 "configure"
15143 #include "confdefs.h"
15144 #include <stdlib.h>
15145 #include <stdarg.h>
15146 #include <string.h>
15147 #include <float.h>
15148
15149 _ACEOF
15150 if { (eval echo "$as_me:15150: \"$ac_cpp conftest.$ac_ext\"") >&5
15151   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15152   ac_status=$?
15153   egrep -v '^ *\+' conftest.er1 >conftest.err
15154   rm -f conftest.er1
15155   cat conftest.err >&5
15156   echo "$as_me:15156: \$? = $ac_status" >&5
15157   (exit $ac_status); } >/dev/null; then
15158   if test -s conftest.err; then
15159     ac_cpp_err=$ac_c_preproc_warn_flag
15160   else
15161     ac_cpp_err=
15162   fi
15163 else
15164   ac_cpp_err=yes
15165 fi
15166 if test -z "$ac_cpp_err"; then
15167   ac_cv_header_stdc=yes
15168 else
15169   echo "$as_me: failed program was:" >&5
15170   cat conftest.$ac_ext >&5
15171   ac_cv_header_stdc=no
15172 fi
15173 rm -f conftest.err conftest.$ac_ext
15174
15175 if test $ac_cv_header_stdc = yes; then
15176   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15177   cat >conftest.$ac_ext <<_ACEOF
15178 #line 15178 "configure"
15179 #include "confdefs.h"
15180 #include <string.h>
15181
15182 _ACEOF
15183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15184   egrep "memchr" >/dev/null 2>&1; then
15185   :
15186 else
15187   ac_cv_header_stdc=no
15188 fi
15189 rm -rf conftest*
15190
15191 fi
15192
15193 if test $ac_cv_header_stdc = yes; then
15194   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15195   cat >conftest.$ac_ext <<_ACEOF
15196 #line 15196 "configure"
15197 #include "confdefs.h"
15198 #include <stdlib.h>
15199
15200 _ACEOF
15201 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15202   egrep "free" >/dev/null 2>&1; then
15203   :
15204 else
15205   ac_cv_header_stdc=no
15206 fi
15207 rm -rf conftest*
15208
15209 fi
15210
15211 if test $ac_cv_header_stdc = yes; then
15212   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15213   if test "$cross_compiling" = yes; then
15214   :
15215 else
15216   cat >conftest.$ac_ext <<_ACEOF
15217 #line 15217 "configure"
15218 #include "confdefs.h"
15219 #include <ctype.h>
15220 #if ((' ' & 0x0FF) == 0x020)
15221 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15222 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15223 #else
15224 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15225                      || ('j' <= (c) && (c) <= 'r') \
15226                      || ('s' <= (c) && (c) <= 'z'))
15227 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15228 #endif
15229
15230 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15231 int
15232 main (void)
15233 {
15234   int i;
15235   for (i = 0; i < 256; i++)
15236     if (XOR (islower (i), ISLOWER (i))
15237         || toupper (i) != TOUPPER (i))
15238       $ac_main_return(2);
15239   $ac_main_return (0);
15240 }
15241 _ACEOF
15242 rm -f conftest$ac_exeext
15243 if { (eval echo "$as_me:15243: \"$ac_link\"") >&5
15244   (eval $ac_link) 2>&5
15245   ac_status=$?
15246   echo "$as_me:15246: \$? = $ac_status" >&5
15247   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15248   { (eval echo "$as_me:15248: \"$ac_try\"") >&5
15249   (eval $ac_try) 2>&5
15250   ac_status=$?
15251   echo "$as_me:15251: \$? = $ac_status" >&5
15252   (exit $ac_status); }; }; then
15253   :
15254 else
15255   echo "$as_me: program exited with status $ac_status" >&5
15256 echo "$as_me: failed program was:" >&5
15257 cat conftest.$ac_ext >&5
15258 ac_cv_header_stdc=no
15259 fi
15260 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15261 fi
15262 fi
15263 fi
15264 echo "$as_me:15264: result: $ac_cv_header_stdc" >&5
15265 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15266 if test $ac_cv_header_stdc = yes; then
15267
15268 cat >>confdefs.h <<\EOF
15269 #define STDC_HEADERS 1
15270 EOF
15271
15272 fi
15273
15274 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15275
15276 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15277                   inttypes.h stdint.h unistd.h
15278 do
15279 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15280 echo "$as_me:15280: checking for $ac_header" >&5
15281 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15282 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15283   echo $ECHO_N "(cached) $ECHO_C" >&6
15284 else
15285   cat >conftest.$ac_ext <<_ACEOF
15286 #line 15286 "configure"
15287 #include "confdefs.h"
15288 $ac_includes_default
15289 #include <$ac_header>
15290 _ACEOF
15291 rm -f conftest.$ac_objext
15292 if { (eval echo "$as_me:15292: \"$ac_compile\"") >&5
15293   (eval $ac_compile) 2>&5
15294   ac_status=$?
15295   echo "$as_me:15295: \$? = $ac_status" >&5
15296   (exit $ac_status); } &&
15297          { ac_try='test -s conftest.$ac_objext'
15298   { (eval echo "$as_me:15298: \"$ac_try\"") >&5
15299   (eval $ac_try) 2>&5
15300   ac_status=$?
15301   echo "$as_me:15301: \$? = $ac_status" >&5
15302   (exit $ac_status); }; }; then
15303   eval "$as_ac_Header=yes"
15304 else
15305   echo "$as_me: failed program was:" >&5
15306 cat conftest.$ac_ext >&5
15307 eval "$as_ac_Header=no"
15308 fi
15309 rm -f conftest.$ac_objext conftest.$ac_ext
15310 fi
15311 echo "$as_me:15311: result: `eval echo '${'$as_ac_Header'}'`" >&5
15312 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15313 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15314   cat >>confdefs.h <<EOF
15315 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15316 EOF
15317
15318 fi
15319 done
15320
15321 echo "$as_me:15321: checking for signed char" >&5
15322 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15323 if test "${ac_cv_type_signed_char+set}" = set; then
15324   echo $ECHO_N "(cached) $ECHO_C" >&6
15325 else
15326   cat >conftest.$ac_ext <<_ACEOF
15327 #line 15327 "configure"
15328 #include "confdefs.h"
15329 $ac_includes_default
15330 int
15331 main (void)
15332 {
15333 if ((signed char *) 0)
15334   return 0;
15335 if (sizeof (signed char))
15336   return 0;
15337   ;
15338   return 0;
15339 }
15340 _ACEOF
15341 rm -f conftest.$ac_objext
15342 if { (eval echo "$as_me:15342: \"$ac_compile\"") >&5
15343   (eval $ac_compile) 2>&5
15344   ac_status=$?
15345   echo "$as_me:15345: \$? = $ac_status" >&5
15346   (exit $ac_status); } &&
15347          { ac_try='test -s conftest.$ac_objext'
15348   { (eval echo "$as_me:15348: \"$ac_try\"") >&5
15349   (eval $ac_try) 2>&5
15350   ac_status=$?
15351   echo "$as_me:15351: \$? = $ac_status" >&5
15352   (exit $ac_status); }; }; then
15353   ac_cv_type_signed_char=yes
15354 else
15355   echo "$as_me: failed program was:" >&5
15356 cat conftest.$ac_ext >&5
15357 ac_cv_type_signed_char=no
15358 fi
15359 rm -f conftest.$ac_objext conftest.$ac_ext
15360 fi
15361 echo "$as_me:15361: result: $ac_cv_type_signed_char" >&5
15362 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15363
15364 echo "$as_me:15364: checking size of signed char" >&5
15365 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15366 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15367   echo $ECHO_N "(cached) $ECHO_C" >&6
15368 else
15369   if test "$ac_cv_type_signed_char" = yes; then
15370   if test "$cross_compiling" = yes; then
15371   # Depending upon the size, compute the lo and hi bounds.
15372 cat >conftest.$ac_ext <<_ACEOF
15373 #line 15373 "configure"
15374 #include "confdefs.h"
15375 $ac_includes_default
15376 int
15377 main (void)
15378 {
15379 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15380   ;
15381   return 0;
15382 }
15383 _ACEOF
15384 rm -f conftest.$ac_objext
15385 if { (eval echo "$as_me:15385: \"$ac_compile\"") >&5
15386   (eval $ac_compile) 2>&5
15387   ac_status=$?
15388   echo "$as_me:15388: \$? = $ac_status" >&5
15389   (exit $ac_status); } &&
15390          { ac_try='test -s conftest.$ac_objext'
15391   { (eval echo "$as_me:15391: \"$ac_try\"") >&5
15392   (eval $ac_try) 2>&5
15393   ac_status=$?
15394   echo "$as_me:15394: \$? = $ac_status" >&5
15395   (exit $ac_status); }; }; then
15396   ac_lo=0 ac_mid=0
15397   while :; do
15398     cat >conftest.$ac_ext <<_ACEOF
15399 #line 15399 "configure"
15400 #include "confdefs.h"
15401 $ac_includes_default
15402 int
15403 main (void)
15404 {
15405 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15406   ;
15407   return 0;
15408 }
15409 _ACEOF
15410 rm -f conftest.$ac_objext
15411 if { (eval echo "$as_me:15411: \"$ac_compile\"") >&5
15412   (eval $ac_compile) 2>&5
15413   ac_status=$?
15414   echo "$as_me:15414: \$? = $ac_status" >&5
15415   (exit $ac_status); } &&
15416          { ac_try='test -s conftest.$ac_objext'
15417   { (eval echo "$as_me:15417: \"$ac_try\"") >&5
15418   (eval $ac_try) 2>&5
15419   ac_status=$?
15420   echo "$as_me:15420: \$? = $ac_status" >&5
15421   (exit $ac_status); }; }; then
15422   ac_hi=$ac_mid; break
15423 else
15424   echo "$as_me: failed program was:" >&5
15425 cat conftest.$ac_ext >&5
15426 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15427 fi
15428 rm -f conftest.$ac_objext conftest.$ac_ext
15429   done
15430 else
15431   echo "$as_me: failed program was:" >&5
15432 cat conftest.$ac_ext >&5
15433 ac_hi=-1 ac_mid=-1
15434   while :; do
15435     cat >conftest.$ac_ext <<_ACEOF
15436 #line 15436 "configure"
15437 #include "confdefs.h"
15438 $ac_includes_default
15439 int
15440 main (void)
15441 {
15442 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15443   ;
15444   return 0;
15445 }
15446 _ACEOF
15447 rm -f conftest.$ac_objext
15448 if { (eval echo "$as_me:15448: \"$ac_compile\"") >&5
15449   (eval $ac_compile) 2>&5
15450   ac_status=$?
15451   echo "$as_me:15451: \$? = $ac_status" >&5
15452   (exit $ac_status); } &&
15453          { ac_try='test -s conftest.$ac_objext'
15454   { (eval echo "$as_me:15454: \"$ac_try\"") >&5
15455   (eval $ac_try) 2>&5
15456   ac_status=$?
15457   echo "$as_me:15457: \$? = $ac_status" >&5
15458   (exit $ac_status); }; }; then
15459   ac_lo=$ac_mid; break
15460 else
15461   echo "$as_me: failed program was:" >&5
15462 cat conftest.$ac_ext >&5
15463 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15464 fi
15465 rm -f conftest.$ac_objext conftest.$ac_ext
15466   done
15467 fi
15468 rm -f conftest.$ac_objext conftest.$ac_ext
15469 # Binary search between lo and hi bounds.
15470 while test "x$ac_lo" != "x$ac_hi"; do
15471   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15472   cat >conftest.$ac_ext <<_ACEOF
15473 #line 15473 "configure"
15474 #include "confdefs.h"
15475 $ac_includes_default
15476 int
15477 main (void)
15478 {
15479 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15480   ;
15481   return 0;
15482 }
15483 _ACEOF
15484 rm -f conftest.$ac_objext
15485 if { (eval echo "$as_me:15485: \"$ac_compile\"") >&5
15486   (eval $ac_compile) 2>&5
15487   ac_status=$?
15488   echo "$as_me:15488: \$? = $ac_status" >&5
15489   (exit $ac_status); } &&
15490          { ac_try='test -s conftest.$ac_objext'
15491   { (eval echo "$as_me:15491: \"$ac_try\"") >&5
15492   (eval $ac_try) 2>&5
15493   ac_status=$?
15494   echo "$as_me:15494: \$? = $ac_status" >&5
15495   (exit $ac_status); }; }; then
15496   ac_hi=$ac_mid
15497 else
15498   echo "$as_me: failed program was:" >&5
15499 cat conftest.$ac_ext >&5
15500 ac_lo=`expr $ac_mid + 1`
15501 fi
15502 rm -f conftest.$ac_objext conftest.$ac_ext
15503 done
15504 ac_cv_sizeof_signed_char=$ac_lo
15505 else
15506   if test "$cross_compiling" = yes; then
15507   { { echo "$as_me:15507: error: cannot run test program while cross compiling" >&5
15508 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15509    { (exit 1); exit 1; }; }
15510 else
15511   cat >conftest.$ac_ext <<_ACEOF
15512 #line 15512 "configure"
15513 #include "confdefs.h"
15514 $ac_includes_default
15515 int
15516 main (void)
15517 {
15518 FILE *f = fopen ("conftest.val", "w");
15519 if (!f)
15520   $ac_main_return (1);
15521 fprintf (f, "%d", (sizeof (signed char)));
15522 fclose (f);
15523   ;
15524   return 0;
15525 }
15526 _ACEOF
15527 rm -f conftest$ac_exeext
15528 if { (eval echo "$as_me:15528: \"$ac_link\"") >&5
15529   (eval $ac_link) 2>&5
15530   ac_status=$?
15531   echo "$as_me:15531: \$? = $ac_status" >&5
15532   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15533   { (eval echo "$as_me:15533: \"$ac_try\"") >&5
15534   (eval $ac_try) 2>&5
15535   ac_status=$?
15536   echo "$as_me:15536: \$? = $ac_status" >&5
15537   (exit $ac_status); }; }; then
15538   ac_cv_sizeof_signed_char=`cat conftest.val`
15539 else
15540   echo "$as_me: program exited with status $ac_status" >&5
15541 echo "$as_me: failed program was:" >&5
15542 cat conftest.$ac_ext >&5
15543 fi
15544 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15545 fi
15546 fi
15547 rm -f conftest.val
15548 else
15549   ac_cv_sizeof_signed_char=0
15550 fi
15551 fi
15552 echo "$as_me:15552: result: $ac_cv_sizeof_signed_char" >&5
15553 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15554 cat >>confdefs.h <<EOF
15555 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15556 EOF
15557
15558 echo "$as_me:15558: checking for ANSI C header files" >&5
15559 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15560 if test "${ac_cv_header_stdc+set}" = set; then
15561   echo $ECHO_N "(cached) $ECHO_C" >&6
15562 else
15563   cat >conftest.$ac_ext <<_ACEOF
15564 #line 15564 "configure"
15565 #include "confdefs.h"
15566 #include <stdlib.h>
15567 #include <stdarg.h>
15568 #include <string.h>
15569 #include <float.h>
15570
15571 _ACEOF
15572 if { (eval echo "$as_me:15572: \"$ac_cpp conftest.$ac_ext\"") >&5
15573   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15574   ac_status=$?
15575   egrep -v '^ *\+' conftest.er1 >conftest.err
15576   rm -f conftest.er1
15577   cat conftest.err >&5
15578   echo "$as_me:15578: \$? = $ac_status" >&5
15579   (exit $ac_status); } >/dev/null; then
15580   if test -s conftest.err; then
15581     ac_cpp_err=$ac_c_preproc_warn_flag
15582   else
15583     ac_cpp_err=
15584   fi
15585 else
15586   ac_cpp_err=yes
15587 fi
15588 if test -z "$ac_cpp_err"; then
15589   ac_cv_header_stdc=yes
15590 else
15591   echo "$as_me: failed program was:" >&5
15592   cat conftest.$ac_ext >&5
15593   ac_cv_header_stdc=no
15594 fi
15595 rm -f conftest.err conftest.$ac_ext
15596
15597 if test $ac_cv_header_stdc = yes; then
15598   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15599   cat >conftest.$ac_ext <<_ACEOF
15600 #line 15600 "configure"
15601 #include "confdefs.h"
15602 #include <string.h>
15603
15604 _ACEOF
15605 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15606   egrep "memchr" >/dev/null 2>&1; then
15607   :
15608 else
15609   ac_cv_header_stdc=no
15610 fi
15611 rm -rf conftest*
15612
15613 fi
15614
15615 if test $ac_cv_header_stdc = yes; then
15616   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15617   cat >conftest.$ac_ext <<_ACEOF
15618 #line 15618 "configure"
15619 #include "confdefs.h"
15620 #include <stdlib.h>
15621
15622 _ACEOF
15623 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15624   egrep "free" >/dev/null 2>&1; then
15625   :
15626 else
15627   ac_cv_header_stdc=no
15628 fi
15629 rm -rf conftest*
15630
15631 fi
15632
15633 if test $ac_cv_header_stdc = yes; then
15634   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15635   if test "$cross_compiling" = yes; then
15636   :
15637 else
15638   cat >conftest.$ac_ext <<_ACEOF
15639 #line 15639 "configure"
15640 #include "confdefs.h"
15641 #include <ctype.h>
15642 #if ((' ' & 0x0FF) == 0x020)
15643 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15644 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15645 #else
15646 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15647                      || ('j' <= (c) && (c) <= 'r') \
15648                      || ('s' <= (c) && (c) <= 'z'))
15649 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15650 #endif
15651
15652 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15653 int
15654 main (void)
15655 {
15656   int i;
15657   for (i = 0; i < 256; i++)
15658     if (XOR (islower (i), ISLOWER (i))
15659         || toupper (i) != TOUPPER (i))
15660       $ac_main_return(2);
15661   $ac_main_return (0);
15662 }
15663 _ACEOF
15664 rm -f conftest$ac_exeext
15665 if { (eval echo "$as_me:15665: \"$ac_link\"") >&5
15666   (eval $ac_link) 2>&5
15667   ac_status=$?
15668   echo "$as_me:15668: \$? = $ac_status" >&5
15669   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15670   { (eval echo "$as_me:15670: \"$ac_try\"") >&5
15671   (eval $ac_try) 2>&5
15672   ac_status=$?
15673   echo "$as_me:15673: \$? = $ac_status" >&5
15674   (exit $ac_status); }; }; then
15675   :
15676 else
15677   echo "$as_me: program exited with status $ac_status" >&5
15678 echo "$as_me: failed program was:" >&5
15679 cat conftest.$ac_ext >&5
15680 ac_cv_header_stdc=no
15681 fi
15682 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15683 fi
15684 fi
15685 fi
15686 echo "$as_me:15686: result: $ac_cv_header_stdc" >&5
15687 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15688 if test $ac_cv_header_stdc = yes; then
15689
15690 cat >>confdefs.h <<\EOF
15691 #define STDC_HEADERS 1
15692 EOF
15693
15694 fi
15695
15696 ac_header_dirent=no
15697 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
15698   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
15699 echo "$as_me:15699: checking for $ac_hdr that defines DIR" >&5
15700 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
15701 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15702   echo $ECHO_N "(cached) $ECHO_C" >&6
15703 else
15704   cat >conftest.$ac_ext <<_ACEOF
15705 #line 15705 "configure"
15706 #include "confdefs.h"
15707 #include <sys/types.h>
15708 #include <$ac_hdr>
15709
15710 int
15711 main (void)
15712 {
15713 if ((DIR *) 0)
15714 return 0;
15715   ;
15716   return 0;
15717 }
15718 _ACEOF
15719 rm -f conftest.$ac_objext
15720 if { (eval echo "$as_me:15720: \"$ac_compile\"") >&5
15721   (eval $ac_compile) 2>&5
15722   ac_status=$?
15723   echo "$as_me:15723: \$? = $ac_status" >&5
15724   (exit $ac_status); } &&
15725          { ac_try='test -s conftest.$ac_objext'
15726   { (eval echo "$as_me:15726: \"$ac_try\"") >&5
15727   (eval $ac_try) 2>&5
15728   ac_status=$?
15729   echo "$as_me:15729: \$? = $ac_status" >&5
15730   (exit $ac_status); }; }; then
15731   eval "$as_ac_Header=yes"
15732 else
15733   echo "$as_me: failed program was:" >&5
15734 cat conftest.$ac_ext >&5
15735 eval "$as_ac_Header=no"
15736 fi
15737 rm -f conftest.$ac_objext conftest.$ac_ext
15738 fi
15739 echo "$as_me:15739: result: `eval echo '${'$as_ac_Header'}'`" >&5
15740 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15741 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15742   cat >>confdefs.h <<EOF
15743 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15744 EOF
15745
15746 ac_header_dirent=$ac_hdr; break
15747 fi
15748
15749 done
15750 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
15751 if test $ac_header_dirent = dirent.h; then
15752   echo "$as_me:15752: checking for opendir in -ldir" >&5
15753 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
15754 if test "${ac_cv_lib_dir_opendir+set}" = set; then
15755   echo $ECHO_N "(cached) $ECHO_C" >&6
15756 else
15757   ac_check_lib_save_LIBS=$LIBS
15758 LIBS="-ldir  $LIBS"
15759 cat >conftest.$ac_ext <<_ACEOF
15760 #line 15760 "configure"
15761 #include "confdefs.h"
15762
15763 /* Override any gcc2 internal prototype to avoid an error.  */
15764 #ifdef __cplusplus
15765 extern "C"
15766 #endif
15767 /* We use char because int might match the return type of a gcc2
15768    builtin and then its argument prototype would still apply.  */
15769 char opendir ();
15770 int
15771 main (void)
15772 {
15773 opendir ();
15774   ;
15775   return 0;
15776 }
15777 _ACEOF
15778 rm -f conftest.$ac_objext conftest$ac_exeext
15779 if { (eval echo "$as_me:15779: \"$ac_link\"") >&5
15780   (eval $ac_link) 2>&5
15781   ac_status=$?
15782   echo "$as_me:15782: \$? = $ac_status" >&5
15783   (exit $ac_status); } &&
15784          { ac_try='test -s conftest$ac_exeext'
15785   { (eval echo "$as_me:15785: \"$ac_try\"") >&5
15786   (eval $ac_try) 2>&5
15787   ac_status=$?
15788   echo "$as_me:15788: \$? = $ac_status" >&5
15789   (exit $ac_status); }; }; then
15790   ac_cv_lib_dir_opendir=yes
15791 else
15792   echo "$as_me: failed program was:" >&5
15793 cat conftest.$ac_ext >&5
15794 ac_cv_lib_dir_opendir=no
15795 fi
15796 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15797 LIBS=$ac_check_lib_save_LIBS
15798 fi
15799 echo "$as_me:15799: result: $ac_cv_lib_dir_opendir" >&5
15800 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15801 if test $ac_cv_lib_dir_opendir = yes; then
15802   LIBS="$LIBS -ldir"
15803 fi
15804
15805 else
15806   echo "$as_me:15806: checking for opendir in -lx" >&5
15807 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15808 if test "${ac_cv_lib_x_opendir+set}" = set; then
15809   echo $ECHO_N "(cached) $ECHO_C" >&6
15810 else
15811   ac_check_lib_save_LIBS=$LIBS
15812 LIBS="-lx  $LIBS"
15813 cat >conftest.$ac_ext <<_ACEOF
15814 #line 15814 "configure"
15815 #include "confdefs.h"
15816
15817 /* Override any gcc2 internal prototype to avoid an error.  */
15818 #ifdef __cplusplus
15819 extern "C"
15820 #endif
15821 /* We use char because int might match the return type of a gcc2
15822    builtin and then its argument prototype would still apply.  */
15823 char opendir ();
15824 int
15825 main (void)
15826 {
15827 opendir ();
15828   ;
15829   return 0;
15830 }
15831 _ACEOF
15832 rm -f conftest.$ac_objext conftest$ac_exeext
15833 if { (eval echo "$as_me:15833: \"$ac_link\"") >&5
15834   (eval $ac_link) 2>&5
15835   ac_status=$?
15836   echo "$as_me:15836: \$? = $ac_status" >&5
15837   (exit $ac_status); } &&
15838          { ac_try='test -s conftest$ac_exeext'
15839   { (eval echo "$as_me:15839: \"$ac_try\"") >&5
15840   (eval $ac_try) 2>&5
15841   ac_status=$?
15842   echo "$as_me:15842: \$? = $ac_status" >&5
15843   (exit $ac_status); }; }; then
15844   ac_cv_lib_x_opendir=yes
15845 else
15846   echo "$as_me: failed program was:" >&5
15847 cat conftest.$ac_ext >&5
15848 ac_cv_lib_x_opendir=no
15849 fi
15850 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15851 LIBS=$ac_check_lib_save_LIBS
15852 fi
15853 echo "$as_me:15853: result: $ac_cv_lib_x_opendir" >&5
15854 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15855 if test $ac_cv_lib_x_opendir = yes; then
15856   LIBS="$LIBS -lx"
15857 fi
15858
15859 fi
15860
15861 echo "$as_me:15861: checking whether time.h and sys/time.h may both be included" >&5
15862 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15863 if test "${ac_cv_header_time+set}" = set; then
15864   echo $ECHO_N "(cached) $ECHO_C" >&6
15865 else
15866   cat >conftest.$ac_ext <<_ACEOF
15867 #line 15867 "configure"
15868 #include "confdefs.h"
15869 #include <sys/types.h>
15870 #include <sys/time.h>
15871 #include <time.h>
15872
15873 int
15874 main (void)
15875 {
15876 if ((struct tm *) 0)
15877 return 0;
15878   ;
15879   return 0;
15880 }
15881 _ACEOF
15882 rm -f conftest.$ac_objext
15883 if { (eval echo "$as_me:15883: \"$ac_compile\"") >&5
15884   (eval $ac_compile) 2>&5
15885   ac_status=$?
15886   echo "$as_me:15886: \$? = $ac_status" >&5
15887   (exit $ac_status); } &&
15888          { ac_try='test -s conftest.$ac_objext'
15889   { (eval echo "$as_me:15889: \"$ac_try\"") >&5
15890   (eval $ac_try) 2>&5
15891   ac_status=$?
15892   echo "$as_me:15892: \$? = $ac_status" >&5
15893   (exit $ac_status); }; }; then
15894   ac_cv_header_time=yes
15895 else
15896   echo "$as_me: failed program was:" >&5
15897 cat conftest.$ac_ext >&5
15898 ac_cv_header_time=no
15899 fi
15900 rm -f conftest.$ac_objext conftest.$ac_ext
15901 fi
15902 echo "$as_me:15902: result: $ac_cv_header_time" >&5
15903 echo "${ECHO_T}$ac_cv_header_time" >&6
15904 if test $ac_cv_header_time = yes; then
15905
15906 cat >>confdefs.h <<\EOF
15907 #define TIME_WITH_SYS_TIME 1
15908 EOF
15909
15910 fi
15911
15912 ###     checks for compiler characteristics
15913 ac_ext=c
15914 ac_cpp='$CPP $CPPFLAGS'
15915 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15916 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15917 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15918 ac_main_return=return
15919
15920 echo "$as_me:15920: checking for an ANSI C-conforming const" >&5
15921 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15922 if test "${ac_cv_c_const+set}" = set; then
15923   echo $ECHO_N "(cached) $ECHO_C" >&6
15924 else
15925   cat >conftest.$ac_ext <<_ACEOF
15926 #line 15926 "configure"
15927 #include "confdefs.h"
15928
15929 int
15930 main (void)
15931 {
15932 /* FIXME: Include the comments suggested by Paul. */
15933 #ifndef __cplusplus
15934   /* Ultrix mips cc rejects this.  */
15935   typedef int charset[2];
15936   const charset x;
15937   /* SunOS 4.1.1 cc rejects this.  */
15938   char const *const *ccp;
15939   char **p;
15940   /* NEC SVR4.0.2 mips cc rejects this.  */
15941   struct point {int x, y;};
15942   static struct point const zero = {0,0};
15943   /* AIX XL C 1.02.0.0 rejects this.
15944      It does not let you subtract one const X* pointer from another in
15945      an arm of an if-expression whose if-part is not a constant
15946      expression */
15947   const char *g = "string";
15948   ccp = &g + (g ? g-g : 0);
15949   /* HPUX 7.0 cc rejects these. */
15950   ++ccp;
15951   p = (char**) ccp;
15952   ccp = (char const *const *) p;
15953   { /* SCO 3.2v4 cc rejects this.  */
15954     char *t;
15955     char const *s = 0 ? (char *) 0 : (char const *) 0;
15956
15957     *t++ = 0;
15958   }
15959   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15960     int x[] = {25, 17};
15961     const int *foo = &x[0];
15962     ++foo;
15963   }
15964   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15965     typedef const int *iptr;
15966     iptr p = 0;
15967     ++p;
15968   }
15969   { /* AIX XL C 1.02.0.0 rejects this saying
15970        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15971     struct s { int j; const int *ap[3]; };
15972     struct s *b; b->j = 5;
15973   }
15974   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15975     const int foo = 10;
15976   }
15977 #endif
15978
15979   ;
15980   return 0;
15981 }
15982 _ACEOF
15983 rm -f conftest.$ac_objext
15984 if { (eval echo "$as_me:15984: \"$ac_compile\"") >&5
15985   (eval $ac_compile) 2>&5
15986   ac_status=$?
15987   echo "$as_me:15987: \$? = $ac_status" >&5
15988   (exit $ac_status); } &&
15989          { ac_try='test -s conftest.$ac_objext'
15990   { (eval echo "$as_me:15990: \"$ac_try\"") >&5
15991   (eval $ac_try) 2>&5
15992   ac_status=$?
15993   echo "$as_me:15993: \$? = $ac_status" >&5
15994   (exit $ac_status); }; }; then
15995   ac_cv_c_const=yes
15996 else
15997   echo "$as_me: failed program was:" >&5
15998 cat conftest.$ac_ext >&5
15999 ac_cv_c_const=no
16000 fi
16001 rm -f conftest.$ac_objext conftest.$ac_ext
16002 fi
16003 echo "$as_me:16003: result: $ac_cv_c_const" >&5
16004 echo "${ECHO_T}$ac_cv_c_const" >&6
16005 if test $ac_cv_c_const = no; then
16006
16007 cat >>confdefs.h <<\EOF
16008 #define const
16009 EOF
16010
16011 fi
16012
16013 ###     Checks for external-data
16014
16015 echo "$as_me:16015: checking if data-only library module links" >&5
16016 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16017 if test "${cf_cv_link_dataonly+set}" = set; then
16018   echo $ECHO_N "(cached) $ECHO_C" >&6
16019 else
16020
16021         rm -f conftest.a
16022         cat >conftest.$ac_ext <<EOF
16023 #line 16023 "configure"
16024 int     testdata[3] = { 123, 456, 789 };
16025 EOF
16026         if { (eval echo "$as_me:16026: \"$ac_compile\"") >&5
16027   (eval $ac_compile) 2>&5
16028   ac_status=$?
16029   echo "$as_me:16029: \$? = $ac_status" >&5
16030   (exit $ac_status); } ; then
16031                 mv conftest.o data.o && \
16032                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16033         fi
16034         rm -f conftest.$ac_ext data.o
16035         cat >conftest.$ac_ext <<EOF
16036 #line 16036 "configure"
16037 int     testfunc(void)
16038 {
16039 #if defined(NeXT)
16040         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16041 #else
16042         extern int testdata[3];
16043         return testdata[0] == 123
16044            &&  testdata[1] == 456
16045            &&  testdata[2] == 789;
16046 #endif
16047 }
16048 EOF
16049         if { (eval echo "$as_me:16049: \"$ac_compile\"") >&5
16050   (eval $ac_compile) 2>&5
16051   ac_status=$?
16052   echo "$as_me:16052: \$? = $ac_status" >&5
16053   (exit $ac_status); }; then
16054                 mv conftest.o func.o && \
16055                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16056         fi
16057         rm -f conftest.$ac_ext func.o
16058         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16059         cf_saveLIBS="$LIBS"
16060         LIBS="conftest.a $LIBS"
16061         if test "$cross_compiling" = yes; then
16062   cf_cv_link_dataonly=unknown
16063 else
16064   cat >conftest.$ac_ext <<_ACEOF
16065 #line 16065 "configure"
16066 #include "confdefs.h"
16067
16068         int main(void)
16069         {
16070                 extern int testfunc();
16071                 ${cf_cv_main_return:-return} (!testfunc());
16072         }
16073
16074 _ACEOF
16075 rm -f conftest$ac_exeext
16076 if { (eval echo "$as_me:16076: \"$ac_link\"") >&5
16077   (eval $ac_link) 2>&5
16078   ac_status=$?
16079   echo "$as_me:16079: \$? = $ac_status" >&5
16080   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16081   { (eval echo "$as_me:16081: \"$ac_try\"") >&5
16082   (eval $ac_try) 2>&5
16083   ac_status=$?
16084   echo "$as_me:16084: \$? = $ac_status" >&5
16085   (exit $ac_status); }; }; then
16086   cf_cv_link_dataonly=yes
16087 else
16088   echo "$as_me: program exited with status $ac_status" >&5
16089 echo "$as_me: failed program was:" >&5
16090 cat conftest.$ac_ext >&5
16091 cf_cv_link_dataonly=no
16092 fi
16093 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16094 fi
16095         LIBS="$cf_saveLIBS"
16096
16097 fi
16098
16099 echo "$as_me:16099: result: $cf_cv_link_dataonly" >&5
16100 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16101
16102 if test "$cf_cv_link_dataonly" = no ; then
16103
16104 cat >>confdefs.h <<\EOF
16105 #define BROKEN_LINKER 1
16106 EOF
16107
16108         BROKEN_LINKER=1
16109 fi
16110
16111 ###     Checks for library functions.
16112
16113 for ac_header in \
16114 unistd.h \
16115
16116 do
16117 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16118 echo "$as_me:16118: checking for $ac_header" >&5
16119 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16120 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16121   echo $ECHO_N "(cached) $ECHO_C" >&6
16122 else
16123   cat >conftest.$ac_ext <<_ACEOF
16124 #line 16124 "configure"
16125 #include "confdefs.h"
16126 #include <$ac_header>
16127 _ACEOF
16128 if { (eval echo "$as_me:16128: \"$ac_cpp conftest.$ac_ext\"") >&5
16129   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16130   ac_status=$?
16131   egrep -v '^ *\+' conftest.er1 >conftest.err
16132   rm -f conftest.er1
16133   cat conftest.err >&5
16134   echo "$as_me:16134: \$? = $ac_status" >&5
16135   (exit $ac_status); } >/dev/null; then
16136   if test -s conftest.err; then
16137     ac_cpp_err=$ac_c_preproc_warn_flag
16138   else
16139     ac_cpp_err=
16140   fi
16141 else
16142   ac_cpp_err=yes
16143 fi
16144 if test -z "$ac_cpp_err"; then
16145   eval "$as_ac_Header=yes"
16146 else
16147   echo "$as_me: failed program was:" >&5
16148   cat conftest.$ac_ext >&5
16149   eval "$as_ac_Header=no"
16150 fi
16151 rm -f conftest.err conftest.$ac_ext
16152 fi
16153 echo "$as_me:16153: result: `eval echo '${'$as_ac_Header'}'`" >&5
16154 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16155 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16156   cat >>confdefs.h <<EOF
16157 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16158 EOF
16159
16160 fi
16161 done
16162
16163 echo "$as_me:16163: checking for working mkstemp" >&5
16164 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16165 if test "${cf_cv_func_mkstemp+set}" = set; then
16166   echo $ECHO_N "(cached) $ECHO_C" >&6
16167 else
16168
16169 rm -rf conftest*
16170 if test "$cross_compiling" = yes; then
16171   cf_cv_func_mkstemp=maybe
16172 else
16173   cat >conftest.$ac_ext <<_ACEOF
16174 #line 16174 "configure"
16175 #include "confdefs.h"
16176
16177 #include <sys/types.h>
16178 #ifdef HAVE_UNISTD_H
16179 #include <unistd.h>
16180 #endif
16181 #include <stdlib.h>
16182 #include <stdio.h>
16183 #include <string.h>
16184 #include <sys/stat.h>
16185 int main(void)
16186 {
16187         char *tmpl = "conftestXXXXXX";
16188         char name[2][80];
16189         int n;
16190         int result = 0;
16191         int fd;
16192         struct stat sb;
16193
16194         umask(077);
16195         for (n = 0; n < 2; ++n) {
16196                 strcpy(name[n], tmpl);
16197                 if ((fd = mkstemp(name[n])) >= 0) {
16198                         if (!strcmp(name[n], tmpl)
16199                          || stat(name[n], &sb) != 0
16200                          || (sb.st_mode & S_IFMT) != S_IFREG
16201                          || (sb.st_mode & 077) != 0) {
16202                                 result = 1;
16203                         }
16204                         close(fd);
16205                 }
16206         }
16207         if (result == 0
16208          && !strcmp(name[0], name[1]))
16209                 result = 1;
16210         ${cf_cv_main_return:-return}(result);
16211 }
16212
16213 _ACEOF
16214 rm -f conftest$ac_exeext
16215 if { (eval echo "$as_me:16215: \"$ac_link\"") >&5
16216   (eval $ac_link) 2>&5
16217   ac_status=$?
16218   echo "$as_me:16218: \$? = $ac_status" >&5
16219   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16220   { (eval echo "$as_me:16220: \"$ac_try\"") >&5
16221   (eval $ac_try) 2>&5
16222   ac_status=$?
16223   echo "$as_me:16223: \$? = $ac_status" >&5
16224   (exit $ac_status); }; }; then
16225   cf_cv_func_mkstemp=yes
16226
16227 else
16228   echo "$as_me: program exited with status $ac_status" >&5
16229 echo "$as_me: failed program was:" >&5
16230 cat conftest.$ac_ext >&5
16231 cf_cv_func_mkstemp=no
16232
16233 fi
16234 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16235 fi
16236
16237 fi
16238 echo "$as_me:16238: result: $cf_cv_func_mkstemp" >&5
16239 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16240 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16241         echo "$as_me:16241: checking for mkstemp" >&5
16242 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16243 if test "${ac_cv_func_mkstemp+set}" = set; then
16244   echo $ECHO_N "(cached) $ECHO_C" >&6
16245 else
16246   cat >conftest.$ac_ext <<_ACEOF
16247 #line 16247 "configure"
16248 #include "confdefs.h"
16249 #define mkstemp autoconf_temporary
16250 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16251 #undef mkstemp
16252
16253 #ifdef __cplusplus
16254 extern "C"
16255 #endif
16256
16257 /* We use char because int might match the return type of a gcc2
16258    builtin and then its argument prototype would still apply.  */
16259 char mkstemp (void);
16260
16261 int
16262 main (void)
16263 {
16264
16265 /* The GNU C library defines stubs for functions which it implements
16266     to always fail with ENOSYS.  Some functions are actually named
16267     something starting with __ and the normal name is an alias.  */
16268 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16269 #error found stub for mkstemp
16270 #endif
16271
16272         return mkstemp ();
16273   ;
16274   return 0;
16275 }
16276 _ACEOF
16277 rm -f conftest.$ac_objext conftest$ac_exeext
16278 if { (eval echo "$as_me:16278: \"$ac_link\"") >&5
16279   (eval $ac_link) 2>&5
16280   ac_status=$?
16281   echo "$as_me:16281: \$? = $ac_status" >&5
16282   (exit $ac_status); } &&
16283          { ac_try='test -s conftest$ac_exeext'
16284   { (eval echo "$as_me:16284: \"$ac_try\"") >&5
16285   (eval $ac_try) 2>&5
16286   ac_status=$?
16287   echo "$as_me:16287: \$? = $ac_status" >&5
16288   (exit $ac_status); }; }; then
16289   ac_cv_func_mkstemp=yes
16290 else
16291   echo "$as_me: failed program was:" >&5
16292 cat conftest.$ac_ext >&5
16293 ac_cv_func_mkstemp=no
16294 fi
16295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16296 fi
16297 echo "$as_me:16297: result: $ac_cv_func_mkstemp" >&5
16298 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16299
16300 fi
16301 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16302
16303 cat >>confdefs.h <<\EOF
16304 #define HAVE_MKSTEMP 1
16305 EOF
16306
16307 fi
16308
16309 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16310         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16311         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16312 fi
16313
16314 cf_with_ada=yes
16315 if test "$cf_with_ada" != "no" ; then
16316
16317 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16318 do
16319
16320 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16321
16322         unset ac_cv_path_cf_TEMP_gnat
16323         unset cf_TEMP_gnat
16324         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16325 set dummy $cf_prog_gnat; ac_word=$2
16326 echo "$as_me:16326: checking for $ac_word" >&5
16327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16328 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16329   echo $ECHO_N "(cached) $ECHO_C" >&6
16330 else
16331   case $cf_TEMP_gnat in
16332   [\\/]* | ?:[\\/]*)
16333   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16334   ;;
16335   *)
16336   ac_save_IFS=$IFS; IFS=$ac_path_separator
16337 ac_dummy="$PATH"
16338 for ac_dir in $ac_dummy; do
16339   IFS=$ac_save_IFS
16340   test -z "$ac_dir" && ac_dir=.
16341   if $as_executable_p "$ac_dir/$ac_word"; then
16342    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16343    echo "$as_me:16343: found $ac_dir/$ac_word" >&5
16344    break
16345 fi
16346 done
16347
16348   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16349   ;;
16350 esac
16351 fi
16352 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16353
16354 if test -n "$cf_TEMP_gnat"; then
16355   echo "$as_me:16355: result: $cf_TEMP_gnat" >&5
16356 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16357 else
16358   echo "$as_me:16358: result: no" >&5
16359 echo "${ECHO_T}no" >&6
16360 fi
16361
16362         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16363
16364         if test "x$cf_TEMP_gnat" != xno; then
16365                 unset cf_cv_gnat_version
16366                 unset cf_TEMP_gnat
16367
16368 echo "$as_me:16368: checking for $cf_prog_gnat version" >&5
16369 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16370 if test "${cf_cv_gnat_version+set}" = set; then
16371   echo $ECHO_N "(cached) $ECHO_C" >&6
16372 else
16373
16374 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16375         grep '[0-9].[0-9][0-9]*' |\
16376         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16377
16378 fi
16379 echo "$as_me:16379: result: $cf_cv_gnat_version" >&5
16380 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16381 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16382 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16383
16384         fi
16385         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16386
16387         unset cf_TEMP_gnat
16388         unset cf_cv_gnat_version
16389         unset ac_cv_path_cf_TEMP_gnat
16390 done
16391
16392 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16393         cf_ada_make=
16394         cf_cv_prog_gnat_correct=no
16395 else
16396         cf_ada_make=gnatmake
16397         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16398                 # gprconfig is newer than gnatmake; we can continue...
16399                 cf_ada_config="##"
16400         else
16401                 rm -rf conftest* *~conftest*
16402                 if mkdir conftest.src
16403                 then
16404                         cf_ada_config=""
16405                         cd conftest.src
16406                         for cf_gprconfig in Ada C
16407                         do
16408                                 echo "$as_me:16408: checking for gprconfig name for $cf_gprconfig" >&5
16409 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16410                                 if test $cf_gprconfig = C
16411                                 then
16412                                         for cf_gprconfig_param in \
16413                                                 $cf_gprconfig,,,,GNATGCC \
16414                                                 $cf_gprconfig,,,,GCC \
16415                                                 $cf_gprconfig
16416                                         do
16417                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16418                                                 test -n "$cf_gprconfig_value" && break
16419                                         done
16420                                 else
16421                                         cf_gprconfig_param=$cf_gprconfig
16422                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16423                                 fi
16424                                 if test -n "$cf_gprconfig_value"
16425                                 then
16426                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16427                                         echo "$as_me:16427: result: $cf_gprconfig_value" >&5
16428 echo "${ECHO_T}$cf_gprconfig_value" >&6
16429                                 else
16430                                         echo "$as_me:16430: result: missing" >&5
16431 echo "${ECHO_T}missing" >&6
16432                                         cf_ada_config="#"
16433                                         break
16434                                 fi
16435                         done
16436                         cd ..
16437                         rm -rf conftest* *~conftest*
16438                 fi
16439         fi
16440         if test "x$cf_ada_config" != "x#"
16441         then
16442
16443 echo "$as_me:16443: checking for gnat version" >&5
16444 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16445 if test "${cf_cv_gnat_version+set}" = set; then
16446   echo $ECHO_N "(cached) $ECHO_C" >&6
16447 else
16448
16449 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16450         grep '[0-9].[0-9][0-9]*' |\
16451         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16452
16453 fi
16454 echo "$as_me:16454: result: $cf_cv_gnat_version" >&5
16455 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16456 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16457
16458 case $cf_cv_gnat_version in
16459 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
16460         cf_cv_prog_gnat_correct=yes
16461         ;;
16462 (*)
16463         { echo "$as_me:16463: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16464 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16465         cf_cv_prog_gnat_correct=no
16466         ;;
16467 esac
16468
16469                 # Extract the first word of "m4", so it can be a program name with args.
16470 set dummy m4; ac_word=$2
16471 echo "$as_me:16471: checking for $ac_word" >&5
16472 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16473 if test "${ac_cv_prog_M4_exists+set}" = set; then
16474   echo $ECHO_N "(cached) $ECHO_C" >&6
16475 else
16476   if test -n "$M4_exists"; then
16477   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16478 else
16479   ac_save_IFS=$IFS; IFS=$ac_path_separator
16480 ac_dummy="$PATH"
16481 for ac_dir in $ac_dummy; do
16482   IFS=$ac_save_IFS
16483   test -z "$ac_dir" && ac_dir=.
16484   $as_executable_p "$ac_dir/$ac_word" || continue
16485 ac_cv_prog_M4_exists="yes"
16486 echo "$as_me:16486: found $ac_dir/$ac_word" >&5
16487 break
16488 done
16489
16490   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16491 fi
16492 fi
16493 M4_exists=$ac_cv_prog_M4_exists
16494 if test -n "$M4_exists"; then
16495   echo "$as_me:16495: result: $M4_exists" >&5
16496 echo "${ECHO_T}$M4_exists" >&6
16497 else
16498   echo "$as_me:16498: result: no" >&5
16499 echo "${ECHO_T}no" >&6
16500 fi
16501
16502                 if test "$ac_cv_prog_M4_exists" = no; then
16503                         cf_cv_prog_gnat_correct=no
16504                         { echo "$as_me:16504: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16505 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16506                 fi
16507                 if test "$cf_cv_prog_gnat_correct" = yes; then
16508                         echo "$as_me:16508: checking if GNAT works" >&5
16509 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16510
16511 rm -rf conftest* *~conftest*
16512 cat >>conftest.ads <<CF_EOF
16513 procedure conftest;
16514 CF_EOF
16515 cat >>conftest.adb <<CF_EOF
16516 with Text_IO;
16517 with GNAT.OS_Lib;
16518 procedure conftest is
16519 begin
16520    Text_IO.Put ("Hello World");
16521    Text_IO.New_Line;
16522    GNAT.OS_Lib.OS_Exit (0);
16523 end conftest;
16524 CF_EOF
16525 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16526    if ( ./conftest 1>&5 2>&1 ) ; then
16527       cf_cv_prog_gnat_correct=yes
16528    else
16529       cf_cv_prog_gnat_correct=no
16530    fi
16531 else
16532    cf_cv_prog_gnat_correct=no
16533 fi
16534 rm -rf conftest* *~conftest*
16535
16536                         echo "$as_me:16536: result: $cf_cv_prog_gnat_correct" >&5
16537 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16538                 fi
16539         else
16540                 cf_cv_prog_gnat_correct=no
16541         fi
16542 fi
16543
16544         if test "$cf_cv_prog_gnat_correct" = yes; then
16545
16546         echo "$as_me:16546: checking optimization options for ADAFLAGS" >&5
16547 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16548         case "$CFLAGS" in
16549         (*-g*)
16550
16551         ADAFLAGS="$ADAFLAGS -g"
16552
16553                 ;;
16554         esac
16555         case "$CFLAGS" in
16556         (*-O*)
16557                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16558
16559         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16560
16561                 ;;
16562         esac
16563         echo "$as_me:16563: result: $ADAFLAGS" >&5
16564 echo "${ECHO_T}$ADAFLAGS" >&6
16565
16566 echo "$as_me:16566: checking if GNATPREP supports -T option" >&5
16567 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16568 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16569   echo $ECHO_N "(cached) $ECHO_C" >&6
16570 else
16571
16572 cf_cv_gnatprep_opt_t=no
16573 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16574
16575 fi
16576 echo "$as_me:16576: result: $cf_cv_gnatprep_opt_t" >&5
16577 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16578 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16579
16580 echo "$as_me:16580: checking if GNAT supports generics" >&5
16581 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16582 case $cf_cv_gnat_version in
16583 (3.[1-9]*|[4-9].*)
16584         cf_gnat_generics=yes
16585         ;;
16586 (*)
16587         cf_gnat_generics=no
16588         ;;
16589 esac
16590 echo "$as_me:16590: result: $cf_gnat_generics" >&5
16591 echo "${ECHO_T}$cf_gnat_generics" >&6
16592
16593 if test "$cf_gnat_generics" = yes
16594 then
16595         cf_compile_generics=generics
16596         cf_generic_objects="\${GENOBJS}"
16597 else
16598         cf_compile_generics=
16599         cf_generic_objects=
16600 fi
16601
16602 echo "$as_me:16602: checking if GNAT supports SIGINT" >&5
16603 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16604 if test "${cf_cv_gnat_sigint+set}" = set; then
16605   echo $ECHO_N "(cached) $ECHO_C" >&6
16606 else
16607
16608 rm -rf conftest* *~conftest*
16609 cat >>conftest.ads <<CF_EOF
16610 with Ada.Interrupts.Names;
16611
16612 package ConfTest is
16613
16614    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16615    pragma Unreserve_All_Interrupts;
16616    pragma Warnings (On);
16617
16618    protected Process is
16619       procedure Stop;
16620       function Continue return Boolean;
16621       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16622    private
16623       Done : Boolean := False;
16624    end Process;
16625
16626 end ConfTest;
16627 CF_EOF
16628 cat >>conftest.adb <<CF_EOF
16629 package body ConfTest is
16630    protected body Process is
16631       procedure Stop is
16632       begin
16633          Done := True;
16634       end Stop;
16635       function Continue return Boolean is
16636       begin
16637          return not Done;
16638       end Continue;
16639    end Process;
16640 end ConfTest;
16641 CF_EOF
16642 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16643       cf_cv_gnat_sigint=yes
16644 else
16645    cf_cv_gnat_sigint=no
16646 fi
16647 rm -rf conftest* *~conftest*
16648
16649 fi
16650 echo "$as_me:16650: result: $cf_cv_gnat_sigint" >&5
16651 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16652
16653 if test $cf_cv_gnat_sigint = yes ; then
16654         USE_GNAT_SIGINT=""
16655 else
16656         USE_GNAT_SIGINT="#"
16657 fi
16658
16659 cf_gnat_libraries=no
16660 cf_gnat_projects=no
16661
16662 if test "$enable_gnat_projects" != no ; then
16663 echo "$as_me:16663: checking if GNAT supports project files" >&5
16664 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16665 case $cf_cv_gnat_version in
16666 (3.[0-9]*)
16667         ;;
16668 (*)
16669         case $cf_cv_system_name in
16670         (cygwin*|msys*)
16671                 ;;
16672         (*)
16673                 rm -rf conftest* *~conftest*
16674                 if mkdir conftest.src conftest.bin conftest.lib
16675                 then
16676                         cd conftest.src
16677                         rm -rf conftest* *~conftest*
16678                         cat >>library.gpr <<CF_EOF
16679 project Library is
16680   Kind := External ("LIB_KIND");
16681   for Library_Name use "ConfTest";
16682   for Object_Dir use ".";
16683   for Library_ALI_Dir use External("LIBRARY_DIR");
16684   for Library_Version use External ("SONAME");
16685   for Library_Kind use Kind;
16686   for Library_Dir use External("BUILD_DIR");
16687   Source_Dir := External ("SOURCE_DIR");
16688   for Source_Dirs use (Source_Dir);
16689 end Library;
16690 CF_EOF
16691                         cat >>confpackage.ads <<CF_EOF
16692 package ConfPackage is
16693    procedure conftest;
16694 end ConfPackage;
16695 CF_EOF
16696                         cat >>confpackage.adb <<CF_EOF
16697 with Text_IO;
16698 package body ConfPackage is
16699    procedure conftest is
16700    begin
16701       Text_IO.Put ("Hello World");
16702       Text_IO.New_Line;
16703    end conftest;
16704 end ConfPackage;
16705 CF_EOF
16706                         if ( $cf_ada_make $ADAFLAGS \
16707                                         -Plibrary.gpr \
16708                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
16709                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
16710                                         -XSOURCE_DIR=`pwd` \
16711                                         -XSONAME=libConfTest.so.1 \
16712                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
16713                                 cf_gnat_projects=yes
16714                         fi
16715                         cd ..
16716                 fi
16717                 if test -f conftest.lib/confpackage.ali
16718                 then
16719                         cf_gnat_libraries=yes
16720                 fi
16721                 rm -rf conftest* *~conftest*
16722                 ;;
16723         esac
16724         ;;
16725 esac
16726 echo "$as_me:16726: result: $cf_gnat_projects" >&5
16727 echo "${ECHO_T}$cf_gnat_projects" >&6
16728 fi # enable_gnat_projects
16729
16730 if test $cf_gnat_projects = yes
16731 then
16732         echo "$as_me:16732: checking if GNAT supports libraries" >&5
16733 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
16734         echo "$as_me:16734: result: $cf_gnat_libraries" >&5
16735 echo "${ECHO_T}$cf_gnat_libraries" >&6
16736 fi
16737
16738 if test "$cf_gnat_projects" = yes
16739 then
16740         USE_OLD_MAKERULES="#"
16741         USE_GNAT_PROJECTS=""
16742 else
16743         USE_OLD_MAKERULES=""
16744         USE_GNAT_PROJECTS="#"
16745 fi
16746
16747 if test "$cf_gnat_libraries" = yes
16748 then
16749         USE_GNAT_LIBRARIES=""
16750 else
16751         USE_GNAT_LIBRARIES="#"
16752 fi
16753
16754 echo "$as_me:16754: checking for ada-compiler" >&5
16755 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
16756
16757 # Check whether --with-ada-compiler or --without-ada-compiler was given.
16758 if test "${with_ada_compiler+set}" = set; then
16759   withval="$with_ada_compiler"
16760   cf_ada_compiler=$withval
16761 else
16762   cf_ada_compiler=gnatmake
16763 fi;
16764
16765 echo "$as_me:16765: result: $cf_ada_compiler" >&5
16766 echo "${ECHO_T}$cf_ada_compiler" >&6
16767
16768                 cf_ada_package=terminal_interface
16769
16770 echo "$as_me:16770: checking for ada-include" >&5
16771 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
16772
16773 # Check whether --with-ada-include or --without-ada-include was given.
16774 if test "${with_ada_include+set}" = set; then
16775   withval="$with_ada_include"
16776
16777 else
16778   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
16779 fi; if test -n "$prefix/share/ada/adainclude" ; then
16780
16781 if test "x$prefix" != xNONE; then
16782         cf_path_syntax="$prefix"
16783 else
16784         cf_path_syntax="$ac_default_prefix"
16785 fi
16786
16787 case ".$withval" in
16788 (.\$\(*\)*|.\'*\'*)
16789         ;;
16790 (..|./*|.\\*)
16791         ;;
16792 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16793         ;;
16794 (.\${*prefix}*|.\${*dir}*)
16795         eval withval="$withval"
16796         case ".$withval" in
16797         (.NONE/*)
16798                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16799                 ;;
16800         esac
16801         ;;
16802 (.no|.NONE/*)
16803         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16804         ;;
16805 (*)
16806         { { echo "$as_me:16806: error: expected a pathname, not \"$withval\"" >&5
16807 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16808    { (exit 1); exit 1; }; }
16809         ;;
16810 esac
16811
16812 fi
16813 eval ADA_INCLUDE="$withval"
16814
16815 echo "$as_me:16815: result: $ADA_INCLUDE" >&5
16816 echo "${ECHO_T}$ADA_INCLUDE" >&6
16817
16818 echo "$as_me:16818: checking for ada-objects" >&5
16819 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
16820
16821 # Check whether --with-ada-objects or --without-ada-objects was given.
16822 if test "${with_ada_objects+set}" = set; then
16823   withval="$with_ada_objects"
16824
16825 else
16826   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16827 fi; if test -n "$prefix/lib/ada/adalib" ; then
16828
16829 if test "x$prefix" != xNONE; then
16830         cf_path_syntax="$prefix"
16831 else
16832         cf_path_syntax="$ac_default_prefix"
16833 fi
16834
16835 case ".$withval" in
16836 (.\$\(*\)*|.\'*\'*)
16837         ;;
16838 (..|./*|.\\*)
16839         ;;
16840 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16841         ;;
16842 (.\${*prefix}*|.\${*dir}*)
16843         eval withval="$withval"
16844         case ".$withval" in
16845         (.NONE/*)
16846                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16847                 ;;
16848         esac
16849         ;;
16850 (.no|.NONE/*)
16851         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16852         ;;
16853 (*)
16854         { { echo "$as_me:16854: error: expected a pathname, not \"$withval\"" >&5
16855 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16856    { (exit 1); exit 1; }; }
16857         ;;
16858 esac
16859
16860 fi
16861 eval ADA_OBJECTS="$withval"
16862
16863 echo "$as_me:16863: result: $ADA_OBJECTS" >&5
16864 echo "${ECHO_T}$ADA_OBJECTS" >&6
16865
16866 echo "$as_me:16866: checking if an Ada95 shared-library should be built" >&5
16867 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16868
16869 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16870 if test "${with_ada_sharedlib+set}" = set; then
16871   withval="$with_ada_sharedlib"
16872   with_ada_sharedlib=$withval
16873 else
16874   with_ada_sharedlib=no
16875 fi;
16876 echo "$as_me:16876: result: $with_ada_sharedlib" >&5
16877 echo "${ECHO_T}$with_ada_sharedlib" >&6
16878
16879 if test "x$with_ada_sharedlib" != xno
16880 then
16881         if test "x$cf_gnat_projects" != xyes
16882         then
16883                 { echo "$as_me:16883: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16884 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16885                 with_ada_sharedlib=no
16886         fi
16887 fi
16888
16889 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16890 MAKE_ADA_SHAREDLIB="#"
16891
16892 if test "x$with_ada_sharedlib" != xno
16893 then
16894         MAKE_ADA_SHAREDLIB=
16895         if test "x$with_ada_sharedlib" != xyes
16896         then
16897                 ADA_SHAREDLIB="$with_ada_sharedlib"
16898         fi
16899 fi
16900
16901                 # allow the Ada binding to be renamed
16902
16903 echo "$as_me:16903: checking for ada-libname" >&5
16904 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
16905
16906 # Check whether --with-ada-libname or --without-ada-libname was given.
16907 if test "${with_ada_libname+set}" = set; then
16908   withval="$with_ada_libname"
16909   ADA_LIBNAME=$withval
16910 else
16911   ADA_LIBNAME=AdaCurses
16912 fi;
16913 case "x$ADA_LIBNAME" in
16914 (x|xyes|xno)
16915         ADA_LIBNAME=AdaCurses
16916         ;;
16917 esac
16918
16919 echo "$as_me:16919: result: $ADA_LIBNAME" >&5
16920 echo "${ECHO_T}$ADA_LIBNAME" >&6
16921
16922         else
16923                 { { echo "$as_me:16923: error: No usable Ada compiler found" >&5
16924 echo "$as_me: error: No usable Ada compiler found" >&2;}
16925    { (exit 1); exit 1; }; }
16926         fi
16927 else
16928         { { echo "$as_me:16928: error: The Ada compiler is needed for this package" >&5
16929 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16930    { (exit 1); exit 1; }; }
16931 fi
16932
16933 ################################################################################
16934
16935 # not needed
16936 TINFO_LDFLAGS2=
16937
16938 TINFO_LIBS=
16939
16940 ### Construct the list of include-directories to be generated
16941
16942 if test "$srcdir" != "."; then
16943         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16944 fi
16945 CPPFLAGS="-I../include $CPPFLAGS"
16946 if test "$srcdir" != "."; then
16947         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16948 fi
16949 CPPFLAGS="-I. $CPPFLAGS"
16950
16951 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16952 if test "$srcdir" != "."; then
16953         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16954 fi
16955 if test "$GCC" != yes; then
16956         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16957 elif test "$includedir" != "/usr/include"; then
16958         if test "$includedir" = '${prefix}/include' ; then
16959                 if test x$prefix != x/usr ; then
16960                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16961                 fi
16962         else
16963                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16964         fi
16965 fi
16966
16967 ### Build up pieces for makefile rules
16968 echo "$as_me:16968: checking default library suffix" >&5
16969 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16970
16971         case $DFT_LWR_MODEL in
16972         (libtool) DFT_ARG_SUFFIX=''   ;;
16973         (normal)  DFT_ARG_SUFFIX=''   ;;
16974         (debug)   DFT_ARG_SUFFIX='_g' ;;
16975         (profile) DFT_ARG_SUFFIX='_p' ;;
16976         (shared)  DFT_ARG_SUFFIX=''   ;;
16977         esac
16978         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16979 echo "$as_me:16979: result: $DFT_ARG_SUFFIX" >&5
16980 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16981
16982 echo "$as_me:16982: checking default library-dependency suffix" >&5
16983 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16984
16985         case X$DFT_LWR_MODEL in
16986         (Xlibtool)
16987                 DFT_LIB_SUFFIX='.la'
16988                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16989                 ;;
16990         (Xdebug)
16991                 DFT_LIB_SUFFIX='_g.a'
16992                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16993                 ;;
16994         (Xprofile)
16995                 DFT_LIB_SUFFIX='_p.a'
16996                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16997                 ;;
16998         (Xshared)
16999                 case $cf_cv_system_name in
17000                 (aix[5-7]*)
17001                         DFT_LIB_SUFFIX='.so'
17002                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17003                         ;;
17004                 (cygwin*|msys*|mingw*)
17005                         DFT_LIB_SUFFIX='.dll'
17006                         DFT_DEP_SUFFIX='.dll.a'
17007                         ;;
17008                 (darwin*)
17009                         DFT_LIB_SUFFIX='.dylib'
17010                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17011                         ;;
17012                 (hpux*)
17013                         case $target in
17014                         (ia64*)
17015                                 DFT_LIB_SUFFIX='.so'
17016                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17017                                 ;;
17018                         (*)
17019                                 DFT_LIB_SUFFIX='.sl'
17020                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17021                                 ;;
17022                         esac
17023                         ;;
17024                 (*)
17025                         DFT_LIB_SUFFIX='.so'
17026                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17027                         ;;
17028                 esac
17029                 ;;
17030         (*)
17031                 DFT_LIB_SUFFIX='.a'
17032                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17033                 ;;
17034         esac
17035         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17036         then
17037                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17038                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17039         fi
17040 echo "$as_me:17040: result: $DFT_DEP_SUFFIX" >&5
17041 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17042
17043 echo "$as_me:17043: checking default object directory" >&5
17044 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17045
17046         case $DFT_LWR_MODEL in
17047         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17048         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17049         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17050         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17051         (shared)
17052                 case $cf_cv_system_name in
17053                 (cygwin|msys)
17054                         DFT_OBJ_SUBDIR='objects' ;;
17055                 (*)
17056                         DFT_OBJ_SUBDIR='obj_s' ;;
17057                 esac
17058         esac
17059 echo "$as_me:17059: result: $DFT_OBJ_SUBDIR" >&5
17060 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17061
17062 ### Set up low-level terminfo dependencies for makefiles.
17063
17064 if test "$DFT_LWR_MODEL" = shared ; then
17065         case $cf_cv_system_name in
17066         (cygwin*)
17067                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17068                 ;;
17069         (msys*)
17070                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17071                 ;;
17072         esac
17073 fi
17074
17075 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17076
17077 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17078
17079 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17080
17081 ### Construct the list of subdirectories for which we'll customize makefiles
17082 ### with the appropriate compile-rules.
17083
17084 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17085
17086 cat >>confdefs.h <<EOF
17087 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17088 EOF
17089
17090 ### Now that we're done running tests, add the compiler-warnings, if any
17091
17092 cf_fix_cppflags=no
17093 cf_new_cflags=
17094 cf_new_cppflags=
17095 cf_new_extra_cppflags=
17096
17097 for cf_add_cflags in $EXTRA_CFLAGS
17098 do
17099 case $cf_fix_cppflags in
17100 (no)
17101         case $cf_add_cflags in
17102         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17103                 case $cf_add_cflags in
17104                 (-D*)
17105                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17106
17107                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17108                                 && test -z "${cf_tst_cflags}" \
17109                                 && cf_fix_cppflags=yes
17110
17111                         if test $cf_fix_cppflags = yes ; then
17112
17113         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17114         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17115
17116                                 continue
17117                         elif test "${cf_tst_cflags}" = "\"'" ; then
17118
17119         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17120         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17121
17122                                 continue
17123                         fi
17124                         ;;
17125                 esac
17126                 case "$CPPFLAGS" in
17127                 (*$cf_add_cflags)
17128                         ;;
17129                 (*)
17130                         case $cf_add_cflags in
17131                         (-D*)
17132                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17133
17134 CPPFLAGS=`echo "$CPPFLAGS" | \
17135         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17136                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17137
17138                                 ;;
17139                         esac
17140
17141         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17142         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17143
17144                         ;;
17145                 esac
17146                 ;;
17147         (*)
17148
17149         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17150         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17151
17152                 ;;
17153         esac
17154         ;;
17155 (yes)
17156
17157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17159
17160         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17161
17162         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17163                 && test -z "${cf_tst_cflags}" \
17164                 && cf_fix_cppflags=no
17165         ;;
17166 esac
17167 done
17168
17169 if test -n "$cf_new_cflags" ; then
17170
17171         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17172         CFLAGS="${CFLAGS}$cf_new_cflags"
17173
17174 fi
17175
17176 if test -n "$cf_new_cppflags" ; then
17177
17178         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17179         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17180
17181 fi
17182
17183 if test -n "$cf_new_extra_cppflags" ; then
17184
17185         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17186         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17187
17188 fi
17189
17190 ################################################################################
17191
17192 TEST_ARG2=
17193
17194 TEST_LIBS2=
17195
17196 NCURSES_SHLIB2="sh -c"
17197
17198 ADA_SUBDIRS="include gen src doc"
17199 if test "x$cf_with_tests" != "xno" ; then
17200         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17201 fi
17202 for cf_dir in $ADA_SUBDIRS
17203 do
17204         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17205 done
17206
17207 NCURSES_TREE="#"
17208
17209 EXTERNAL_TREE=
17210
17211 # match layout used by make-tar.sh
17212 ADAHTML_DIR=../doc/ada
17213
17214 if test "x$cross_compiling" = xyes ; then
17215         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17216 else
17217         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17218 fi
17219
17220 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"
17221 ac_config_commands="$ac_config_commands default"
17222 cat >confcache <<\_ACEOF
17223 # This file is a shell script that caches the results of configure
17224 # tests run on this system so they can be shared between configure
17225 # scripts and configure runs, see configure's option --config-cache.
17226 # It is not useful on other systems.  If it contains results you don't
17227 # want to keep, you may remove or edit it.
17228 #
17229 # config.status only pays attention to the cache file if you give it
17230 # the --recheck option to rerun configure.
17231 #
17232 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17233 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17234 # following values.
17235
17236 _ACEOF
17237
17238 # The following way of writing the cache mishandles newlines in values,
17239 # but we know of no workaround that is simple, portable, and efficient.
17240 # So, don't put newlines in cache variables' values.
17241 # Ultrix sh set writes to stderr and can't be redirected directly,
17242 # and sets the high bit in the cache file unless we assign to the vars.
17243 {
17244   (set) 2>&1 |
17245     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17246     *ac_space=\ *)
17247       # `set' does not quote correctly, so add quotes (double-quote
17248       # substitution turns \\\\ into \\, and sed turns \\ into \).
17249       sed -n \
17250         "s/'/'\\\\''/g;
17251           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17252       ;;
17253     *)
17254       # `set' quotes correctly as required by POSIX, so do not add quotes.
17255       sed -n \
17256         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17257       ;;
17258     esac;
17259 } |
17260   sed '
17261      t clear
17262      : clear
17263      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17264      t end
17265      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17266      : end' >>confcache
17267 if cmp -s $cache_file confcache; then :; else
17268   if test -w $cache_file; then
17269     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17270     cat confcache >$cache_file
17271   else
17272     echo "not updating unwritable cache $cache_file"
17273   fi
17274 fi
17275 rm -f confcache
17276
17277 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17278 # Let make expand exec_prefix.
17279 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17280
17281 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17282 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17283 # trailing colons and then remove the whole line if VPATH becomes empty
17284 # (actually we leave an empty line to preserve line numbers).
17285 if test "x$srcdir" = x.; then
17286   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17287 s/:*\$(srcdir):*/:/;
17288 s/:*\${srcdir}:*/:/;
17289 s/:*@srcdir@:*/:/;
17290 s/^\([^=]*=[    ]*\):*/\1/;
17291 s/:*$//;
17292 s/^[^=]*=[      ]*$//;
17293 }'
17294 fi
17295
17296 DEFS=-DHAVE_CONFIG_H
17297
17298 : ${CONFIG_STATUS=./config.status}
17299 ac_clean_files_save=$ac_clean_files
17300 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17301 { echo "$as_me:17301: creating $CONFIG_STATUS" >&5
17302 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17303 cat >$CONFIG_STATUS <<_ACEOF
17304 #! $SHELL
17305 # Generated automatically by configure.
17306 # Run this file to recreate the current configuration.
17307 # Compiler output produced by configure, useful for debugging
17308 # configure, is in config.log if it exists.
17309
17310 debug=false
17311 SHELL=\${CONFIG_SHELL-$SHELL}
17312 ac_cs_invocation="\$0 \$@"
17313
17314 _ACEOF
17315
17316 cat >>$CONFIG_STATUS <<\_ACEOF
17317 # Be Bourne compatible
17318 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17319   emulate sh
17320   NULLCMD=:
17321 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17322   set -o posix
17323 fi
17324
17325 # Name of the executable.
17326 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17327
17328 if expr a : '\(a\)' >/dev/null 2>&1; then
17329   as_expr=expr
17330 else
17331   as_expr=false
17332 fi
17333
17334 rm -f conf$$ conf$$.exe conf$$.file
17335 echo >conf$$.file
17336 if ln -s conf$$.file conf$$ 2>/dev/null; then
17337   # We could just check for DJGPP; but this test a) works b) is more generic
17338   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17339   if test -f conf$$.exe; then
17340     # Don't use ln at all; we don't have any links
17341     as_ln_s='cp -p'
17342   else
17343     as_ln_s='ln -s'
17344   fi
17345 elif ln conf$$.file conf$$ 2>/dev/null; then
17346   as_ln_s=ln
17347 else
17348   as_ln_s='cp -p'
17349 fi
17350 rm -f conf$$ conf$$.exe conf$$.file
17351
17352 as_executable_p="test -f"
17353
17354 # Support unset when possible.
17355 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17356   as_unset=unset
17357 else
17358   as_unset=false
17359 fi
17360
17361 # NLS nuisances.
17362 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17363 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17364 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17365 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17366 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17367 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17368 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17369 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17370
17371 # IFS
17372 # We need space, tab and new line, in precisely that order.
17373 as_nl='
17374 '
17375 IFS="   $as_nl"
17376
17377 # CDPATH.
17378 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17379
17380 exec 6>&1
17381
17382 _ACEOF
17383
17384 # Files that config.status was made for.
17385 if test -n "$ac_config_files"; then
17386   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17387 fi
17388
17389 if test -n "$ac_config_headers"; then
17390   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17391 fi
17392
17393 if test -n "$ac_config_links"; then
17394   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17395 fi
17396
17397 if test -n "$ac_config_commands"; then
17398   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17399 fi
17400
17401 cat >>$CONFIG_STATUS <<\EOF
17402
17403 ac_cs_usage="\
17404 \`$as_me' instantiates files from templates according to the
17405 current configuration.
17406
17407 Usage: $0 [OPTIONS] [FILE]...
17408
17409   -h, --help       print this help, then exit
17410   -V, --version    print version number, then exit
17411   -d, --debug      don't remove temporary files
17412       --recheck    update $as_me by reconfiguring in the same conditions
17413   --file=FILE[:TEMPLATE]
17414                    instantiate the configuration file FILE
17415   --header=FILE[:TEMPLATE]
17416                    instantiate the configuration header FILE
17417
17418 Configuration files:
17419 $config_files
17420
17421 Configuration headers:
17422 $config_headers
17423
17424 Configuration commands:
17425 $config_commands
17426
17427 Report bugs to <dickey@invisible-island.net>."
17428 EOF
17429
17430 cat >>$CONFIG_STATUS <<EOF
17431 ac_cs_version="\\
17432 config.status
17433 configured by $0, generated by GNU Autoconf 2.52.20200111,
17434   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17435
17436 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17437 Free Software Foundation, Inc.
17438 This config.status script is free software; the Free Software Foundation
17439 gives unlimited permission to copy, distribute and modify it."
17440 srcdir=$srcdir
17441 INSTALL="$INSTALL"
17442 EOF
17443
17444 cat >>$CONFIG_STATUS <<\EOF
17445 # If no file are specified by the user, then we need to provide default
17446 # value.  By we need to know if files were specified by the user.
17447 ac_need_defaults=:
17448 while test $# != 0
17449 do
17450   case $1 in
17451   --*=*)
17452     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17453     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17454     shift
17455     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17456     shift
17457     ;;
17458   -*);;
17459   *) # This is not an option, so the user has probably given explicit
17460      # arguments.
17461      ac_need_defaults=false;;
17462   esac
17463
17464   case $1 in
17465   # Handling of the options.
17466 EOF
17467 cat >>$CONFIG_STATUS <<EOF
17468   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17469     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17470     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17471 EOF
17472 cat >>$CONFIG_STATUS <<\EOF
17473   --version | --vers* | -V )
17474     echo "$ac_cs_version"; exit 0 ;;
17475   --he | --h)
17476     # Conflict between --help and --header
17477     { { echo "$as_me:17477: error: ambiguous option: $1
17478 Try \`$0 --help' for more information." >&5
17479 echo "$as_me: error: ambiguous option: $1
17480 Try \`$0 --help' for more information." >&2;}
17481    { (exit 1); exit 1; }; };;
17482   --help | --hel | -h )
17483     echo "$ac_cs_usage"; exit 0 ;;
17484   --debug | --d* | -d )
17485     debug=: ;;
17486   --file | --fil | --fi | --f )
17487     shift
17488     CONFIG_FILES="$CONFIG_FILES $1"
17489     ac_need_defaults=false;;
17490   --header | --heade | --head | --hea )
17491     shift
17492     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17493     ac_need_defaults=false;;
17494
17495   # This is an error.
17496   -*) { { echo "$as_me:17496: error: unrecognized option: $1
17497 Try \`$0 --help' for more information." >&5
17498 echo "$as_me: error: unrecognized option: $1
17499 Try \`$0 --help' for more information." >&2;}
17500    { (exit 1); exit 1; }; } ;;
17501
17502   *) ac_config_targets="$ac_config_targets $1" ;;
17503
17504   esac
17505   shift
17506 done
17507
17508 exec 5>>config.log
17509 cat >&5 << _ACEOF
17510
17511 ## ----------------------- ##
17512 ## Running config.status.  ##
17513 ## ----------------------- ##
17514
17515 This file was extended by $as_me 2.52.20200111, executed with
17516   CONFIG_FILES    = $CONFIG_FILES
17517   CONFIG_HEADERS  = $CONFIG_HEADERS
17518   CONFIG_LINKS    = $CONFIG_LINKS
17519   CONFIG_COMMANDS = $CONFIG_COMMANDS
17520   > $ac_cs_invocation
17521 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17522
17523 _ACEOF
17524 EOF
17525
17526 cat >>$CONFIG_STATUS <<EOF
17527 #
17528 # INIT-COMMANDS section.
17529 #
17530
17531 ### Special initialization commands, used to pass information from the
17532 ### configuration-run into config.status
17533
17534 AWK="$AWK"
17535 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17536 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17537 LIB_NAME="$LIB_NAME"
17538 LIB_PREFIX="$LIB_PREFIX"
17539 LIB_SUFFIX="$LIB_SUFFIX"
17540 LN_S="$LN_S"
17541 NCURSES_MAJOR="$NCURSES_MAJOR"
17542 NCURSES_MINOR="$NCURSES_MINOR"
17543 NCURSES_PATCH="$NCURSES_PATCH"
17544 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17545 cf_cv_abi_version="$cf_cv_abi_version"
17546 cf_cv_rel_version="$cf_cv_rel_version"
17547 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17548 cf_cv_shared_soname='$cf_cv_shared_soname'
17549 cf_cv_shlib_version="$cf_cv_shlib_version"
17550 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17551 cf_cv_system_name="$cf_cv_system_name"
17552 host="$host"
17553 target="$target"
17554
17555 EOF
17556
17557 cat >>$CONFIG_STATUS <<\EOF
17558 for ac_config_target in $ac_config_targets
17559 do
17560   case "$ac_config_target" in
17561   # Handling of arguments.
17562   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17563   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17564   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17565   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17566   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17567   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17568   *) { { echo "$as_me:17568: error: invalid argument: $ac_config_target" >&5
17569 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17570    { (exit 1); exit 1; }; };;
17571   esac
17572 done
17573
17574 # If the user did not use the arguments to specify the items to instantiate,
17575 # then the envvar interface is used.  Set only those that are not.
17576 # We use the long form for the default assignment because of an extremely
17577 # bizarre bug on SunOS 4.1.3.
17578 if $ac_need_defaults; then
17579   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17580   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17581   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17582 fi
17583
17584 # Create a temporary directory, and hook for its removal unless debugging.
17585 $debug ||
17586 {
17587   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17588   trap '{ (exit 1); exit 1; }' 1 2 13 15
17589 }
17590
17591 # Create a (secure) tmp directory for tmp files.
17592 : ${TMPDIR=/tmp}
17593 {
17594   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17595   test -n "$tmp" && test -d "$tmp"
17596 }  ||
17597 {
17598   tmp=$TMPDIR/cs$$-$RANDOM
17599   (umask 077 && mkdir $tmp)
17600 } ||
17601 {
17602    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17603    { (exit 1); exit 1; }
17604 }
17605
17606 EOF
17607
17608 cat >>$CONFIG_STATUS <<EOF
17609
17610 #
17611 # CONFIG_FILES section.
17612 #
17613
17614 # No need to generate the scripts if there are no CONFIG_FILES.
17615 # This happens for instance when ./config.status config.h
17616 if test -n "\$CONFIG_FILES"; then
17617   # Protect against being on the right side of a sed subst in config.status.
17618   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17619    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17620 s,@SHELL@,$SHELL,;t t
17621 s,@exec_prefix@,$exec_prefix,;t t
17622 s,@prefix@,$prefix,;t t
17623 s,@program_transform_name@,$program_transform_name,;t t
17624 s,@bindir@,$bindir,;t t
17625 s,@sbindir@,$sbindir,;t t
17626 s,@libexecdir@,$libexecdir,;t t
17627 s,@datarootdir@,$datarootdir,;t t
17628 s,@datadir@,$datadir,;t t
17629 s,@sysconfdir@,$sysconfdir,;t t
17630 s,@sharedstatedir@,$sharedstatedir,;t t
17631 s,@localstatedir@,$localstatedir,;t t
17632 s,@runstatedir@,$runstatedir,;t t
17633 s,@libdir@,$libdir,;t t
17634 s,@includedir@,$includedir,;t t
17635 s,@oldincludedir@,$oldincludedir,;t t
17636 s,@infodir@,$infodir,;t t
17637 s,@mandir@,$mandir,;t t
17638 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17639 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17640 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17641 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17642 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17643 s,@build_alias@,$build_alias,;t t
17644 s,@host_alias@,$host_alias,;t t
17645 s,@target_alias@,$target_alias,;t t
17646 s,@ECHO_C@,$ECHO_C,;t t
17647 s,@ECHO_N@,$ECHO_N,;t t
17648 s,@ECHO_T@,$ECHO_T,;t t
17649 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17650 s,@DEFS@,$DEFS,;t t
17651 s,@LIBS@,$LIBS,;t t
17652 s,@top_builddir@,$top_builddir,;t t
17653 s,@build@,$build,;t t
17654 s,@build_cpu@,$build_cpu,;t t
17655 s,@build_vendor@,$build_vendor,;t t
17656 s,@build_os@,$build_os,;t t
17657 s,@host@,$host,;t t
17658 s,@host_cpu@,$host_cpu,;t t
17659 s,@host_vendor@,$host_vendor,;t t
17660 s,@host_os@,$host_os,;t t
17661 s,@target@,$target,;t t
17662 s,@target_cpu@,$target_cpu,;t t
17663 s,@target_vendor@,$target_vendor,;t t
17664 s,@target_os@,$target_os,;t t
17665 s,@CC@,$CC,;t t
17666 s,@CFLAGS@,$CFLAGS,;t t
17667 s,@LDFLAGS@,$LDFLAGS,;t t
17668 s,@CPPFLAGS@,$CPPFLAGS,;t t
17669 s,@ac_ct_CC@,$ac_ct_CC,;t t
17670 s,@EXEEXT@,$EXEEXT,;t t
17671 s,@OBJEXT@,$OBJEXT,;t t
17672 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17673 s,@CPP@,$CPP,;t t
17674 s,@AWK@,$AWK,;t t
17675 s,@EGREP@,$EGREP,;t t
17676 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17677 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17678 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17679 s,@LN_S@,$LN_S,;t t
17680 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17681 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17682 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17683 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17684 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17685 s,@SET_MAKE@,$SET_MAKE,;t t
17686 s,@CTAGS@,$CTAGS,;t t
17687 s,@ETAGS@,$ETAGS,;t t
17688 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17689 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17690 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17691 s,@RANLIB@,$RANLIB,;t t
17692 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17693 s,@LD@,$LD,;t t
17694 s,@ac_ct_LD@,$ac_ct_LD,;t t
17695 s,@AR@,$AR,;t t
17696 s,@ac_ct_AR@,$ac_ct_AR,;t t
17697 s,@ARFLAGS@,$ARFLAGS,;t t
17698 s,@DESTDIR@,$DESTDIR,;t t
17699 s,@BUILD_CC@,$BUILD_CC,;t t
17700 s,@BUILD_CPP@,$BUILD_CPP,;t t
17701 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17702 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17703 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17704 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17705 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17706 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17707 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17708 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17709 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17710 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17711 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17712 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17713 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17714 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17715 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17716 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17717 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17718 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17719 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17720 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17721 s,@CC_G_OPT@,$CC_G_OPT,;t t
17722 s,@LD_MODEL@,$LD_MODEL,;t t
17723 s,@shlibdir@,$shlibdir,;t t
17724 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17725 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17726 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17727 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17728 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17729 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17730 s,@LINK_PROGS@,$LINK_PROGS,;t t
17731 s,@LINK_TESTS@,$LINK_TESTS,;t t
17732 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17733 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17734 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17735 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17736 s,@RPATH_LIST@,$RPATH_LIST,;t t
17737 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17738 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17739 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17740 s,@PTHREAD@,$PTHREAD,;t t
17741 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17742 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17743 s,@ECHO_LT@,$ECHO_LT,;t t
17744 s,@ECHO_LD@,$ECHO_LD,;t t
17745 s,@RULE_CC@,$RULE_CC,;t t
17746 s,@SHOW_CC@,$SHOW_CC,;t t
17747 s,@ECHO_CC@,$ECHO_CC,;t t
17748 s,@ADAFLAGS@,$ADAFLAGS,;t t
17749 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17750 s,@ADA_TRACE@,$ADA_TRACE,;t t
17751 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17752 s,@M4_exists@,$M4_exists,;t t
17753 s,@cf_ada_make@,$cf_ada_make,;t t
17754 s,@cf_ada_config@,$cf_ada_config,;t t
17755 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17756 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17757 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17758 s,@cf_compile_generics@,$cf_compile_generics,;t t
17759 s,@cf_generic_objects@,$cf_generic_objects,;t t
17760 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17761 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17762 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17763 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17764 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17765 s,@cf_ada_package@,$cf_ada_package,;t t
17766 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17767 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17768 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17769 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17770 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
17771 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17772 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17773 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17774 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17775 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17776 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17777 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17778 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17779 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17780 s,@TEST_ARG2@,$TEST_ARG2,;t t
17781 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17782 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17783 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17784 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17785 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17786 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17787 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17788 CEOF
17789
17790 EOF
17791
17792   cat >>$CONFIG_STATUS <<\EOF
17793   # Split the substitutions into bite-sized pieces for seds with
17794   # small command number limits, like on Digital OSF/1 and HP-UX.
17795   ac_max_sed_lines=48
17796   ac_sed_frag=1 # Number of current file.
17797   ac_beg=1 # First line for current file.
17798   ac_end=$ac_max_sed_lines # Line after last line for current file.
17799   ac_more_lines=:
17800   ac_sed_cmds=
17801   while $ac_more_lines; do
17802     if test $ac_beg -gt 1; then
17803       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17804     else
17805       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17806     fi
17807     if test ! -s $tmp/subs.frag; then
17808       ac_more_lines=false
17809     else
17810       # The purpose of the label and of the branching condition is to
17811       # speed up the sed processing (if there are no `@' at all, there
17812       # is no need to browse any of the substitutions).
17813       # These are the two extra sed commands mentioned above.
17814       (echo ':t
17815   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17816       # It is possible to make a multiline substitution using escaped newlines.
17817       # Ensure that we do not split the substitution between script fragments.
17818       ac_BEG=$ac_end
17819       ac_END=`expr $ac_end + $ac_max_sed_lines`
17820       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
17821       if test -s $tmp/subs.next; then
17822         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
17823         if test ! -s $tmp/subs.edit; then
17824           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
17825           if test ! -s $tmp/subs.edit; then
17826             if test $ac_beg -gt 1; then
17827               ac_end=`expr $ac_end - 1`
17828               continue
17829             fi
17830           fi
17831         fi
17832       fi
17833
17834       if test -z "$ac_sed_cmds"; then
17835         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17836       else
17837         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17838       fi
17839       ac_sed_frag=`expr $ac_sed_frag + 1`
17840       ac_beg=$ac_end
17841       ac_end=`expr $ac_end + $ac_max_sed_lines`
17842     fi
17843   done
17844   if test -z "$ac_sed_cmds"; then
17845     ac_sed_cmds=cat
17846   fi
17847 fi # test -n "$CONFIG_FILES"
17848
17849 EOF
17850 cat >>$CONFIG_STATUS <<\EOF
17851 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17852   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17853   case $ac_file in
17854   - | *:- | *:-:* ) # input from stdin
17855         cat >$tmp/stdin
17856         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17857         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17858   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17859         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17860   * )   ac_file_in=$ac_file.in ;;
17861   esac
17862
17863   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17864   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17865          X"$ac_file" : 'X\(//\)[^/]' \| \
17866          X"$ac_file" : 'X\(//\)$' \| \
17867          X"$ac_file" : 'X\(/\)' \| \
17868          .     : '\(.\)' 2>/dev/null ||
17869 echo X"$ac_file" |
17870     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17871           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17872           /^X\(\/\/\)$/{ s//\1/; q; }
17873           /^X\(\/\).*/{ s//\1/; q; }
17874           s/.*/./; q'`
17875   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17876     { case "$ac_dir" in
17877   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17878   *)                      as_incr_dir=.;;
17879 esac
17880 as_dummy="$ac_dir"
17881 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17882   case $as_mkdir_dir in
17883     # Skip DOS drivespec
17884     ?:) as_incr_dir=$as_mkdir_dir ;;
17885     *)
17886       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17887       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17888     ;;
17889   esac
17890 done; }
17891
17892     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17893     # A "../" for each directory in $ac_dir_suffix.
17894     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17895   else
17896     ac_dir_suffix= ac_dots=
17897   fi
17898
17899   case $srcdir in
17900   .)  ac_srcdir=.
17901       if test -z "$ac_dots"; then
17902          ac_top_srcdir=.
17903       else
17904          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17905       fi ;;
17906   [\\/]* | ?:[\\/]* )
17907       ac_srcdir=$srcdir$ac_dir_suffix;
17908       ac_top_srcdir=$srcdir ;;
17909   *) # Relative path.
17910     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17911     ac_top_srcdir=$ac_dots$srcdir ;;
17912   esac
17913
17914   case $INSTALL in
17915   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17916   *) ac_INSTALL=$ac_dots$INSTALL ;;
17917   esac
17918
17919   if test x"$ac_file" != x-; then
17920     { echo "$as_me:17920: creating $ac_file" >&5
17921 echo "$as_me: creating $ac_file" >&6;}
17922     rm -f "$ac_file"
17923   fi
17924   # Let's still pretend it is `configure' which instantiates (i.e., don't
17925   # use $as_me), people would be surprised to read:
17926   #    /* config.h.  Generated automatically by config.status.  */
17927   configure_input="Generated automatically from `echo $ac_file_in |
17928                                                  sed 's,.*/,,'` by configure."
17929
17930   # First look for the input files in the build tree, otherwise in the
17931   # src tree.
17932   ac_file_inputs=`IFS=:
17933     for f in $ac_file_in; do
17934       case $f in
17935       -) echo $tmp/stdin ;;
17936       [\\/$]*)
17937          # Absolute (can't be DOS-style, as IFS=:)
17938          test -f "$f" || { { echo "$as_me:17938: error: cannot find input file: $f" >&5
17939 echo "$as_me: error: cannot find input file: $f" >&2;}
17940    { (exit 1); exit 1; }; }
17941          echo $f;;
17942       *) # Relative
17943          if test -f "$f"; then
17944            # Build tree
17945            echo $f
17946          elif test -f "$srcdir/$f"; then
17947            # Source tree
17948            echo $srcdir/$f
17949          else
17950            # /dev/null tree
17951            { { echo "$as_me:17951: error: cannot find input file: $f" >&5
17952 echo "$as_me: error: cannot find input file: $f" >&2;}
17953    { (exit 1); exit 1; }; }
17954          fi;;
17955       esac
17956     done` || { (exit 1); exit 1; }
17957 EOF
17958 cat >>$CONFIG_STATUS <<\EOF
17959   ac_warn_datarootdir=no
17960   if test x"$ac_file" != x-; then
17961     for ac_item in $ac_file_inputs
17962     do
17963       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17964       if test -n "$ac_seen"; then
17965         ac_used=`grep '@datarootdir@' $ac_item`
17966         if test -z "$ac_used"; then
17967           { echo "$as_me:17967: WARNING: datarootdir was used implicitly but not set:
17968 $ac_seen" >&5
17969 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17970 $ac_seen" >&2;}
17971           ac_warn_datarootdir=yes
17972         fi
17973       fi
17974       ac_seen=`grep '${datarootdir}' $ac_item`
17975       if test -n "$ac_seen"; then
17976         { echo "$as_me:17976: WARNING: datarootdir was used explicitly but not set:
17977 $ac_seen" >&5
17978 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17979 $ac_seen" >&2;}
17980         ac_warn_datarootdir=yes
17981       fi
17982     done
17983   fi
17984
17985 if test "x$ac_warn_datarootdir" = xyes; then
17986   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17987 fi
17988
17989 EOF
17990 cat >>$CONFIG_STATUS <<EOF
17991   sed "$ac_vpsub
17992 $extrasub
17993 EOF
17994 cat >>$CONFIG_STATUS <<\EOF
17995 :t
17996 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17997 s,@configure_input@,$configure_input,;t t
17998 s,@srcdir@,$ac_srcdir,;t t
17999 s,@top_srcdir@,$ac_top_srcdir,;t t
18000 s,@INSTALL@,$ac_INSTALL,;t t
18001 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18002   rm -f $tmp/stdin
18003   if test x"$ac_file" != x-; then
18004     cp $tmp/out $ac_file
18005
18006     for ac_name in prefix exec_prefix datarootdir
18007     do
18008         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18009         if test -n "$ac_seen"; then
18010             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18011             if test -z "$ac_init"; then
18012               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18013               { echo "$as_me:18013: WARNING: Variable $ac_name is used but was not set:
18014 $ac_seen" >&5
18015 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18016 $ac_seen" >&2;}
18017             fi
18018         fi
18019     done
18020     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18021     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18022     if test -s $tmp/out; then
18023       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18024       { echo "$as_me:18024: WARNING: Some variables may not be substituted:
18025 $ac_seen" >&5
18026 echo "$as_me: WARNING: Some variables may not be substituted:
18027 $ac_seen" >&2;}
18028     fi
18029   else
18030     cat $tmp/out
18031   fi
18032   rm -f $tmp/out
18033
18034 done
18035 EOF
18036 cat >>$CONFIG_STATUS <<\EOF
18037
18038 #
18039 # CONFIG_HEADER section.
18040 #
18041
18042 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18043 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18044 #
18045 # ac_d sets the value in "#define NAME VALUE" lines.
18046 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18047 ac_dB='[        ].*$,\1#\2'
18048 ac_dC=' '
18049 ac_dD=',;t'
18050 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18051 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18052 ac_iB='\([      ]\),\1#\2define\3'
18053 ac_iC=' '
18054 ac_iD='\4,;t'
18055 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18056 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18057 ac_uB='$,\1#\2define\3'
18058 ac_uC=' '
18059 ac_uD=',;t'
18060
18061 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18062   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18063   case $ac_file in
18064   - | *:- | *:-:* ) # input from stdin
18065         cat >$tmp/stdin
18066         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18067         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18068   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18069         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18070   * )   ac_file_in=$ac_file.in ;;
18071   esac
18072
18073   test x"$ac_file" != x- && { echo "$as_me:18073: creating $ac_file" >&5
18074 echo "$as_me: creating $ac_file" >&6;}
18075
18076   # First look for the input files in the build tree, otherwise in the
18077   # src tree.
18078   ac_file_inputs=`IFS=:
18079     for f in $ac_file_in; do
18080       case $f in
18081       -) echo $tmp/stdin ;;
18082       [\\/$]*)
18083          # Absolute (can't be DOS-style, as IFS=:)
18084          test -f "$f" || { { echo "$as_me:18084: error: cannot find input file: $f" >&5
18085 echo "$as_me: error: cannot find input file: $f" >&2;}
18086    { (exit 1); exit 1; }; }
18087          echo $f;;
18088       *) # Relative
18089          if test -f "$f"; then
18090            # Build tree
18091            echo $f
18092          elif test -f "$srcdir/$f"; then
18093            # Source tree
18094            echo $srcdir/$f
18095          else
18096            # /dev/null tree
18097            { { echo "$as_me:18097: error: cannot find input file: $f" >&5
18098 echo "$as_me: error: cannot find input file: $f" >&2;}
18099    { (exit 1); exit 1; }; }
18100          fi;;
18101       esac
18102     done` || { (exit 1); exit 1; }
18103   # Remove the trailing spaces.
18104   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18105
18106 EOF
18107
18108 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18109 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18110 # be either 'cat' or 'sort'.
18111 cat confdefs.h | uniq >conftest.vals
18112
18113 # Break up conftest.vals because some shells have a limit on
18114 # the size of here documents, and old seds have small limits too.
18115
18116 rm -f conftest.tail
18117 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18118 while grep . conftest.vals >/dev/null
18119 do
18120   # Write chunks of a limited-size here document to conftest.frag.
18121   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18122   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18123   echo 'CEOF' >> $CONFIG_STATUS
18124   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18125   rm -f conftest.vals
18126   mv conftest.tail conftest.vals
18127 done
18128 rm -f conftest.vals
18129
18130 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18131 # marker @DEFS@.
18132 echo '  cat >> conftest.edit <<CEOF
18133 /@DEFS@/r conftest.frag
18134 /@DEFS@/d
18135 CEOF
18136 sed -f conftest.edit $tmp/in > $tmp/out
18137 rm -f $tmp/in
18138 mv $tmp/out $tmp/in
18139 rm -f conftest.edit conftest.frag
18140 ' >> $CONFIG_STATUS
18141
18142 cat >>$CONFIG_STATUS <<\EOF
18143   # Let's still pretend it is `configure' which instantiates (i.e., don't
18144   # use $as_me), people would be surprised to read:
18145   #    /* config.h.  Generated automatically by config.status.  */
18146   if test x"$ac_file" = x-; then
18147     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18148   else
18149     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18150   fi
18151   cat $tmp/in >>$tmp/config.h
18152   rm -f $tmp/in
18153   if test x"$ac_file" != x-; then
18154     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18155       { echo "$as_me:18155: $ac_file is unchanged" >&5
18156 echo "$as_me: $ac_file is unchanged" >&6;}
18157     else
18158       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18159          X"$ac_file" : 'X\(//\)[^/]' \| \
18160          X"$ac_file" : 'X\(//\)$' \| \
18161          X"$ac_file" : 'X\(/\)' \| \
18162          .     : '\(.\)' 2>/dev/null ||
18163 echo X"$ac_file" |
18164     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18165           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18166           /^X\(\/\/\)$/{ s//\1/; q; }
18167           /^X\(\/\).*/{ s//\1/; q; }
18168           s/.*/./; q'`
18169       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18170         { case "$ac_dir" in
18171   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18172   *)                      as_incr_dir=.;;
18173 esac
18174 as_dummy="$ac_dir"
18175 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18176   case $as_mkdir_dir in
18177     # Skip DOS drivespec
18178     ?:) as_incr_dir=$as_mkdir_dir ;;
18179     *)
18180       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18181       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18182     ;;
18183   esac
18184 done; }
18185
18186       fi
18187       rm -f $ac_file
18188       mv $tmp/config.h $ac_file
18189     fi
18190   else
18191     cat $tmp/config.h
18192     rm -f $tmp/config.h
18193   fi
18194 done
18195 EOF
18196 cat >>$CONFIG_STATUS <<\EOF
18197 #
18198 # CONFIG_COMMANDS section.
18199 #
18200 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18201   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18202   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18203
18204   case $ac_dest in
18205     default )
18206 if test -z "$USE_OLD_MAKERULES" ; then
18207         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18208 fi
18209  ;;
18210   esac
18211 done
18212 EOF
18213
18214 cat >>$CONFIG_STATUS <<\EOF
18215
18216 { (exit 0); exit 0; }
18217 EOF
18218 chmod +x $CONFIG_STATUS
18219 ac_clean_files=$ac_clean_files_save
18220
18221 # configure is writing to config.log, and then calls config.status.
18222 # config.status does its own redirection, appending to config.log.
18223 # Unfortunately, on DOS this fails, as config.log is still kept open
18224 # by configure, so config.status won't be able to write to it; its
18225 # output is simply discarded.  So we exec the FD to /dev/null,
18226 # effectively closing config.log, so it can be properly (re)opened and
18227 # appended to by config.status.  When coming back to configure, we
18228 # need to make the FD available again.
18229 if test "$no_create" != yes; then
18230   ac_cs_success=:
18231   exec 5>/dev/null
18232   $SHELL $CONFIG_STATUS || ac_cs_success=false
18233   exec 5>>config.log
18234   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18235   # would make configure fail if this is the last instruction.
18236   $ac_cs_success || { (exit 1); exit 1; }
18237 fi
18238 ${MAKE:-make} preinstall