]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
03e8fda6fd18c6962ed0247ebc91d30b7ab60dd7
[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_CPPFLAGS="$CPPFLAGS"
4155                 cf_save_LIBS="$LIBS"
4156
4157 cf_fix_cppflags=no
4158 cf_new_cflags=
4159 cf_new_cppflags=
4160 cf_new_extra_cppflags=
4161
4162 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
4163 do
4164 case $cf_fix_cppflags in
4165 (no)
4166         case $cf_add_cflags in
4167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4168                 case $cf_add_cflags in
4169                 (-D*)
4170                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4171
4172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4173                                 && test -z "${cf_tst_cflags}" \
4174                                 && cf_fix_cppflags=yes
4175
4176                         if test $cf_fix_cppflags = yes ; then
4177
4178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4180
4181                                 continue
4182                         elif test "${cf_tst_cflags}" = "\"'" ; then
4183
4184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4186
4187                                 continue
4188                         fi
4189                         ;;
4190                 esac
4191                 case "$CPPFLAGS" in
4192                 (*$cf_add_cflags)
4193                         ;;
4194                 (*)
4195                         case $cf_add_cflags in
4196                         (-D*)
4197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4198
4199 CPPFLAGS=`echo "$CPPFLAGS" | \
4200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4202
4203                                 ;;
4204                         esac
4205
4206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4208
4209                         ;;
4210                 esac
4211                 ;;
4212         (*)
4213
4214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4216
4217                 ;;
4218         esac
4219         ;;
4220 (yes)
4221
4222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4224
4225         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4226
4227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4228                 && test -z "${cf_tst_cflags}" \
4229                 && cf_fix_cppflags=no
4230         ;;
4231 esac
4232 done
4233
4234 if test -n "$cf_new_cflags" ; then
4235
4236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4237         CFLAGS="${CFLAGS}$cf_new_cflags"
4238
4239 fi
4240
4241 if test -n "$cf_new_cppflags" ; then
4242
4243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4245
4246 fi
4247
4248 if test -n "$cf_new_extra_cppflags" ; then
4249
4250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4252
4253 fi
4254
4255 cf_add_libs="$LIBS"
4256 # reverse order
4257 cf_add_0lib=
4258 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4259 # filter duplicates
4260 for cf_add_1lib in $cf_add_0lib; do
4261         for cf_add_2lib in $cf_add_libs; do
4262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4263                         cf_add_1lib=
4264                         break
4265                 fi
4266         done
4267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4268 done
4269 LIBS="$cf_add_libs"
4270
4271                 cat >conftest.$ac_ext <<_ACEOF
4272 #line 4272 "configure"
4273 #include "confdefs.h"
4274 #include <${cf_cv_ncurses_header:-curses.h}>
4275 int
4276 main (void)
4277 {
4278 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4279   ;
4280   return 0;
4281 }
4282 _ACEOF
4283 rm -f conftest.$ac_objext conftest$ac_exeext
4284 if { (eval echo "$as_me:4284: \"$ac_link\"") >&5
4285   (eval $ac_link) 2>&5
4286   ac_status=$?
4287   echo "$as_me:4287: \$? = $ac_status" >&5
4288   (exit $ac_status); } &&
4289          { ac_try='test -s conftest$ac_exeext'
4290   { (eval echo "$as_me:4290: \"$ac_try\"") >&5
4291   (eval $ac_try) 2>&5
4292   ac_status=$?
4293   echo "$as_me:4293: \$? = $ac_status" >&5
4294   (exit $ac_status); }; }; then
4295   if test "$cross_compiling" = yes; then
4296   cf_have_ncuconfig=maybe
4297 else
4298   cat >conftest.$ac_ext <<_ACEOF
4299 #line 4299 "configure"
4300 #include "confdefs.h"
4301 #include <${cf_cv_ncurses_header:-curses.h}>
4302                                 int main(void)
4303                                 { char *xx = curses_version(); return (xx == 0); }
4304 _ACEOF
4305 rm -f conftest$ac_exeext
4306 if { (eval echo "$as_me:4306: \"$ac_link\"") >&5
4307   (eval $ac_link) 2>&5
4308   ac_status=$?
4309   echo "$as_me:4309: \$? = $ac_status" >&5
4310   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4311   { (eval echo "$as_me:4311: \"$ac_try\"") >&5
4312   (eval $ac_try) 2>&5
4313   ac_status=$?
4314   echo "$as_me:4314: \$? = $ac_status" >&5
4315   (exit $ac_status); }; }; then
4316   cf_have_ncuconfig=yes
4317 else
4318   echo "$as_me: program exited with status $ac_status" >&5
4319 echo "$as_me: failed program was:" >&5
4320 cat conftest.$ac_ext >&5
4321 cf_have_ncuconfig=no
4322 fi
4323 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4324 fi
4325 else
4326   echo "$as_me: failed program was:" >&5
4327 cat conftest.$ac_ext >&5
4328 cf_have_ncuconfig=no
4329 fi
4330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4331                 echo "$as_me:4331: result: $cf_have_ncuconfig" >&5
4332 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4333                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4334                 if test "$cf_have_ncuconfig" != "yes"
4335                 then
4336                         CPPFLAGS="$cf_save_CPPFLAGS"
4337                         LIBS="$cf_save_LIBS"
4338                         NCURSES_CONFIG_PKG=none
4339                 else
4340
4341 cat >>confdefs.h <<\EOF
4342 #define NCURSES 1
4343 EOF
4344
4345                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4346
4347 echo "$as_me:4347: checking for terminfo header" >&5
4348 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4349 if test "${cf_cv_term_header+set}" = set; then
4350   echo $ECHO_N "(cached) $ECHO_C" >&6
4351 else
4352
4353 case ${cf_cv_ncurses_header} in
4354 (*/ncurses.h|*/ncursesw.h)
4355         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4356         ;;
4357 (*)
4358         cf_term_header=term.h
4359         ;;
4360 esac
4361
4362 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4363 do
4364 cat >conftest.$ac_ext <<_ACEOF
4365 #line 4365 "configure"
4366 #include "confdefs.h"
4367 #include <stdio.h>
4368 #include <${cf_cv_ncurses_header:-curses.h}>
4369 #include <$cf_test>
4370
4371 int
4372 main (void)
4373 {
4374 int x = auto_left_margin
4375   ;
4376   return 0;
4377 }
4378 _ACEOF
4379 rm -f conftest.$ac_objext
4380 if { (eval echo "$as_me:4380: \"$ac_compile\"") >&5
4381   (eval $ac_compile) 2>&5
4382   ac_status=$?
4383   echo "$as_me:4383: \$? = $ac_status" >&5
4384   (exit $ac_status); } &&
4385          { ac_try='test -s conftest.$ac_objext'
4386   { (eval echo "$as_me:4386: \"$ac_try\"") >&5
4387   (eval $ac_try) 2>&5
4388   ac_status=$?
4389   echo "$as_me:4389: \$? = $ac_status" >&5
4390   (exit $ac_status); }; }; then
4391
4392         cf_cv_term_header="$cf_test"
4393 else
4394   echo "$as_me: failed program was:" >&5
4395 cat conftest.$ac_ext >&5
4396
4397         cf_cv_term_header=unknown
4398
4399 fi
4400 rm -f conftest.$ac_objext conftest.$ac_ext
4401         test "$cf_cv_term_header" != unknown && break
4402 done
4403
4404 fi
4405 echo "$as_me:4405: result: $cf_cv_term_header" >&5
4406 echo "${ECHO_T}$cf_cv_term_header" >&6
4407
4408 # Set definitions to allow ifdef'ing to accommodate subdirectories
4409
4410 case $cf_cv_term_header in
4411 (*term.h)
4412
4413 cat >>confdefs.h <<\EOF
4414 #define HAVE_TERM_H 1
4415 EOF
4416
4417         ;;
4418 esac
4419
4420 case $cf_cv_term_header in
4421 (ncurses/term.h)
4422
4423 cat >>confdefs.h <<\EOF
4424 #define HAVE_NCURSES_TERM_H 1
4425 EOF
4426
4427         ;;
4428 (ncursesw/term.h)
4429
4430 cat >>confdefs.h <<\EOF
4431 #define HAVE_NCURSESW_TERM_H 1
4432 EOF
4433
4434         ;;
4435 esac
4436
4437                 fi
4438
4439         else
4440                 echo "$as_me:4440: result: no" >&5
4441 echo "${ECHO_T}no" >&6
4442                 NCURSES_CONFIG_PKG=none
4443         fi
4444 else
4445         NCURSES_CONFIG_PKG=none
4446 fi
4447
4448 if test "x$cf_have_ncuconfig" = "xno"; then
4449         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4450
4451 if test -n "$ac_tool_prefix"; then
4452   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4453   do
4454     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4455 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4456 echo "$as_me:4456: checking for $ac_word" >&5
4457 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4458 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4459   echo $ECHO_N "(cached) $ECHO_C" >&6
4460 else
4461   if test -n "$NCURSES_CONFIG"; then
4462   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4463 else
4464   ac_save_IFS=$IFS; IFS=$ac_path_separator
4465 ac_dummy="$PATH"
4466 for ac_dir in $ac_dummy; do
4467   IFS=$ac_save_IFS
4468   test -z "$ac_dir" && ac_dir=.
4469   $as_executable_p "$ac_dir/$ac_word" || continue
4470 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4471 echo "$as_me:4471: found $ac_dir/$ac_word" >&5
4472 break
4473 done
4474
4475 fi
4476 fi
4477 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4478 if test -n "$NCURSES_CONFIG"; then
4479   echo "$as_me:4479: result: $NCURSES_CONFIG" >&5
4480 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4481 else
4482   echo "$as_me:4482: result: no" >&5
4483 echo "${ECHO_T}no" >&6
4484 fi
4485
4486     test -n "$NCURSES_CONFIG" && break
4487   done
4488 fi
4489 if test -z "$NCURSES_CONFIG"; then
4490   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4491   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4492 do
4493   # Extract the first word of "$ac_prog", so it can be a program name with args.
4494 set dummy $ac_prog; ac_word=$2
4495 echo "$as_me:4495: checking for $ac_word" >&5
4496 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4497 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4498   echo $ECHO_N "(cached) $ECHO_C" >&6
4499 else
4500   if test -n "$ac_ct_NCURSES_CONFIG"; then
4501   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4502 else
4503   ac_save_IFS=$IFS; IFS=$ac_path_separator
4504 ac_dummy="$PATH"
4505 for ac_dir in $ac_dummy; do
4506   IFS=$ac_save_IFS
4507   test -z "$ac_dir" && ac_dir=.
4508   $as_executable_p "$ac_dir/$ac_word" || continue
4509 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4510 echo "$as_me:4510: found $ac_dir/$ac_word" >&5
4511 break
4512 done
4513
4514 fi
4515 fi
4516 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4517 if test -n "$ac_ct_NCURSES_CONFIG"; then
4518   echo "$as_me:4518: result: $ac_ct_NCURSES_CONFIG" >&5
4519 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4520 else
4521   echo "$as_me:4521: result: no" >&5
4522 echo "${ECHO_T}no" >&6
4523 fi
4524
4525   test -n "$ac_ct_NCURSES_CONFIG" && break
4526 done
4527 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4528
4529   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4530 fi
4531
4532         if test "$NCURSES_CONFIG" != none ; then
4533
4534 cf_fix_cppflags=no
4535 cf_new_cflags=
4536 cf_new_cppflags=
4537 cf_new_extra_cppflags=
4538
4539 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4540 do
4541 case $cf_fix_cppflags in
4542 (no)
4543         case $cf_add_cflags in
4544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4545                 case $cf_add_cflags in
4546                 (-D*)
4547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4548
4549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4550                                 && test -z "${cf_tst_cflags}" \
4551                                 && cf_fix_cppflags=yes
4552
4553                         if test $cf_fix_cppflags = yes ; then
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558                                 continue
4559                         elif test "${cf_tst_cflags}" = "\"'" ; then
4560
4561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4563
4564                                 continue
4565                         fi
4566                         ;;
4567                 esac
4568                 case "$CPPFLAGS" in
4569                 (*$cf_add_cflags)
4570                         ;;
4571                 (*)
4572                         case $cf_add_cflags in
4573                         (-D*)
4574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4575
4576 CPPFLAGS=`echo "$CPPFLAGS" | \
4577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4579
4580                                 ;;
4581                         esac
4582
4583         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4584         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4585
4586                         ;;
4587                 esac
4588                 ;;
4589         (*)
4590
4591         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4592         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4593
4594                 ;;
4595         esac
4596         ;;
4597 (yes)
4598
4599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4601
4602         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4603
4604         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4605                 && test -z "${cf_tst_cflags}" \
4606                 && cf_fix_cppflags=no
4607         ;;
4608 esac
4609 done
4610
4611 if test -n "$cf_new_cflags" ; then
4612
4613         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4614         CFLAGS="${CFLAGS}$cf_new_cflags"
4615
4616 fi
4617
4618 if test -n "$cf_new_cppflags" ; then
4619
4620         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4621         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4622
4623 fi
4624
4625 if test -n "$cf_new_extra_cppflags" ; then
4626
4627         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4628         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4629
4630 fi
4631
4632 cf_add_libs="$LIBS"
4633 # reverse order
4634 cf_add_0lib=
4635 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4636 # filter duplicates
4637 for cf_add_1lib in $cf_add_0lib; do
4638         for cf_add_2lib in $cf_add_libs; do
4639                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4640                         cf_add_1lib=
4641                         break
4642                 fi
4643         done
4644         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4645 done
4646 LIBS="$cf_add_libs"
4647
4648                 # even with config script, some packages use no-override for curses.h
4649
4650 echo "$as_me:4650: checking if we have identified curses headers" >&5
4651 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4652 if test "${cf_cv_ncurses_header+set}" = set; then
4653   echo $ECHO_N "(cached) $ECHO_C" >&6
4654 else
4655
4656 cf_cv_ncurses_header=none
4657 for cf_header in \
4658         ncurses.h ncurses/ncurses.h \
4659         curses.h ncurses/curses.h
4660 do
4661 cat >conftest.$ac_ext <<_ACEOF
4662 #line 4662 "configure"
4663 #include "confdefs.h"
4664 #include <${cf_header}>
4665 int
4666 main (void)
4667 {
4668 initscr(); tgoto("?", 0,0)
4669   ;
4670   return 0;
4671 }
4672 _ACEOF
4673 rm -f conftest.$ac_objext
4674 if { (eval echo "$as_me:4674: \"$ac_compile\"") >&5
4675   (eval $ac_compile) 2>&5
4676   ac_status=$?
4677   echo "$as_me:4677: \$? = $ac_status" >&5
4678   (exit $ac_status); } &&
4679          { ac_try='test -s conftest.$ac_objext'
4680   { (eval echo "$as_me:4680: \"$ac_try\"") >&5
4681   (eval $ac_try) 2>&5
4682   ac_status=$?
4683   echo "$as_me:4683: \$? = $ac_status" >&5
4684   (exit $ac_status); }; }; then
4685   cf_cv_ncurses_header=$cf_header; break
4686 else
4687   echo "$as_me: failed program was:" >&5
4688 cat conftest.$ac_ext >&5
4689 fi
4690 rm -f conftest.$ac_objext conftest.$ac_ext
4691 done
4692
4693 fi
4694 echo "$as_me:4694: result: $cf_cv_ncurses_header" >&5
4695 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4696
4697 if test "$cf_cv_ncurses_header" = none ; then
4698         { { echo "$as_me:4698: error: No curses header-files found" >&5
4699 echo "$as_me: error: No curses header-files found" >&2;}
4700    { (exit 1); exit 1; }; }
4701 fi
4702
4703 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4704
4705 for ac_header in $cf_cv_ncurses_header
4706 do
4707 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4708 echo "$as_me:4708: checking for $ac_header" >&5
4709 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4710 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4711   echo $ECHO_N "(cached) $ECHO_C" >&6
4712 else
4713   cat >conftest.$ac_ext <<_ACEOF
4714 #line 4714 "configure"
4715 #include "confdefs.h"
4716 #include <$ac_header>
4717 _ACEOF
4718 if { (eval echo "$as_me:4718: \"$ac_cpp conftest.$ac_ext\"") >&5
4719   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4720   ac_status=$?
4721   egrep -v '^ *\+' conftest.er1 >conftest.err
4722   rm -f conftest.er1
4723   cat conftest.err >&5
4724   echo "$as_me:4724: \$? = $ac_status" >&5
4725   (exit $ac_status); } >/dev/null; then
4726   if test -s conftest.err; then
4727     ac_cpp_err=$ac_c_preproc_warn_flag
4728   else
4729     ac_cpp_err=
4730   fi
4731 else
4732   ac_cpp_err=yes
4733 fi
4734 if test -z "$ac_cpp_err"; then
4735   eval "$as_ac_Header=yes"
4736 else
4737   echo "$as_me: failed program was:" >&5
4738   cat conftest.$ac_ext >&5
4739   eval "$as_ac_Header=no"
4740 fi
4741 rm -f conftest.err conftest.$ac_ext
4742 fi
4743 echo "$as_me:4743: result: `eval echo '${'$as_ac_Header'}'`" >&5
4744 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4745 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4746   cat >>confdefs.h <<EOF
4747 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4748 EOF
4749
4750 fi
4751 done
4752
4753 cat >>confdefs.h <<\EOF
4754 #define NCURSES 1
4755 EOF
4756
4757 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4758
4759                 cat >>confdefs.h <<EOF
4760 #define $cf_nculib_ROOT 1
4761 EOF
4762
4763                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4764
4765         else
4766
4767 cf_ncuhdr_root=ncurses
4768
4769 test -n "$cf_cv_curses_dir" && \
4770 test "$cf_cv_curses_dir" != "no" && { \
4771
4772 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4773   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4774   do
4775         while test $cf_add_incdir != /usr/include
4776         do
4777           if test -d $cf_add_incdir
4778           then
4779                 cf_have_incdir=no
4780                 if test -n "$CFLAGS$CPPFLAGS" ; then
4781                   # a loop is needed to ensure we can add subdirs of existing dirs
4782                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4783                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4784                           cf_have_incdir=yes; break
4785                         fi
4786                   done
4787                 fi
4788
4789                 if test "$cf_have_incdir" = no ; then
4790                   if test "$cf_add_incdir" = /usr/local/include ; then
4791                         if test "$GCC" = yes
4792                         then
4793                           cf_save_CPPFLAGS=$CPPFLAGS
4794
4795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4796         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4797
4798                           cat >conftest.$ac_ext <<_ACEOF
4799 #line 4799 "configure"
4800 #include "confdefs.h"
4801 #include <stdio.h>
4802 int
4803 main (void)
4804 {
4805 printf("Hello")
4806   ;
4807   return 0;
4808 }
4809 _ACEOF
4810 rm -f conftest.$ac_objext
4811 if { (eval echo "$as_me:4811: \"$ac_compile\"") >&5
4812   (eval $ac_compile) 2>&5
4813   ac_status=$?
4814   echo "$as_me:4814: \$? = $ac_status" >&5
4815   (exit $ac_status); } &&
4816          { ac_try='test -s conftest.$ac_objext'
4817   { (eval echo "$as_me:4817: \"$ac_try\"") >&5
4818   (eval $ac_try) 2>&5
4819   ac_status=$?
4820   echo "$as_me:4820: \$? = $ac_status" >&5
4821   (exit $ac_status); }; }; then
4822   :
4823 else
4824   echo "$as_me: failed program was:" >&5
4825 cat conftest.$ac_ext >&5
4826 cf_have_incdir=yes
4827 fi
4828 rm -f conftest.$ac_objext conftest.$ac_ext
4829                           CPPFLAGS=$cf_save_CPPFLAGS
4830                         fi
4831                   fi
4832                 fi
4833
4834                 if test "$cf_have_incdir" = no ; then
4835                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4836
4837 echo "${as_me:-configure}:4837: testing adding $cf_add_incdir to include-path ..." 1>&5
4838
4839                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4840
4841                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4842                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4843                   cf_add_incdir="$cf_top_incdir"
4844                 else
4845                   break
4846                 fi
4847           else
4848                 break
4849           fi
4850         done
4851   done
4852 fi
4853
4854 }
4855
4856 echo "$as_me:4856: checking for $cf_ncuhdr_root header in include-path" >&5
4857 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4858 if test "${cf_cv_ncurses_h+set}" = set; then
4859   echo $ECHO_N "(cached) $ECHO_C" >&6
4860 else
4861
4862         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4863         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4864         for cf_header in $cf_header_list
4865         do
4866
4867         cat >conftest.$ac_ext <<_ACEOF
4868 #line 4868 "configure"
4869 #include "confdefs.h"
4870
4871 #include <$cf_header>
4872 int
4873 main (void)
4874 {
4875
4876 #ifdef NCURSES_VERSION
4877
4878 printf("%s\n", NCURSES_VERSION);
4879 #else
4880 #ifdef __NCURSES_H
4881 printf("old\n");
4882 #else
4883         make an error
4884 #endif
4885 #endif
4886
4887   ;
4888   return 0;
4889 }
4890 _ACEOF
4891 rm -f conftest.$ac_objext
4892 if { (eval echo "$as_me:4892: \"$ac_compile\"") >&5
4893   (eval $ac_compile) 2>&5
4894   ac_status=$?
4895   echo "$as_me:4895: \$? = $ac_status" >&5
4896   (exit $ac_status); } &&
4897          { ac_try='test -s conftest.$ac_objext'
4898   { (eval echo "$as_me:4898: \"$ac_try\"") >&5
4899   (eval $ac_try) 2>&5
4900   ac_status=$?
4901   echo "$as_me:4901: \$? = $ac_status" >&5
4902   (exit $ac_status); }; }; then
4903   cf_cv_ncurses_h=$cf_header
4904
4905 else
4906   echo "$as_me: failed program was:" >&5
4907 cat conftest.$ac_ext >&5
4908 cf_cv_ncurses_h=no
4909 fi
4910 rm -f conftest.$ac_objext conftest.$ac_ext
4911
4912                 test "$cf_cv_ncurses_h" != no && break
4913         done
4914
4915 fi
4916 echo "$as_me:4916: result: $cf_cv_ncurses_h" >&5
4917 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4918
4919 if test "$cf_cv_ncurses_h" != no ; then
4920         cf_cv_ncurses_header=$cf_cv_ncurses_h
4921 else
4922
4923 echo "$as_me:4923: checking for $cf_ncuhdr_root include-path" >&5
4924 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4925 if test "${cf_cv_ncurses_h2+set}" = set; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928
4929         test -n "$verbose" && echo
4930
4931 cf_search=
4932
4933 # collect the current set of include-directories from compiler flags
4934 cf_header_path_list=""
4935 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4936         for cf_header_path in $CPPFLAGS $CFLAGS
4937         do
4938                 case $cf_header_path in
4939                 (-I*)
4940                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4941
4942 test "x$cf_header_path" != "xNONE" && \
4943 test -d "$cf_header_path" && \
4944  {
4945         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4946         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4947         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4948         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4949         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4950         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4951 }
4952
4953                         cf_header_path_list="$cf_header_path_list $cf_search"
4954                         ;;
4955                 esac
4956         done
4957 fi
4958
4959 # add the variations for the package we are looking for
4960
4961 cf_search=
4962
4963 test "x$prefix" != "xNONE" && \
4964 test -d "$prefix" && \
4965  {
4966         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4967         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4968         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4969         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4970         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4971         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4972 }
4973
4974 for cf_subdir_prefix in \
4975         /usr \
4976         /usr/local \
4977         /usr/pkg \
4978         /opt \
4979         /opt/local \
4980         $HOME
4981 do
4982
4983 test "x$cf_subdir_prefix" != "x$prefix" && \
4984 test -d "$cf_subdir_prefix" && \
4985 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4986         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4987         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4988         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4989         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4990         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4991         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4992 }
4993
4994 done
4995
4996 test "$includedir" != NONE && \
4997 test "$includedir" != "/usr/include" && \
4998 test -d "$includedir" && {
4999         test -d $includedir &&    cf_search="$cf_search $includedir"
5000         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5001 }
5002
5003 test "$oldincludedir" != NONE && \
5004 test "$oldincludedir" != "/usr/include" && \
5005 test -d "$oldincludedir" && {
5006         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5007         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5008 }
5009
5010 cf_search="$cf_search $cf_header_path_list"
5011
5012         test -n "$verbose" && echo search path $cf_search
5013         cf_save2_CPPFLAGS="$CPPFLAGS"
5014         for cf_incdir in $cf_search
5015         do
5016
5017 if test -n "$cf_incdir" ; then
5018   for cf_add_incdir in $cf_incdir
5019   do
5020         while test $cf_add_incdir != /usr/include
5021         do
5022           if test -d $cf_add_incdir
5023           then
5024                 cf_have_incdir=no
5025                 if test -n "$CFLAGS$CPPFLAGS" ; then
5026                   # a loop is needed to ensure we can add subdirs of existing dirs
5027                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5028                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5029                           cf_have_incdir=yes; break
5030                         fi
5031                   done
5032                 fi
5033
5034                 if test "$cf_have_incdir" = no ; then
5035                   if test "$cf_add_incdir" = /usr/local/include ; then
5036                         if test "$GCC" = yes
5037                         then
5038                           cf_save_CPPFLAGS=$CPPFLAGS
5039
5040         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5041         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5042
5043                           cat >conftest.$ac_ext <<_ACEOF
5044 #line 5044 "configure"
5045 #include "confdefs.h"
5046 #include <stdio.h>
5047 int
5048 main (void)
5049 {
5050 printf("Hello")
5051   ;
5052   return 0;
5053 }
5054 _ACEOF
5055 rm -f conftest.$ac_objext
5056 if { (eval echo "$as_me:5056: \"$ac_compile\"") >&5
5057   (eval $ac_compile) 2>&5
5058   ac_status=$?
5059   echo "$as_me:5059: \$? = $ac_status" >&5
5060   (exit $ac_status); } &&
5061          { ac_try='test -s conftest.$ac_objext'
5062   { (eval echo "$as_me:5062: \"$ac_try\"") >&5
5063   (eval $ac_try) 2>&5
5064   ac_status=$?
5065   echo "$as_me:5065: \$? = $ac_status" >&5
5066   (exit $ac_status); }; }; then
5067   :
5068 else
5069   echo "$as_me: failed program was:" >&5
5070 cat conftest.$ac_ext >&5
5071 cf_have_incdir=yes
5072 fi
5073 rm -f conftest.$ac_objext conftest.$ac_ext
5074                           CPPFLAGS=$cf_save_CPPFLAGS
5075                         fi
5076                   fi
5077                 fi
5078
5079                 if test "$cf_have_incdir" = no ; then
5080                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5081
5082 echo "${as_me:-configure}:5082: testing adding $cf_add_incdir to include-path ..." 1>&5
5083
5084                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5085
5086                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5087                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5088                   cf_add_incdir="$cf_top_incdir"
5089                 else
5090                   break
5091                 fi
5092           else
5093                 break
5094           fi
5095         done
5096   done
5097 fi
5098
5099                 for cf_header in \
5100                         ncurses.h \
5101                         curses.h
5102                 do
5103
5104         cat >conftest.$ac_ext <<_ACEOF
5105 #line 5105 "configure"
5106 #include "confdefs.h"
5107
5108 #include <$cf_header>
5109 int
5110 main (void)
5111 {
5112
5113 #ifdef NCURSES_VERSION
5114
5115 printf("%s\n", NCURSES_VERSION);
5116 #else
5117 #ifdef __NCURSES_H
5118 printf("old\n");
5119 #else
5120         make an error
5121 #endif
5122 #endif
5123
5124   ;
5125   return 0;
5126 }
5127 _ACEOF
5128 rm -f conftest.$ac_objext
5129 if { (eval echo "$as_me:5129: \"$ac_compile\"") >&5
5130   (eval $ac_compile) 2>&5
5131   ac_status=$?
5132   echo "$as_me:5132: \$? = $ac_status" >&5
5133   (exit $ac_status); } &&
5134          { ac_try='test -s conftest.$ac_objext'
5135   { (eval echo "$as_me:5135: \"$ac_try\"") >&5
5136   (eval $ac_try) 2>&5
5137   ac_status=$?
5138   echo "$as_me:5138: \$? = $ac_status" >&5
5139   (exit $ac_status); }; }; then
5140   cf_cv_ncurses_h2=$cf_header
5141
5142 else
5143   echo "$as_me: failed program was:" >&5
5144 cat conftest.$ac_ext >&5
5145 cf_cv_ncurses_h2=no
5146 fi
5147 rm -f conftest.$ac_objext conftest.$ac_ext
5148
5149                         if test "$cf_cv_ncurses_h2" != no ; then
5150                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5151                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5152                                 break
5153                         fi
5154                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5155                 done
5156                 CPPFLAGS="$cf_save2_CPPFLAGS"
5157                 test "$cf_cv_ncurses_h2" != no && break
5158         done
5159         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5159: error: not found" >&5
5160 echo "$as_me: error: not found" >&2;}
5161    { (exit 1); exit 1; }; }
5162
5163 fi
5164 echo "$as_me:5164: result: $cf_cv_ncurses_h2" >&5
5165 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5166
5167         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5168         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5169         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5170                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5171         fi
5172
5173 if test -n "$cf_1st_incdir" ; then
5174   for cf_add_incdir in $cf_1st_incdir
5175   do
5176         while test $cf_add_incdir != /usr/include
5177         do
5178           if test -d $cf_add_incdir
5179           then
5180                 cf_have_incdir=no
5181                 if test -n "$CFLAGS$CPPFLAGS" ; then
5182                   # a loop is needed to ensure we can add subdirs of existing dirs
5183                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5184                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5185                           cf_have_incdir=yes; break
5186                         fi
5187                   done
5188                 fi
5189
5190                 if test "$cf_have_incdir" = no ; then
5191                   if test "$cf_add_incdir" = /usr/local/include ; then
5192                         if test "$GCC" = yes
5193                         then
5194                           cf_save_CPPFLAGS=$CPPFLAGS
5195
5196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5197         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5198
5199                           cat >conftest.$ac_ext <<_ACEOF
5200 #line 5200 "configure"
5201 #include "confdefs.h"
5202 #include <stdio.h>
5203 int
5204 main (void)
5205 {
5206 printf("Hello")
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext
5212 if { (eval echo "$as_me:5212: \"$ac_compile\"") >&5
5213   (eval $ac_compile) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest.$ac_objext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   :
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 cf_have_incdir=yes
5228 fi
5229 rm -f conftest.$ac_objext conftest.$ac_ext
5230                           CPPFLAGS=$cf_save_CPPFLAGS
5231                         fi
5232                   fi
5233                 fi
5234
5235                 if test "$cf_have_incdir" = no ; then
5236                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5237
5238 echo "${as_me:-configure}:5238: testing adding $cf_add_incdir to include-path ..." 1>&5
5239
5240                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5241
5242                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5243                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5244                   cf_add_incdir="$cf_top_incdir"
5245                 else
5246                   break
5247                 fi
5248           else
5249                 break
5250           fi
5251         done
5252   done
5253 fi
5254
5255 fi
5256
5257 # Set definitions to allow ifdef'ing for ncurses.h
5258
5259 case $cf_cv_ncurses_header in
5260 (*ncurses.h)
5261
5262 cat >>confdefs.h <<\EOF
5263 #define HAVE_NCURSES_H 1
5264 EOF
5265
5266         ;;
5267 esac
5268
5269 case $cf_cv_ncurses_header in
5270 (ncurses/curses.h|ncurses/ncurses.h)
5271
5272 cat >>confdefs.h <<\EOF
5273 #define HAVE_NCURSES_NCURSES_H 1
5274 EOF
5275
5276         ;;
5277 (ncursesw/curses.h|ncursesw/ncurses.h)
5278
5279 cat >>confdefs.h <<\EOF
5280 #define HAVE_NCURSESW_NCURSES_H 1
5281 EOF
5282
5283         ;;
5284 esac
5285
5286 echo "$as_me:5286: checking for terminfo header" >&5
5287 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5288 if test "${cf_cv_term_header+set}" = set; then
5289   echo $ECHO_N "(cached) $ECHO_C" >&6
5290 else
5291
5292 case ${cf_cv_ncurses_header} in
5293 (*/ncurses.h|*/ncursesw.h)
5294         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5295         ;;
5296 (*)
5297         cf_term_header=term.h
5298         ;;
5299 esac
5300
5301 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5302 do
5303 cat >conftest.$ac_ext <<_ACEOF
5304 #line 5304 "configure"
5305 #include "confdefs.h"
5306 #include <stdio.h>
5307 #include <${cf_cv_ncurses_header:-curses.h}>
5308 #include <$cf_test>
5309
5310 int
5311 main (void)
5312 {
5313 int x = auto_left_margin
5314   ;
5315   return 0;
5316 }
5317 _ACEOF
5318 rm -f conftest.$ac_objext
5319 if { (eval echo "$as_me:5319: \"$ac_compile\"") >&5
5320   (eval $ac_compile) 2>&5
5321   ac_status=$?
5322   echo "$as_me:5322: \$? = $ac_status" >&5
5323   (exit $ac_status); } &&
5324          { ac_try='test -s conftest.$ac_objext'
5325   { (eval echo "$as_me:5325: \"$ac_try\"") >&5
5326   (eval $ac_try) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit $ac_status); }; }; then
5330
5331         cf_cv_term_header="$cf_test"
5332 else
5333   echo "$as_me: failed program was:" >&5
5334 cat conftest.$ac_ext >&5
5335
5336         cf_cv_term_header=unknown
5337
5338 fi
5339 rm -f conftest.$ac_objext conftest.$ac_ext
5340         test "$cf_cv_term_header" != unknown && break
5341 done
5342
5343 fi
5344 echo "$as_me:5344: result: $cf_cv_term_header" >&5
5345 echo "${ECHO_T}$cf_cv_term_header" >&6
5346
5347 # Set definitions to allow ifdef'ing to accommodate subdirectories
5348
5349 case $cf_cv_term_header in
5350 (*term.h)
5351
5352 cat >>confdefs.h <<\EOF
5353 #define HAVE_TERM_H 1
5354 EOF
5355
5356         ;;
5357 esac
5358
5359 case $cf_cv_term_header in
5360 (ncurses/term.h)
5361
5362 cat >>confdefs.h <<\EOF
5363 #define HAVE_NCURSES_TERM_H 1
5364 EOF
5365
5366         ;;
5367 (ncursesw/term.h)
5368
5369 cat >>confdefs.h <<\EOF
5370 #define HAVE_NCURSESW_TERM_H 1
5371 EOF
5372
5373         ;;
5374 esac
5375
5376 # some applications need this, but should check for NCURSES_VERSION
5377
5378 cat >>confdefs.h <<\EOF
5379 #define NCURSES 1
5380 EOF
5381
5382 echo "$as_me:5382: checking for ncurses version" >&5
5383 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5384 if test "${cf_cv_ncurses_version+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388         cf_cv_ncurses_version=no
5389         cf_tempfile=out$$
5390         rm -f $cf_tempfile
5391         if test "$cross_compiling" = yes; then
5392
5393         # This will not work if the preprocessor splits the line after the
5394         # Autoconf token.  The 'unproto' program does that.
5395         cat > conftest.$ac_ext <<EOF
5396 #include <${cf_cv_ncurses_header:-curses.h}>
5397 #undef Autoconf
5398 #ifdef NCURSES_VERSION
5399 Autoconf NCURSES_VERSION
5400 #else
5401 #ifdef __NCURSES_H
5402 Autoconf "old"
5403 #endif
5404 ;
5405 #endif
5406 EOF
5407         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5408         { (eval echo "$as_me:5408: \"$cf_try\"") >&5
5409   (eval $cf_try) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); }
5413         if test -f conftest.out ; then
5414                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5415                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5416                 rm -f conftest.out
5417         fi
5418
5419 else
5420   cat >conftest.$ac_ext <<_ACEOF
5421 #line 5421 "configure"
5422 #include "confdefs.h"
5423
5424 #include <${cf_cv_ncurses_header:-curses.h}>
5425 #include <stdio.h>
5426 int main(void)
5427 {
5428         FILE *fp = fopen("$cf_tempfile", "w");
5429 #ifdef NCURSES_VERSION
5430 # ifdef NCURSES_VERSION_PATCH
5431         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5432 # else
5433         fprintf(fp, "%s\n", NCURSES_VERSION);
5434 # endif
5435 #else
5436 # ifdef __NCURSES_H
5437         fprintf(fp, "old\n");
5438 # else
5439         make an error
5440 # endif
5441 #endif
5442         ${cf_cv_main_return:-return}(0);
5443 }
5444 _ACEOF
5445 rm -f conftest$ac_exeext
5446 if { (eval echo "$as_me:5446: \"$ac_link\"") >&5
5447   (eval $ac_link) 2>&5
5448   ac_status=$?
5449   echo "$as_me:5449: \$? = $ac_status" >&5
5450   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5451   { (eval echo "$as_me:5451: \"$ac_try\"") >&5
5452   (eval $ac_try) 2>&5
5453   ac_status=$?
5454   echo "$as_me:5454: \$? = $ac_status" >&5
5455   (exit $ac_status); }; }; then
5456
5457         cf_cv_ncurses_version=`cat $cf_tempfile`
5458 else
5459   echo "$as_me: program exited with status $ac_status" >&5
5460 echo "$as_me: failed program was:" >&5
5461 cat conftest.$ac_ext >&5
5462 fi
5463 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5464 fi
5465         rm -f $cf_tempfile
5466
5467 fi
5468 echo "$as_me:5468: result: $cf_cv_ncurses_version" >&5
5469 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5470 test "$cf_cv_ncurses_version" = no ||
5471 cat >>confdefs.h <<\EOF
5472 #define NCURSES 1
5473 EOF
5474
5475 cf_nculib_root=ncurses
5476         # This works, except for the special case where we find gpm, but
5477         # ncurses is in a nonstandard location via $LIBS, and we really want
5478         # to link gpm.
5479 cf_ncurses_LIBS=""
5480 cf_ncurses_SAVE="$LIBS"
5481 echo "$as_me:5481: checking for Gpm_Open in -lgpm" >&5
5482 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5483 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5484   echo $ECHO_N "(cached) $ECHO_C" >&6
5485 else
5486   ac_check_lib_save_LIBS=$LIBS
5487 LIBS="-lgpm  $LIBS"
5488 cat >conftest.$ac_ext <<_ACEOF
5489 #line 5489 "configure"
5490 #include "confdefs.h"
5491
5492 /* Override any gcc2 internal prototype to avoid an error.  */
5493 #ifdef __cplusplus
5494 extern "C"
5495 #endif
5496 /* We use char because int might match the return type of a gcc2
5497    builtin and then its argument prototype would still apply.  */
5498 char Gpm_Open ();
5499 int
5500 main (void)
5501 {
5502 Gpm_Open ();
5503   ;
5504   return 0;
5505 }
5506 _ACEOF
5507 rm -f conftest.$ac_objext conftest$ac_exeext
5508 if { (eval echo "$as_me:5508: \"$ac_link\"") >&5
5509   (eval $ac_link) 2>&5
5510   ac_status=$?
5511   echo "$as_me:5511: \$? = $ac_status" >&5
5512   (exit $ac_status); } &&
5513          { ac_try='test -s conftest$ac_exeext'
5514   { (eval echo "$as_me:5514: \"$ac_try\"") >&5
5515   (eval $ac_try) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); }; }; then
5519   ac_cv_lib_gpm_Gpm_Open=yes
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat conftest.$ac_ext >&5
5523 ac_cv_lib_gpm_Gpm_Open=no
5524 fi
5525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5526 LIBS=$ac_check_lib_save_LIBS
5527 fi
5528 echo "$as_me:5528: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5529 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5530 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5531   echo "$as_me:5531: checking for initscr in -lgpm" >&5
5532 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5533 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5534   echo $ECHO_N "(cached) $ECHO_C" >&6
5535 else
5536   ac_check_lib_save_LIBS=$LIBS
5537 LIBS="-lgpm  $LIBS"
5538 cat >conftest.$ac_ext <<_ACEOF
5539 #line 5539 "configure"
5540 #include "confdefs.h"
5541
5542 /* Override any gcc2 internal prototype to avoid an error.  */
5543 #ifdef __cplusplus
5544 extern "C"
5545 #endif
5546 /* We use char because int might match the return type of a gcc2
5547    builtin and then its argument prototype would still apply.  */
5548 char initscr ();
5549 int
5550 main (void)
5551 {
5552 initscr ();
5553   ;
5554   return 0;
5555 }
5556 _ACEOF
5557 rm -f conftest.$ac_objext conftest$ac_exeext
5558 if { (eval echo "$as_me:5558: \"$ac_link\"") >&5
5559   (eval $ac_link) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit $ac_status); } &&
5563          { ac_try='test -s conftest$ac_exeext'
5564   { (eval echo "$as_me:5564: \"$ac_try\"") >&5
5565   (eval $ac_try) 2>&5
5566   ac_status=$?
5567   echo "$as_me:5567: \$? = $ac_status" >&5
5568   (exit $ac_status); }; }; then
5569   ac_cv_lib_gpm_initscr=yes
5570 else
5571   echo "$as_me: failed program was:" >&5
5572 cat conftest.$ac_ext >&5
5573 ac_cv_lib_gpm_initscr=no
5574 fi
5575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5576 LIBS=$ac_check_lib_save_LIBS
5577 fi
5578 echo "$as_me:5578: result: $ac_cv_lib_gpm_initscr" >&5
5579 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5580 if test $ac_cv_lib_gpm_initscr = yes; then
5581   LIBS="$cf_ncurses_SAVE"
5582 else
5583   cf_ncurses_LIBS="-lgpm"
5584 fi
5585
5586 fi
5587
5588 case $host_os in
5589 (freebsd*)
5590         # This is only necessary if you are linking against an obsolete
5591         # version of ncurses (but it should do no harm, since it's static).
5592         if test "$cf_nculib_root" = ncurses ; then
5593                 echo "$as_me:5593: checking for tgoto in -lmytinfo" >&5
5594 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5595 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5596   echo $ECHO_N "(cached) $ECHO_C" >&6
5597 else
5598   ac_check_lib_save_LIBS=$LIBS
5599 LIBS="-lmytinfo  $LIBS"
5600 cat >conftest.$ac_ext <<_ACEOF
5601 #line 5601 "configure"
5602 #include "confdefs.h"
5603
5604 /* Override any gcc2 internal prototype to avoid an error.  */
5605 #ifdef __cplusplus
5606 extern "C"
5607 #endif
5608 /* We use char because int might match the return type of a gcc2
5609    builtin and then its argument prototype would still apply.  */
5610 char tgoto ();
5611 int
5612 main (void)
5613 {
5614 tgoto ();
5615   ;
5616   return 0;
5617 }
5618 _ACEOF
5619 rm -f conftest.$ac_objext conftest$ac_exeext
5620 if { (eval echo "$as_me:5620: \"$ac_link\"") >&5
5621   (eval $ac_link) 2>&5
5622   ac_status=$?
5623   echo "$as_me:5623: \$? = $ac_status" >&5
5624   (exit $ac_status); } &&
5625          { ac_try='test -s conftest$ac_exeext'
5626   { (eval echo "$as_me:5626: \"$ac_try\"") >&5
5627   (eval $ac_try) 2>&5
5628   ac_status=$?
5629   echo "$as_me:5629: \$? = $ac_status" >&5
5630   (exit $ac_status); }; }; then
5631   ac_cv_lib_mytinfo_tgoto=yes
5632 else
5633   echo "$as_me: failed program was:" >&5
5634 cat conftest.$ac_ext >&5
5635 ac_cv_lib_mytinfo_tgoto=no
5636 fi
5637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5638 LIBS=$ac_check_lib_save_LIBS
5639 fi
5640 echo "$as_me:5640: result: $ac_cv_lib_mytinfo_tgoto" >&5
5641 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5642 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5643   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5644 fi
5645
5646         fi
5647         ;;
5648 esac
5649
5650 cf_add_libs="$LIBS"
5651 # reverse order
5652 cf_add_0lib=
5653 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5654 # filter duplicates
5655 for cf_add_1lib in $cf_add_0lib; do
5656         for cf_add_2lib in $cf_add_libs; do
5657                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5658                         cf_add_1lib=
5659                         break
5660                 fi
5661         done
5662         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5663 done
5664 LIBS="$cf_add_libs"
5665
5666 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5667 then
5668
5669 cf_add_libs="$LIBS"
5670 # reverse order
5671 cf_add_0lib=
5672 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5673 # filter duplicates
5674 for cf_add_1lib in $cf_add_0lib; do
5675         for cf_add_2lib in $cf_add_libs; do
5676                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5677                         cf_add_1lib=
5678                         break
5679                 fi
5680         done
5681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5682 done
5683 LIBS="$cf_add_libs"
5684
5685 else
5686
5687         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5688         cf_libdir=""
5689         echo "$as_me:5689: checking for initscr" >&5
5690 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5691 if test "${ac_cv_func_initscr+set}" = set; then
5692   echo $ECHO_N "(cached) $ECHO_C" >&6
5693 else
5694   cat >conftest.$ac_ext <<_ACEOF
5695 #line 5695 "configure"
5696 #include "confdefs.h"
5697 #define initscr autoconf_temporary
5698 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5699 #undef initscr
5700
5701 #ifdef __cplusplus
5702 extern "C"
5703 #endif
5704
5705 /* We use char because int might match the return type of a gcc2
5706    builtin and then its argument prototype would still apply.  */
5707 char initscr (void);
5708
5709 int
5710 main (void)
5711 {
5712
5713 /* The GNU C library defines stubs for functions which it implements
5714     to always fail with ENOSYS.  Some functions are actually named
5715     something starting with __ and the normal name is an alias.  */
5716 #if defined (__stub_initscr) || defined (__stub___initscr)
5717 #error found stub for initscr
5718 #endif
5719
5720         return initscr ();
5721   ;
5722   return 0;
5723 }
5724 _ACEOF
5725 rm -f conftest.$ac_objext conftest$ac_exeext
5726 if { (eval echo "$as_me:5726: \"$ac_link\"") >&5
5727   (eval $ac_link) 2>&5
5728   ac_status=$?
5729   echo "$as_me:5729: \$? = $ac_status" >&5
5730   (exit $ac_status); } &&
5731          { ac_try='test -s conftest$ac_exeext'
5732   { (eval echo "$as_me:5732: \"$ac_try\"") >&5
5733   (eval $ac_try) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit $ac_status); }; }; then
5737   ac_cv_func_initscr=yes
5738 else
5739   echo "$as_me: failed program was:" >&5
5740 cat conftest.$ac_ext >&5
5741 ac_cv_func_initscr=no
5742 fi
5743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5744 fi
5745 echo "$as_me:5745: result: $ac_cv_func_initscr" >&5
5746 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5747 if test $ac_cv_func_initscr = yes; then
5748   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5749 else
5750
5751                 cf_save_LIBS="$LIBS"
5752                 echo "$as_me:5752: checking for initscr in -l$cf_nculib_root" >&5
5753 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5754                 LIBS="-l$cf_nculib_root $LIBS"
5755                 cat >conftest.$ac_ext <<_ACEOF
5756 #line 5756 "configure"
5757 #include "confdefs.h"
5758 #include <${cf_cv_ncurses_header:-curses.h}>
5759 int
5760 main (void)
5761 {
5762 initscr()
5763   ;
5764   return 0;
5765 }
5766 _ACEOF
5767 rm -f conftest.$ac_objext conftest$ac_exeext
5768 if { (eval echo "$as_me:5768: \"$ac_link\"") >&5
5769   (eval $ac_link) 2>&5
5770   ac_status=$?
5771   echo "$as_me:5771: \$? = $ac_status" >&5
5772   (exit $ac_status); } &&
5773          { ac_try='test -s conftest$ac_exeext'
5774   { (eval echo "$as_me:5774: \"$ac_try\"") >&5
5775   (eval $ac_try) 2>&5
5776   ac_status=$?
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); }; }; then
5779   echo "$as_me:5779: result: yes" >&5
5780 echo "${ECHO_T}yes" >&6
5781                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5782
5783 else
5784   echo "$as_me: failed program was:" >&5
5785 cat conftest.$ac_ext >&5
5786 echo "$as_me:5786: result: no" >&5
5787 echo "${ECHO_T}no" >&6
5788
5789 cf_search=
5790 cf_library_path_list=""
5791 if test -n "${LDFLAGS}${LIBS}" ; then
5792         for cf_library_path in $LDFLAGS $LIBS
5793         do
5794                 case $cf_library_path in
5795                 (-L*)
5796                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5797
5798 test "x$cf_library_path" != "xNONE" && \
5799 test -d "$cf_library_path" && \
5800  {
5801         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5802         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5803         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5804         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5805         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5806         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
5807 }
5808
5809                         cf_library_path_list="$cf_library_path_list $cf_search"
5810                         ;;
5811                 esac
5812         done
5813 fi
5814
5815 cf_search=
5816
5817 test "x$prefix" != "xNONE" && \
5818 test -d "$prefix" && \
5819  {
5820         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5821         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5822         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5823         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5824         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5825         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5826 }
5827
5828 for cf_subdir_prefix in \
5829         /usr \
5830         /usr/local \
5831         /usr/pkg \
5832         /opt \
5833         /opt/local \
5834         $HOME
5835 do
5836
5837 test "x$cf_subdir_prefix" != "x$prefix" && \
5838 test -d "$cf_subdir_prefix" && \
5839 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5840         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5841         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5842         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5843         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5844         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5845         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
5846 }
5847
5848 done
5849
5850 cf_search="$cf_library_path_list $cf_search"
5851
5852                         for cf_libdir in $cf_search
5853                         do
5854                                 echo "$as_me:5854: checking for -l$cf_nculib_root in $cf_libdir" >&5
5855 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5856                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5857                                 cat >conftest.$ac_ext <<_ACEOF
5858 #line 5858 "configure"
5859 #include "confdefs.h"
5860 #include <${cf_cv_ncurses_header:-curses.h}>
5861 int
5862 main (void)
5863 {
5864 initscr()
5865   ;
5866   return 0;
5867 }
5868 _ACEOF
5869 rm -f conftest.$ac_objext conftest$ac_exeext
5870 if { (eval echo "$as_me:5870: \"$ac_link\"") >&5
5871   (eval $ac_link) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); } &&
5875          { ac_try='test -s conftest$ac_exeext'
5876   { (eval echo "$as_me:5876: \"$ac_try\"") >&5
5877   (eval $ac_try) 2>&5
5878   ac_status=$?
5879   echo "$as_me:5879: \$? = $ac_status" >&5
5880   (exit $ac_status); }; }; then
5881   echo "$as_me:5881: result: yes" >&5
5882 echo "${ECHO_T}yes" >&6
5883                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5884                                          break
5885 else
5886   echo "$as_me: failed program was:" >&5
5887 cat conftest.$ac_ext >&5
5888 echo "$as_me:5888: result: no" >&5
5889 echo "${ECHO_T}no" >&6
5890                                          LIBS="$cf_save_LIBS"
5891 fi
5892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5893                         done
5894
5895 fi
5896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5897
5898 fi
5899
5900 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5901
5902 if test $cf_found_library = no ; then
5903         { { echo "$as_me:5903: error: Cannot link $cf_nculib_root library" >&5
5904 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5905    { (exit 1); exit 1; }; }
5906 fi
5907
5908 fi
5909
5910 if test -n "$cf_ncurses_LIBS" ; then
5911         echo "$as_me:5911: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5912 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5913         cf_ncurses_SAVE="$LIBS"
5914         for p in $cf_ncurses_LIBS ; do
5915                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5916                 if test "$q" != "$LIBS" ; then
5917                         LIBS="$q"
5918                 fi
5919         done
5920         cat >conftest.$ac_ext <<_ACEOF
5921 #line 5921 "configure"
5922 #include "confdefs.h"
5923 #include <${cf_cv_ncurses_header:-curses.h}>
5924 int
5925 main (void)
5926 {
5927 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5928   ;
5929   return 0;
5930 }
5931 _ACEOF
5932 rm -f conftest.$ac_objext conftest$ac_exeext
5933 if { (eval echo "$as_me:5933: \"$ac_link\"") >&5
5934   (eval $ac_link) 2>&5
5935   ac_status=$?
5936   echo "$as_me:5936: \$? = $ac_status" >&5
5937   (exit $ac_status); } &&
5938          { ac_try='test -s conftest$ac_exeext'
5939   { (eval echo "$as_me:5939: \"$ac_try\"") >&5
5940   (eval $ac_try) 2>&5
5941   ac_status=$?
5942   echo "$as_me:5942: \$? = $ac_status" >&5
5943   (exit $ac_status); }; }; then
5944   echo "$as_me:5944: result: yes" >&5
5945 echo "${ECHO_T}yes" >&6
5946 else
5947   echo "$as_me: failed program was:" >&5
5948 cat conftest.$ac_ext >&5
5949 echo "$as_me:5949: result: no" >&5
5950 echo "${ECHO_T}no" >&6
5951                  LIBS="$cf_ncurses_SAVE"
5952 fi
5953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5954 fi
5955
5956 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5957
5958 cat >>confdefs.h <<EOF
5959 #define $cf_nculib_ROOT 1
5960 EOF
5961
5962         fi
5963 else
5964         NCURSES_CONFIG=none
5965 fi
5966
5967 echo "$as_me:5967: checking if you want wide-character code" >&5
5968 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5969
5970 # Check whether --enable-widec or --disable-widec was given.
5971 if test "${enable_widec+set}" = set; then
5972   enableval="$enable_widec"
5973   with_widec=$enableval
5974 else
5975   with_widec=no
5976 fi;
5977 echo "$as_me:5977: result: $with_widec" >&5
5978 echo "${ECHO_T}$with_widec" >&6
5979 if test "$with_widec" = yes ; then
5980
5981 echo "$as_me:5981: checking for multibyte character support" >&5
5982 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5983 if test "${cf_cv_utf8_lib+set}" = set; then
5984   echo $ECHO_N "(cached) $ECHO_C" >&6
5985 else
5986
5987         cf_save_LIBS="$LIBS"
5988         cat >conftest.$ac_ext <<_ACEOF
5989 #line 5989 "configure"
5990 #include "confdefs.h"
5991
5992 #include <stdlib.h>
5993 int
5994 main (void)
5995 {
5996 putwc(0,0);
5997   ;
5998   return 0;
5999 }
6000 _ACEOF
6001 rm -f conftest.$ac_objext conftest$ac_exeext
6002 if { (eval echo "$as_me:6002: \"$ac_link\"") >&5
6003   (eval $ac_link) 2>&5
6004   ac_status=$?
6005   echo "$as_me:6005: \$? = $ac_status" >&5
6006   (exit $ac_status); } &&
6007          { ac_try='test -s conftest$ac_exeext'
6008   { (eval echo "$as_me:6008: \"$ac_try\"") >&5
6009   (eval $ac_try) 2>&5
6010   ac_status=$?
6011   echo "$as_me:6011: \$? = $ac_status" >&5
6012   (exit $ac_status); }; }; then
6013   cf_cv_utf8_lib=yes
6014 else
6015   echo "$as_me: failed program was:" >&5
6016 cat conftest.$ac_ext >&5
6017
6018 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6019 # will be set on completion of the AC_TRY_LINK below.
6020 cf_cv_header_path_utf8=
6021 cf_cv_library_path_utf8=
6022
6023 echo "${as_me:-configure}:6023: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6024
6025 cf_save_LIBS="$LIBS"
6026
6027 cat >conftest.$ac_ext <<_ACEOF
6028 #line 6028 "configure"
6029 #include "confdefs.h"
6030
6031 #include <libutf8.h>
6032 int
6033 main (void)
6034 {
6035 putwc(0,0);
6036   ;
6037   return 0;
6038 }
6039 _ACEOF
6040 rm -f conftest.$ac_objext conftest$ac_exeext
6041 if { (eval echo "$as_me:6041: \"$ac_link\"") >&5
6042   (eval $ac_link) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); } &&
6046          { ac_try='test -s conftest$ac_exeext'
6047   { (eval echo "$as_me:6047: \"$ac_try\"") >&5
6048   (eval $ac_try) 2>&5
6049   ac_status=$?
6050   echo "$as_me:6050: \$? = $ac_status" >&5
6051   (exit $ac_status); }; }; then
6052
6053         cf_cv_find_linkage_utf8=yes
6054         cf_cv_header_path_utf8=/usr/include
6055         cf_cv_library_path_utf8=/usr/lib
6056
6057 else
6058   echo "$as_me: failed program was:" >&5
6059 cat conftest.$ac_ext >&5
6060
6061 LIBS="-lutf8  $cf_save_LIBS"
6062
6063 cat >conftest.$ac_ext <<_ACEOF
6064 #line 6064 "configure"
6065 #include "confdefs.h"
6066
6067 #include <libutf8.h>
6068 int
6069 main (void)
6070 {
6071 putwc(0,0);
6072   ;
6073   return 0;
6074 }
6075 _ACEOF
6076 rm -f conftest.$ac_objext conftest$ac_exeext
6077 if { (eval echo "$as_me:6077: \"$ac_link\"") >&5
6078   (eval $ac_link) 2>&5
6079   ac_status=$?
6080   echo "$as_me:6080: \$? = $ac_status" >&5
6081   (exit $ac_status); } &&
6082          { ac_try='test -s conftest$ac_exeext'
6083   { (eval echo "$as_me:6083: \"$ac_try\"") >&5
6084   (eval $ac_try) 2>&5
6085   ac_status=$?
6086   echo "$as_me:6086: \$? = $ac_status" >&5
6087   (exit $ac_status); }; }; then
6088
6089         cf_cv_find_linkage_utf8=yes
6090         cf_cv_header_path_utf8=/usr/include
6091         cf_cv_library_path_utf8=/usr/lib
6092         cf_cv_library_file_utf8="-lutf8"
6093
6094 else
6095   echo "$as_me: failed program was:" >&5
6096 cat conftest.$ac_ext >&5
6097
6098         cf_cv_find_linkage_utf8=no
6099         LIBS="$cf_save_LIBS"
6100
6101         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6102
6103 echo "${as_me:-configure}:6103: testing find linkage for utf8 library ..." 1>&5
6104
6105 echo "${as_me:-configure}:6105: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6106
6107         cf_save_CPPFLAGS="$CPPFLAGS"
6108         cf_test_CPPFLAGS="$CPPFLAGS"
6109
6110 cf_search=
6111
6112 # collect the current set of include-directories from compiler flags
6113 cf_header_path_list=""
6114 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6115         for cf_header_path in $CPPFLAGS $CFLAGS
6116         do
6117                 case $cf_header_path in
6118                 (-I*)
6119                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6120
6121 test "x$cf_header_path" != "xNONE" && \
6122 test -d "$cf_header_path" && \
6123  {
6124         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6125         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6126         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6127         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6128         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6129         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6130 }
6131
6132                         cf_header_path_list="$cf_header_path_list $cf_search"
6133                         ;;
6134                 esac
6135         done
6136 fi
6137
6138 # add the variations for the package we are looking for
6139
6140 cf_search=
6141
6142 test "x$prefix" != "xNONE" && \
6143 test -d "$prefix" && \
6144  {
6145         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6146         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6147         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6148         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6149         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6150         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6151 }
6152
6153 for cf_subdir_prefix in \
6154         /usr \
6155         /usr/local \
6156         /usr/pkg \
6157         /opt \
6158         /opt/local \
6159         $HOME
6160 do
6161
6162 test "x$cf_subdir_prefix" != "x$prefix" && \
6163 test -d "$cf_subdir_prefix" && \
6164 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6165         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6166         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6167         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6168         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6169         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6170         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6171 }
6172
6173 done
6174
6175 test "$includedir" != NONE && \
6176 test "$includedir" != "/usr/include" && \
6177 test -d "$includedir" && {
6178         test -d $includedir &&    cf_search="$cf_search $includedir"
6179         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6180 }
6181
6182 test "$oldincludedir" != NONE && \
6183 test "$oldincludedir" != "/usr/include" && \
6184 test -d "$oldincludedir" && {
6185         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6186         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6187 }
6188
6189 cf_search="$cf_search $cf_header_path_list"
6190
6191         for cf_cv_header_path_utf8 in $cf_search
6192         do
6193                 if test -d $cf_cv_header_path_utf8 ; then
6194                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6195
6196 echo "${as_me:-configure}:6196: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6197
6198                         CPPFLAGS="$cf_save_CPPFLAGS"
6199
6200         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6201         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6202
6203                         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <libutf8.h>
6208 int
6209 main (void)
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext
6217 if { (eval echo "$as_me:6217: \"$ac_compile\"") >&5
6218   (eval $ac_compile) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest.$ac_objext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228
6229                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6230
6231 echo "${as_me:-configure}:6231: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6232
6233                                 cf_cv_find_linkage_utf8=maybe
6234                                 cf_test_CPPFLAGS="$CPPFLAGS"
6235                                 break
6236 else
6237   echo "$as_me: failed program was:" >&5
6238 cat conftest.$ac_ext >&5
6239
6240                                 CPPFLAGS="$cf_save_CPPFLAGS"
6241
6242 fi
6243 rm -f conftest.$ac_objext conftest.$ac_ext
6244                 fi
6245         done
6246
6247         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6248
6249 echo "${as_me:-configure}:6249: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6250
6251                 cf_save_LIBS="$LIBS"
6252                 cf_save_LDFLAGS="$LDFLAGS"
6253
6254                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6255
6256 cf_search=
6257 cf_library_path_list=""
6258 if test -n "${LDFLAGS}${LIBS}" ; then
6259         for cf_library_path in $LDFLAGS $LIBS
6260         do
6261                 case $cf_library_path in
6262                 (-L*)
6263                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6264
6265 test "x$cf_library_path" != "xNONE" && \
6266 test -d "$cf_library_path" && \
6267  {
6268         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6269         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6270         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6271         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6272         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6273         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6274 }
6275
6276                         cf_library_path_list="$cf_library_path_list $cf_search"
6277                         ;;
6278                 esac
6279         done
6280 fi
6281
6282 cf_search=
6283
6284 test "x$prefix" != "xNONE" && \
6285 test -d "$prefix" && \
6286  {
6287         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6288         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6289         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6290         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6291         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6292         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6293 }
6294
6295 for cf_subdir_prefix in \
6296         /usr \
6297         /usr/local \
6298         /usr/pkg \
6299         /opt \
6300         /opt/local \
6301         $HOME
6302 do
6303
6304 test "x$cf_subdir_prefix" != "x$prefix" && \
6305 test -d "$cf_subdir_prefix" && \
6306 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6307         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6308         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6309         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6310         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6311         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6312         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6313 }
6314
6315 done
6316
6317 cf_search="$cf_library_path_list $cf_search"
6318
6319                         for cf_cv_library_path_utf8 in $cf_search
6320                         do
6321                                 if test -d $cf_cv_library_path_utf8 ; then
6322                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6323
6324 echo "${as_me:-configure}:6324: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6325
6326                                         CPPFLAGS="$cf_test_CPPFLAGS"
6327                                         LIBS="-lutf8  $cf_save_LIBS"
6328                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6329                                         cat >conftest.$ac_ext <<_ACEOF
6330 #line 6330 "configure"
6331 #include "confdefs.h"
6332
6333 #include <libutf8.h>
6334 int
6335 main (void)
6336 {
6337 putwc(0,0);
6338   ;
6339   return 0;
6340 }
6341 _ACEOF
6342 rm -f conftest.$ac_objext conftest$ac_exeext
6343 if { (eval echo "$as_me:6343: \"$ac_link\"") >&5
6344   (eval $ac_link) 2>&5
6345   ac_status=$?
6346   echo "$as_me:6346: \$? = $ac_status" >&5
6347   (exit $ac_status); } &&
6348          { ac_try='test -s conftest$ac_exeext'
6349   { (eval echo "$as_me:6349: \"$ac_try\"") >&5
6350   (eval $ac_try) 2>&5
6351   ac_status=$?
6352   echo "$as_me:6352: \$? = $ac_status" >&5
6353   (exit $ac_status); }; }; then
6354
6355                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6356
6357 echo "${as_me:-configure}:6357: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6358
6359                                         cf_cv_find_linkage_utf8=yes
6360                                         cf_cv_library_file_utf8="-lutf8"
6361                                         break
6362 else
6363   echo "$as_me: failed program was:" >&5
6364 cat conftest.$ac_ext >&5
6365
6366                                         CPPFLAGS="$cf_save_CPPFLAGS"
6367                                         LIBS="$cf_save_LIBS"
6368                                         LDFLAGS="$cf_save_LDFLAGS"
6369
6370 fi
6371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6372                                 fi
6373                         done
6374                         CPPFLAGS="$cf_save_CPPFLAGS"
6375                         LDFLAGS="$cf_save_LDFLAGS"
6376                 fi
6377
6378         else
6379                 cf_cv_find_linkage_utf8=no
6380         fi
6381
6382 fi
6383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6384
6385 fi
6386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6387
6388 LIBS="$cf_save_LIBS"
6389
6390 if test "$cf_cv_find_linkage_utf8" = yes ; then
6391 cf_cv_utf8_lib=add-on
6392 else
6393 cf_cv_utf8_lib=no
6394 fi
6395
6396 fi
6397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6398 fi
6399 echo "$as_me:6399: result: $cf_cv_utf8_lib" >&5
6400 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6401
6402 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6403 # ncurses/ncursesw:
6404 if test "$cf_cv_utf8_lib" = "add-on" ; then
6405
6406 cat >>confdefs.h <<\EOF
6407 #define HAVE_LIBUTF8_H 1
6408 EOF
6409
6410 if test -n "$cf_cv_header_path_utf8" ; then
6411   for cf_add_incdir in $cf_cv_header_path_utf8
6412   do
6413         while test $cf_add_incdir != /usr/include
6414         do
6415           if test -d $cf_add_incdir
6416           then
6417                 cf_have_incdir=no
6418                 if test -n "$CFLAGS$CPPFLAGS" ; then
6419                   # a loop is needed to ensure we can add subdirs of existing dirs
6420                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6421                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6422                           cf_have_incdir=yes; break
6423                         fi
6424                   done
6425                 fi
6426
6427                 if test "$cf_have_incdir" = no ; then
6428                   if test "$cf_add_incdir" = /usr/local/include ; then
6429                         if test "$GCC" = yes
6430                         then
6431                           cf_save_CPPFLAGS=$CPPFLAGS
6432
6433         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6434         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6435
6436                           cat >conftest.$ac_ext <<_ACEOF
6437 #line 6437 "configure"
6438 #include "confdefs.h"
6439 #include <stdio.h>
6440 int
6441 main (void)
6442 {
6443 printf("Hello")
6444   ;
6445   return 0;
6446 }
6447 _ACEOF
6448 rm -f conftest.$ac_objext
6449 if { (eval echo "$as_me:6449: \"$ac_compile\"") >&5
6450   (eval $ac_compile) 2>&5
6451   ac_status=$?
6452   echo "$as_me:6452: \$? = $ac_status" >&5
6453   (exit $ac_status); } &&
6454          { ac_try='test -s conftest.$ac_objext'
6455   { (eval echo "$as_me:6455: \"$ac_try\"") >&5
6456   (eval $ac_try) 2>&5
6457   ac_status=$?
6458   echo "$as_me:6458: \$? = $ac_status" >&5
6459   (exit $ac_status); }; }; then
6460   :
6461 else
6462   echo "$as_me: failed program was:" >&5
6463 cat conftest.$ac_ext >&5
6464 cf_have_incdir=yes
6465 fi
6466 rm -f conftest.$ac_objext conftest.$ac_ext
6467                           CPPFLAGS=$cf_save_CPPFLAGS
6468                         fi
6469                   fi
6470                 fi
6471
6472                 if test "$cf_have_incdir" = no ; then
6473                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6474
6475 echo "${as_me:-configure}:6475: testing adding $cf_add_incdir to include-path ..." 1>&5
6476
6477                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6478
6479                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6480                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6481                   cf_add_incdir="$cf_top_incdir"
6482                 else
6483                   break
6484                 fi
6485           else
6486                 break
6487           fi
6488         done
6489   done
6490 fi
6491
6492 if test -n "$cf_cv_library_path_utf8" ; then
6493         for cf_add_libdir in $cf_cv_library_path_utf8
6494         do
6495                 if test $cf_add_libdir = /usr/lib ; then
6496                         :
6497                 elif test -d $cf_add_libdir
6498                 then
6499                         cf_have_libdir=no
6500                         if test -n "$LDFLAGS$LIBS" ; then
6501                                 # a loop is needed to ensure we can add subdirs of existing dirs
6502                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6503                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6504                                                 cf_have_libdir=yes; break
6505                                         fi
6506                                 done
6507                         fi
6508                         if test "$cf_have_libdir" = no ; then
6509                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6510
6511 echo "${as_me:-configure}:6511: testing adding $cf_add_libdir to library-path ..." 1>&5
6512
6513                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6514                         fi
6515                 fi
6516         done
6517 fi
6518
6519 cf_add_libs="$LIBS"
6520 # reverse order
6521 cf_add_0lib=
6522 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6523 # filter duplicates
6524 for cf_add_1lib in $cf_add_0lib; do
6525         for cf_add_2lib in $cf_add_libs; do
6526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6527                         cf_add_1lib=
6528                         break
6529                 fi
6530         done
6531         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6532 done
6533 LIBS="$cf_add_libs"
6534
6535 fi
6536
6537 cf_ncuconfig_root=ncursesw
6538 cf_have_ncuconfig=no
6539
6540 if test "x${PKG_CONFIG:=none}" != xnone; then
6541         echo "$as_me:6541: checking pkg-config for $cf_ncuconfig_root" >&5
6542 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6543         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6544                 echo "$as_me:6544: result: yes" >&5
6545 echo "${ECHO_T}yes" >&6
6546
6547                 echo "$as_me:6547: checking if the $cf_ncuconfig_root package files work" >&5
6548 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6549                 cf_have_ncuconfig=unknown
6550
6551                 cf_save_CPPFLAGS="$CPPFLAGS"
6552                 cf_save_LIBS="$LIBS"
6553
6554 cf_fix_cppflags=no
6555 cf_new_cflags=
6556 cf_new_cppflags=
6557 cf_new_extra_cppflags=
6558
6559 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
6560 do
6561 case $cf_fix_cppflags in
6562 (no)
6563         case $cf_add_cflags in
6564         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6565                 case $cf_add_cflags in
6566                 (-D*)
6567                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6568
6569                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6570                                 && test -z "${cf_tst_cflags}" \
6571                                 && cf_fix_cppflags=yes
6572
6573                         if test $cf_fix_cppflags = yes ; then
6574
6575         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6576         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6577
6578                                 continue
6579                         elif test "${cf_tst_cflags}" = "\"'" ; then
6580
6581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6583
6584                                 continue
6585                         fi
6586                         ;;
6587                 esac
6588                 case "$CPPFLAGS" in
6589                 (*$cf_add_cflags)
6590                         ;;
6591                 (*)
6592                         case $cf_add_cflags in
6593                         (-D*)
6594                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6595
6596 CPPFLAGS=`echo "$CPPFLAGS" | \
6597         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6598                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6599
6600                                 ;;
6601                         esac
6602
6603         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6604         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6605
6606                         ;;
6607                 esac
6608                 ;;
6609         (*)
6610
6611         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6612         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6613
6614                 ;;
6615         esac
6616         ;;
6617 (yes)
6618
6619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6621
6622         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6623
6624         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6625                 && test -z "${cf_tst_cflags}" \
6626                 && cf_fix_cppflags=no
6627         ;;
6628 esac
6629 done
6630
6631 if test -n "$cf_new_cflags" ; then
6632
6633         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6634         CFLAGS="${CFLAGS}$cf_new_cflags"
6635
6636 fi
6637
6638 if test -n "$cf_new_cppflags" ; then
6639
6640         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6641         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6642
6643 fi
6644
6645 if test -n "$cf_new_extra_cppflags" ; then
6646
6647         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6648         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6649
6650 fi
6651
6652 cf_add_libs="$LIBS"
6653 # reverse order
6654 cf_add_0lib=
6655 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6656 # filter duplicates
6657 for cf_add_1lib in $cf_add_0lib; do
6658         for cf_add_2lib in $cf_add_libs; do
6659                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6660                         cf_add_1lib=
6661                         break
6662                 fi
6663         done
6664         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6665 done
6666 LIBS="$cf_add_libs"
6667
6668                 cat >conftest.$ac_ext <<_ACEOF
6669 #line 6669 "configure"
6670 #include "confdefs.h"
6671 #include <${cf_cv_ncurses_header:-curses.h}>
6672 int
6673 main (void)
6674 {
6675 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6676   ;
6677   return 0;
6678 }
6679 _ACEOF
6680 rm -f conftest.$ac_objext conftest$ac_exeext
6681 if { (eval echo "$as_me:6681: \"$ac_link\"") >&5
6682   (eval $ac_link) 2>&5
6683   ac_status=$?
6684   echo "$as_me:6684: \$? = $ac_status" >&5
6685   (exit $ac_status); } &&
6686          { ac_try='test -s conftest$ac_exeext'
6687   { (eval echo "$as_me:6687: \"$ac_try\"") >&5
6688   (eval $ac_try) 2>&5
6689   ac_status=$?
6690   echo "$as_me:6690: \$? = $ac_status" >&5
6691   (exit $ac_status); }; }; then
6692   if test "$cross_compiling" = yes; then
6693   cf_have_ncuconfig=maybe
6694 else
6695   cat >conftest.$ac_ext <<_ACEOF
6696 #line 6696 "configure"
6697 #include "confdefs.h"
6698 #include <${cf_cv_ncurses_header:-curses.h}>
6699                                 int main(void)
6700                                 { char *xx = curses_version(); return (xx == 0); }
6701 _ACEOF
6702 rm -f conftest$ac_exeext
6703 if { (eval echo "$as_me:6703: \"$ac_link\"") >&5
6704   (eval $ac_link) 2>&5
6705   ac_status=$?
6706   echo "$as_me:6706: \$? = $ac_status" >&5
6707   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6708   { (eval echo "$as_me:6708: \"$ac_try\"") >&5
6709   (eval $ac_try) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit $ac_status); }; }; then
6713   cf_have_ncuconfig=yes
6714 else
6715   echo "$as_me: program exited with status $ac_status" >&5
6716 echo "$as_me: failed program was:" >&5
6717 cat conftest.$ac_ext >&5
6718 cf_have_ncuconfig=no
6719 fi
6720 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6721 fi
6722 else
6723   echo "$as_me: failed program was:" >&5
6724 cat conftest.$ac_ext >&5
6725 cf_have_ncuconfig=no
6726 fi
6727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6728                 echo "$as_me:6728: result: $cf_have_ncuconfig" >&5
6729 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6730                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6731                 if test "$cf_have_ncuconfig" != "yes"
6732                 then
6733                         CPPFLAGS="$cf_save_CPPFLAGS"
6734                         LIBS="$cf_save_LIBS"
6735                         NCURSES_CONFIG_PKG=none
6736                 else
6737
6738 cat >>confdefs.h <<\EOF
6739 #define NCURSES 1
6740 EOF
6741
6742                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6743
6744 echo "$as_me:6744: checking for terminfo header" >&5
6745 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6746 if test "${cf_cv_term_header+set}" = set; then
6747   echo $ECHO_N "(cached) $ECHO_C" >&6
6748 else
6749
6750 case ${cf_cv_ncurses_header} in
6751 (*/ncurses.h|*/ncursesw.h)
6752         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6753         ;;
6754 (*)
6755         cf_term_header=term.h
6756         ;;
6757 esac
6758
6759 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6760 do
6761 cat >conftest.$ac_ext <<_ACEOF
6762 #line 6762 "configure"
6763 #include "confdefs.h"
6764 #include <stdio.h>
6765 #include <${cf_cv_ncurses_header:-curses.h}>
6766 #include <$cf_test>
6767
6768 int
6769 main (void)
6770 {
6771 int x = auto_left_margin
6772   ;
6773   return 0;
6774 }
6775 _ACEOF
6776 rm -f conftest.$ac_objext
6777 if { (eval echo "$as_me:6777: \"$ac_compile\"") >&5
6778   (eval $ac_compile) 2>&5
6779   ac_status=$?
6780   echo "$as_me:6780: \$? = $ac_status" >&5
6781   (exit $ac_status); } &&
6782          { ac_try='test -s conftest.$ac_objext'
6783   { (eval echo "$as_me:6783: \"$ac_try\"") >&5
6784   (eval $ac_try) 2>&5
6785   ac_status=$?
6786   echo "$as_me:6786: \$? = $ac_status" >&5
6787   (exit $ac_status); }; }; then
6788
6789         cf_cv_term_header="$cf_test"
6790 else
6791   echo "$as_me: failed program was:" >&5
6792 cat conftest.$ac_ext >&5
6793
6794         cf_cv_term_header=unknown
6795
6796 fi
6797 rm -f conftest.$ac_objext conftest.$ac_ext
6798         test "$cf_cv_term_header" != unknown && break
6799 done
6800
6801 fi
6802 echo "$as_me:6802: result: $cf_cv_term_header" >&5
6803 echo "${ECHO_T}$cf_cv_term_header" >&6
6804
6805 # Set definitions to allow ifdef'ing to accommodate subdirectories
6806
6807 case $cf_cv_term_header in
6808 (*term.h)
6809
6810 cat >>confdefs.h <<\EOF
6811 #define HAVE_TERM_H 1
6812 EOF
6813
6814         ;;
6815 esac
6816
6817 case $cf_cv_term_header in
6818 (ncurses/term.h)
6819
6820 cat >>confdefs.h <<\EOF
6821 #define HAVE_NCURSES_TERM_H 1
6822 EOF
6823
6824         ;;
6825 (ncursesw/term.h)
6826
6827 cat >>confdefs.h <<\EOF
6828 #define HAVE_NCURSESW_TERM_H 1
6829 EOF
6830
6831         ;;
6832 esac
6833
6834                 fi
6835
6836         else
6837                 echo "$as_me:6837: result: no" >&5
6838 echo "${ECHO_T}no" >&6
6839                 NCURSES_CONFIG_PKG=none
6840         fi
6841 else
6842         NCURSES_CONFIG_PKG=none
6843 fi
6844
6845 if test "x$cf_have_ncuconfig" = "xno"; then
6846         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6847
6848 if test -n "$ac_tool_prefix"; then
6849   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6850   do
6851     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6852 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6853 echo "$as_me:6853: checking for $ac_word" >&5
6854 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6855 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6856   echo $ECHO_N "(cached) $ECHO_C" >&6
6857 else
6858   if test -n "$NCURSES_CONFIG"; then
6859   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6860 else
6861   ac_save_IFS=$IFS; IFS=$ac_path_separator
6862 ac_dummy="$PATH"
6863 for ac_dir in $ac_dummy; do
6864   IFS=$ac_save_IFS
6865   test -z "$ac_dir" && ac_dir=.
6866   $as_executable_p "$ac_dir/$ac_word" || continue
6867 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6868 echo "$as_me:6868: found $ac_dir/$ac_word" >&5
6869 break
6870 done
6871
6872 fi
6873 fi
6874 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6875 if test -n "$NCURSES_CONFIG"; then
6876   echo "$as_me:6876: result: $NCURSES_CONFIG" >&5
6877 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6878 else
6879   echo "$as_me:6879: result: no" >&5
6880 echo "${ECHO_T}no" >&6
6881 fi
6882
6883     test -n "$NCURSES_CONFIG" && break
6884   done
6885 fi
6886 if test -z "$NCURSES_CONFIG"; then
6887   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6888   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6889 do
6890   # Extract the first word of "$ac_prog", so it can be a program name with args.
6891 set dummy $ac_prog; ac_word=$2
6892 echo "$as_me:6892: checking for $ac_word" >&5
6893 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6894 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6895   echo $ECHO_N "(cached) $ECHO_C" >&6
6896 else
6897   if test -n "$ac_ct_NCURSES_CONFIG"; then
6898   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6899 else
6900   ac_save_IFS=$IFS; IFS=$ac_path_separator
6901 ac_dummy="$PATH"
6902 for ac_dir in $ac_dummy; do
6903   IFS=$ac_save_IFS
6904   test -z "$ac_dir" && ac_dir=.
6905   $as_executable_p "$ac_dir/$ac_word" || continue
6906 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6907 echo "$as_me:6907: found $ac_dir/$ac_word" >&5
6908 break
6909 done
6910
6911 fi
6912 fi
6913 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6914 if test -n "$ac_ct_NCURSES_CONFIG"; then
6915   echo "$as_me:6915: result: $ac_ct_NCURSES_CONFIG" >&5
6916 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6917 else
6918   echo "$as_me:6918: result: no" >&5
6919 echo "${ECHO_T}no" >&6
6920 fi
6921
6922   test -n "$ac_ct_NCURSES_CONFIG" && break
6923 done
6924 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6925
6926   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6927 fi
6928
6929         if test "$NCURSES_CONFIG" != none ; then
6930
6931 cf_fix_cppflags=no
6932 cf_new_cflags=
6933 cf_new_cppflags=
6934 cf_new_extra_cppflags=
6935
6936 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
6937 do
6938 case $cf_fix_cppflags in
6939 (no)
6940         case $cf_add_cflags in
6941         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6942                 case $cf_add_cflags in
6943                 (-D*)
6944                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6945
6946                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6947                                 && test -z "${cf_tst_cflags}" \
6948                                 && cf_fix_cppflags=yes
6949
6950                         if test $cf_fix_cppflags = yes ; then
6951
6952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6954
6955                                 continue
6956                         elif test "${cf_tst_cflags}" = "\"'" ; then
6957
6958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6960
6961                                 continue
6962                         fi
6963                         ;;
6964                 esac
6965                 case "$CPPFLAGS" in
6966                 (*$cf_add_cflags)
6967                         ;;
6968                 (*)
6969                         case $cf_add_cflags in
6970                         (-D*)
6971                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6972
6973 CPPFLAGS=`echo "$CPPFLAGS" | \
6974         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6975                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6976
6977                                 ;;
6978                         esac
6979
6980         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6981         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6982
6983                         ;;
6984                 esac
6985                 ;;
6986         (*)
6987
6988         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6989         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6990
6991                 ;;
6992         esac
6993         ;;
6994 (yes)
6995
6996         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6997         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6998
6999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7000
7001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7002                 && test -z "${cf_tst_cflags}" \
7003                 && cf_fix_cppflags=no
7004         ;;
7005 esac
7006 done
7007
7008 if test -n "$cf_new_cflags" ; then
7009
7010         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7011         CFLAGS="${CFLAGS}$cf_new_cflags"
7012
7013 fi
7014
7015 if test -n "$cf_new_cppflags" ; then
7016
7017         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7018         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7019
7020 fi
7021
7022 if test -n "$cf_new_extra_cppflags" ; then
7023
7024         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7025         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7026
7027 fi
7028
7029 cf_add_libs="$LIBS"
7030 # reverse order
7031 cf_add_0lib=
7032 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7033 # filter duplicates
7034 for cf_add_1lib in $cf_add_0lib; do
7035         for cf_add_2lib in $cf_add_libs; do
7036                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7037                         cf_add_1lib=
7038                         break
7039                 fi
7040         done
7041         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7042 done
7043 LIBS="$cf_add_libs"
7044
7045                 # even with config script, some packages use no-override for curses.h
7046
7047 echo "$as_me:7047: checking if we have identified curses headers" >&5
7048 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7049 if test "${cf_cv_ncurses_header+set}" = set; then
7050   echo $ECHO_N "(cached) $ECHO_C" >&6
7051 else
7052
7053 cf_cv_ncurses_header=none
7054 for cf_header in \
7055         ncurses.h ncursesw/ncurses.h \
7056         curses.h ncursesw/curses.h
7057 do
7058 cat >conftest.$ac_ext <<_ACEOF
7059 #line 7059 "configure"
7060 #include "confdefs.h"
7061 #include <${cf_header}>
7062 int
7063 main (void)
7064 {
7065 initscr(); tgoto("?", 0,0)
7066   ;
7067   return 0;
7068 }
7069 _ACEOF
7070 rm -f conftest.$ac_objext
7071 if { (eval echo "$as_me:7071: \"$ac_compile\"") >&5
7072   (eval $ac_compile) 2>&5
7073   ac_status=$?
7074   echo "$as_me:7074: \$? = $ac_status" >&5
7075   (exit $ac_status); } &&
7076          { ac_try='test -s conftest.$ac_objext'
7077   { (eval echo "$as_me:7077: \"$ac_try\"") >&5
7078   (eval $ac_try) 2>&5
7079   ac_status=$?
7080   echo "$as_me:7080: \$? = $ac_status" >&5
7081   (exit $ac_status); }; }; then
7082   cf_cv_ncurses_header=$cf_header; break
7083 else
7084   echo "$as_me: failed program was:" >&5
7085 cat conftest.$ac_ext >&5
7086 fi
7087 rm -f conftest.$ac_objext conftest.$ac_ext
7088 done
7089
7090 fi
7091 echo "$as_me:7091: result: $cf_cv_ncurses_header" >&5
7092 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7093
7094 if test "$cf_cv_ncurses_header" = none ; then
7095         { { echo "$as_me:7095: error: No curses header-files found" >&5
7096 echo "$as_me: error: No curses header-files found" >&2;}
7097    { (exit 1); exit 1; }; }
7098 fi
7099
7100 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7101
7102 for ac_header in $cf_cv_ncurses_header
7103 do
7104 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7105 echo "$as_me:7105: checking for $ac_header" >&5
7106 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7107 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7108   echo $ECHO_N "(cached) $ECHO_C" >&6
7109 else
7110   cat >conftest.$ac_ext <<_ACEOF
7111 #line 7111 "configure"
7112 #include "confdefs.h"
7113 #include <$ac_header>
7114 _ACEOF
7115 if { (eval echo "$as_me:7115: \"$ac_cpp conftest.$ac_ext\"") >&5
7116   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7117   ac_status=$?
7118   egrep -v '^ *\+' conftest.er1 >conftest.err
7119   rm -f conftest.er1
7120   cat conftest.err >&5
7121   echo "$as_me:7121: \$? = $ac_status" >&5
7122   (exit $ac_status); } >/dev/null; then
7123   if test -s conftest.err; then
7124     ac_cpp_err=$ac_c_preproc_warn_flag
7125   else
7126     ac_cpp_err=
7127   fi
7128 else
7129   ac_cpp_err=yes
7130 fi
7131 if test -z "$ac_cpp_err"; then
7132   eval "$as_ac_Header=yes"
7133 else
7134   echo "$as_me: failed program was:" >&5
7135   cat conftest.$ac_ext >&5
7136   eval "$as_ac_Header=no"
7137 fi
7138 rm -f conftest.err conftest.$ac_ext
7139 fi
7140 echo "$as_me:7140: result: `eval echo '${'$as_ac_Header'}'`" >&5
7141 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7142 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7143   cat >>confdefs.h <<EOF
7144 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7145 EOF
7146
7147 fi
7148 done
7149
7150 cat >>confdefs.h <<\EOF
7151 #define NCURSES 1
7152 EOF
7153
7154 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7155
7156                 cat >>confdefs.h <<EOF
7157 #define $cf_nculib_ROOT 1
7158 EOF
7159
7160                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7161
7162         else
7163
7164 cf_ncuhdr_root=ncursesw
7165
7166 test -n "$cf_cv_curses_dir" && \
7167 test "$cf_cv_curses_dir" != "no" && { \
7168
7169 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7170   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7171   do
7172         while test $cf_add_incdir != /usr/include
7173         do
7174           if test -d $cf_add_incdir
7175           then
7176                 cf_have_incdir=no
7177                 if test -n "$CFLAGS$CPPFLAGS" ; then
7178                   # a loop is needed to ensure we can add subdirs of existing dirs
7179                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7180                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7181                           cf_have_incdir=yes; break
7182                         fi
7183                   done
7184                 fi
7185
7186                 if test "$cf_have_incdir" = no ; then
7187                   if test "$cf_add_incdir" = /usr/local/include ; then
7188                         if test "$GCC" = yes
7189                         then
7190                           cf_save_CPPFLAGS=$CPPFLAGS
7191
7192         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7193         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7194
7195                           cat >conftest.$ac_ext <<_ACEOF
7196 #line 7196 "configure"
7197 #include "confdefs.h"
7198 #include <stdio.h>
7199 int
7200 main (void)
7201 {
7202 printf("Hello")
7203   ;
7204   return 0;
7205 }
7206 _ACEOF
7207 rm -f conftest.$ac_objext
7208 if { (eval echo "$as_me:7208: \"$ac_compile\"") >&5
7209   (eval $ac_compile) 2>&5
7210   ac_status=$?
7211   echo "$as_me:7211: \$? = $ac_status" >&5
7212   (exit $ac_status); } &&
7213          { ac_try='test -s conftest.$ac_objext'
7214   { (eval echo "$as_me:7214: \"$ac_try\"") >&5
7215   (eval $ac_try) 2>&5
7216   ac_status=$?
7217   echo "$as_me:7217: \$? = $ac_status" >&5
7218   (exit $ac_status); }; }; then
7219   :
7220 else
7221   echo "$as_me: failed program was:" >&5
7222 cat conftest.$ac_ext >&5
7223 cf_have_incdir=yes
7224 fi
7225 rm -f conftest.$ac_objext conftest.$ac_ext
7226                           CPPFLAGS=$cf_save_CPPFLAGS
7227                         fi
7228                   fi
7229                 fi
7230
7231                 if test "$cf_have_incdir" = no ; then
7232                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7233
7234 echo "${as_me:-configure}:7234: testing adding $cf_add_incdir to include-path ..." 1>&5
7235
7236                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7237
7238                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7239                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7240                   cf_add_incdir="$cf_top_incdir"
7241                 else
7242                   break
7243                 fi
7244           else
7245                 break
7246           fi
7247         done
7248   done
7249 fi
7250
7251 }
7252
7253 echo "$as_me:7253: checking for $cf_ncuhdr_root header in include-path" >&5
7254 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7255 if test "${cf_cv_ncurses_h+set}" = set; then
7256   echo $ECHO_N "(cached) $ECHO_C" >&6
7257 else
7258
7259         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7260         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7261         for cf_header in $cf_header_list
7262         do
7263
7264         cat >conftest.$ac_ext <<_ACEOF
7265 #line 7265 "configure"
7266 #include "confdefs.h"
7267
7268 #define _XOPEN_SOURCE_EXTENDED
7269 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7270 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7271
7272 #include <$cf_header>
7273 int
7274 main (void)
7275 {
7276
7277 #ifdef NCURSES_VERSION
7278
7279 #ifndef WACS_BSSB
7280         make an error
7281 #endif
7282
7283 printf("%s\n", NCURSES_VERSION);
7284 #else
7285 #ifdef __NCURSES_H
7286 printf("old\n");
7287 #else
7288         make an error
7289 #endif
7290 #endif
7291
7292   ;
7293   return 0;
7294 }
7295 _ACEOF
7296 rm -f conftest.$ac_objext
7297 if { (eval echo "$as_me:7297: \"$ac_compile\"") >&5
7298   (eval $ac_compile) 2>&5
7299   ac_status=$?
7300   echo "$as_me:7300: \$? = $ac_status" >&5
7301   (exit $ac_status); } &&
7302          { ac_try='test -s conftest.$ac_objext'
7303   { (eval echo "$as_me:7303: \"$ac_try\"") >&5
7304   (eval $ac_try) 2>&5
7305   ac_status=$?
7306   echo "$as_me:7306: \$? = $ac_status" >&5
7307   (exit $ac_status); }; }; then
7308   cf_cv_ncurses_h=$cf_header
7309
7310 else
7311   echo "$as_me: failed program was:" >&5
7312 cat conftest.$ac_ext >&5
7313 cf_cv_ncurses_h=no
7314 fi
7315 rm -f conftest.$ac_objext conftest.$ac_ext
7316
7317                 test "$cf_cv_ncurses_h" != no && break
7318         done
7319
7320 fi
7321 echo "$as_me:7321: result: $cf_cv_ncurses_h" >&5
7322 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7323
7324 if test "$cf_cv_ncurses_h" != no ; then
7325         cf_cv_ncurses_header=$cf_cv_ncurses_h
7326 else
7327
7328 echo "$as_me:7328: checking for $cf_ncuhdr_root include-path" >&5
7329 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7330 if test "${cf_cv_ncurses_h2+set}" = set; then
7331   echo $ECHO_N "(cached) $ECHO_C" >&6
7332 else
7333
7334         test -n "$verbose" && echo
7335
7336 cf_search=
7337
7338 # collect the current set of include-directories from compiler flags
7339 cf_header_path_list=""
7340 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7341         for cf_header_path in $CPPFLAGS $CFLAGS
7342         do
7343                 case $cf_header_path in
7344                 (-I*)
7345                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7346
7347 test "x$cf_header_path" != "xNONE" && \
7348 test -d "$cf_header_path" && \
7349  {
7350         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7351         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7352         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7353         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7354         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7355         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7356 }
7357
7358                         cf_header_path_list="$cf_header_path_list $cf_search"
7359                         ;;
7360                 esac
7361         done
7362 fi
7363
7364 # add the variations for the package we are looking for
7365
7366 cf_search=
7367
7368 test "x$prefix" != "xNONE" && \
7369 test -d "$prefix" && \
7370  {
7371         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7372         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7373         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7374         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7375         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7376         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7377 }
7378
7379 for cf_subdir_prefix in \
7380         /usr \
7381         /usr/local \
7382         /usr/pkg \
7383         /opt \
7384         /opt/local \
7385         $HOME
7386 do
7387
7388 test "x$cf_subdir_prefix" != "x$prefix" && \
7389 test -d "$cf_subdir_prefix" && \
7390 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7391         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7392         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7393         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7394         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7395         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7396         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7397 }
7398
7399 done
7400
7401 test "$includedir" != NONE && \
7402 test "$includedir" != "/usr/include" && \
7403 test -d "$includedir" && {
7404         test -d $includedir &&    cf_search="$cf_search $includedir"
7405         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7406 }
7407
7408 test "$oldincludedir" != NONE && \
7409 test "$oldincludedir" != "/usr/include" && \
7410 test -d "$oldincludedir" && {
7411         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7412         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7413 }
7414
7415 cf_search="$cf_search $cf_header_path_list"
7416
7417         test -n "$verbose" && echo search path $cf_search
7418         cf_save2_CPPFLAGS="$CPPFLAGS"
7419         for cf_incdir in $cf_search
7420         do
7421
7422 if test -n "$cf_incdir" ; then
7423   for cf_add_incdir in $cf_incdir
7424   do
7425         while test $cf_add_incdir != /usr/include
7426         do
7427           if test -d $cf_add_incdir
7428           then
7429                 cf_have_incdir=no
7430                 if test -n "$CFLAGS$CPPFLAGS" ; then
7431                   # a loop is needed to ensure we can add subdirs of existing dirs
7432                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7433                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7434                           cf_have_incdir=yes; break
7435                         fi
7436                   done
7437                 fi
7438
7439                 if test "$cf_have_incdir" = no ; then
7440                   if test "$cf_add_incdir" = /usr/local/include ; then
7441                         if test "$GCC" = yes
7442                         then
7443                           cf_save_CPPFLAGS=$CPPFLAGS
7444
7445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7446         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7447
7448                           cat >conftest.$ac_ext <<_ACEOF
7449 #line 7449 "configure"
7450 #include "confdefs.h"
7451 #include <stdio.h>
7452 int
7453 main (void)
7454 {
7455 printf("Hello")
7456   ;
7457   return 0;
7458 }
7459 _ACEOF
7460 rm -f conftest.$ac_objext
7461 if { (eval echo "$as_me:7461: \"$ac_compile\"") >&5
7462   (eval $ac_compile) 2>&5
7463   ac_status=$?
7464   echo "$as_me:7464: \$? = $ac_status" >&5
7465   (exit $ac_status); } &&
7466          { ac_try='test -s conftest.$ac_objext'
7467   { (eval echo "$as_me:7467: \"$ac_try\"") >&5
7468   (eval $ac_try) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); }; }; then
7472   :
7473 else
7474   echo "$as_me: failed program was:" >&5
7475 cat conftest.$ac_ext >&5
7476 cf_have_incdir=yes
7477 fi
7478 rm -f conftest.$ac_objext conftest.$ac_ext
7479                           CPPFLAGS=$cf_save_CPPFLAGS
7480                         fi
7481                   fi
7482                 fi
7483
7484                 if test "$cf_have_incdir" = no ; then
7485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7486
7487 echo "${as_me:-configure}:7487: testing adding $cf_add_incdir to include-path ..." 1>&5
7488
7489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7490
7491                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7493                   cf_add_incdir="$cf_top_incdir"
7494                 else
7495                   break
7496                 fi
7497           else
7498                 break
7499           fi
7500         done
7501   done
7502 fi
7503
7504                 for cf_header in \
7505                         ncurses.h \
7506                         curses.h
7507                 do
7508
7509         cat >conftest.$ac_ext <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512
7513 #include <$cf_header>
7514 int
7515 main (void)
7516 {
7517
7518 #ifdef NCURSES_VERSION
7519
7520 printf("%s\n", NCURSES_VERSION);
7521 #else
7522 #ifdef __NCURSES_H
7523 printf("old\n");
7524 #else
7525         make an error
7526 #endif
7527 #endif
7528
7529   ;
7530   return 0;
7531 }
7532 _ACEOF
7533 rm -f conftest.$ac_objext
7534 if { (eval echo "$as_me:7534: \"$ac_compile\"") >&5
7535   (eval $ac_compile) 2>&5
7536   ac_status=$?
7537   echo "$as_me:7537: \$? = $ac_status" >&5
7538   (exit $ac_status); } &&
7539          { ac_try='test -s conftest.$ac_objext'
7540   { (eval echo "$as_me:7540: \"$ac_try\"") >&5
7541   (eval $ac_try) 2>&5
7542   ac_status=$?
7543   echo "$as_me:7543: \$? = $ac_status" >&5
7544   (exit $ac_status); }; }; then
7545   cf_cv_ncurses_h2=$cf_header
7546
7547 else
7548   echo "$as_me: failed program was:" >&5
7549 cat conftest.$ac_ext >&5
7550 cf_cv_ncurses_h2=no
7551 fi
7552 rm -f conftest.$ac_objext conftest.$ac_ext
7553
7554                         if test "$cf_cv_ncurses_h2" != no ; then
7555                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7556                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7557                                 break
7558                         fi
7559                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7560                 done
7561                 CPPFLAGS="$cf_save2_CPPFLAGS"
7562                 test "$cf_cv_ncurses_h2" != no && break
7563         done
7564         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7564: error: not found" >&5
7565 echo "$as_me: error: not found" >&2;}
7566    { (exit 1); exit 1; }; }
7567
7568 fi
7569 echo "$as_me:7569: result: $cf_cv_ncurses_h2" >&5
7570 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7571
7572         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7573         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7574         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7575                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7576         fi
7577
7578 if test -n "$cf_1st_incdir" ; then
7579   for cf_add_incdir in $cf_1st_incdir
7580   do
7581         while test $cf_add_incdir != /usr/include
7582         do
7583           if test -d $cf_add_incdir
7584           then
7585                 cf_have_incdir=no
7586                 if test -n "$CFLAGS$CPPFLAGS" ; then
7587                   # a loop is needed to ensure we can add subdirs of existing dirs
7588                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7589                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7590                           cf_have_incdir=yes; break
7591                         fi
7592                   done
7593                 fi
7594
7595                 if test "$cf_have_incdir" = no ; then
7596                   if test "$cf_add_incdir" = /usr/local/include ; then
7597                         if test "$GCC" = yes
7598                         then
7599                           cf_save_CPPFLAGS=$CPPFLAGS
7600
7601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7602         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7603
7604                           cat >conftest.$ac_ext <<_ACEOF
7605 #line 7605 "configure"
7606 #include "confdefs.h"
7607 #include <stdio.h>
7608 int
7609 main (void)
7610 {
7611 printf("Hello")
7612   ;
7613   return 0;
7614 }
7615 _ACEOF
7616 rm -f conftest.$ac_objext
7617 if { (eval echo "$as_me:7617: \"$ac_compile\"") >&5
7618   (eval $ac_compile) 2>&5
7619   ac_status=$?
7620   echo "$as_me:7620: \$? = $ac_status" >&5
7621   (exit $ac_status); } &&
7622          { ac_try='test -s conftest.$ac_objext'
7623   { (eval echo "$as_me:7623: \"$ac_try\"") >&5
7624   (eval $ac_try) 2>&5
7625   ac_status=$?
7626   echo "$as_me:7626: \$? = $ac_status" >&5
7627   (exit $ac_status); }; }; then
7628   :
7629 else
7630   echo "$as_me: failed program was:" >&5
7631 cat conftest.$ac_ext >&5
7632 cf_have_incdir=yes
7633 fi
7634 rm -f conftest.$ac_objext conftest.$ac_ext
7635                           CPPFLAGS=$cf_save_CPPFLAGS
7636                         fi
7637                   fi
7638                 fi
7639
7640                 if test "$cf_have_incdir" = no ; then
7641                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7642
7643 echo "${as_me:-configure}:7643: testing adding $cf_add_incdir to include-path ..." 1>&5
7644
7645                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7646
7647                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7648                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7649                   cf_add_incdir="$cf_top_incdir"
7650                 else
7651                   break
7652                 fi
7653           else
7654                 break
7655           fi
7656         done
7657   done
7658 fi
7659
7660 fi
7661
7662 # Set definitions to allow ifdef'ing for ncurses.h
7663
7664 case $cf_cv_ncurses_header in
7665 (*ncurses.h)
7666
7667 cat >>confdefs.h <<\EOF
7668 #define HAVE_NCURSES_H 1
7669 EOF
7670
7671         ;;
7672 esac
7673
7674 case $cf_cv_ncurses_header in
7675 (ncurses/curses.h|ncurses/ncurses.h)
7676
7677 cat >>confdefs.h <<\EOF
7678 #define HAVE_NCURSES_NCURSES_H 1
7679 EOF
7680
7681         ;;
7682 (ncursesw/curses.h|ncursesw/ncurses.h)
7683
7684 cat >>confdefs.h <<\EOF
7685 #define HAVE_NCURSESW_NCURSES_H 1
7686 EOF
7687
7688         ;;
7689 esac
7690
7691 echo "$as_me:7691: checking for terminfo header" >&5
7692 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7693 if test "${cf_cv_term_header+set}" = set; then
7694   echo $ECHO_N "(cached) $ECHO_C" >&6
7695 else
7696
7697 case ${cf_cv_ncurses_header} in
7698 (*/ncurses.h|*/ncursesw.h)
7699         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7700         ;;
7701 (*)
7702         cf_term_header=term.h
7703         ;;
7704 esac
7705
7706 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7707 do
7708 cat >conftest.$ac_ext <<_ACEOF
7709 #line 7709 "configure"
7710 #include "confdefs.h"
7711 #include <stdio.h>
7712 #include <${cf_cv_ncurses_header:-curses.h}>
7713 #include <$cf_test>
7714
7715 int
7716 main (void)
7717 {
7718 int x = auto_left_margin
7719   ;
7720   return 0;
7721 }
7722 _ACEOF
7723 rm -f conftest.$ac_objext
7724 if { (eval echo "$as_me:7724: \"$ac_compile\"") >&5
7725   (eval $ac_compile) 2>&5
7726   ac_status=$?
7727   echo "$as_me:7727: \$? = $ac_status" >&5
7728   (exit $ac_status); } &&
7729          { ac_try='test -s conftest.$ac_objext'
7730   { (eval echo "$as_me:7730: \"$ac_try\"") >&5
7731   (eval $ac_try) 2>&5
7732   ac_status=$?
7733   echo "$as_me:7733: \$? = $ac_status" >&5
7734   (exit $ac_status); }; }; then
7735
7736         cf_cv_term_header="$cf_test"
7737 else
7738   echo "$as_me: failed program was:" >&5
7739 cat conftest.$ac_ext >&5
7740
7741         cf_cv_term_header=unknown
7742
7743 fi
7744 rm -f conftest.$ac_objext conftest.$ac_ext
7745         test "$cf_cv_term_header" != unknown && break
7746 done
7747
7748 fi
7749 echo "$as_me:7749: result: $cf_cv_term_header" >&5
7750 echo "${ECHO_T}$cf_cv_term_header" >&6
7751
7752 # Set definitions to allow ifdef'ing to accommodate subdirectories
7753
7754 case $cf_cv_term_header in
7755 (*term.h)
7756
7757 cat >>confdefs.h <<\EOF
7758 #define HAVE_TERM_H 1
7759 EOF
7760
7761         ;;
7762 esac
7763
7764 case $cf_cv_term_header in
7765 (ncurses/term.h)
7766
7767 cat >>confdefs.h <<\EOF
7768 #define HAVE_NCURSES_TERM_H 1
7769 EOF
7770
7771         ;;
7772 (ncursesw/term.h)
7773
7774 cat >>confdefs.h <<\EOF
7775 #define HAVE_NCURSESW_TERM_H 1
7776 EOF
7777
7778         ;;
7779 esac
7780
7781 # some applications need this, but should check for NCURSES_VERSION
7782
7783 cat >>confdefs.h <<\EOF
7784 #define NCURSES 1
7785 EOF
7786
7787 echo "$as_me:7787: checking for ncurses version" >&5
7788 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7789 if test "${cf_cv_ncurses_version+set}" = set; then
7790   echo $ECHO_N "(cached) $ECHO_C" >&6
7791 else
7792
7793         cf_cv_ncurses_version=no
7794         cf_tempfile=out$$
7795         rm -f $cf_tempfile
7796         if test "$cross_compiling" = yes; then
7797
7798         # This will not work if the preprocessor splits the line after the
7799         # Autoconf token.  The 'unproto' program does that.
7800         cat > conftest.$ac_ext <<EOF
7801 #include <${cf_cv_ncurses_header:-curses.h}>
7802 #undef Autoconf
7803 #ifdef NCURSES_VERSION
7804 Autoconf NCURSES_VERSION
7805 #else
7806 #ifdef __NCURSES_H
7807 Autoconf "old"
7808 #endif
7809 ;
7810 #endif
7811 EOF
7812         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7813         { (eval echo "$as_me:7813: \"$cf_try\"") >&5
7814   (eval $cf_try) 2>&5
7815   ac_status=$?
7816   echo "$as_me:7816: \$? = $ac_status" >&5
7817   (exit $ac_status); }
7818         if test -f conftest.out ; then
7819                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7820                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7821                 rm -f conftest.out
7822         fi
7823
7824 else
7825   cat >conftest.$ac_ext <<_ACEOF
7826 #line 7826 "configure"
7827 #include "confdefs.h"
7828
7829 #include <${cf_cv_ncurses_header:-curses.h}>
7830 #include <stdio.h>
7831 int main(void)
7832 {
7833         FILE *fp = fopen("$cf_tempfile", "w");
7834 #ifdef NCURSES_VERSION
7835 # ifdef NCURSES_VERSION_PATCH
7836         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7837 # else
7838         fprintf(fp, "%s\n", NCURSES_VERSION);
7839 # endif
7840 #else
7841 # ifdef __NCURSES_H
7842         fprintf(fp, "old\n");
7843 # else
7844         make an error
7845 # endif
7846 #endif
7847         ${cf_cv_main_return:-return}(0);
7848 }
7849 _ACEOF
7850 rm -f conftest$ac_exeext
7851 if { (eval echo "$as_me:7851: \"$ac_link\"") >&5
7852   (eval $ac_link) 2>&5
7853   ac_status=$?
7854   echo "$as_me:7854: \$? = $ac_status" >&5
7855   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7856   { (eval echo "$as_me:7856: \"$ac_try\"") >&5
7857   (eval $ac_try) 2>&5
7858   ac_status=$?
7859   echo "$as_me:7859: \$? = $ac_status" >&5
7860   (exit $ac_status); }; }; then
7861
7862         cf_cv_ncurses_version=`cat $cf_tempfile`
7863 else
7864   echo "$as_me: program exited with status $ac_status" >&5
7865 echo "$as_me: failed program was:" >&5
7866 cat conftest.$ac_ext >&5
7867 fi
7868 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7869 fi
7870         rm -f $cf_tempfile
7871
7872 fi
7873 echo "$as_me:7873: result: $cf_cv_ncurses_version" >&5
7874 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7875 test "$cf_cv_ncurses_version" = no ||
7876 cat >>confdefs.h <<\EOF
7877 #define NCURSES 1
7878 EOF
7879
7880 cf_nculib_root=ncursesw
7881         # This works, except for the special case where we find gpm, but
7882         # ncurses is in a nonstandard location via $LIBS, and we really want
7883         # to link gpm.
7884 cf_ncurses_LIBS=""
7885 cf_ncurses_SAVE="$LIBS"
7886 echo "$as_me:7886: checking for Gpm_Open in -lgpm" >&5
7887 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7888 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7889   echo $ECHO_N "(cached) $ECHO_C" >&6
7890 else
7891   ac_check_lib_save_LIBS=$LIBS
7892 LIBS="-lgpm  $LIBS"
7893 cat >conftest.$ac_ext <<_ACEOF
7894 #line 7894 "configure"
7895 #include "confdefs.h"
7896
7897 /* Override any gcc2 internal prototype to avoid an error.  */
7898 #ifdef __cplusplus
7899 extern "C"
7900 #endif
7901 /* We use char because int might match the return type of a gcc2
7902    builtin and then its argument prototype would still apply.  */
7903 char Gpm_Open ();
7904 int
7905 main (void)
7906 {
7907 Gpm_Open ();
7908   ;
7909   return 0;
7910 }
7911 _ACEOF
7912 rm -f conftest.$ac_objext conftest$ac_exeext
7913 if { (eval echo "$as_me:7913: \"$ac_link\"") >&5
7914   (eval $ac_link) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); } &&
7918          { ac_try='test -s conftest$ac_exeext'
7919   { (eval echo "$as_me:7919: \"$ac_try\"") >&5
7920   (eval $ac_try) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); }; }; then
7924   ac_cv_lib_gpm_Gpm_Open=yes
7925 else
7926   echo "$as_me: failed program was:" >&5
7927 cat conftest.$ac_ext >&5
7928 ac_cv_lib_gpm_Gpm_Open=no
7929 fi
7930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7931 LIBS=$ac_check_lib_save_LIBS
7932 fi
7933 echo "$as_me:7933: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7934 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7935 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7936   echo "$as_me:7936: checking for initscr in -lgpm" >&5
7937 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7938 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7939   echo $ECHO_N "(cached) $ECHO_C" >&6
7940 else
7941   ac_check_lib_save_LIBS=$LIBS
7942 LIBS="-lgpm  $LIBS"
7943 cat >conftest.$ac_ext <<_ACEOF
7944 #line 7944 "configure"
7945 #include "confdefs.h"
7946
7947 /* Override any gcc2 internal prototype to avoid an error.  */
7948 #ifdef __cplusplus
7949 extern "C"
7950 #endif
7951 /* We use char because int might match the return type of a gcc2
7952    builtin and then its argument prototype would still apply.  */
7953 char initscr ();
7954 int
7955 main (void)
7956 {
7957 initscr ();
7958   ;
7959   return 0;
7960 }
7961 _ACEOF
7962 rm -f conftest.$ac_objext conftest$ac_exeext
7963 if { (eval echo "$as_me:7963: \"$ac_link\"") >&5
7964   (eval $ac_link) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); } &&
7968          { ac_try='test -s conftest$ac_exeext'
7969   { (eval echo "$as_me:7969: \"$ac_try\"") >&5
7970   (eval $ac_try) 2>&5
7971   ac_status=$?
7972   echo "$as_me:7972: \$? = $ac_status" >&5
7973   (exit $ac_status); }; }; then
7974   ac_cv_lib_gpm_initscr=yes
7975 else
7976   echo "$as_me: failed program was:" >&5
7977 cat conftest.$ac_ext >&5
7978 ac_cv_lib_gpm_initscr=no
7979 fi
7980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7981 LIBS=$ac_check_lib_save_LIBS
7982 fi
7983 echo "$as_me:7983: result: $ac_cv_lib_gpm_initscr" >&5
7984 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7985 if test $ac_cv_lib_gpm_initscr = yes; then
7986   LIBS="$cf_ncurses_SAVE"
7987 else
7988   cf_ncurses_LIBS="-lgpm"
7989 fi
7990
7991 fi
7992
7993 case $host_os in
7994 (freebsd*)
7995         # This is only necessary if you are linking against an obsolete
7996         # version of ncurses (but it should do no harm, since it's static).
7997         if test "$cf_nculib_root" = ncurses ; then
7998                 echo "$as_me:7998: checking for tgoto in -lmytinfo" >&5
7999 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8000 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8001   echo $ECHO_N "(cached) $ECHO_C" >&6
8002 else
8003   ac_check_lib_save_LIBS=$LIBS
8004 LIBS="-lmytinfo  $LIBS"
8005 cat >conftest.$ac_ext <<_ACEOF
8006 #line 8006 "configure"
8007 #include "confdefs.h"
8008
8009 /* Override any gcc2 internal prototype to avoid an error.  */
8010 #ifdef __cplusplus
8011 extern "C"
8012 #endif
8013 /* We use char because int might match the return type of a gcc2
8014    builtin and then its argument prototype would still apply.  */
8015 char tgoto ();
8016 int
8017 main (void)
8018 {
8019 tgoto ();
8020   ;
8021   return 0;
8022 }
8023 _ACEOF
8024 rm -f conftest.$ac_objext conftest$ac_exeext
8025 if { (eval echo "$as_me:8025: \"$ac_link\"") >&5
8026   (eval $ac_link) 2>&5
8027   ac_status=$?
8028   echo "$as_me:8028: \$? = $ac_status" >&5
8029   (exit $ac_status); } &&
8030          { ac_try='test -s conftest$ac_exeext'
8031   { (eval echo "$as_me:8031: \"$ac_try\"") >&5
8032   (eval $ac_try) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit $ac_status); }; }; then
8036   ac_cv_lib_mytinfo_tgoto=yes
8037 else
8038   echo "$as_me: failed program was:" >&5
8039 cat conftest.$ac_ext >&5
8040 ac_cv_lib_mytinfo_tgoto=no
8041 fi
8042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8043 LIBS=$ac_check_lib_save_LIBS
8044 fi
8045 echo "$as_me:8045: result: $ac_cv_lib_mytinfo_tgoto" >&5
8046 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8047 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8048   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8049 fi
8050
8051         fi
8052         ;;
8053 esac
8054
8055 cf_add_libs="$LIBS"
8056 # reverse order
8057 cf_add_0lib=
8058 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8059 # filter duplicates
8060 for cf_add_1lib in $cf_add_0lib; do
8061         for cf_add_2lib in $cf_add_libs; do
8062                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8063                         cf_add_1lib=
8064                         break
8065                 fi
8066         done
8067         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8068 done
8069 LIBS="$cf_add_libs"
8070
8071 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8072 then
8073
8074 cf_add_libs="$LIBS"
8075 # reverse order
8076 cf_add_0lib=
8077 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8078 # filter duplicates
8079 for cf_add_1lib in $cf_add_0lib; do
8080         for cf_add_2lib in $cf_add_libs; do
8081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8082                         cf_add_1lib=
8083                         break
8084                 fi
8085         done
8086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8087 done
8088 LIBS="$cf_add_libs"
8089
8090 else
8091
8092         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8093         cf_libdir=""
8094         echo "$as_me:8094: checking for initscr" >&5
8095 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8096 if test "${ac_cv_func_initscr+set}" = set; then
8097   echo $ECHO_N "(cached) $ECHO_C" >&6
8098 else
8099   cat >conftest.$ac_ext <<_ACEOF
8100 #line 8100 "configure"
8101 #include "confdefs.h"
8102 #define initscr autoconf_temporary
8103 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8104 #undef initscr
8105
8106 #ifdef __cplusplus
8107 extern "C"
8108 #endif
8109
8110 /* We use char because int might match the return type of a gcc2
8111    builtin and then its argument prototype would still apply.  */
8112 char initscr (void);
8113
8114 int
8115 main (void)
8116 {
8117
8118 /* The GNU C library defines stubs for functions which it implements
8119     to always fail with ENOSYS.  Some functions are actually named
8120     something starting with __ and the normal name is an alias.  */
8121 #if defined (__stub_initscr) || defined (__stub___initscr)
8122 #error found stub for initscr
8123 #endif
8124
8125         return initscr ();
8126   ;
8127   return 0;
8128 }
8129 _ACEOF
8130 rm -f conftest.$ac_objext conftest$ac_exeext
8131 if { (eval echo "$as_me:8131: \"$ac_link\"") >&5
8132   (eval $ac_link) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); } &&
8136          { ac_try='test -s conftest$ac_exeext'
8137   { (eval echo "$as_me:8137: \"$ac_try\"") >&5
8138   (eval $ac_try) 2>&5
8139   ac_status=$?
8140   echo "$as_me:8140: \$? = $ac_status" >&5
8141   (exit $ac_status); }; }; then
8142   ac_cv_func_initscr=yes
8143 else
8144   echo "$as_me: failed program was:" >&5
8145 cat conftest.$ac_ext >&5
8146 ac_cv_func_initscr=no
8147 fi
8148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8149 fi
8150 echo "$as_me:8150: result: $ac_cv_func_initscr" >&5
8151 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8152 if test $ac_cv_func_initscr = yes; then
8153   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8154 else
8155
8156                 cf_save_LIBS="$LIBS"
8157                 echo "$as_me:8157: checking for initscr in -l$cf_nculib_root" >&5
8158 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8159                 LIBS="-l$cf_nculib_root $LIBS"
8160                 cat >conftest.$ac_ext <<_ACEOF
8161 #line 8161 "configure"
8162 #include "confdefs.h"
8163 #include <${cf_cv_ncurses_header:-curses.h}>
8164 int
8165 main (void)
8166 {
8167 initscr()
8168   ;
8169   return 0;
8170 }
8171 _ACEOF
8172 rm -f conftest.$ac_objext conftest$ac_exeext
8173 if { (eval echo "$as_me:8173: \"$ac_link\"") >&5
8174   (eval $ac_link) 2>&5
8175   ac_status=$?
8176   echo "$as_me:8176: \$? = $ac_status" >&5
8177   (exit $ac_status); } &&
8178          { ac_try='test -s conftest$ac_exeext'
8179   { (eval echo "$as_me:8179: \"$ac_try\"") >&5
8180   (eval $ac_try) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); }; }; then
8184   echo "$as_me:8184: result: yes" >&5
8185 echo "${ECHO_T}yes" >&6
8186                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8187
8188 else
8189   echo "$as_me: failed program was:" >&5
8190 cat conftest.$ac_ext >&5
8191 echo "$as_me:8191: result: no" >&5
8192 echo "${ECHO_T}no" >&6
8193
8194 cf_search=
8195 cf_library_path_list=""
8196 if test -n "${LDFLAGS}${LIBS}" ; then
8197         for cf_library_path in $LDFLAGS $LIBS
8198         do
8199                 case $cf_library_path in
8200                 (-L*)
8201                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8202
8203 test "x$cf_library_path" != "xNONE" && \
8204 test -d "$cf_library_path" && \
8205  {
8206         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8207         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8208         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8209         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8210         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8211         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
8212 }
8213
8214                         cf_library_path_list="$cf_library_path_list $cf_search"
8215                         ;;
8216                 esac
8217         done
8218 fi
8219
8220 cf_search=
8221
8222 test "x$prefix" != "xNONE" && \
8223 test -d "$prefix" && \
8224  {
8225         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8226         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8227         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8228         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8229         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8230         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8231 }
8232
8233 for cf_subdir_prefix in \
8234         /usr \
8235         /usr/local \
8236         /usr/pkg \
8237         /opt \
8238         /opt/local \
8239         $HOME
8240 do
8241
8242 test "x$cf_subdir_prefix" != "x$prefix" && \
8243 test -d "$cf_subdir_prefix" && \
8244 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8245         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8246         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8247         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8248         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8249         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8250         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
8251 }
8252
8253 done
8254
8255 cf_search="$cf_library_path_list $cf_search"
8256
8257                         for cf_libdir in $cf_search
8258                         do
8259                                 echo "$as_me:8259: checking for -l$cf_nculib_root in $cf_libdir" >&5
8260 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8261                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8262                                 cat >conftest.$ac_ext <<_ACEOF
8263 #line 8263 "configure"
8264 #include "confdefs.h"
8265 #include <${cf_cv_ncurses_header:-curses.h}>
8266 int
8267 main (void)
8268 {
8269 initscr()
8270   ;
8271   return 0;
8272 }
8273 _ACEOF
8274 rm -f conftest.$ac_objext conftest$ac_exeext
8275 if { (eval echo "$as_me:8275: \"$ac_link\"") >&5
8276   (eval $ac_link) 2>&5
8277   ac_status=$?
8278   echo "$as_me:8278: \$? = $ac_status" >&5
8279   (exit $ac_status); } &&
8280          { ac_try='test -s conftest$ac_exeext'
8281   { (eval echo "$as_me:8281: \"$ac_try\"") >&5
8282   (eval $ac_try) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit $ac_status); }; }; then
8286   echo "$as_me:8286: result: yes" >&5
8287 echo "${ECHO_T}yes" >&6
8288                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8289                                          break
8290 else
8291   echo "$as_me: failed program was:" >&5
8292 cat conftest.$ac_ext >&5
8293 echo "$as_me:8293: result: no" >&5
8294 echo "${ECHO_T}no" >&6
8295                                          LIBS="$cf_save_LIBS"
8296 fi
8297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8298                         done
8299
8300 fi
8301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8302
8303 fi
8304
8305 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8306
8307 if test $cf_found_library = no ; then
8308         { { echo "$as_me:8308: error: Cannot link $cf_nculib_root library" >&5
8309 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8310    { (exit 1); exit 1; }; }
8311 fi
8312
8313 fi
8314
8315 if test -n "$cf_ncurses_LIBS" ; then
8316         echo "$as_me:8316: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8317 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8318         cf_ncurses_SAVE="$LIBS"
8319         for p in $cf_ncurses_LIBS ; do
8320                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8321                 if test "$q" != "$LIBS" ; then
8322                         LIBS="$q"
8323                 fi
8324         done
8325         cat >conftest.$ac_ext <<_ACEOF
8326 #line 8326 "configure"
8327 #include "confdefs.h"
8328 #include <${cf_cv_ncurses_header:-curses.h}>
8329 int
8330 main (void)
8331 {
8332 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8333   ;
8334   return 0;
8335 }
8336 _ACEOF
8337 rm -f conftest.$ac_objext conftest$ac_exeext
8338 if { (eval echo "$as_me:8338: \"$ac_link\"") >&5
8339   (eval $ac_link) 2>&5
8340   ac_status=$?
8341   echo "$as_me:8341: \$? = $ac_status" >&5
8342   (exit $ac_status); } &&
8343          { ac_try='test -s conftest$ac_exeext'
8344   { (eval echo "$as_me:8344: \"$ac_try\"") >&5
8345   (eval $ac_try) 2>&5
8346   ac_status=$?
8347   echo "$as_me:8347: \$? = $ac_status" >&5
8348   (exit $ac_status); }; }; then
8349   echo "$as_me:8349: result: yes" >&5
8350 echo "${ECHO_T}yes" >&6
8351 else
8352   echo "$as_me: failed program was:" >&5
8353 cat conftest.$ac_ext >&5
8354 echo "$as_me:8354: result: no" >&5
8355 echo "${ECHO_T}no" >&6
8356                  LIBS="$cf_ncurses_SAVE"
8357 fi
8358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8359 fi
8360
8361 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8362
8363 cat >>confdefs.h <<EOF
8364 #define $cf_nculib_ROOT 1
8365 EOF
8366
8367         fi
8368 else
8369         NCURSES_CONFIG=none
8370 fi
8371
8372 else
8373
8374 cf_ncuconfig_root=ncurses
8375 cf_have_ncuconfig=no
8376
8377 if test "x${PKG_CONFIG:=none}" != xnone; then
8378         echo "$as_me:8378: checking pkg-config for $cf_ncuconfig_root" >&5
8379 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8380         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8381                 echo "$as_me:8381: result: yes" >&5
8382 echo "${ECHO_T}yes" >&6
8383
8384                 echo "$as_me:8384: checking if the $cf_ncuconfig_root package files work" >&5
8385 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8386                 cf_have_ncuconfig=unknown
8387
8388                 cf_save_CPPFLAGS="$CPPFLAGS"
8389                 cf_save_LIBS="$LIBS"
8390
8391 cf_fix_cppflags=no
8392 cf_new_cflags=
8393 cf_new_cppflags=
8394 cf_new_extra_cppflags=
8395
8396 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
8397 do
8398 case $cf_fix_cppflags in
8399 (no)
8400         case $cf_add_cflags in
8401         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8402                 case $cf_add_cflags in
8403                 (-D*)
8404                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8405
8406                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8407                                 && test -z "${cf_tst_cflags}" \
8408                                 && cf_fix_cppflags=yes
8409
8410                         if test $cf_fix_cppflags = yes ; then
8411
8412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8414
8415                                 continue
8416                         elif test "${cf_tst_cflags}" = "\"'" ; then
8417
8418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8420
8421                                 continue
8422                         fi
8423                         ;;
8424                 esac
8425                 case "$CPPFLAGS" in
8426                 (*$cf_add_cflags)
8427                         ;;
8428                 (*)
8429                         case $cf_add_cflags in
8430                         (-D*)
8431                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8432
8433 CPPFLAGS=`echo "$CPPFLAGS" | \
8434         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8435                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8436
8437                                 ;;
8438                         esac
8439
8440         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8441         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8442
8443                         ;;
8444                 esac
8445                 ;;
8446         (*)
8447
8448         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8449         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8450
8451                 ;;
8452         esac
8453         ;;
8454 (yes)
8455
8456         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8457         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8458
8459         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8460
8461         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8462                 && test -z "${cf_tst_cflags}" \
8463                 && cf_fix_cppflags=no
8464         ;;
8465 esac
8466 done
8467
8468 if test -n "$cf_new_cflags" ; then
8469
8470         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8471         CFLAGS="${CFLAGS}$cf_new_cflags"
8472
8473 fi
8474
8475 if test -n "$cf_new_cppflags" ; then
8476
8477         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8478         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8479
8480 fi
8481
8482 if test -n "$cf_new_extra_cppflags" ; then
8483
8484         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8485         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8486
8487 fi
8488
8489 cf_add_libs="$LIBS"
8490 # reverse order
8491 cf_add_0lib=
8492 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8493 # filter duplicates
8494 for cf_add_1lib in $cf_add_0lib; do
8495         for cf_add_2lib in $cf_add_libs; do
8496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8497                         cf_add_1lib=
8498                         break
8499                 fi
8500         done
8501         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8502 done
8503 LIBS="$cf_add_libs"
8504
8505                 cat >conftest.$ac_ext <<_ACEOF
8506 #line 8506 "configure"
8507 #include "confdefs.h"
8508 #include <${cf_cv_ncurses_header:-curses.h}>
8509 int
8510 main (void)
8511 {
8512 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f conftest.$ac_objext conftest$ac_exeext
8518 if { (eval echo "$as_me:8518: \"$ac_link\"") >&5
8519   (eval $ac_link) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); } &&
8523          { ac_try='test -s conftest$ac_exeext'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); }; }; then
8529   if test "$cross_compiling" = yes; then
8530   cf_have_ncuconfig=maybe
8531 else
8532   cat >conftest.$ac_ext <<_ACEOF
8533 #line 8533 "configure"
8534 #include "confdefs.h"
8535 #include <${cf_cv_ncurses_header:-curses.h}>
8536                                 int main(void)
8537                                 { char *xx = curses_version(); return (xx == 0); }
8538 _ACEOF
8539 rm -f conftest$ac_exeext
8540 if { (eval echo "$as_me:8540: \"$ac_link\"") >&5
8541   (eval $ac_link) 2>&5
8542   ac_status=$?
8543   echo "$as_me:8543: \$? = $ac_status" >&5
8544   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8545   { (eval echo "$as_me:8545: \"$ac_try\"") >&5
8546   (eval $ac_try) 2>&5
8547   ac_status=$?
8548   echo "$as_me:8548: \$? = $ac_status" >&5
8549   (exit $ac_status); }; }; then
8550   cf_have_ncuconfig=yes
8551 else
8552   echo "$as_me: program exited with status $ac_status" >&5
8553 echo "$as_me: failed program was:" >&5
8554 cat conftest.$ac_ext >&5
8555 cf_have_ncuconfig=no
8556 fi
8557 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8558 fi
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat conftest.$ac_ext >&5
8562 cf_have_ncuconfig=no
8563 fi
8564 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8565                 echo "$as_me:8565: result: $cf_have_ncuconfig" >&5
8566 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8567                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8568                 if test "$cf_have_ncuconfig" != "yes"
8569                 then
8570                         CPPFLAGS="$cf_save_CPPFLAGS"
8571                         LIBS="$cf_save_LIBS"
8572                         NCURSES_CONFIG_PKG=none
8573                 else
8574
8575 cat >>confdefs.h <<\EOF
8576 #define NCURSES 1
8577 EOF
8578
8579                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8580
8581 echo "$as_me:8581: checking for terminfo header" >&5
8582 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8583 if test "${cf_cv_term_header+set}" = set; then
8584   echo $ECHO_N "(cached) $ECHO_C" >&6
8585 else
8586
8587 case ${cf_cv_ncurses_header} in
8588 (*/ncurses.h|*/ncursesw.h)
8589         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8590         ;;
8591 (*)
8592         cf_term_header=term.h
8593         ;;
8594 esac
8595
8596 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8597 do
8598 cat >conftest.$ac_ext <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601 #include <stdio.h>
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 #include <$cf_test>
8604
8605 int
8606 main (void)
8607 {
8608 int x = auto_left_margin
8609   ;
8610   return 0;
8611 }
8612 _ACEOF
8613 rm -f conftest.$ac_objext
8614 if { (eval echo "$as_me:8614: \"$ac_compile\"") >&5
8615   (eval $ac_compile) 2>&5
8616   ac_status=$?
8617   echo "$as_me:8617: \$? = $ac_status" >&5
8618   (exit $ac_status); } &&
8619          { ac_try='test -s conftest.$ac_objext'
8620   { (eval echo "$as_me:8620: \"$ac_try\"") >&5
8621   (eval $ac_try) 2>&5
8622   ac_status=$?
8623   echo "$as_me:8623: \$? = $ac_status" >&5
8624   (exit $ac_status); }; }; then
8625
8626         cf_cv_term_header="$cf_test"
8627 else
8628   echo "$as_me: failed program was:" >&5
8629 cat conftest.$ac_ext >&5
8630
8631         cf_cv_term_header=unknown
8632
8633 fi
8634 rm -f conftest.$ac_objext conftest.$ac_ext
8635         test "$cf_cv_term_header" != unknown && break
8636 done
8637
8638 fi
8639 echo "$as_me:8639: result: $cf_cv_term_header" >&5
8640 echo "${ECHO_T}$cf_cv_term_header" >&6
8641
8642 # Set definitions to allow ifdef'ing to accommodate subdirectories
8643
8644 case $cf_cv_term_header in
8645 (*term.h)
8646
8647 cat >>confdefs.h <<\EOF
8648 #define HAVE_TERM_H 1
8649 EOF
8650
8651         ;;
8652 esac
8653
8654 case $cf_cv_term_header in
8655 (ncurses/term.h)
8656
8657 cat >>confdefs.h <<\EOF
8658 #define HAVE_NCURSES_TERM_H 1
8659 EOF
8660
8661         ;;
8662 (ncursesw/term.h)
8663
8664 cat >>confdefs.h <<\EOF
8665 #define HAVE_NCURSESW_TERM_H 1
8666 EOF
8667
8668         ;;
8669 esac
8670
8671                 fi
8672
8673         else
8674                 echo "$as_me:8674: result: no" >&5
8675 echo "${ECHO_T}no" >&6
8676                 NCURSES_CONFIG_PKG=none
8677         fi
8678 else
8679         NCURSES_CONFIG_PKG=none
8680 fi
8681
8682 if test "x$cf_have_ncuconfig" = "xno"; then
8683         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8684
8685 if test -n "$ac_tool_prefix"; then
8686   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8687   do
8688     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8689 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8690 echo "$as_me:8690: checking for $ac_word" >&5
8691 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8692 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8693   echo $ECHO_N "(cached) $ECHO_C" >&6
8694 else
8695   if test -n "$NCURSES_CONFIG"; then
8696   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8697 else
8698   ac_save_IFS=$IFS; IFS=$ac_path_separator
8699 ac_dummy="$PATH"
8700 for ac_dir in $ac_dummy; do
8701   IFS=$ac_save_IFS
8702   test -z "$ac_dir" && ac_dir=.
8703   $as_executable_p "$ac_dir/$ac_word" || continue
8704 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8705 echo "$as_me:8705: found $ac_dir/$ac_word" >&5
8706 break
8707 done
8708
8709 fi
8710 fi
8711 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8712 if test -n "$NCURSES_CONFIG"; then
8713   echo "$as_me:8713: result: $NCURSES_CONFIG" >&5
8714 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8715 else
8716   echo "$as_me:8716: result: no" >&5
8717 echo "${ECHO_T}no" >&6
8718 fi
8719
8720     test -n "$NCURSES_CONFIG" && break
8721   done
8722 fi
8723 if test -z "$NCURSES_CONFIG"; then
8724   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8725   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8726 do
8727   # Extract the first word of "$ac_prog", so it can be a program name with args.
8728 set dummy $ac_prog; ac_word=$2
8729 echo "$as_me:8729: checking for $ac_word" >&5
8730 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8731 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8732   echo $ECHO_N "(cached) $ECHO_C" >&6
8733 else
8734   if test -n "$ac_ct_NCURSES_CONFIG"; then
8735   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8736 else
8737   ac_save_IFS=$IFS; IFS=$ac_path_separator
8738 ac_dummy="$PATH"
8739 for ac_dir in $ac_dummy; do
8740   IFS=$ac_save_IFS
8741   test -z "$ac_dir" && ac_dir=.
8742   $as_executable_p "$ac_dir/$ac_word" || continue
8743 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8744 echo "$as_me:8744: found $ac_dir/$ac_word" >&5
8745 break
8746 done
8747
8748 fi
8749 fi
8750 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8751 if test -n "$ac_ct_NCURSES_CONFIG"; then
8752   echo "$as_me:8752: result: $ac_ct_NCURSES_CONFIG" >&5
8753 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8754 else
8755   echo "$as_me:8755: result: no" >&5
8756 echo "${ECHO_T}no" >&6
8757 fi
8758
8759   test -n "$ac_ct_NCURSES_CONFIG" && break
8760 done
8761 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8762
8763   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8764 fi
8765
8766         if test "$NCURSES_CONFIG" != none ; then
8767
8768 cf_fix_cppflags=no
8769 cf_new_cflags=
8770 cf_new_cppflags=
8771 cf_new_extra_cppflags=
8772
8773 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8774 do
8775 case $cf_fix_cppflags in
8776 (no)
8777         case $cf_add_cflags in
8778         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8779                 case $cf_add_cflags in
8780                 (-D*)
8781                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8782
8783                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8784                                 && test -z "${cf_tst_cflags}" \
8785                                 && cf_fix_cppflags=yes
8786
8787                         if test $cf_fix_cppflags = yes ; then
8788
8789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8791
8792                                 continue
8793                         elif test "${cf_tst_cflags}" = "\"'" ; then
8794
8795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8797
8798                                 continue
8799                         fi
8800                         ;;
8801                 esac
8802                 case "$CPPFLAGS" in
8803                 (*$cf_add_cflags)
8804                         ;;
8805                 (*)
8806                         case $cf_add_cflags in
8807                         (-D*)
8808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8809
8810 CPPFLAGS=`echo "$CPPFLAGS" | \
8811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8813
8814                                 ;;
8815                         esac
8816
8817         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8818         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8819
8820                         ;;
8821                 esac
8822                 ;;
8823         (*)
8824
8825         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8826         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8827
8828                 ;;
8829         esac
8830         ;;
8831 (yes)
8832
8833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8835
8836         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8837
8838         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8839                 && test -z "${cf_tst_cflags}" \
8840                 && cf_fix_cppflags=no
8841         ;;
8842 esac
8843 done
8844
8845 if test -n "$cf_new_cflags" ; then
8846
8847         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8848         CFLAGS="${CFLAGS}$cf_new_cflags"
8849
8850 fi
8851
8852 if test -n "$cf_new_cppflags" ; then
8853
8854         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8855         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8856
8857 fi
8858
8859 if test -n "$cf_new_extra_cppflags" ; then
8860
8861         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8862         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8863
8864 fi
8865
8866 cf_add_libs="$LIBS"
8867 # reverse order
8868 cf_add_0lib=
8869 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8870 # filter duplicates
8871 for cf_add_1lib in $cf_add_0lib; do
8872         for cf_add_2lib in $cf_add_libs; do
8873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8874                         cf_add_1lib=
8875                         break
8876                 fi
8877         done
8878         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8879 done
8880 LIBS="$cf_add_libs"
8881
8882                 # even with config script, some packages use no-override for curses.h
8883
8884 echo "$as_me:8884: checking if we have identified curses headers" >&5
8885 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8886 if test "${cf_cv_ncurses_header+set}" = set; then
8887   echo $ECHO_N "(cached) $ECHO_C" >&6
8888 else
8889
8890 cf_cv_ncurses_header=none
8891 for cf_header in \
8892         ncurses.h ncurses/ncurses.h \
8893         curses.h ncurses/curses.h
8894 do
8895 cat >conftest.$ac_ext <<_ACEOF
8896 #line 8896 "configure"
8897 #include "confdefs.h"
8898 #include <${cf_header}>
8899 int
8900 main (void)
8901 {
8902 initscr(); tgoto("?", 0,0)
8903   ;
8904   return 0;
8905 }
8906 _ACEOF
8907 rm -f conftest.$ac_objext
8908 if { (eval echo "$as_me:8908: \"$ac_compile\"") >&5
8909   (eval $ac_compile) 2>&5
8910   ac_status=$?
8911   echo "$as_me:8911: \$? = $ac_status" >&5
8912   (exit $ac_status); } &&
8913          { ac_try='test -s conftest.$ac_objext'
8914   { (eval echo "$as_me:8914: \"$ac_try\"") >&5
8915   (eval $ac_try) 2>&5
8916   ac_status=$?
8917   echo "$as_me:8917: \$? = $ac_status" >&5
8918   (exit $ac_status); }; }; then
8919   cf_cv_ncurses_header=$cf_header; break
8920 else
8921   echo "$as_me: failed program was:" >&5
8922 cat conftest.$ac_ext >&5
8923 fi
8924 rm -f conftest.$ac_objext conftest.$ac_ext
8925 done
8926
8927 fi
8928 echo "$as_me:8928: result: $cf_cv_ncurses_header" >&5
8929 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8930
8931 if test "$cf_cv_ncurses_header" = none ; then
8932         { { echo "$as_me:8932: error: No curses header-files found" >&5
8933 echo "$as_me: error: No curses header-files found" >&2;}
8934    { (exit 1); exit 1; }; }
8935 fi
8936
8937 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8938
8939 for ac_header in $cf_cv_ncurses_header
8940 do
8941 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8942 echo "$as_me:8942: checking for $ac_header" >&5
8943 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8944 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8945   echo $ECHO_N "(cached) $ECHO_C" >&6
8946 else
8947   cat >conftest.$ac_ext <<_ACEOF
8948 #line 8948 "configure"
8949 #include "confdefs.h"
8950 #include <$ac_header>
8951 _ACEOF
8952 if { (eval echo "$as_me:8952: \"$ac_cpp conftest.$ac_ext\"") >&5
8953   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8954   ac_status=$?
8955   egrep -v '^ *\+' conftest.er1 >conftest.err
8956   rm -f conftest.er1
8957   cat conftest.err >&5
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit $ac_status); } >/dev/null; then
8960   if test -s conftest.err; then
8961     ac_cpp_err=$ac_c_preproc_warn_flag
8962   else
8963     ac_cpp_err=
8964   fi
8965 else
8966   ac_cpp_err=yes
8967 fi
8968 if test -z "$ac_cpp_err"; then
8969   eval "$as_ac_Header=yes"
8970 else
8971   echo "$as_me: failed program was:" >&5
8972   cat conftest.$ac_ext >&5
8973   eval "$as_ac_Header=no"
8974 fi
8975 rm -f conftest.err conftest.$ac_ext
8976 fi
8977 echo "$as_me:8977: result: `eval echo '${'$as_ac_Header'}'`" >&5
8978 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8979 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8980   cat >>confdefs.h <<EOF
8981 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8982 EOF
8983
8984 fi
8985 done
8986
8987 cat >>confdefs.h <<\EOF
8988 #define NCURSES 1
8989 EOF
8990
8991 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8992
8993                 cat >>confdefs.h <<EOF
8994 #define $cf_nculib_ROOT 1
8995 EOF
8996
8997                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8998
8999         else
9000
9001 cf_ncuhdr_root=ncurses
9002
9003 test -n "$cf_cv_curses_dir" && \
9004 test "$cf_cv_curses_dir" != "no" && { \
9005
9006 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9007   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9008   do
9009         while test $cf_add_incdir != /usr/include
9010         do
9011           if test -d $cf_add_incdir
9012           then
9013                 cf_have_incdir=no
9014                 if test -n "$CFLAGS$CPPFLAGS" ; then
9015                   # a loop is needed to ensure we can add subdirs of existing dirs
9016                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9017                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9018                           cf_have_incdir=yes; break
9019                         fi
9020                   done
9021                 fi
9022
9023                 if test "$cf_have_incdir" = no ; then
9024                   if test "$cf_add_incdir" = /usr/local/include ; then
9025                         if test "$GCC" = yes
9026                         then
9027                           cf_save_CPPFLAGS=$CPPFLAGS
9028
9029         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9030         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9031
9032                           cat >conftest.$ac_ext <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035 #include <stdio.h>
9036 int
9037 main (void)
9038 {
9039 printf("Hello")
9040   ;
9041   return 0;
9042 }
9043 _ACEOF
9044 rm -f conftest.$ac_objext
9045 if { (eval echo "$as_me:9045: \"$ac_compile\"") >&5
9046   (eval $ac_compile) 2>&5
9047   ac_status=$?
9048   echo "$as_me:9048: \$? = $ac_status" >&5
9049   (exit $ac_status); } &&
9050          { ac_try='test -s conftest.$ac_objext'
9051   { (eval echo "$as_me:9051: \"$ac_try\"") >&5
9052   (eval $ac_try) 2>&5
9053   ac_status=$?
9054   echo "$as_me:9054: \$? = $ac_status" >&5
9055   (exit $ac_status); }; }; then
9056   :
9057 else
9058   echo "$as_me: failed program was:" >&5
9059 cat conftest.$ac_ext >&5
9060 cf_have_incdir=yes
9061 fi
9062 rm -f conftest.$ac_objext conftest.$ac_ext
9063                           CPPFLAGS=$cf_save_CPPFLAGS
9064                         fi
9065                   fi
9066                 fi
9067
9068                 if test "$cf_have_incdir" = no ; then
9069                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9070
9071 echo "${as_me:-configure}:9071: testing adding $cf_add_incdir to include-path ..." 1>&5
9072
9073                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9074
9075                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9076                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9077                   cf_add_incdir="$cf_top_incdir"
9078                 else
9079                   break
9080                 fi
9081           else
9082                 break
9083           fi
9084         done
9085   done
9086 fi
9087
9088 }
9089
9090 echo "$as_me:9090: checking for $cf_ncuhdr_root header in include-path" >&5
9091 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9092 if test "${cf_cv_ncurses_h+set}" = set; then
9093   echo $ECHO_N "(cached) $ECHO_C" >&6
9094 else
9095
9096         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9097         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9098         for cf_header in $cf_header_list
9099         do
9100
9101         cat >conftest.$ac_ext <<_ACEOF
9102 #line 9102 "configure"
9103 #include "confdefs.h"
9104
9105 #include <$cf_header>
9106 int
9107 main (void)
9108 {
9109
9110 #ifdef NCURSES_VERSION
9111
9112 printf("%s\n", NCURSES_VERSION);
9113 #else
9114 #ifdef __NCURSES_H
9115 printf("old\n");
9116 #else
9117         make an error
9118 #endif
9119 #endif
9120
9121   ;
9122   return 0;
9123 }
9124 _ACEOF
9125 rm -f conftest.$ac_objext
9126 if { (eval echo "$as_me:9126: \"$ac_compile\"") >&5
9127   (eval $ac_compile) 2>&5
9128   ac_status=$?
9129   echo "$as_me:9129: \$? = $ac_status" >&5
9130   (exit $ac_status); } &&
9131          { ac_try='test -s conftest.$ac_objext'
9132   { (eval echo "$as_me:9132: \"$ac_try\"") >&5
9133   (eval $ac_try) 2>&5
9134   ac_status=$?
9135   echo "$as_me:9135: \$? = $ac_status" >&5
9136   (exit $ac_status); }; }; then
9137   cf_cv_ncurses_h=$cf_header
9138
9139 else
9140   echo "$as_me: failed program was:" >&5
9141 cat conftest.$ac_ext >&5
9142 cf_cv_ncurses_h=no
9143 fi
9144 rm -f conftest.$ac_objext conftest.$ac_ext
9145
9146                 test "$cf_cv_ncurses_h" != no && break
9147         done
9148
9149 fi
9150 echo "$as_me:9150: result: $cf_cv_ncurses_h" >&5
9151 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9152
9153 if test "$cf_cv_ncurses_h" != no ; then
9154         cf_cv_ncurses_header=$cf_cv_ncurses_h
9155 else
9156
9157 echo "$as_me:9157: checking for $cf_ncuhdr_root include-path" >&5
9158 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9159 if test "${cf_cv_ncurses_h2+set}" = set; then
9160   echo $ECHO_N "(cached) $ECHO_C" >&6
9161 else
9162
9163         test -n "$verbose" && echo
9164
9165 cf_search=
9166
9167 # collect the current set of include-directories from compiler flags
9168 cf_header_path_list=""
9169 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9170         for cf_header_path in $CPPFLAGS $CFLAGS
9171         do
9172                 case $cf_header_path in
9173                 (-I*)
9174                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9175
9176 test "x$cf_header_path" != "xNONE" && \
9177 test -d "$cf_header_path" && \
9178  {
9179         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9180         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9181         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9182         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9183         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9184         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9185 }
9186
9187                         cf_header_path_list="$cf_header_path_list $cf_search"
9188                         ;;
9189                 esac
9190         done
9191 fi
9192
9193 # add the variations for the package we are looking for
9194
9195 cf_search=
9196
9197 test "x$prefix" != "xNONE" && \
9198 test -d "$prefix" && \
9199  {
9200         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9201         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9202         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9203         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9204         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9205         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9206 }
9207
9208 for cf_subdir_prefix in \
9209         /usr \
9210         /usr/local \
9211         /usr/pkg \
9212         /opt \
9213         /opt/local \
9214         $HOME
9215 do
9216
9217 test "x$cf_subdir_prefix" != "x$prefix" && \
9218 test -d "$cf_subdir_prefix" && \
9219 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9220         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9221         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9222         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9223         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9224         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9225         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9226 }
9227
9228 done
9229
9230 test "$includedir" != NONE && \
9231 test "$includedir" != "/usr/include" && \
9232 test -d "$includedir" && {
9233         test -d $includedir &&    cf_search="$cf_search $includedir"
9234         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9235 }
9236
9237 test "$oldincludedir" != NONE && \
9238 test "$oldincludedir" != "/usr/include" && \
9239 test -d "$oldincludedir" && {
9240         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9241         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9242 }
9243
9244 cf_search="$cf_search $cf_header_path_list"
9245
9246         test -n "$verbose" && echo search path $cf_search
9247         cf_save2_CPPFLAGS="$CPPFLAGS"
9248         for cf_incdir in $cf_search
9249         do
9250
9251 if test -n "$cf_incdir" ; then
9252   for cf_add_incdir in $cf_incdir
9253   do
9254         while test $cf_add_incdir != /usr/include
9255         do
9256           if test -d $cf_add_incdir
9257           then
9258                 cf_have_incdir=no
9259                 if test -n "$CFLAGS$CPPFLAGS" ; then
9260                   # a loop is needed to ensure we can add subdirs of existing dirs
9261                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9262                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9263                           cf_have_incdir=yes; break
9264                         fi
9265                   done
9266                 fi
9267
9268                 if test "$cf_have_incdir" = no ; then
9269                   if test "$cf_add_incdir" = /usr/local/include ; then
9270                         if test "$GCC" = yes
9271                         then
9272                           cf_save_CPPFLAGS=$CPPFLAGS
9273
9274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9275         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9276
9277                           cat >conftest.$ac_ext <<_ACEOF
9278 #line 9278 "configure"
9279 #include "confdefs.h"
9280 #include <stdio.h>
9281 int
9282 main (void)
9283 {
9284 printf("Hello")
9285   ;
9286   return 0;
9287 }
9288 _ACEOF
9289 rm -f conftest.$ac_objext
9290 if { (eval echo "$as_me:9290: \"$ac_compile\"") >&5
9291   (eval $ac_compile) 2>&5
9292   ac_status=$?
9293   echo "$as_me:9293: \$? = $ac_status" >&5
9294   (exit $ac_status); } &&
9295          { ac_try='test -s conftest.$ac_objext'
9296   { (eval echo "$as_me:9296: \"$ac_try\"") >&5
9297   (eval $ac_try) 2>&5
9298   ac_status=$?
9299   echo "$as_me:9299: \$? = $ac_status" >&5
9300   (exit $ac_status); }; }; then
9301   :
9302 else
9303   echo "$as_me: failed program was:" >&5
9304 cat conftest.$ac_ext >&5
9305 cf_have_incdir=yes
9306 fi
9307 rm -f conftest.$ac_objext conftest.$ac_ext
9308                           CPPFLAGS=$cf_save_CPPFLAGS
9309                         fi
9310                   fi
9311                 fi
9312
9313                 if test "$cf_have_incdir" = no ; then
9314                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9315
9316 echo "${as_me:-configure}:9316: testing adding $cf_add_incdir to include-path ..." 1>&5
9317
9318                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9319
9320                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9321                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9322                   cf_add_incdir="$cf_top_incdir"
9323                 else
9324                   break
9325                 fi
9326           else
9327                 break
9328           fi
9329         done
9330   done
9331 fi
9332
9333                 for cf_header in \
9334                         ncurses.h \
9335                         curses.h
9336                 do
9337
9338         cat >conftest.$ac_ext <<_ACEOF
9339 #line 9339 "configure"
9340 #include "confdefs.h"
9341
9342 #include <$cf_header>
9343 int
9344 main (void)
9345 {
9346
9347 #ifdef NCURSES_VERSION
9348
9349 printf("%s\n", NCURSES_VERSION);
9350 #else
9351 #ifdef __NCURSES_H
9352 printf("old\n");
9353 #else
9354         make an error
9355 #endif
9356 #endif
9357
9358   ;
9359   return 0;
9360 }
9361 _ACEOF
9362 rm -f conftest.$ac_objext
9363 if { (eval echo "$as_me:9363: \"$ac_compile\"") >&5
9364   (eval $ac_compile) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); } &&
9368          { ac_try='test -s conftest.$ac_objext'
9369   { (eval echo "$as_me:9369: \"$ac_try\"") >&5
9370   (eval $ac_try) 2>&5
9371   ac_status=$?
9372   echo "$as_me:9372: \$? = $ac_status" >&5
9373   (exit $ac_status); }; }; then
9374   cf_cv_ncurses_h2=$cf_header
9375
9376 else
9377   echo "$as_me: failed program was:" >&5
9378 cat conftest.$ac_ext >&5
9379 cf_cv_ncurses_h2=no
9380 fi
9381 rm -f conftest.$ac_objext conftest.$ac_ext
9382
9383                         if test "$cf_cv_ncurses_h2" != no ; then
9384                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9385                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9386                                 break
9387                         fi
9388                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9389                 done
9390                 CPPFLAGS="$cf_save2_CPPFLAGS"
9391                 test "$cf_cv_ncurses_h2" != no && break
9392         done
9393         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9393: error: not found" >&5
9394 echo "$as_me: error: not found" >&2;}
9395    { (exit 1); exit 1; }; }
9396
9397 fi
9398 echo "$as_me:9398: result: $cf_cv_ncurses_h2" >&5
9399 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9400
9401         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9402         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9403         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9404                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9405         fi
9406
9407 if test -n "$cf_1st_incdir" ; then
9408   for cf_add_incdir in $cf_1st_incdir
9409   do
9410         while test $cf_add_incdir != /usr/include
9411         do
9412           if test -d $cf_add_incdir
9413           then
9414                 cf_have_incdir=no
9415                 if test -n "$CFLAGS$CPPFLAGS" ; then
9416                   # a loop is needed to ensure we can add subdirs of existing dirs
9417                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9418                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9419                           cf_have_incdir=yes; break
9420                         fi
9421                   done
9422                 fi
9423
9424                 if test "$cf_have_incdir" = no ; then
9425                   if test "$cf_add_incdir" = /usr/local/include ; then
9426                         if test "$GCC" = yes
9427                         then
9428                           cf_save_CPPFLAGS=$CPPFLAGS
9429
9430         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9431         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9432
9433                           cat >conftest.$ac_ext <<_ACEOF
9434 #line 9434 "configure"
9435 #include "confdefs.h"
9436 #include <stdio.h>
9437 int
9438 main (void)
9439 {
9440 printf("Hello")
9441   ;
9442   return 0;
9443 }
9444 _ACEOF
9445 rm -f conftest.$ac_objext
9446 if { (eval echo "$as_me:9446: \"$ac_compile\"") >&5
9447   (eval $ac_compile) 2>&5
9448   ac_status=$?
9449   echo "$as_me:9449: \$? = $ac_status" >&5
9450   (exit $ac_status); } &&
9451          { ac_try='test -s conftest.$ac_objext'
9452   { (eval echo "$as_me:9452: \"$ac_try\"") >&5
9453   (eval $ac_try) 2>&5
9454   ac_status=$?
9455   echo "$as_me:9455: \$? = $ac_status" >&5
9456   (exit $ac_status); }; }; then
9457   :
9458 else
9459   echo "$as_me: failed program was:" >&5
9460 cat conftest.$ac_ext >&5
9461 cf_have_incdir=yes
9462 fi
9463 rm -f conftest.$ac_objext conftest.$ac_ext
9464                           CPPFLAGS=$cf_save_CPPFLAGS
9465                         fi
9466                   fi
9467                 fi
9468
9469                 if test "$cf_have_incdir" = no ; then
9470                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9471
9472 echo "${as_me:-configure}:9472: testing adding $cf_add_incdir to include-path ..." 1>&5
9473
9474                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9475
9476                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9477                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9478                   cf_add_incdir="$cf_top_incdir"
9479                 else
9480                   break
9481                 fi
9482           else
9483                 break
9484           fi
9485         done
9486   done
9487 fi
9488
9489 fi
9490
9491 # Set definitions to allow ifdef'ing for ncurses.h
9492
9493 case $cf_cv_ncurses_header in
9494 (*ncurses.h)
9495
9496 cat >>confdefs.h <<\EOF
9497 #define HAVE_NCURSES_H 1
9498 EOF
9499
9500         ;;
9501 esac
9502
9503 case $cf_cv_ncurses_header in
9504 (ncurses/curses.h|ncurses/ncurses.h)
9505
9506 cat >>confdefs.h <<\EOF
9507 #define HAVE_NCURSES_NCURSES_H 1
9508 EOF
9509
9510         ;;
9511 (ncursesw/curses.h|ncursesw/ncurses.h)
9512
9513 cat >>confdefs.h <<\EOF
9514 #define HAVE_NCURSESW_NCURSES_H 1
9515 EOF
9516
9517         ;;
9518 esac
9519
9520 echo "$as_me:9520: checking for terminfo header" >&5
9521 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9522 if test "${cf_cv_term_header+set}" = set; then
9523   echo $ECHO_N "(cached) $ECHO_C" >&6
9524 else
9525
9526 case ${cf_cv_ncurses_header} in
9527 (*/ncurses.h|*/ncursesw.h)
9528         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9529         ;;
9530 (*)
9531         cf_term_header=term.h
9532         ;;
9533 esac
9534
9535 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9536 do
9537 cat >conftest.$ac_ext <<_ACEOF
9538 #line 9538 "configure"
9539 #include "confdefs.h"
9540 #include <stdio.h>
9541 #include <${cf_cv_ncurses_header:-curses.h}>
9542 #include <$cf_test>
9543
9544 int
9545 main (void)
9546 {
9547 int x = auto_left_margin
9548   ;
9549   return 0;
9550 }
9551 _ACEOF
9552 rm -f conftest.$ac_objext
9553 if { (eval echo "$as_me:9553: \"$ac_compile\"") >&5
9554   (eval $ac_compile) 2>&5
9555   ac_status=$?
9556   echo "$as_me:9556: \$? = $ac_status" >&5
9557   (exit $ac_status); } &&
9558          { ac_try='test -s conftest.$ac_objext'
9559   { (eval echo "$as_me:9559: \"$ac_try\"") >&5
9560   (eval $ac_try) 2>&5
9561   ac_status=$?
9562   echo "$as_me:9562: \$? = $ac_status" >&5
9563   (exit $ac_status); }; }; then
9564
9565         cf_cv_term_header="$cf_test"
9566 else
9567   echo "$as_me: failed program was:" >&5
9568 cat conftest.$ac_ext >&5
9569
9570         cf_cv_term_header=unknown
9571
9572 fi
9573 rm -f conftest.$ac_objext conftest.$ac_ext
9574         test "$cf_cv_term_header" != unknown && break
9575 done
9576
9577 fi
9578 echo "$as_me:9578: result: $cf_cv_term_header" >&5
9579 echo "${ECHO_T}$cf_cv_term_header" >&6
9580
9581 # Set definitions to allow ifdef'ing to accommodate subdirectories
9582
9583 case $cf_cv_term_header in
9584 (*term.h)
9585
9586 cat >>confdefs.h <<\EOF
9587 #define HAVE_TERM_H 1
9588 EOF
9589
9590         ;;
9591 esac
9592
9593 case $cf_cv_term_header in
9594 (ncurses/term.h)
9595
9596 cat >>confdefs.h <<\EOF
9597 #define HAVE_NCURSES_TERM_H 1
9598 EOF
9599
9600         ;;
9601 (ncursesw/term.h)
9602
9603 cat >>confdefs.h <<\EOF
9604 #define HAVE_NCURSESW_TERM_H 1
9605 EOF
9606
9607         ;;
9608 esac
9609
9610 # some applications need this, but should check for NCURSES_VERSION
9611
9612 cat >>confdefs.h <<\EOF
9613 #define NCURSES 1
9614 EOF
9615
9616 echo "$as_me:9616: checking for ncurses version" >&5
9617 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9618 if test "${cf_cv_ncurses_version+set}" = set; then
9619   echo $ECHO_N "(cached) $ECHO_C" >&6
9620 else
9621
9622         cf_cv_ncurses_version=no
9623         cf_tempfile=out$$
9624         rm -f $cf_tempfile
9625         if test "$cross_compiling" = yes; then
9626
9627         # This will not work if the preprocessor splits the line after the
9628         # Autoconf token.  The 'unproto' program does that.
9629         cat > conftest.$ac_ext <<EOF
9630 #include <${cf_cv_ncurses_header:-curses.h}>
9631 #undef Autoconf
9632 #ifdef NCURSES_VERSION
9633 Autoconf NCURSES_VERSION
9634 #else
9635 #ifdef __NCURSES_H
9636 Autoconf "old"
9637 #endif
9638 ;
9639 #endif
9640 EOF
9641         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9642         { (eval echo "$as_me:9642: \"$cf_try\"") >&5
9643   (eval $cf_try) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); }
9647         if test -f conftest.out ; then
9648                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9649                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9650                 rm -f conftest.out
9651         fi
9652
9653 else
9654   cat >conftest.$ac_ext <<_ACEOF
9655 #line 9655 "configure"
9656 #include "confdefs.h"
9657
9658 #include <${cf_cv_ncurses_header:-curses.h}>
9659 #include <stdio.h>
9660 int main(void)
9661 {
9662         FILE *fp = fopen("$cf_tempfile", "w");
9663 #ifdef NCURSES_VERSION
9664 # ifdef NCURSES_VERSION_PATCH
9665         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9666 # else
9667         fprintf(fp, "%s\n", NCURSES_VERSION);
9668 # endif
9669 #else
9670 # ifdef __NCURSES_H
9671         fprintf(fp, "old\n");
9672 # else
9673         make an error
9674 # endif
9675 #endif
9676         ${cf_cv_main_return:-return}(0);
9677 }
9678 _ACEOF
9679 rm -f conftest$ac_exeext
9680 if { (eval echo "$as_me:9680: \"$ac_link\"") >&5
9681   (eval $ac_link) 2>&5
9682   ac_status=$?
9683   echo "$as_me:9683: \$? = $ac_status" >&5
9684   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9685   { (eval echo "$as_me:9685: \"$ac_try\"") >&5
9686   (eval $ac_try) 2>&5
9687   ac_status=$?
9688   echo "$as_me:9688: \$? = $ac_status" >&5
9689   (exit $ac_status); }; }; then
9690
9691         cf_cv_ncurses_version=`cat $cf_tempfile`
9692 else
9693   echo "$as_me: program exited with status $ac_status" >&5
9694 echo "$as_me: failed program was:" >&5
9695 cat conftest.$ac_ext >&5
9696 fi
9697 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9698 fi
9699         rm -f $cf_tempfile
9700
9701 fi
9702 echo "$as_me:9702: result: $cf_cv_ncurses_version" >&5
9703 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9704 test "$cf_cv_ncurses_version" = no ||
9705 cat >>confdefs.h <<\EOF
9706 #define NCURSES 1
9707 EOF
9708
9709 cf_nculib_root=ncurses
9710         # This works, except for the special case where we find gpm, but
9711         # ncurses is in a nonstandard location via $LIBS, and we really want
9712         # to link gpm.
9713 cf_ncurses_LIBS=""
9714 cf_ncurses_SAVE="$LIBS"
9715 echo "$as_me:9715: checking for Gpm_Open in -lgpm" >&5
9716 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9717 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9718   echo $ECHO_N "(cached) $ECHO_C" >&6
9719 else
9720   ac_check_lib_save_LIBS=$LIBS
9721 LIBS="-lgpm  $LIBS"
9722 cat >conftest.$ac_ext <<_ACEOF
9723 #line 9723 "configure"
9724 #include "confdefs.h"
9725
9726 /* Override any gcc2 internal prototype to avoid an error.  */
9727 #ifdef __cplusplus
9728 extern "C"
9729 #endif
9730 /* We use char because int might match the return type of a gcc2
9731    builtin and then its argument prototype would still apply.  */
9732 char Gpm_Open ();
9733 int
9734 main (void)
9735 {
9736 Gpm_Open ();
9737   ;
9738   return 0;
9739 }
9740 _ACEOF
9741 rm -f conftest.$ac_objext conftest$ac_exeext
9742 if { (eval echo "$as_me:9742: \"$ac_link\"") >&5
9743   (eval $ac_link) 2>&5
9744   ac_status=$?
9745   echo "$as_me:9745: \$? = $ac_status" >&5
9746   (exit $ac_status); } &&
9747          { ac_try='test -s conftest$ac_exeext'
9748   { (eval echo "$as_me:9748: \"$ac_try\"") >&5
9749   (eval $ac_try) 2>&5
9750   ac_status=$?
9751   echo "$as_me:9751: \$? = $ac_status" >&5
9752   (exit $ac_status); }; }; then
9753   ac_cv_lib_gpm_Gpm_Open=yes
9754 else
9755   echo "$as_me: failed program was:" >&5
9756 cat conftest.$ac_ext >&5
9757 ac_cv_lib_gpm_Gpm_Open=no
9758 fi
9759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9760 LIBS=$ac_check_lib_save_LIBS
9761 fi
9762 echo "$as_me:9762: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9763 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9764 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9765   echo "$as_me:9765: checking for initscr in -lgpm" >&5
9766 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9767 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9768   echo $ECHO_N "(cached) $ECHO_C" >&6
9769 else
9770   ac_check_lib_save_LIBS=$LIBS
9771 LIBS="-lgpm  $LIBS"
9772 cat >conftest.$ac_ext <<_ACEOF
9773 #line 9773 "configure"
9774 #include "confdefs.h"
9775
9776 /* Override any gcc2 internal prototype to avoid an error.  */
9777 #ifdef __cplusplus
9778 extern "C"
9779 #endif
9780 /* We use char because int might match the return type of a gcc2
9781    builtin and then its argument prototype would still apply.  */
9782 char initscr ();
9783 int
9784 main (void)
9785 {
9786 initscr ();
9787   ;
9788   return 0;
9789 }
9790 _ACEOF
9791 rm -f conftest.$ac_objext conftest$ac_exeext
9792 if { (eval echo "$as_me:9792: \"$ac_link\"") >&5
9793   (eval $ac_link) 2>&5
9794   ac_status=$?
9795   echo "$as_me:9795: \$? = $ac_status" >&5
9796   (exit $ac_status); } &&
9797          { ac_try='test -s conftest$ac_exeext'
9798   { (eval echo "$as_me:9798: \"$ac_try\"") >&5
9799   (eval $ac_try) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); }; }; then
9803   ac_cv_lib_gpm_initscr=yes
9804 else
9805   echo "$as_me: failed program was:" >&5
9806 cat conftest.$ac_ext >&5
9807 ac_cv_lib_gpm_initscr=no
9808 fi
9809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9810 LIBS=$ac_check_lib_save_LIBS
9811 fi
9812 echo "$as_me:9812: result: $ac_cv_lib_gpm_initscr" >&5
9813 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9814 if test $ac_cv_lib_gpm_initscr = yes; then
9815   LIBS="$cf_ncurses_SAVE"
9816 else
9817   cf_ncurses_LIBS="-lgpm"
9818 fi
9819
9820 fi
9821
9822 case $host_os in
9823 (freebsd*)
9824         # This is only necessary if you are linking against an obsolete
9825         # version of ncurses (but it should do no harm, since it's static).
9826         if test "$cf_nculib_root" = ncurses ; then
9827                 echo "$as_me:9827: checking for tgoto in -lmytinfo" >&5
9828 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9829 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9830   echo $ECHO_N "(cached) $ECHO_C" >&6
9831 else
9832   ac_check_lib_save_LIBS=$LIBS
9833 LIBS="-lmytinfo  $LIBS"
9834 cat >conftest.$ac_ext <<_ACEOF
9835 #line 9835 "configure"
9836 #include "confdefs.h"
9837
9838 /* Override any gcc2 internal prototype to avoid an error.  */
9839 #ifdef __cplusplus
9840 extern "C"
9841 #endif
9842 /* We use char because int might match the return type of a gcc2
9843    builtin and then its argument prototype would still apply.  */
9844 char tgoto ();
9845 int
9846 main (void)
9847 {
9848 tgoto ();
9849   ;
9850   return 0;
9851 }
9852 _ACEOF
9853 rm -f conftest.$ac_objext conftest$ac_exeext
9854 if { (eval echo "$as_me:9854: \"$ac_link\"") >&5
9855   (eval $ac_link) 2>&5
9856   ac_status=$?
9857   echo "$as_me:9857: \$? = $ac_status" >&5
9858   (exit $ac_status); } &&
9859          { ac_try='test -s conftest$ac_exeext'
9860   { (eval echo "$as_me:9860: \"$ac_try\"") >&5
9861   (eval $ac_try) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit $ac_status); }; }; then
9865   ac_cv_lib_mytinfo_tgoto=yes
9866 else
9867   echo "$as_me: failed program was:" >&5
9868 cat conftest.$ac_ext >&5
9869 ac_cv_lib_mytinfo_tgoto=no
9870 fi
9871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9872 LIBS=$ac_check_lib_save_LIBS
9873 fi
9874 echo "$as_me:9874: result: $ac_cv_lib_mytinfo_tgoto" >&5
9875 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9876 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9877   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9878 fi
9879
9880         fi
9881         ;;
9882 esac
9883
9884 cf_add_libs="$LIBS"
9885 # reverse order
9886 cf_add_0lib=
9887 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9888 # filter duplicates
9889 for cf_add_1lib in $cf_add_0lib; do
9890         for cf_add_2lib in $cf_add_libs; do
9891                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9892                         cf_add_1lib=
9893                         break
9894                 fi
9895         done
9896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9897 done
9898 LIBS="$cf_add_libs"
9899
9900 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9901 then
9902
9903 cf_add_libs="$LIBS"
9904 # reverse order
9905 cf_add_0lib=
9906 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9907 # filter duplicates
9908 for cf_add_1lib in $cf_add_0lib; do
9909         for cf_add_2lib in $cf_add_libs; do
9910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9911                         cf_add_1lib=
9912                         break
9913                 fi
9914         done
9915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9916 done
9917 LIBS="$cf_add_libs"
9918
9919 else
9920
9921         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9922         cf_libdir=""
9923         echo "$as_me:9923: checking for initscr" >&5
9924 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9925 if test "${ac_cv_func_initscr+set}" = set; then
9926   echo $ECHO_N "(cached) $ECHO_C" >&6
9927 else
9928   cat >conftest.$ac_ext <<_ACEOF
9929 #line 9929 "configure"
9930 #include "confdefs.h"
9931 #define initscr autoconf_temporary
9932 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9933 #undef initscr
9934
9935 #ifdef __cplusplus
9936 extern "C"
9937 #endif
9938
9939 /* We use char because int might match the return type of a gcc2
9940    builtin and then its argument prototype would still apply.  */
9941 char initscr (void);
9942
9943 int
9944 main (void)
9945 {
9946
9947 /* The GNU C library defines stubs for functions which it implements
9948     to always fail with ENOSYS.  Some functions are actually named
9949     something starting with __ and the normal name is an alias.  */
9950 #if defined (__stub_initscr) || defined (__stub___initscr)
9951 #error found stub for initscr
9952 #endif
9953
9954         return initscr ();
9955   ;
9956   return 0;
9957 }
9958 _ACEOF
9959 rm -f conftest.$ac_objext conftest$ac_exeext
9960 if { (eval echo "$as_me:9960: \"$ac_link\"") >&5
9961   (eval $ac_link) 2>&5
9962   ac_status=$?
9963   echo "$as_me:9963: \$? = $ac_status" >&5
9964   (exit $ac_status); } &&
9965          { ac_try='test -s conftest$ac_exeext'
9966   { (eval echo "$as_me:9966: \"$ac_try\"") >&5
9967   (eval $ac_try) 2>&5
9968   ac_status=$?
9969   echo "$as_me:9969: \$? = $ac_status" >&5
9970   (exit $ac_status); }; }; then
9971   ac_cv_func_initscr=yes
9972 else
9973   echo "$as_me: failed program was:" >&5
9974 cat conftest.$ac_ext >&5
9975 ac_cv_func_initscr=no
9976 fi
9977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9978 fi
9979 echo "$as_me:9979: result: $ac_cv_func_initscr" >&5
9980 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9981 if test $ac_cv_func_initscr = yes; then
9982   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9983 else
9984
9985                 cf_save_LIBS="$LIBS"
9986                 echo "$as_me:9986: checking for initscr in -l$cf_nculib_root" >&5
9987 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9988                 LIBS="-l$cf_nculib_root $LIBS"
9989                 cat >conftest.$ac_ext <<_ACEOF
9990 #line 9990 "configure"
9991 #include "confdefs.h"
9992 #include <${cf_cv_ncurses_header:-curses.h}>
9993 int
9994 main (void)
9995 {
9996 initscr()
9997   ;
9998   return 0;
9999 }
10000 _ACEOF
10001 rm -f conftest.$ac_objext conftest$ac_exeext
10002 if { (eval echo "$as_me:10002: \"$ac_link\"") >&5
10003   (eval $ac_link) 2>&5
10004   ac_status=$?
10005   echo "$as_me:10005: \$? = $ac_status" >&5
10006   (exit $ac_status); } &&
10007          { ac_try='test -s conftest$ac_exeext'
10008   { (eval echo "$as_me:10008: \"$ac_try\"") >&5
10009   (eval $ac_try) 2>&5
10010   ac_status=$?
10011   echo "$as_me:10011: \$? = $ac_status" >&5
10012   (exit $ac_status); }; }; then
10013   echo "$as_me:10013: result: yes" >&5
10014 echo "${ECHO_T}yes" >&6
10015                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10016
10017 else
10018   echo "$as_me: failed program was:" >&5
10019 cat conftest.$ac_ext >&5
10020 echo "$as_me:10020: result: no" >&5
10021 echo "${ECHO_T}no" >&6
10022
10023 cf_search=
10024 cf_library_path_list=""
10025 if test -n "${LDFLAGS}${LIBS}" ; then
10026         for cf_library_path in $LDFLAGS $LIBS
10027         do
10028                 case $cf_library_path in
10029                 (-L*)
10030                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10031
10032 test "x$cf_library_path" != "xNONE" && \
10033 test -d "$cf_library_path" && \
10034  {
10035         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10036         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10037         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10038         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10039         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10040         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
10041 }
10042
10043                         cf_library_path_list="$cf_library_path_list $cf_search"
10044                         ;;
10045                 esac
10046         done
10047 fi
10048
10049 cf_search=
10050
10051 test "x$prefix" != "xNONE" && \
10052 test -d "$prefix" && \
10053  {
10054         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10055         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10056         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10057         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10058         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10059         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10060 }
10061
10062 for cf_subdir_prefix in \
10063         /usr \
10064         /usr/local \
10065         /usr/pkg \
10066         /opt \
10067         /opt/local \
10068         $HOME
10069 do
10070
10071 test "x$cf_subdir_prefix" != "x$prefix" && \
10072 test -d "$cf_subdir_prefix" && \
10073 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10074         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10075         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10076         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10077         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10078         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10079         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
10080 }
10081
10082 done
10083
10084 cf_search="$cf_library_path_list $cf_search"
10085
10086                         for cf_libdir in $cf_search
10087                         do
10088                                 echo "$as_me:10088: checking for -l$cf_nculib_root in $cf_libdir" >&5
10089 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10090                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10091                                 cat >conftest.$ac_ext <<_ACEOF
10092 #line 10092 "configure"
10093 #include "confdefs.h"
10094 #include <${cf_cv_ncurses_header:-curses.h}>
10095 int
10096 main (void)
10097 {
10098 initscr()
10099   ;
10100   return 0;
10101 }
10102 _ACEOF
10103 rm -f conftest.$ac_objext conftest$ac_exeext
10104 if { (eval echo "$as_me:10104: \"$ac_link\"") >&5
10105   (eval $ac_link) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); } &&
10109          { ac_try='test -s conftest$ac_exeext'
10110   { (eval echo "$as_me:10110: \"$ac_try\"") >&5
10111   (eval $ac_try) 2>&5
10112   ac_status=$?
10113   echo "$as_me:10113: \$? = $ac_status" >&5
10114   (exit $ac_status); }; }; then
10115   echo "$as_me:10115: result: yes" >&5
10116 echo "${ECHO_T}yes" >&6
10117                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10118                                          break
10119 else
10120   echo "$as_me: failed program was:" >&5
10121 cat conftest.$ac_ext >&5
10122 echo "$as_me:10122: result: no" >&5
10123 echo "${ECHO_T}no" >&6
10124                                          LIBS="$cf_save_LIBS"
10125 fi
10126 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10127                         done
10128
10129 fi
10130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10131
10132 fi
10133
10134 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10135
10136 if test $cf_found_library = no ; then
10137         { { echo "$as_me:10137: error: Cannot link $cf_nculib_root library" >&5
10138 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10139    { (exit 1); exit 1; }; }
10140 fi
10141
10142 fi
10143
10144 if test -n "$cf_ncurses_LIBS" ; then
10145         echo "$as_me:10145: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10146 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10147         cf_ncurses_SAVE="$LIBS"
10148         for p in $cf_ncurses_LIBS ; do
10149                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10150                 if test "$q" != "$LIBS" ; then
10151                         LIBS="$q"
10152                 fi
10153         done
10154         cat >conftest.$ac_ext <<_ACEOF
10155 #line 10155 "configure"
10156 #include "confdefs.h"
10157 #include <${cf_cv_ncurses_header:-curses.h}>
10158 int
10159 main (void)
10160 {
10161 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10162   ;
10163   return 0;
10164 }
10165 _ACEOF
10166 rm -f conftest.$ac_objext conftest$ac_exeext
10167 if { (eval echo "$as_me:10167: \"$ac_link\"") >&5
10168   (eval $ac_link) 2>&5
10169   ac_status=$?
10170   echo "$as_me:10170: \$? = $ac_status" >&5
10171   (exit $ac_status); } &&
10172          { ac_try='test -s conftest$ac_exeext'
10173   { (eval echo "$as_me:10173: \"$ac_try\"") >&5
10174   (eval $ac_try) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); }; }; then
10178   echo "$as_me:10178: result: yes" >&5
10179 echo "${ECHO_T}yes" >&6
10180 else
10181   echo "$as_me: failed program was:" >&5
10182 cat conftest.$ac_ext >&5
10183 echo "$as_me:10183: result: no" >&5
10184 echo "${ECHO_T}no" >&6
10185                  LIBS="$cf_ncurses_SAVE"
10186 fi
10187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10188 fi
10189
10190 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10191
10192 cat >>confdefs.h <<EOF
10193 #define $cf_nculib_ROOT 1
10194 EOF
10195
10196         fi
10197 else
10198         NCURSES_CONFIG=none
10199 fi
10200
10201 fi
10202
10203 if test "$NCURSES_CONFIG_PKG" != none ; then
10204         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10205
10206         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10207         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10208         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10209
10210         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10211         if test -z "$cf_cv_abi_version"
10212         then
10213                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10214         fi
10215
10216 elif test "$NCURSES_CONFIG" != none ; then
10217
10218         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10219
10220         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10221         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10222         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10223
10224         # ABI version is not available from headers
10225         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10226
10227 else
10228
10229         for cf_name in MAJOR MINOR PATCH
10230         do
10231         cat >conftest.$ac_ext <<CF_EOF
10232         #include <${cf_cv_ncurses_header:-curses.h}>
10233         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10234 CF_EOF
10235                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10236                 { (eval echo "$as_me:10236: \"$cf_try\"") >&5
10237   (eval $cf_try) 2>&5
10238   ac_status=$?
10239   echo "$as_me:10239: \$? = $ac_status" >&5
10240   (exit $ac_status); }
10241                 if test -f conftest.out ; then
10242                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10243                         eval NCURSES_$cf_name=\"$cf_result\"
10244                         # cat conftest.$ac_ext
10245                         # cat conftest.out
10246                 fi
10247         done
10248
10249         cf_cv_abi_version=${NCURSES_MAJOR}
10250
10251 fi
10252
10253 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10254
10255 cf_cv_timestamp=`date`
10256
10257 echo "$as_me:10257: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10258 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10259
10260 echo "$as_me:10260: checking if you want to have a library-prefix" >&5
10261 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10262
10263 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10264 if test "${with_lib_prefix+set}" = set; then
10265   withval="$with_lib_prefix"
10266   with_lib_prefix=$withval
10267 else
10268   with_lib_prefix=auto
10269 fi;
10270 echo "$as_me:10270: result: $with_lib_prefix" >&5
10271 echo "${ECHO_T}$with_lib_prefix" >&6
10272
10273 if test $with_lib_prefix = auto
10274 then
10275
10276         case $cf_cv_system_name in
10277         (OS/2*|os2*)
10278                 if test "$DFT_LWR_MODEL" = libtool; then
10279                         LIB_PREFIX='lib'
10280                 else
10281                         LIB_PREFIX=''
10282                 fi
10283                 ;;
10284         (*)     LIB_PREFIX='lib'
10285                 ;;
10286         esac
10287 cf_prefix=$LIB_PREFIX
10288
10289 elif test $with_lib_prefix = no
10290 then
10291         LIB_PREFIX=
10292 else
10293         LIB_PREFIX=$with_lib_prefix
10294 fi
10295
10296 LIB_SUFFIX=
10297
10298 ###############################################################################
10299
10300 if test X"$CC_G_OPT" = X"" ; then
10301         CC_G_OPT='-g'
10302         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10303 fi
10304
10305 echo "$as_me:10305: checking for default loader flags" >&5
10306 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10307 case $DFT_LWR_MODEL in
10308 (normal)  LD_MODEL=''   ;;
10309 (debug)   LD_MODEL=$CC_G_OPT ;;
10310 (profile) LD_MODEL='-pg';;
10311 (shared)  LD_MODEL=''   ;;
10312 esac
10313 echo "$as_me:10313: result: $LD_MODEL" >&5
10314 echo "${ECHO_T}$LD_MODEL" >&6
10315
10316 LD_RPATH_OPT=
10317 if test "x$cf_cv_enable_rpath" != xno
10318 then
10319         echo "$as_me:10319: checking for an rpath option" >&5
10320 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10321         case $cf_cv_system_name in
10322         (irix*)
10323                 if test "$GCC" = yes; then
10324                         LD_RPATH_OPT="-Wl,-rpath,"
10325                 else
10326                         LD_RPATH_OPT="-rpath "
10327                 fi
10328                 ;;
10329         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10330                 LD_RPATH_OPT="-Wl,-rpath,"
10331                 ;;
10332         (openbsd[2-9].*|mirbsd*)
10333                 LD_RPATH_OPT="-Wl,-rpath,"
10334                 ;;
10335         (dragonfly*)
10336                 LD_RPATH_OPT="-rpath "
10337                 ;;
10338         (netbsd*)
10339                 LD_RPATH_OPT="-Wl,-rpath,"
10340                 ;;
10341         (osf*|mls+*)
10342                 LD_RPATH_OPT="-rpath "
10343                 ;;
10344         (solaris2*)
10345                 LD_RPATH_OPT="-R"
10346                 ;;
10347         (*)
10348                 ;;
10349         esac
10350         echo "$as_me:10350: result: $LD_RPATH_OPT" >&5
10351 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10352
10353         case "x$LD_RPATH_OPT" in
10354         (x-R*)
10355                 echo "$as_me:10355: checking if we need a space after rpath option" >&5
10356 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10357                 cf_save_LIBS="$LIBS"
10358
10359 cf_add_libs="$LIBS"
10360 # reverse order
10361 cf_add_0lib=
10362 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10363 # filter duplicates
10364 for cf_add_1lib in $cf_add_0lib; do
10365         for cf_add_2lib in $cf_add_libs; do
10366                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10367                         cf_add_1lib=
10368                         break
10369                 fi
10370         done
10371         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10372 done
10373 LIBS="$cf_add_libs"
10374
10375                 cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 int
10380 main (void)
10381 {
10382
10383   ;
10384   return 0;
10385 }
10386 _ACEOF
10387 rm -f conftest.$ac_objext conftest$ac_exeext
10388 if { (eval echo "$as_me:10388: \"$ac_link\"") >&5
10389   (eval $ac_link) 2>&5
10390   ac_status=$?
10391   echo "$as_me:10391: \$? = $ac_status" >&5
10392   (exit $ac_status); } &&
10393          { ac_try='test -s conftest$ac_exeext'
10394   { (eval echo "$as_me:10394: \"$ac_try\"") >&5
10395   (eval $ac_try) 2>&5
10396   ac_status=$?
10397   echo "$as_me:10397: \$? = $ac_status" >&5
10398   (exit $ac_status); }; }; then
10399   cf_rpath_space=no
10400 else
10401   echo "$as_me: failed program was:" >&5
10402 cat conftest.$ac_ext >&5
10403 cf_rpath_space=yes
10404 fi
10405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10406                 LIBS="$cf_save_LIBS"
10407                 echo "$as_me:10407: result: $cf_rpath_space" >&5
10408 echo "${ECHO_T}$cf_rpath_space" >&6
10409                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
10410                 ;;
10411         esac
10412 fi
10413
10414         RM_SHARED_OPTS=
10415         LOCAL_LDFLAGS=
10416         LOCAL_LDFLAGS2=
10417         LD_SHARED_OPTS=
10418         INSTALL_LIB="-m 644"
10419         : ${rel_builddir:=.}
10420
10421         shlibdir=$libdir
10422
10423         MAKE_DLLS="#"
10424
10425         cf_cv_do_symlinks=no
10426         cf_ld_rpath_opt=
10427         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
10428
10429         echo "$as_me:10429: checking if release/abi version should be used for shared libs" >&5
10430 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
10431
10432 # Check whether --with-shlib-version or --without-shlib-version was given.
10433 if test "${with_shlib_version+set}" = set; then
10434   withval="$with_shlib_version"
10435   test -z "$withval" && withval=auto
10436         case $withval in
10437         (yes)
10438                 cf_cv_shlib_version=auto
10439                 ;;
10440         (rel|abi|auto)
10441                 cf_cv_shlib_version=$withval
10442                 ;;
10443         (*)
10444                 echo "$as_me:10444: result: $withval" >&5
10445 echo "${ECHO_T}$withval" >&6
10446                 { { echo "$as_me:10446: error: option value must be one of: rel, abi, or auto" >&5
10447 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
10448    { (exit 1); exit 1; }; }
10449                 ;;
10450         esac
10451
10452 else
10453   cf_cv_shlib_version=auto
10454 fi;
10455         echo "$as_me:10455: result: $cf_cv_shlib_version" >&5
10456 echo "${ECHO_T}$cf_cv_shlib_version" >&6
10457
10458         cf_cv_rm_so_locs=no
10459         cf_try_cflags=
10460
10461         # Some less-capable ports of gcc support only -fpic
10462         CC_SHARED_OPTS=
10463
10464         cf_try_fPIC=no
10465         if test "$GCC" = yes
10466         then
10467                 cf_try_fPIC=yes
10468         else
10469                 case $cf_cv_system_name in
10470                 (*linux*)       # e.g., PGI compiler
10471                         cf_try_fPIC=yes
10472                         ;;
10473                 esac
10474         fi
10475
10476         if test "$cf_try_fPIC" = yes
10477         then
10478                 echo "$as_me:10478: checking which $CC option to use" >&5
10479 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
10480                 cf_save_CFLAGS="$CFLAGS"
10481                 for CC_SHARED_OPTS in -fPIC -fpic ''
10482                 do
10483                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
10484                         cat >conftest.$ac_ext <<_ACEOF
10485 #line 10485 "configure"
10486 #include "confdefs.h"
10487 #include <stdio.h>
10488 int
10489 main (void)
10490 {
10491 int x = 1
10492   ;
10493   return 0;
10494 }
10495 _ACEOF
10496 rm -f conftest.$ac_objext
10497 if { (eval echo "$as_me:10497: \"$ac_compile\"") >&5
10498   (eval $ac_compile) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); } &&
10502          { ac_try='test -s conftest.$ac_objext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508   break
10509 else
10510   echo "$as_me: failed program was:" >&5
10511 cat conftest.$ac_ext >&5
10512 fi
10513 rm -f conftest.$ac_objext conftest.$ac_ext
10514                 done
10515                 echo "$as_me:10515: result: $CC_SHARED_OPTS" >&5
10516 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
10517                 CFLAGS="$cf_save_CFLAGS"
10518         fi
10519
10520         cf_cv_shlib_version_infix=no
10521
10522         case $cf_cv_system_name in
10523         (aix4.3-9*|aix[5-7]*)
10524                 if test "$GCC" = yes; then
10525                         CC_SHARED_OPTS='-Wl,-brtl'
10526                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10527                 else
10528                         CC_SHARED_OPTS='-brtl'
10529                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
10530                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10531                 fi
10532                 ;;
10533         (beos*)
10534                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
10535                 ;;
10536         (cygwin*)
10537                 CC_SHARED_OPTS=
10538                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10539                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10540                 cf_cv_shlib_version=cygdll
10541                 cf_cv_shlib_version_infix=cygdll
10542                 shlibdir=$bindir
10543                 MAKE_DLLS=
10544                 cat >mk_shared_lib.sh <<-CF_EOF
10545                 #!$SHELL
10546                 SHARED_LIB=\$1
10547                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10548                 shift
10549                 cat <<-EOF
10550                 Linking shared library
10551                 ** SHARED_LIB \$SHARED_LIB
10552                 ** IMPORT_LIB \$IMPORT_LIB
10553 EOF
10554                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10555 CF_EOF
10556                 chmod +x mk_shared_lib.sh
10557                 ;;
10558         (msys*)
10559                 CC_SHARED_OPTS=
10560                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10561                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10562                 cf_cv_shlib_version=msysdll
10563                 cf_cv_shlib_version_infix=msysdll
10564                 shlibdir=$bindir
10565                 MAKE_DLLS=
10566                 cat >mk_shared_lib.sh <<-CF_EOF
10567                 #!$SHELL
10568                 SHARED_LIB=\$1
10569                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10570                 shift
10571                 cat <<-EOF
10572                 Linking shared library
10573                 ** SHARED_LIB \$SHARED_LIB
10574                 ** IMPORT_LIB \$IMPORT_LIB
10575 EOF
10576                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10577 CF_EOF
10578                 chmod +x mk_shared_lib.sh
10579                 ;;
10580         (darwin*)
10581                 cf_try_cflags="no-cpp-precomp"
10582                 CC_SHARED_OPTS="-dynamic"
10583                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
10584                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
10585                 cf_cv_shlib_version_infix=yes
10586                 echo "$as_me:10586: checking if ld -search_paths_first works" >&5
10587 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
10588 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
10589   echo $ECHO_N "(cached) $ECHO_C" >&6
10590 else
10591
10592                         cf_save_LDFLAGS=$LDFLAGS
10593                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10594                         cat >conftest.$ac_ext <<_ACEOF
10595 #line 10595 "configure"
10596 #include "confdefs.h"
10597
10598 int
10599 main (void)
10600 {
10601 int i;
10602   ;
10603   return 0;
10604 }
10605 _ACEOF
10606 rm -f conftest.$ac_objext conftest$ac_exeext
10607 if { (eval echo "$as_me:10607: \"$ac_link\"") >&5
10608   (eval $ac_link) 2>&5
10609   ac_status=$?
10610   echo "$as_me:10610: \$? = $ac_status" >&5
10611   (exit $ac_status); } &&
10612          { ac_try='test -s conftest$ac_exeext'
10613   { (eval echo "$as_me:10613: \"$ac_try\"") >&5
10614   (eval $ac_try) 2>&5
10615   ac_status=$?
10616   echo "$as_me:10616: \$? = $ac_status" >&5
10617   (exit $ac_status); }; }; then
10618   cf_cv_ldflags_search_paths_first=yes
10619 else
10620   echo "$as_me: failed program was:" >&5
10621 cat conftest.$ac_ext >&5
10622 cf_cv_ldflags_search_paths_first=no
10623 fi
10624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10625                                 LDFLAGS=$cf_save_LDFLAGS
10626 fi
10627 echo "$as_me:10627: result: $cf_cv_ldflags_search_paths_first" >&5
10628 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
10629                 if test $cf_cv_ldflags_search_paths_first = yes; then
10630                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10631                 fi
10632                 ;;
10633         (hpux[7-8]*)
10634                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
10635                 if test "$GCC" != yes; then
10636                         CC_SHARED_OPTS='+Z'
10637                 fi
10638                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
10639                 INSTALL_LIB="-m 555"
10640                 ;;
10641         (hpux*)
10642                 # (tested with gcc 2.7.2 -- I don't have c89)
10643                 if test "$GCC" = yes; then
10644                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
10645                 else
10646                         CC_SHARED_OPTS='+Z'
10647                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
10648                 fi
10649                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
10650                 # HP-UX shared libraries must be executable, and should be
10651                 # readonly to exploit a quirk in the memory manager.
10652                 INSTALL_LIB="-m 555"
10653                 ;;
10654         (interix*)
10655                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10656                 if test "$cf_cv_shlib_version" = rel; then
10657                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10658                 else
10659                         cf_shared_soname='`basename $@`'
10660                 fi
10661                 CC_SHARED_OPTS=
10662                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
10663                 ;;
10664         (irix*)
10665                 if test "$cf_cv_enable_rpath" = yes ; then
10666                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10667                 fi
10668                 # tested with IRIX 5.2 and 'cc'.
10669                 if test "$GCC" != yes; then
10670                         CC_SHARED_OPTS='-KPIC'
10671                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
10672                 else
10673                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
10674                 fi
10675                 cf_cv_rm_so_locs=yes
10676                 ;;
10677         (linux*|gnu*|k*bsd*-gnu)
10678                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10679                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10680                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10681                 fi
10682                 if test "$cf_cv_enable_rpath" = yes ; then
10683                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10684                 fi
10685
10686         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10687         if test "$cf_cv_shlib_version" = rel; then
10688                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10689         else
10690                 cf_cv_shared_soname='`basename $@`'
10691         fi
10692
10693                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10694                 ;;
10695         (mingw*)
10696                 cf_cv_shlib_version=mingw
10697                 cf_cv_shlib_version_infix=mingw
10698                 shlibdir=$bindir
10699                 MAKE_DLLS=
10700                 if test "$DFT_LWR_MODEL" = "shared" ; then
10701                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
10702                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10703                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
10704                 fi
10705                 CC_SHARED_OPTS=
10706                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10707                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10708                 cat >mk_shared_lib.sh <<-CF_EOF
10709                 #!$SHELL
10710                 SHARED_LIB=\$1
10711                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
10712                 shift
10713                 cat <<-EOF
10714                 Linking shared library
10715                 ** SHARED_LIB \$SHARED_LIB
10716                 ** IMPORT_LIB \$IMPORT_LIB
10717 EOF
10718                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10719 CF_EOF
10720                 chmod +x mk_shared_lib.sh
10721                 ;;
10722         (openbsd[2-9].*|mirbsd*)
10723                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10724                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10725                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10726                 fi
10727                 if test "$cf_cv_enable_rpath" = yes ; then
10728                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10729                 fi
10730                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10731
10732         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10733         if test "$cf_cv_shlib_version" = rel; then
10734                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10735         else
10736                 cf_cv_shared_soname='`basename $@`'
10737         fi
10738
10739                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10740                 ;;
10741         (nto-qnx*|openbsd*|freebsd[12].*)
10742                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10743                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
10744                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10745                 ;;
10746         (dragonfly*|freebsd*)
10747                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10748                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10749                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10750                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
10751                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10752                 fi
10753
10754         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10755         if test "$cf_cv_shlib_version" = rel; then
10756                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10757         else
10758                 cf_cv_shared_soname='`basename $@`'
10759         fi
10760
10761                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10762                 ;;
10763         (netbsd*)
10764                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10765                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10766                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10767                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10768                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10769                         if test "$cf_cv_shlib_version" = auto; then
10770                         if test -f /usr/libexec/ld.elf_so; then
10771                                 cf_cv_shlib_version=abi
10772                         else
10773                                 cf_cv_shlib_version=rel
10774                         fi
10775                         fi
10776
10777         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10778         if test "$cf_cv_shlib_version" = rel; then
10779                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10780         else
10781                 cf_cv_shared_soname='`basename $@`'
10782         fi
10783
10784                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
10785                 else
10786                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
10787                 fi
10788                 ;;
10789         (osf*|mls+*)
10790                 # tested with OSF/1 V3.2 and 'cc'
10791                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
10792                 # link with shared libs).
10793                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
10794                 case $host_os in
10795                 (osf4*)
10796                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
10797                         ;;
10798                 esac
10799                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
10800                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10801                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10802                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10803                 fi
10804                 cf_cv_rm_so_locs=yes
10805                 ;;
10806         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
10807                 # tested with osr5.0.5
10808                 if test "$GCC" != yes; then
10809                         CC_SHARED_OPTS='-belf -KPIC'
10810                 fi
10811                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
10812                 if test "$cf_cv_enable_rpath" = yes ; then
10813                         # only way is to set LD_RUN_PATH but no switch for it
10814                         RUN_PATH=$libdir
10815                 fi
10816                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10817                 LINK_PROGS='LD_RUN_PATH=${libdir}'
10818                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
10819                 ;;
10820         (sunos4*)
10821                 # tested with SunOS 4.1.1 and gcc 2.7.0
10822                 if test "$GCC" != yes; then
10823                         CC_SHARED_OPTS='-KPIC'
10824                 fi
10825                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
10826                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10827                 ;;
10828         (solaris2*)
10829                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
10830                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
10831                 if test "$DFT_LWR_MODEL" = "shared" ; then
10832                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
10833                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10834                 fi
10835                 if test "$cf_cv_enable_rpath" = yes ; then
10836                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
10837                 fi
10838
10839         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10840         if test "$cf_cv_shlib_version" = rel; then
10841                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10842         else
10843                 cf_cv_shared_soname='`basename $@`'
10844         fi
10845
10846                 if test "$GCC" != yes; then
10847                         cf_save_CFLAGS="$CFLAGS"
10848                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
10849                         do
10850                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
10851                                 cat >conftest.$ac_ext <<_ACEOF
10852 #line 10852 "configure"
10853 #include "confdefs.h"
10854 #include <stdio.h>
10855 int
10856 main (void)
10857 {
10858 printf("Hello\n");
10859   ;
10860   return 0;
10861 }
10862 _ACEOF
10863 rm -f conftest.$ac_objext
10864 if { (eval echo "$as_me:10864: \"$ac_compile\"") >&5
10865   (eval $ac_compile) 2>&5
10866   ac_status=$?
10867   echo "$as_me:10867: \$? = $ac_status" >&5
10868   (exit $ac_status); } &&
10869          { ac_try='test -s conftest.$ac_objext'
10870   { (eval echo "$as_me:10870: \"$ac_try\"") >&5
10871   (eval $ac_try) 2>&5
10872   ac_status=$?
10873   echo "$as_me:10873: \$? = $ac_status" >&5
10874   (exit $ac_status); }; }; then
10875   break
10876 else
10877   echo "$as_me: failed program was:" >&5
10878 cat conftest.$ac_ext >&5
10879 fi
10880 rm -f conftest.$ac_objext conftest.$ac_ext
10881                         done
10882                         CFLAGS="$cf_save_CFLAGS"
10883                         CC_SHARED_OPTS=$cf_shared_opts
10884                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10885                 else
10886                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10887                 fi
10888                 ;;
10889         (sysv5uw7*|unix_sv*)
10890                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10891                 if test "$GCC" != yes; then
10892                         CC_SHARED_OPTS='-KPIC'
10893                 fi
10894                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10895                 ;;
10896         (*)
10897                 CC_SHARED_OPTS='unknown'
10898                 MK_SHARED_LIB='echo unknown'
10899                 ;;
10900         esac
10901
10902         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10903         case "$cf_cv_shlib_version" in
10904         (rel|abi)
10905                 case "$MK_SHARED_LIB" in
10906                 (*'-o $@')
10907                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10908                         ;;
10909                 (*)
10910                         { echo "$as_me:10910: WARNING: ignored --with-shlib-version" >&5
10911 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10912                         ;;
10913                 esac
10914                 ;;
10915         esac
10916
10917         if test -n "$cf_try_cflags"
10918         then
10919 cat > conftest.$ac_ext <<EOF
10920 #line 10920 "${as_me:-configure}"
10921 #include <stdio.h>
10922 int main(int argc, char *argv[])
10923 {
10924         printf("hello\n");
10925         return (argv[argc-1] == 0) ;
10926 }
10927 EOF
10928                 cf_save_CFLAGS="$CFLAGS"
10929                 for cf_opt in $cf_try_cflags
10930                 do
10931                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10932                         echo "$as_me:10932: checking if CFLAGS option -$cf_opt works" >&5
10933 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10934                         if { (eval echo "$as_me:10934: \"$ac_compile\"") >&5
10935   (eval $ac_compile) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit $ac_status); }; then
10939                                 echo "$as_me:10939: result: yes" >&5
10940 echo "${ECHO_T}yes" >&6
10941                                 cf_save_CFLAGS="$CFLAGS"
10942                         else
10943                                 echo "$as_me:10943: result: no" >&5
10944 echo "${ECHO_T}no" >&6
10945                         fi
10946                 done
10947                 CFLAGS="$cf_save_CFLAGS"
10948         fi
10949
10950         # RPATH_LIST is a colon-separated list of directories
10951         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10952         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10953
10954         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10955
10956         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10957
10958 echo "${as_me:-configure}:10958: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10959
10960         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10961
10962 echo "${as_me:-configure}:10962: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10963
10964 # The test/sample programs in the original tree link using rpath option.
10965 # Make it optional for packagers.
10966 if test -n "$LOCAL_LDFLAGS"
10967 then
10968         echo "$as_me:10968: checking if you want to link sample programs with rpath option" >&5
10969 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10970
10971 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10972 if test "${enable_rpath_link+set}" = set; then
10973   enableval="$enable_rpath_link"
10974   with_rpath_link=$enableval
10975 else
10976   with_rpath_link=yes
10977 fi;
10978         echo "$as_me:10978: result: $with_rpath_link" >&5
10979 echo "${ECHO_T}$with_rpath_link" >&6
10980         if test "$with_rpath_link" = no
10981         then
10982                 LOCAL_LDFLAGS=
10983                 LOCAL_LDFLAGS2=
10984         fi
10985 fi
10986
10987 ###############################################################################
10988
10989 ###   use option --enable-broken-linker to force on use of broken-linker support
10990
10991 echo "$as_me:10991: checking if you want broken-linker support code" >&5
10992 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10993
10994 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10995 if test "${enable_broken_linker+set}" = set; then
10996   enableval="$enable_broken_linker"
10997   with_broken_linker=$enableval
10998 else
10999   with_broken_linker=no
11000 fi;
11001 echo "$as_me:11001: result: $with_broken_linker" >&5
11002 echo "${ECHO_T}$with_broken_linker" >&6
11003
11004 : ${BROKEN_LINKER:=0}
11005 if test "x$with_broken_linker" = xyes ; then
11006
11007 cat >>confdefs.h <<\EOF
11008 #define BROKEN_LINKER 1
11009 EOF
11010
11011         BROKEN_LINKER=1
11012 fi
11013
11014 # Check to define _XOPEN_SOURCE "automatically"
11015
11016 echo "$as_me:11016: checking if the POSIX test-macros are already defined" >&5
11017 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11018 if test "${cf_cv_posix_visible+set}" = set; then
11019   echo $ECHO_N "(cached) $ECHO_C" >&6
11020 else
11021
11022 cat >conftest.$ac_ext <<_ACEOF
11023 #line 11023 "configure"
11024 #include "confdefs.h"
11025 #include <stdio.h>
11026 int
11027 main (void)
11028 {
11029
11030 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11031         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11032         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11033         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11034 #error conflicting symbols found
11035 #endif
11036
11037   ;
11038   return 0;
11039 }
11040 _ACEOF
11041 rm -f conftest.$ac_objext
11042 if { (eval echo "$as_me:11042: \"$ac_compile\"") >&5
11043   (eval $ac_compile) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit $ac_status); } &&
11047          { ac_try='test -s conftest.$ac_objext'
11048   { (eval echo "$as_me:11048: \"$ac_try\"") >&5
11049   (eval $ac_try) 2>&5
11050   ac_status=$?
11051   echo "$as_me:11051: \$? = $ac_status" >&5
11052   (exit $ac_status); }; }; then
11053   cf_cv_posix_visible=no
11054 else
11055   echo "$as_me: failed program was:" >&5
11056 cat conftest.$ac_ext >&5
11057 cf_cv_posix_visible=yes
11058 fi
11059 rm -f conftest.$ac_objext conftest.$ac_ext
11060
11061 fi
11062 echo "$as_me:11062: result: $cf_cv_posix_visible" >&5
11063 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11064
11065 if test "$cf_cv_posix_visible" = no; then
11066
11067 cf_XOPEN_SOURCE=600
11068 cf_POSIX_C_SOURCE=199506L
11069 cf_xopen_source=
11070
11071 case $host_os in
11072 (aix[4-7]*)
11073         cf_xopen_source="-D_ALL_SOURCE"
11074         ;;
11075 (msys)
11076         cf_XOPEN_SOURCE=600
11077         ;;
11078 (darwin[0-8].*)
11079         cf_xopen_source="-D_APPLE_C_SOURCE"
11080         ;;
11081 (darwin*)
11082         cf_xopen_source="-D_DARWIN_C_SOURCE"
11083         cf_XOPEN_SOURCE=
11084         ;;
11085 (freebsd*|dragonfly*|midnightbsd*)
11086         # 5.x headers associate
11087         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11088         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11089         cf_POSIX_C_SOURCE=200112L
11090         cf_XOPEN_SOURCE=600
11091         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11092         ;;
11093 (hpux11*)
11094         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11095         ;;
11096 (hpux*)
11097         cf_xopen_source="-D_HPUX_SOURCE"
11098         ;;
11099 (irix[56].*)
11100         cf_xopen_source="-D_SGI_SOURCE"
11101         cf_XOPEN_SOURCE=
11102         ;;
11103 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11104
11105 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11106
11107 echo "$as_me:11107: checking if this is the GNU C library" >&5
11108 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11109 if test "${cf_cv_gnu_library+set}" = set; then
11110   echo $ECHO_N "(cached) $ECHO_C" >&6
11111 else
11112
11113 cat >conftest.$ac_ext <<_ACEOF
11114 #line 11114 "configure"
11115 #include "confdefs.h"
11116 #include <sys/types.h>
11117 int
11118 main (void)
11119 {
11120
11121         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11122                 return 0;
11123         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11124                 return 0;
11125         #else
11126         #       error not GNU C library
11127         #endif
11128   ;
11129   return 0;
11130 }
11131 _ACEOF
11132 rm -f conftest.$ac_objext
11133 if { (eval echo "$as_me:11133: \"$ac_compile\"") >&5
11134   (eval $ac_compile) 2>&5
11135   ac_status=$?
11136   echo "$as_me:11136: \$? = $ac_status" >&5
11137   (exit $ac_status); } &&
11138          { ac_try='test -s conftest.$ac_objext'
11139   { (eval echo "$as_me:11139: \"$ac_try\"") >&5
11140   (eval $ac_try) 2>&5
11141   ac_status=$?
11142   echo "$as_me:11142: \$? = $ac_status" >&5
11143   (exit $ac_status); }; }; then
11144   cf_cv_gnu_library=yes
11145 else
11146   echo "$as_me: failed program was:" >&5
11147 cat conftest.$ac_ext >&5
11148 cf_cv_gnu_library=no
11149 fi
11150 rm -f conftest.$ac_objext conftest.$ac_ext
11151
11152 fi
11153 echo "$as_me:11153: result: $cf_cv_gnu_library" >&5
11154 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11155
11156 if test x$cf_cv_gnu_library = xyes; then
11157
11158         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11159         # was changed to help a little.  newlib incorporated the change about 4
11160         # years later.
11161         echo "$as_me:11161: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11162 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11163 if test "${cf_cv_gnu_library_219+set}" = set; then
11164   echo $ECHO_N "(cached) $ECHO_C" >&6
11165 else
11166
11167                 cf_save="$CPPFLAGS"
11168
11169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11170         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11171
11172                 cat >conftest.$ac_ext <<_ACEOF
11173 #line 11173 "configure"
11174 #include "confdefs.h"
11175 #include <sys/types.h>
11176 int
11177 main (void)
11178 {
11179
11180                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11181                                 return 0;
11182                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11183                                 return 0;
11184                         #else
11185                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11186                         #endif
11187   ;
11188   return 0;
11189 }
11190 _ACEOF
11191 rm -f conftest.$ac_objext
11192 if { (eval echo "$as_me:11192: \"$ac_compile\"") >&5
11193   (eval $ac_compile) 2>&5
11194   ac_status=$?
11195   echo "$as_me:11195: \$? = $ac_status" >&5
11196   (exit $ac_status); } &&
11197          { ac_try='test -s conftest.$ac_objext'
11198   { (eval echo "$as_me:11198: \"$ac_try\"") >&5
11199   (eval $ac_try) 2>&5
11200   ac_status=$?
11201   echo "$as_me:11201: \$? = $ac_status" >&5
11202   (exit $ac_status); }; }; then
11203   cf_cv_gnu_library_219=yes
11204 else
11205   echo "$as_me: failed program was:" >&5
11206 cat conftest.$ac_ext >&5
11207 cf_cv_gnu_library_219=no
11208 fi
11209 rm -f conftest.$ac_objext conftest.$ac_ext
11210                 CPPFLAGS="$cf_save"
11211
11212 fi
11213 echo "$as_me:11213: result: $cf_cv_gnu_library_219" >&5
11214 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11215
11216         if test "x$cf_cv_gnu_library_219" = xyes; then
11217                 cf_save="$CPPFLAGS"
11218                 echo "$as_me:11218: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11219 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11220 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11221   echo $ECHO_N "(cached) $ECHO_C" >&6
11222 else
11223
11224 cf_fix_cppflags=no
11225 cf_new_cflags=
11226 cf_new_cppflags=
11227 cf_new_extra_cppflags=
11228
11229 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11230 do
11231 case $cf_fix_cppflags in
11232 (no)
11233         case $cf_add_cflags in
11234         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11235                 case $cf_add_cflags in
11236                 (-D*)
11237                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11238
11239                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11240                                 && test -z "${cf_tst_cflags}" \
11241                                 && cf_fix_cppflags=yes
11242
11243                         if test $cf_fix_cppflags = yes ; then
11244
11245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11247
11248                                 continue
11249                         elif test "${cf_tst_cflags}" = "\"'" ; then
11250
11251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11253
11254                                 continue
11255                         fi
11256                         ;;
11257                 esac
11258                 case "$CPPFLAGS" in
11259                 (*$cf_add_cflags)
11260                         ;;
11261                 (*)
11262                         case $cf_add_cflags in
11263                         (-D*)
11264                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11265
11266 CPPFLAGS=`echo "$CPPFLAGS" | \
11267         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11268                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11269
11270                                 ;;
11271                         esac
11272
11273         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11274         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11275
11276                         ;;
11277                 esac
11278                 ;;
11279         (*)
11280
11281         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11282         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11283
11284                 ;;
11285         esac
11286         ;;
11287 (yes)
11288
11289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11291
11292         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11293
11294         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11295                 && test -z "${cf_tst_cflags}" \
11296                 && cf_fix_cppflags=no
11297         ;;
11298 esac
11299 done
11300
11301 if test -n "$cf_new_cflags" ; then
11302
11303         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11304         CFLAGS="${CFLAGS}$cf_new_cflags"
11305
11306 fi
11307
11308 if test -n "$cf_new_cppflags" ; then
11309
11310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11311         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11312
11313 fi
11314
11315 if test -n "$cf_new_extra_cppflags" ; then
11316
11317         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11318         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11319
11320 fi
11321
11322                         cat >conftest.$ac_ext <<_ACEOF
11323 #line 11323 "configure"
11324 #include "confdefs.h"
11325
11326                                 #include <limits.h>
11327                                 #include <sys/types.h>
11328
11329 int
11330 main (void)
11331 {
11332
11333                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11334                                         return 0;
11335                                 #else
11336                                 #       error GNU C library is too old
11337                                 #endif
11338   ;
11339   return 0;
11340 }
11341 _ACEOF
11342 rm -f conftest.$ac_objext
11343 if { (eval echo "$as_me:11343: \"$ac_compile\"") >&5
11344   (eval $ac_compile) 2>&5
11345   ac_status=$?
11346   echo "$as_me:11346: \$? = $ac_status" >&5
11347   (exit $ac_status); } &&
11348          { ac_try='test -s conftest.$ac_objext'
11349   { (eval echo "$as_me:11349: \"$ac_try\"") >&5
11350   (eval $ac_try) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit $ac_status); }; }; then
11354   cf_cv_gnu_dftsrc_219=yes
11355 else
11356   echo "$as_me: failed program was:" >&5
11357 cat conftest.$ac_ext >&5
11358 cf_cv_gnu_dftsrc_219=no
11359 fi
11360 rm -f conftest.$ac_objext conftest.$ac_ext
11361
11362 fi
11363 echo "$as_me:11363: result: $cf_cv_gnu_dftsrc_219" >&5
11364 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11365                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11366         else
11367                 cf_cv_gnu_dftsrc_219=maybe
11368         fi
11369
11370         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11371
11372                 echo "$as_me:11372: checking if we must define _GNU_SOURCE" >&5
11373 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11374 if test "${cf_cv_gnu_source+set}" = set; then
11375   echo $ECHO_N "(cached) $ECHO_C" >&6
11376 else
11377
11378                 cat >conftest.$ac_ext <<_ACEOF
11379 #line 11379 "configure"
11380 #include "confdefs.h"
11381 #include <sys/types.h>
11382 int
11383 main (void)
11384 {
11385
11386                         #ifndef _XOPEN_SOURCE
11387                         #error  expected _XOPEN_SOURCE to be defined
11388                         #endif
11389   ;
11390   return 0;
11391 }
11392 _ACEOF
11393 rm -f conftest.$ac_objext
11394 if { (eval echo "$as_me:11394: \"$ac_compile\"") >&5
11395   (eval $ac_compile) 2>&5
11396   ac_status=$?
11397   echo "$as_me:11397: \$? = $ac_status" >&5
11398   (exit $ac_status); } &&
11399          { ac_try='test -s conftest.$ac_objext'
11400   { (eval echo "$as_me:11400: \"$ac_try\"") >&5
11401   (eval $ac_try) 2>&5
11402   ac_status=$?
11403   echo "$as_me:11403: \$? = $ac_status" >&5
11404   (exit $ac_status); }; }; then
11405   cf_cv_gnu_source=no
11406 else
11407   echo "$as_me: failed program was:" >&5
11408 cat conftest.$ac_ext >&5
11409 cf_save="$CPPFLAGS"
11410
11411 cf_fix_cppflags=no
11412 cf_new_cflags=
11413 cf_new_cppflags=
11414 cf_new_extra_cppflags=
11415
11416 for cf_add_cflags in -D_GNU_SOURCE
11417 do
11418 case $cf_fix_cppflags in
11419 (no)
11420         case $cf_add_cflags in
11421         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11422                 case $cf_add_cflags in
11423                 (-D*)
11424                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11425
11426                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11427                                 && test -z "${cf_tst_cflags}" \
11428                                 && cf_fix_cppflags=yes
11429
11430                         if test $cf_fix_cppflags = yes ; then
11431
11432         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11433         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11434
11435                                 continue
11436                         elif test "${cf_tst_cflags}" = "\"'" ; then
11437
11438         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11439         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11440
11441                                 continue
11442                         fi
11443                         ;;
11444                 esac
11445                 case "$CPPFLAGS" in
11446                 (*$cf_add_cflags)
11447                         ;;
11448                 (*)
11449                         case $cf_add_cflags in
11450                         (-D*)
11451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11452
11453 CPPFLAGS=`echo "$CPPFLAGS" | \
11454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11456
11457                                 ;;
11458                         esac
11459
11460         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11461         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11462
11463                         ;;
11464                 esac
11465                 ;;
11466         (*)
11467
11468         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11469         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11470
11471                 ;;
11472         esac
11473         ;;
11474 (yes)
11475
11476         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11477         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11478
11479         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11480
11481         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11482                 && test -z "${cf_tst_cflags}" \
11483                 && cf_fix_cppflags=no
11484         ;;
11485 esac
11486 done
11487
11488 if test -n "$cf_new_cflags" ; then
11489
11490         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11491         CFLAGS="${CFLAGS}$cf_new_cflags"
11492
11493 fi
11494
11495 if test -n "$cf_new_cppflags" ; then
11496
11497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11498         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11499
11500 fi
11501
11502 if test -n "$cf_new_extra_cppflags" ; then
11503
11504         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11505         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11506
11507 fi
11508
11509                          cat >conftest.$ac_ext <<_ACEOF
11510 #line 11510 "configure"
11511 #include "confdefs.h"
11512 #include <sys/types.h>
11513 int
11514 main (void)
11515 {
11516
11517                                 #ifdef _XOPEN_SOURCE
11518                                 #error  expected _XOPEN_SOURCE to be undefined
11519                                 #endif
11520   ;
11521   return 0;
11522 }
11523 _ACEOF
11524 rm -f conftest.$ac_objext
11525 if { (eval echo "$as_me:11525: \"$ac_compile\"") >&5
11526   (eval $ac_compile) 2>&5
11527   ac_status=$?
11528   echo "$as_me:11528: \$? = $ac_status" >&5
11529   (exit $ac_status); } &&
11530          { ac_try='test -s conftest.$ac_objext'
11531   { (eval echo "$as_me:11531: \"$ac_try\"") >&5
11532   (eval $ac_try) 2>&5
11533   ac_status=$?
11534   echo "$as_me:11534: \$? = $ac_status" >&5
11535   (exit $ac_status); }; }; then
11536   cf_cv_gnu_source=no
11537 else
11538   echo "$as_me: failed program was:" >&5
11539 cat conftest.$ac_ext >&5
11540 cf_cv_gnu_source=yes
11541 fi
11542 rm -f conftest.$ac_objext conftest.$ac_ext
11543                         CPPFLAGS="$cf_save"
11544
11545 fi
11546 rm -f conftest.$ac_objext conftest.$ac_ext
11547
11548 fi
11549 echo "$as_me:11549: result: $cf_cv_gnu_source" >&5
11550 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11551
11552                 if test "$cf_cv_gnu_source" = yes
11553                 then
11554                 echo "$as_me:11554: checking if we should also define _DEFAULT_SOURCE" >&5
11555 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11556 if test "${cf_cv_default_source+set}" = set; then
11557   echo $ECHO_N "(cached) $ECHO_C" >&6
11558 else
11559
11560         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11561         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11562
11563                         cat >conftest.$ac_ext <<_ACEOF
11564 #line 11564 "configure"
11565 #include "confdefs.h"
11566 #include <sys/types.h>
11567 int
11568 main (void)
11569 {
11570
11571                                 #ifdef _DEFAULT_SOURCE
11572                                 #error  expected _DEFAULT_SOURCE to be undefined
11573                                 #endif
11574   ;
11575   return 0;
11576 }
11577 _ACEOF
11578 rm -f conftest.$ac_objext
11579 if { (eval echo "$as_me:11579: \"$ac_compile\"") >&5
11580   (eval $ac_compile) 2>&5
11581   ac_status=$?
11582   echo "$as_me:11582: \$? = $ac_status" >&5
11583   (exit $ac_status); } &&
11584          { ac_try='test -s conftest.$ac_objext'
11585   { (eval echo "$as_me:11585: \"$ac_try\"") >&5
11586   (eval $ac_try) 2>&5
11587   ac_status=$?
11588   echo "$as_me:11588: \$? = $ac_status" >&5
11589   (exit $ac_status); }; }; then
11590   cf_cv_default_source=no
11591 else
11592   echo "$as_me: failed program was:" >&5
11593 cat conftest.$ac_ext >&5
11594 cf_cv_default_source=yes
11595 fi
11596 rm -f conftest.$ac_objext conftest.$ac_ext
11597
11598 fi
11599 echo "$as_me:11599: result: $cf_cv_default_source" >&5
11600 echo "${ECHO_T}$cf_cv_default_source" >&6
11601                         if test "$cf_cv_default_source" = yes
11602                         then
11603
11604         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11605         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11606
11607                         fi
11608                 fi
11609         fi
11610
11611 fi
11612
11613         ;;
11614 (minix*)
11615         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11616         ;;
11617 (mirbsd*)
11618         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11619         cf_XOPEN_SOURCE=
11620
11621 if test "$cf_cv_posix_visible" = no; then
11622
11623 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11624
11625 cf_save_CFLAGS="$CFLAGS"
11626 cf_save_CPPFLAGS="$CPPFLAGS"
11627
11628 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11629         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11630                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11631
11632 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11633         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11634                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11635
11636 echo "$as_me:11636: checking if we should define _POSIX_C_SOURCE" >&5
11637 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11638 if test "${cf_cv_posix_c_source+set}" = set; then
11639   echo $ECHO_N "(cached) $ECHO_C" >&6
11640 else
11641
11642 echo "${as_me:-configure}:11642: testing if the symbol is already defined go no further ..." 1>&5
11643
11644         cat >conftest.$ac_ext <<_ACEOF
11645 #line 11645 "configure"
11646 #include "confdefs.h"
11647 #include <sys/types.h>
11648 int
11649 main (void)
11650 {
11651
11652 #ifndef _POSIX_C_SOURCE
11653 make an error
11654 #endif
11655   ;
11656   return 0;
11657 }
11658 _ACEOF
11659 rm -f conftest.$ac_objext
11660 if { (eval echo "$as_me:11660: \"$ac_compile\"") >&5
11661   (eval $ac_compile) 2>&5
11662   ac_status=$?
11663   echo "$as_me:11663: \$? = $ac_status" >&5
11664   (exit $ac_status); } &&
11665          { ac_try='test -s conftest.$ac_objext'
11666   { (eval echo "$as_me:11666: \"$ac_try\"") >&5
11667   (eval $ac_try) 2>&5
11668   ac_status=$?
11669   echo "$as_me:11669: \$? = $ac_status" >&5
11670   (exit $ac_status); }; }; then
11671   cf_cv_posix_c_source=no
11672 else
11673   echo "$as_me: failed program was:" >&5
11674 cat conftest.$ac_ext >&5
11675 cf_want_posix_source=no
11676          case .$cf_POSIX_C_SOURCE in
11677          (.[12]??*)
11678                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11679                 ;;
11680          (.2)
11681                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11682                 cf_want_posix_source=yes
11683                 ;;
11684          (.*)
11685                 cf_want_posix_source=yes
11686                 ;;
11687          esac
11688          if test "$cf_want_posix_source" = yes ; then
11689                 cat >conftest.$ac_ext <<_ACEOF
11690 #line 11690 "configure"
11691 #include "confdefs.h"
11692 #include <sys/types.h>
11693 int
11694 main (void)
11695 {
11696
11697 #ifdef _POSIX_SOURCE
11698 make an error
11699 #endif
11700   ;
11701   return 0;
11702 }
11703 _ACEOF
11704 rm -f conftest.$ac_objext
11705 if { (eval echo "$as_me:11705: \"$ac_compile\"") >&5
11706   (eval $ac_compile) 2>&5
11707   ac_status=$?
11708   echo "$as_me:11708: \$? = $ac_status" >&5
11709   (exit $ac_status); } &&
11710          { ac_try='test -s conftest.$ac_objext'
11711   { (eval echo "$as_me:11711: \"$ac_try\"") >&5
11712   (eval $ac_try) 2>&5
11713   ac_status=$?
11714   echo "$as_me:11714: \$? = $ac_status" >&5
11715   (exit $ac_status); }; }; then
11716   :
11717 else
11718   echo "$as_me: failed program was:" >&5
11719 cat conftest.$ac_ext >&5
11720 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11721 fi
11722 rm -f conftest.$ac_objext conftest.$ac_ext
11723          fi
11724
11725 echo "${as_me:-configure}:11725: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11726
11727          CFLAGS="$cf_trim_CFLAGS"
11728          CPPFLAGS="$cf_trim_CPPFLAGS"
11729
11730         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11731         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11732
11733 echo "${as_me:-configure}:11733: testing if the second compile does not leave our definition intact error ..." 1>&5
11734
11735          cat >conftest.$ac_ext <<_ACEOF
11736 #line 11736 "configure"
11737 #include "confdefs.h"
11738 #include <sys/types.h>
11739 int
11740 main (void)
11741 {
11742
11743 #ifndef _POSIX_C_SOURCE
11744 make an error
11745 #endif
11746   ;
11747   return 0;
11748 }
11749 _ACEOF
11750 rm -f conftest.$ac_objext
11751 if { (eval echo "$as_me:11751: \"$ac_compile\"") >&5
11752   (eval $ac_compile) 2>&5
11753   ac_status=$?
11754   echo "$as_me:11754: \$? = $ac_status" >&5
11755   (exit $ac_status); } &&
11756          { ac_try='test -s conftest.$ac_objext'
11757   { (eval echo "$as_me:11757: \"$ac_try\"") >&5
11758   (eval $ac_try) 2>&5
11759   ac_status=$?
11760   echo "$as_me:11760: \$? = $ac_status" >&5
11761   (exit $ac_status); }; }; then
11762   :
11763 else
11764   echo "$as_me: failed program was:" >&5
11765 cat conftest.$ac_ext >&5
11766 cf_cv_posix_c_source=no
11767 fi
11768 rm -f conftest.$ac_objext conftest.$ac_ext
11769          CFLAGS="$cf_save_CFLAGS"
11770          CPPFLAGS="$cf_save_CPPFLAGS"
11771
11772 fi
11773 rm -f conftest.$ac_objext conftest.$ac_ext
11774
11775 fi
11776 echo "$as_me:11776: result: $cf_cv_posix_c_source" >&5
11777 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11778
11779 if test "$cf_cv_posix_c_source" != no ; then
11780         CFLAGS="$cf_trim_CFLAGS"
11781         CPPFLAGS="$cf_trim_CPPFLAGS"
11782
11783 cf_fix_cppflags=no
11784 cf_new_cflags=
11785 cf_new_cppflags=
11786 cf_new_extra_cppflags=
11787
11788 for cf_add_cflags in $cf_cv_posix_c_source
11789 do
11790 case $cf_fix_cppflags in
11791 (no)
11792         case $cf_add_cflags in
11793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11794                 case $cf_add_cflags in
11795                 (-D*)
11796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11797
11798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11799                                 && test -z "${cf_tst_cflags}" \
11800                                 && cf_fix_cppflags=yes
11801
11802                         if test $cf_fix_cppflags = yes ; then
11803
11804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11806
11807                                 continue
11808                         elif test "${cf_tst_cflags}" = "\"'" ; then
11809
11810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11812
11813                                 continue
11814                         fi
11815                         ;;
11816                 esac
11817                 case "$CPPFLAGS" in
11818                 (*$cf_add_cflags)
11819                         ;;
11820                 (*)
11821                         case $cf_add_cflags in
11822                         (-D*)
11823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11824
11825 CPPFLAGS=`echo "$CPPFLAGS" | \
11826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11828
11829                                 ;;
11830                         esac
11831
11832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11834
11835                         ;;
11836                 esac
11837                 ;;
11838         (*)
11839
11840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11842
11843                 ;;
11844         esac
11845         ;;
11846 (yes)
11847
11848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11850
11851         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11852
11853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11854                 && test -z "${cf_tst_cflags}" \
11855                 && cf_fix_cppflags=no
11856         ;;
11857 esac
11858 done
11859
11860 if test -n "$cf_new_cflags" ; then
11861
11862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11863         CFLAGS="${CFLAGS}$cf_new_cflags"
11864
11865 fi
11866
11867 if test -n "$cf_new_cppflags" ; then
11868
11869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11871
11872 fi
11873
11874 if test -n "$cf_new_extra_cppflags" ; then
11875
11876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11878
11879 fi
11880
11881 fi
11882
11883 fi # cf_cv_posix_visible
11884
11885         ;;
11886 (netbsd*)
11887         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11888         ;;
11889 (openbsd[4-9]*)
11890         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11891         cf_xopen_source="-D_BSD_SOURCE"
11892         cf_XOPEN_SOURCE=600
11893         ;;
11894 (openbsd*)
11895         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11896         ;;
11897 (osf[45]*)
11898         cf_xopen_source="-D_OSF_SOURCE"
11899         ;;
11900 (nto-qnx*)
11901         cf_xopen_source="-D_QNX_SOURCE"
11902         ;;
11903 (sco*)
11904         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11905         ;;
11906 (solaris2.*)
11907         cf_xopen_source="-D__EXTENSIONS__"
11908         cf_cv_xopen_source=broken
11909         ;;
11910 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11911         cf_XOPEN_SOURCE=
11912         cf_POSIX_C_SOURCE=
11913         ;;
11914 (*)
11915
11916 echo "$as_me:11916: checking if we should define _XOPEN_SOURCE" >&5
11917 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11918 if test "${cf_cv_xopen_source+set}" = set; then
11919   echo $ECHO_N "(cached) $ECHO_C" >&6
11920 else
11921
11922         cat >conftest.$ac_ext <<_ACEOF
11923 #line 11923 "configure"
11924 #include "confdefs.h"
11925
11926 #include <stdlib.h>
11927 #include <string.h>
11928 #include <sys/types.h>
11929
11930 int
11931 main (void)
11932 {
11933
11934 #ifndef _XOPEN_SOURCE
11935 make an error
11936 #endif
11937   ;
11938   return 0;
11939 }
11940 _ACEOF
11941 rm -f conftest.$ac_objext
11942 if { (eval echo "$as_me:11942: \"$ac_compile\"") >&5
11943   (eval $ac_compile) 2>&5
11944   ac_status=$?
11945   echo "$as_me:11945: \$? = $ac_status" >&5
11946   (exit $ac_status); } &&
11947          { ac_try='test -s conftest.$ac_objext'
11948   { (eval echo "$as_me:11948: \"$ac_try\"") >&5
11949   (eval $ac_try) 2>&5
11950   ac_status=$?
11951   echo "$as_me:11951: \$? = $ac_status" >&5
11952   (exit $ac_status); }; }; then
11953   cf_cv_xopen_source=no
11954 else
11955   echo "$as_me: failed program was:" >&5
11956 cat conftest.$ac_ext >&5
11957 cf_save="$CPPFLAGS"
11958
11959         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11960         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11961
11962          cat >conftest.$ac_ext <<_ACEOF
11963 #line 11963 "configure"
11964 #include "confdefs.h"
11965
11966 #include <stdlib.h>
11967 #include <string.h>
11968 #include <sys/types.h>
11969
11970 int
11971 main (void)
11972 {
11973
11974 #ifdef _XOPEN_SOURCE
11975 make an error
11976 #endif
11977   ;
11978   return 0;
11979 }
11980 _ACEOF
11981 rm -f conftest.$ac_objext
11982 if { (eval echo "$as_me:11982: \"$ac_compile\"") >&5
11983   (eval $ac_compile) 2>&5
11984   ac_status=$?
11985   echo "$as_me:11985: \$? = $ac_status" >&5
11986   (exit $ac_status); } &&
11987          { ac_try='test -s conftest.$ac_objext'
11988   { (eval echo "$as_me:11988: \"$ac_try\"") >&5
11989   (eval $ac_try) 2>&5
11990   ac_status=$?
11991   echo "$as_me:11991: \$? = $ac_status" >&5
11992   (exit $ac_status); }; }; then
11993   cf_cv_xopen_source=no
11994 else
11995   echo "$as_me: failed program was:" >&5
11996 cat conftest.$ac_ext >&5
11997 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11998 fi
11999 rm -f conftest.$ac_objext conftest.$ac_ext
12000         CPPFLAGS="$cf_save"
12001
12002 fi
12003 rm -f conftest.$ac_objext conftest.$ac_ext
12004
12005 fi
12006 echo "$as_me:12006: result: $cf_cv_xopen_source" >&5
12007 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12008
12009 if test "$cf_cv_xopen_source" != no ; then
12010
12011 CFLAGS=`echo "$CFLAGS" | \
12012         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12013                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12014
12015 CPPFLAGS=`echo "$CPPFLAGS" | \
12016         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12017                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12018
12019         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12020
12021 cf_fix_cppflags=no
12022 cf_new_cflags=
12023 cf_new_cppflags=
12024 cf_new_extra_cppflags=
12025
12026 for cf_add_cflags in $cf_temp_xopen_source
12027 do
12028 case $cf_fix_cppflags in
12029 (no)
12030         case $cf_add_cflags in
12031         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12032                 case $cf_add_cflags in
12033                 (-D*)
12034                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12035
12036                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12037                                 && test -z "${cf_tst_cflags}" \
12038                                 && cf_fix_cppflags=yes
12039
12040                         if test $cf_fix_cppflags = yes ; then
12041
12042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12044
12045                                 continue
12046                         elif test "${cf_tst_cflags}" = "\"'" ; then
12047
12048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12050
12051                                 continue
12052                         fi
12053                         ;;
12054                 esac
12055                 case "$CPPFLAGS" in
12056                 (*$cf_add_cflags)
12057                         ;;
12058                 (*)
12059                         case $cf_add_cflags in
12060                         (-D*)
12061                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12062
12063 CPPFLAGS=`echo "$CPPFLAGS" | \
12064         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12065                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12066
12067                                 ;;
12068                         esac
12069
12070         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12071         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12072
12073                         ;;
12074                 esac
12075                 ;;
12076         (*)
12077
12078         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12079         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12080
12081                 ;;
12082         esac
12083         ;;
12084 (yes)
12085
12086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12088
12089         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12090
12091         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12092                 && test -z "${cf_tst_cflags}" \
12093                 && cf_fix_cppflags=no
12094         ;;
12095 esac
12096 done
12097
12098 if test -n "$cf_new_cflags" ; then
12099
12100         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12101         CFLAGS="${CFLAGS}$cf_new_cflags"
12102
12103 fi
12104
12105 if test -n "$cf_new_cppflags" ; then
12106
12107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12108         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12109
12110 fi
12111
12112 if test -n "$cf_new_extra_cppflags" ; then
12113
12114         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12115         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12116
12117 fi
12118
12119 fi
12120
12121 if test "$cf_cv_posix_visible" = no; then
12122
12123 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12124
12125 cf_save_CFLAGS="$CFLAGS"
12126 cf_save_CPPFLAGS="$CPPFLAGS"
12127
12128 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12129         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12130                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12131
12132 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12133         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12134                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12135
12136 echo "$as_me:12136: checking if we should define _POSIX_C_SOURCE" >&5
12137 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12138 if test "${cf_cv_posix_c_source+set}" = set; then
12139   echo $ECHO_N "(cached) $ECHO_C" >&6
12140 else
12141
12142 echo "${as_me:-configure}:12142: testing if the symbol is already defined go no further ..." 1>&5
12143
12144         cat >conftest.$ac_ext <<_ACEOF
12145 #line 12145 "configure"
12146 #include "confdefs.h"
12147 #include <sys/types.h>
12148 int
12149 main (void)
12150 {
12151
12152 #ifndef _POSIX_C_SOURCE
12153 make an error
12154 #endif
12155   ;
12156   return 0;
12157 }
12158 _ACEOF
12159 rm -f conftest.$ac_objext
12160 if { (eval echo "$as_me:12160: \"$ac_compile\"") >&5
12161   (eval $ac_compile) 2>&5
12162   ac_status=$?
12163   echo "$as_me:12163: \$? = $ac_status" >&5
12164   (exit $ac_status); } &&
12165          { ac_try='test -s conftest.$ac_objext'
12166   { (eval echo "$as_me:12166: \"$ac_try\"") >&5
12167   (eval $ac_try) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit $ac_status); }; }; then
12171   cf_cv_posix_c_source=no
12172 else
12173   echo "$as_me: failed program was:" >&5
12174 cat conftest.$ac_ext >&5
12175 cf_want_posix_source=no
12176          case .$cf_POSIX_C_SOURCE in
12177          (.[12]??*)
12178                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12179                 ;;
12180          (.2)
12181                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12182                 cf_want_posix_source=yes
12183                 ;;
12184          (.*)
12185                 cf_want_posix_source=yes
12186                 ;;
12187          esac
12188          if test "$cf_want_posix_source" = yes ; then
12189                 cat >conftest.$ac_ext <<_ACEOF
12190 #line 12190 "configure"
12191 #include "confdefs.h"
12192 #include <sys/types.h>
12193 int
12194 main (void)
12195 {
12196
12197 #ifdef _POSIX_SOURCE
12198 make an error
12199 #endif
12200   ;
12201   return 0;
12202 }
12203 _ACEOF
12204 rm -f conftest.$ac_objext
12205 if { (eval echo "$as_me:12205: \"$ac_compile\"") >&5
12206   (eval $ac_compile) 2>&5
12207   ac_status=$?
12208   echo "$as_me:12208: \$? = $ac_status" >&5
12209   (exit $ac_status); } &&
12210          { ac_try='test -s conftest.$ac_objext'
12211   { (eval echo "$as_me:12211: \"$ac_try\"") >&5
12212   (eval $ac_try) 2>&5
12213   ac_status=$?
12214   echo "$as_me:12214: \$? = $ac_status" >&5
12215   (exit $ac_status); }; }; then
12216   :
12217 else
12218   echo "$as_me: failed program was:" >&5
12219 cat conftest.$ac_ext >&5
12220 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12221 fi
12222 rm -f conftest.$ac_objext conftest.$ac_ext
12223          fi
12224
12225 echo "${as_me:-configure}:12225: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12226
12227          CFLAGS="$cf_trim_CFLAGS"
12228          CPPFLAGS="$cf_trim_CPPFLAGS"
12229
12230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12231         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12232
12233 echo "${as_me:-configure}:12233: testing if the second compile does not leave our definition intact error ..." 1>&5
12234
12235          cat >conftest.$ac_ext <<_ACEOF
12236 #line 12236 "configure"
12237 #include "confdefs.h"
12238 #include <sys/types.h>
12239 int
12240 main (void)
12241 {
12242
12243 #ifndef _POSIX_C_SOURCE
12244 make an error
12245 #endif
12246   ;
12247   return 0;
12248 }
12249 _ACEOF
12250 rm -f conftest.$ac_objext
12251 if { (eval echo "$as_me:12251: \"$ac_compile\"") >&5
12252   (eval $ac_compile) 2>&5
12253   ac_status=$?
12254   echo "$as_me:12254: \$? = $ac_status" >&5
12255   (exit $ac_status); } &&
12256          { ac_try='test -s conftest.$ac_objext'
12257   { (eval echo "$as_me:12257: \"$ac_try\"") >&5
12258   (eval $ac_try) 2>&5
12259   ac_status=$?
12260   echo "$as_me:12260: \$? = $ac_status" >&5
12261   (exit $ac_status); }; }; then
12262   :
12263 else
12264   echo "$as_me: failed program was:" >&5
12265 cat conftest.$ac_ext >&5
12266 cf_cv_posix_c_source=no
12267 fi
12268 rm -f conftest.$ac_objext conftest.$ac_ext
12269          CFLAGS="$cf_save_CFLAGS"
12270          CPPFLAGS="$cf_save_CPPFLAGS"
12271
12272 fi
12273 rm -f conftest.$ac_objext conftest.$ac_ext
12274
12275 fi
12276 echo "$as_me:12276: result: $cf_cv_posix_c_source" >&5
12277 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12278
12279 if test "$cf_cv_posix_c_source" != no ; then
12280         CFLAGS="$cf_trim_CFLAGS"
12281         CPPFLAGS="$cf_trim_CPPFLAGS"
12282
12283 cf_fix_cppflags=no
12284 cf_new_cflags=
12285 cf_new_cppflags=
12286 cf_new_extra_cppflags=
12287
12288 for cf_add_cflags in $cf_cv_posix_c_source
12289 do
12290 case $cf_fix_cppflags in
12291 (no)
12292         case $cf_add_cflags in
12293         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12294                 case $cf_add_cflags in
12295                 (-D*)
12296                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12297
12298                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12299                                 && test -z "${cf_tst_cflags}" \
12300                                 && cf_fix_cppflags=yes
12301
12302                         if test $cf_fix_cppflags = yes ; then
12303
12304         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12305         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12306
12307                                 continue
12308                         elif test "${cf_tst_cflags}" = "\"'" ; then
12309
12310         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12311         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12312
12313                                 continue
12314                         fi
12315                         ;;
12316                 esac
12317                 case "$CPPFLAGS" in
12318                 (*$cf_add_cflags)
12319                         ;;
12320                 (*)
12321                         case $cf_add_cflags in
12322                         (-D*)
12323                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12324
12325 CPPFLAGS=`echo "$CPPFLAGS" | \
12326         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12327                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12328
12329                                 ;;
12330                         esac
12331
12332         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12333         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12334
12335                         ;;
12336                 esac
12337                 ;;
12338         (*)
12339
12340         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12341         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12342
12343                 ;;
12344         esac
12345         ;;
12346 (yes)
12347
12348         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12349         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12350
12351         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12352
12353         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12354                 && test -z "${cf_tst_cflags}" \
12355                 && cf_fix_cppflags=no
12356         ;;
12357 esac
12358 done
12359
12360 if test -n "$cf_new_cflags" ; then
12361
12362         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12363         CFLAGS="${CFLAGS}$cf_new_cflags"
12364
12365 fi
12366
12367 if test -n "$cf_new_cppflags" ; then
12368
12369         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12370         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12371
12372 fi
12373
12374 if test -n "$cf_new_extra_cppflags" ; then
12375
12376         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12377         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12378
12379 fi
12380
12381 fi
12382
12383 fi # cf_cv_posix_visible
12384
12385         ;;
12386 esac
12387
12388 if test -n "$cf_xopen_source" ; then
12389
12390 cf_fix_cppflags=no
12391 cf_new_cflags=
12392 cf_new_cppflags=
12393 cf_new_extra_cppflags=
12394
12395 for cf_add_cflags in $cf_xopen_source
12396 do
12397 case $cf_fix_cppflags in
12398 (no)
12399         case $cf_add_cflags in
12400         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12401                 case $cf_add_cflags in
12402                 (-D*)
12403                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12404
12405                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12406                                 && test -z "${cf_tst_cflags}" \
12407                                 && cf_fix_cppflags=yes
12408
12409                         if test $cf_fix_cppflags = yes ; then
12410
12411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12413
12414                                 continue
12415                         elif test "${cf_tst_cflags}" = "\"'" ; then
12416
12417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12419
12420                                 continue
12421                         fi
12422                         ;;
12423                 esac
12424                 case "$CPPFLAGS" in
12425                 (*$cf_add_cflags)
12426                         ;;
12427                 (*)
12428                         case $cf_add_cflags in
12429                         (-D*)
12430                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12431
12432 CPPFLAGS=`echo "$CPPFLAGS" | \
12433         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12434                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12435
12436                                 ;;
12437                         esac
12438
12439         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12440         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12441
12442                         ;;
12443                 esac
12444                 ;;
12445         (*)
12446
12447         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12448         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12449
12450                 ;;
12451         esac
12452         ;;
12453 (yes)
12454
12455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12457
12458         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12459
12460         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12461                 && test -z "${cf_tst_cflags}" \
12462                 && cf_fix_cppflags=no
12463         ;;
12464 esac
12465 done
12466
12467 if test -n "$cf_new_cflags" ; then
12468         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12469
12470 echo "${as_me:-configure}:12470: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12471
12472         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12473         CFLAGS="${CFLAGS}$cf_new_cflags"
12474
12475 fi
12476
12477 if test -n "$cf_new_cppflags" ; then
12478         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12479
12480 echo "${as_me:-configure}:12480: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12481
12482         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12483         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12484
12485 fi
12486
12487 if test -n "$cf_new_extra_cppflags" ; then
12488         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12489
12490 echo "${as_me:-configure}:12490: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12491
12492         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12493         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12494
12495 fi
12496
12497 fi
12498
12499 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12500         echo "$as_me:12500: checking if _XOPEN_SOURCE really is set" >&5
12501 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12502         cat >conftest.$ac_ext <<_ACEOF
12503 #line 12503 "configure"
12504 #include "confdefs.h"
12505 #include <stdlib.h>
12506 int
12507 main (void)
12508 {
12509
12510 #ifndef _XOPEN_SOURCE
12511 make an error
12512 #endif
12513   ;
12514   return 0;
12515 }
12516 _ACEOF
12517 rm -f conftest.$ac_objext
12518 if { (eval echo "$as_me:12518: \"$ac_compile\"") >&5
12519   (eval $ac_compile) 2>&5
12520   ac_status=$?
12521   echo "$as_me:12521: \$? = $ac_status" >&5
12522   (exit $ac_status); } &&
12523          { ac_try='test -s conftest.$ac_objext'
12524   { (eval echo "$as_me:12524: \"$ac_try\"") >&5
12525   (eval $ac_try) 2>&5
12526   ac_status=$?
12527   echo "$as_me:12527: \$? = $ac_status" >&5
12528   (exit $ac_status); }; }; then
12529   cf_XOPEN_SOURCE_set=yes
12530 else
12531   echo "$as_me: failed program was:" >&5
12532 cat conftest.$ac_ext >&5
12533 cf_XOPEN_SOURCE_set=no
12534 fi
12535 rm -f conftest.$ac_objext conftest.$ac_ext
12536         echo "$as_me:12536: result: $cf_XOPEN_SOURCE_set" >&5
12537 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12538         if test $cf_XOPEN_SOURCE_set = yes
12539         then
12540                 cat >conftest.$ac_ext <<_ACEOF
12541 #line 12541 "configure"
12542 #include "confdefs.h"
12543 #include <stdlib.h>
12544 int
12545 main (void)
12546 {
12547
12548 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12549 make an error
12550 #endif
12551   ;
12552   return 0;
12553 }
12554 _ACEOF
12555 rm -f conftest.$ac_objext
12556 if { (eval echo "$as_me:12556: \"$ac_compile\"") >&5
12557   (eval $ac_compile) 2>&5
12558   ac_status=$?
12559   echo "$as_me:12559: \$? = $ac_status" >&5
12560   (exit $ac_status); } &&
12561          { ac_try='test -s conftest.$ac_objext'
12562   { (eval echo "$as_me:12562: \"$ac_try\"") >&5
12563   (eval $ac_try) 2>&5
12564   ac_status=$?
12565   echo "$as_me:12565: \$? = $ac_status" >&5
12566   (exit $ac_status); }; }; then
12567   cf_XOPEN_SOURCE_set_ok=yes
12568 else
12569   echo "$as_me: failed program was:" >&5
12570 cat conftest.$ac_ext >&5
12571 cf_XOPEN_SOURCE_set_ok=no
12572 fi
12573 rm -f conftest.$ac_objext conftest.$ac_ext
12574                 if test $cf_XOPEN_SOURCE_set_ok = no
12575                 then
12576                         { echo "$as_me:12576: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12577 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12578                 fi
12579         else
12580
12581 echo "$as_me:12581: checking if we should define _XOPEN_SOURCE" >&5
12582 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12583 if test "${cf_cv_xopen_source+set}" = set; then
12584   echo $ECHO_N "(cached) $ECHO_C" >&6
12585 else
12586
12587         cat >conftest.$ac_ext <<_ACEOF
12588 #line 12588 "configure"
12589 #include "confdefs.h"
12590
12591 #include <stdlib.h>
12592 #include <string.h>
12593 #include <sys/types.h>
12594
12595 int
12596 main (void)
12597 {
12598
12599 #ifndef _XOPEN_SOURCE
12600 make an error
12601 #endif
12602   ;
12603   return 0;
12604 }
12605 _ACEOF
12606 rm -f conftest.$ac_objext
12607 if { (eval echo "$as_me:12607: \"$ac_compile\"") >&5
12608   (eval $ac_compile) 2>&5
12609   ac_status=$?
12610   echo "$as_me:12610: \$? = $ac_status" >&5
12611   (exit $ac_status); } &&
12612          { ac_try='test -s conftest.$ac_objext'
12613   { (eval echo "$as_me:12613: \"$ac_try\"") >&5
12614   (eval $ac_try) 2>&5
12615   ac_status=$?
12616   echo "$as_me:12616: \$? = $ac_status" >&5
12617   (exit $ac_status); }; }; then
12618   cf_cv_xopen_source=no
12619 else
12620   echo "$as_me: failed program was:" >&5
12621 cat conftest.$ac_ext >&5
12622 cf_save="$CPPFLAGS"
12623
12624         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12625         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12626
12627          cat >conftest.$ac_ext <<_ACEOF
12628 #line 12628 "configure"
12629 #include "confdefs.h"
12630
12631 #include <stdlib.h>
12632 #include <string.h>
12633 #include <sys/types.h>
12634
12635 int
12636 main (void)
12637 {
12638
12639 #ifdef _XOPEN_SOURCE
12640 make an error
12641 #endif
12642   ;
12643   return 0;
12644 }
12645 _ACEOF
12646 rm -f conftest.$ac_objext
12647 if { (eval echo "$as_me:12647: \"$ac_compile\"") >&5
12648   (eval $ac_compile) 2>&5
12649   ac_status=$?
12650   echo "$as_me:12650: \$? = $ac_status" >&5
12651   (exit $ac_status); } &&
12652          { ac_try='test -s conftest.$ac_objext'
12653   { (eval echo "$as_me:12653: \"$ac_try\"") >&5
12654   (eval $ac_try) 2>&5
12655   ac_status=$?
12656   echo "$as_me:12656: \$? = $ac_status" >&5
12657   (exit $ac_status); }; }; then
12658   cf_cv_xopen_source=no
12659 else
12660   echo "$as_me: failed program was:" >&5
12661 cat conftest.$ac_ext >&5
12662 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12663 fi
12664 rm -f conftest.$ac_objext conftest.$ac_ext
12665         CPPFLAGS="$cf_save"
12666
12667 fi
12668 rm -f conftest.$ac_objext conftest.$ac_ext
12669
12670 fi
12671 echo "$as_me:12671: result: $cf_cv_xopen_source" >&5
12672 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12673
12674 if test "$cf_cv_xopen_source" != no ; then
12675
12676 CFLAGS=`echo "$CFLAGS" | \
12677         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12678                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12679
12680 CPPFLAGS=`echo "$CPPFLAGS" | \
12681         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12682                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12683
12684         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12685
12686 cf_fix_cppflags=no
12687 cf_new_cflags=
12688 cf_new_cppflags=
12689 cf_new_extra_cppflags=
12690
12691 for cf_add_cflags in $cf_temp_xopen_source
12692 do
12693 case $cf_fix_cppflags in
12694 (no)
12695         case $cf_add_cflags in
12696         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12697                 case $cf_add_cflags in
12698                 (-D*)
12699                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12700
12701                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12702                                 && test -z "${cf_tst_cflags}" \
12703                                 && cf_fix_cppflags=yes
12704
12705                         if test $cf_fix_cppflags = yes ; then
12706
12707         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12708         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12709
12710                                 continue
12711                         elif test "${cf_tst_cflags}" = "\"'" ; then
12712
12713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12715
12716                                 continue
12717                         fi
12718                         ;;
12719                 esac
12720                 case "$CPPFLAGS" in
12721                 (*$cf_add_cflags)
12722                         ;;
12723                 (*)
12724                         case $cf_add_cflags in
12725                         (-D*)
12726                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12727
12728 CPPFLAGS=`echo "$CPPFLAGS" | \
12729         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12730                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12731
12732                                 ;;
12733                         esac
12734
12735         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12736         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12737
12738                         ;;
12739                 esac
12740                 ;;
12741         (*)
12742
12743         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12744         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12745
12746                 ;;
12747         esac
12748         ;;
12749 (yes)
12750
12751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12753
12754         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12755
12756         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12757                 && test -z "${cf_tst_cflags}" \
12758                 && cf_fix_cppflags=no
12759         ;;
12760 esac
12761 done
12762
12763 if test -n "$cf_new_cflags" ; then
12764
12765         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12766         CFLAGS="${CFLAGS}$cf_new_cflags"
12767
12768 fi
12769
12770 if test -n "$cf_new_cppflags" ; then
12771
12772         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12773         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12774
12775 fi
12776
12777 if test -n "$cf_new_extra_cppflags" ; then
12778
12779         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12780         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12781
12782 fi
12783
12784 fi
12785
12786         fi
12787 fi
12788 fi # cf_cv_posix_visible
12789
12790 # Check whether --enable-largefile or --disable-largefile was given.
12791 if test "${enable_largefile+set}" = set; then
12792   enableval="$enable_largefile"
12793
12794 fi;
12795 if test "$enable_largefile" != no; then
12796
12797   echo "$as_me:12797: checking for special C compiler options needed for large files" >&5
12798 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12799 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12800   echo $ECHO_N "(cached) $ECHO_C" >&6
12801 else
12802   ac_cv_sys_largefile_CC=no
12803      if test "$GCC" != yes; then
12804        ac_save_CC=$CC
12805        while :; do
12806          # IRIX 6.2 and later do not support large files by default,
12807          # so use the C compiler's -n32 option if that helps.
12808          cat >conftest.$ac_ext <<_ACEOF
12809 #line 12809 "configure"
12810 #include "confdefs.h"
12811 #include <sys/types.h>
12812  /* Check that off_t can represent 2**63 - 1 correctly.
12813     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12814     since some C++ compilers masquerading as C compilers
12815     incorrectly reject 9223372036854775807.  */
12816 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12817   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12818                        && LARGE_OFF_T % 2147483647 == 1)
12819                       ? 1 : -1];
12820 int
12821 main (void)
12822 {
12823
12824   ;
12825   return 0;
12826 }
12827 _ACEOF
12828          rm -f conftest.$ac_objext
12829 if { (eval echo "$as_me:12829: \"$ac_compile\"") >&5
12830   (eval $ac_compile) 2>&5
12831   ac_status=$?
12832   echo "$as_me:12832: \$? = $ac_status" >&5
12833   (exit $ac_status); } &&
12834          { ac_try='test -s conftest.$ac_objext'
12835   { (eval echo "$as_me:12835: \"$ac_try\"") >&5
12836   (eval $ac_try) 2>&5
12837   ac_status=$?
12838   echo "$as_me:12838: \$? = $ac_status" >&5
12839   (exit $ac_status); }; }; then
12840   break
12841 else
12842   echo "$as_me: failed program was:" >&5
12843 cat conftest.$ac_ext >&5
12844 fi
12845 rm -f conftest.$ac_objext
12846          CC="$CC -n32"
12847          rm -f conftest.$ac_objext
12848 if { (eval echo "$as_me:12848: \"$ac_compile\"") >&5
12849   (eval $ac_compile) 2>&5
12850   ac_status=$?
12851   echo "$as_me:12851: \$? = $ac_status" >&5
12852   (exit $ac_status); } &&
12853          { ac_try='test -s conftest.$ac_objext'
12854   { (eval echo "$as_me:12854: \"$ac_try\"") >&5
12855   (eval $ac_try) 2>&5
12856   ac_status=$?
12857   echo "$as_me:12857: \$? = $ac_status" >&5
12858   (exit $ac_status); }; }; then
12859   ac_cv_sys_largefile_CC=' -n32'; break
12860 else
12861   echo "$as_me: failed program was:" >&5
12862 cat conftest.$ac_ext >&5
12863 fi
12864 rm -f conftest.$ac_objext
12865          break
12866        done
12867        CC=$ac_save_CC
12868        rm -f conftest.$ac_ext
12869     fi
12870 fi
12871 echo "$as_me:12871: result: $ac_cv_sys_largefile_CC" >&5
12872 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12873   if test "$ac_cv_sys_largefile_CC" != no; then
12874     CC=$CC$ac_cv_sys_largefile_CC
12875   fi
12876
12877   echo "$as_me:12877: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12878 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12879 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12880   echo $ECHO_N "(cached) $ECHO_C" >&6
12881 else
12882   while :; do
12883   ac_cv_sys_file_offset_bits=no
12884   cat >conftest.$ac_ext <<_ACEOF
12885 #line 12885 "configure"
12886 #include "confdefs.h"
12887 #include <sys/types.h>
12888  /* Check that off_t can represent 2**63 - 1 correctly.
12889     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12890     since some C++ compilers masquerading as C compilers
12891     incorrectly reject 9223372036854775807.  */
12892 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12893   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12894                        && LARGE_OFF_T % 2147483647 == 1)
12895                       ? 1 : -1];
12896 int
12897 main (void)
12898 {
12899
12900   ;
12901   return 0;
12902 }
12903 _ACEOF
12904 rm -f conftest.$ac_objext
12905 if { (eval echo "$as_me:12905: \"$ac_compile\"") >&5
12906   (eval $ac_compile) 2>&5
12907   ac_status=$?
12908   echo "$as_me:12908: \$? = $ac_status" >&5
12909   (exit $ac_status); } &&
12910          { ac_try='test -s conftest.$ac_objext'
12911   { (eval echo "$as_me:12911: \"$ac_try\"") >&5
12912   (eval $ac_try) 2>&5
12913   ac_status=$?
12914   echo "$as_me:12914: \$? = $ac_status" >&5
12915   (exit $ac_status); }; }; then
12916   break
12917 else
12918   echo "$as_me: failed program was:" >&5
12919 cat conftest.$ac_ext >&5
12920 fi
12921 rm -f conftest.$ac_objext conftest.$ac_ext
12922   cat >conftest.$ac_ext <<_ACEOF
12923 #line 12923 "configure"
12924 #include "confdefs.h"
12925 #define _FILE_OFFSET_BITS 64
12926 #include <sys/types.h>
12927  /* Check that off_t can represent 2**63 - 1 correctly.
12928     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12929     since some C++ compilers masquerading as C compilers
12930     incorrectly reject 9223372036854775807.  */
12931 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12932   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12933                        && LARGE_OFF_T % 2147483647 == 1)
12934                       ? 1 : -1];
12935 int
12936 main (void)
12937 {
12938
12939   ;
12940   return 0;
12941 }
12942 _ACEOF
12943 rm -f conftest.$ac_objext
12944 if { (eval echo "$as_me:12944: \"$ac_compile\"") >&5
12945   (eval $ac_compile) 2>&5
12946   ac_status=$?
12947   echo "$as_me:12947: \$? = $ac_status" >&5
12948   (exit $ac_status); } &&
12949          { ac_try='test -s conftest.$ac_objext'
12950   { (eval echo "$as_me:12950: \"$ac_try\"") >&5
12951   (eval $ac_try) 2>&5
12952   ac_status=$?
12953   echo "$as_me:12953: \$? = $ac_status" >&5
12954   (exit $ac_status); }; }; then
12955   ac_cv_sys_file_offset_bits=64; break
12956 else
12957   echo "$as_me: failed program was:" >&5
12958 cat conftest.$ac_ext >&5
12959 fi
12960 rm -f conftest.$ac_objext conftest.$ac_ext
12961   break
12962 done
12963 fi
12964 echo "$as_me:12964: result: $ac_cv_sys_file_offset_bits" >&5
12965 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12966 if test "$ac_cv_sys_file_offset_bits" != no; then
12967
12968 cat >>confdefs.h <<EOF
12969 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12970 EOF
12971
12972 fi
12973 rm -rf conftest*
12974   echo "$as_me:12974: checking for _LARGE_FILES value needed for large files" >&5
12975 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12976 if test "${ac_cv_sys_large_files+set}" = set; then
12977   echo $ECHO_N "(cached) $ECHO_C" >&6
12978 else
12979   while :; do
12980   ac_cv_sys_large_files=no
12981   cat >conftest.$ac_ext <<_ACEOF
12982 #line 12982 "configure"
12983 #include "confdefs.h"
12984 #include <sys/types.h>
12985  /* Check that off_t can represent 2**63 - 1 correctly.
12986     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12987     since some C++ compilers masquerading as C compilers
12988     incorrectly reject 9223372036854775807.  */
12989 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12990   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12991                        && LARGE_OFF_T % 2147483647 == 1)
12992                       ? 1 : -1];
12993 int
12994 main (void)
12995 {
12996
12997   ;
12998   return 0;
12999 }
13000 _ACEOF
13001 rm -f conftest.$ac_objext
13002 if { (eval echo "$as_me:13002: \"$ac_compile\"") >&5
13003   (eval $ac_compile) 2>&5
13004   ac_status=$?
13005   echo "$as_me:13005: \$? = $ac_status" >&5
13006   (exit $ac_status); } &&
13007          { ac_try='test -s conftest.$ac_objext'
13008   { (eval echo "$as_me:13008: \"$ac_try\"") >&5
13009   (eval $ac_try) 2>&5
13010   ac_status=$?
13011   echo "$as_me:13011: \$? = $ac_status" >&5
13012   (exit $ac_status); }; }; then
13013   break
13014 else
13015   echo "$as_me: failed program was:" >&5
13016 cat conftest.$ac_ext >&5
13017 fi
13018 rm -f conftest.$ac_objext conftest.$ac_ext
13019   cat >conftest.$ac_ext <<_ACEOF
13020 #line 13020 "configure"
13021 #include "confdefs.h"
13022 #define _LARGE_FILES 1
13023 #include <sys/types.h>
13024  /* Check that off_t can represent 2**63 - 1 correctly.
13025     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13026     since some C++ compilers masquerading as C compilers
13027     incorrectly reject 9223372036854775807.  */
13028 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13029   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13030                        && LARGE_OFF_T % 2147483647 == 1)
13031                       ? 1 : -1];
13032 int
13033 main (void)
13034 {
13035
13036   ;
13037   return 0;
13038 }
13039 _ACEOF
13040 rm -f conftest.$ac_objext
13041 if { (eval echo "$as_me:13041: \"$ac_compile\"") >&5
13042   (eval $ac_compile) 2>&5
13043   ac_status=$?
13044   echo "$as_me:13044: \$? = $ac_status" >&5
13045   (exit $ac_status); } &&
13046          { ac_try='test -s conftest.$ac_objext'
13047   { (eval echo "$as_me:13047: \"$ac_try\"") >&5
13048   (eval $ac_try) 2>&5
13049   ac_status=$?
13050   echo "$as_me:13050: \$? = $ac_status" >&5
13051   (exit $ac_status); }; }; then
13052   ac_cv_sys_large_files=1; break
13053 else
13054   echo "$as_me: failed program was:" >&5
13055 cat conftest.$ac_ext >&5
13056 fi
13057 rm -f conftest.$ac_objext conftest.$ac_ext
13058   break
13059 done
13060 fi
13061 echo "$as_me:13061: result: $ac_cv_sys_large_files" >&5
13062 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13063 if test "$ac_cv_sys_large_files" != no; then
13064
13065 cat >>confdefs.h <<EOF
13066 #define _LARGE_FILES $ac_cv_sys_large_files
13067 EOF
13068
13069 fi
13070 rm -rf conftest*
13071 fi
13072
13073         if test "$enable_largefile" != no ; then
13074         echo "$as_me:13074: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13075 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13076 if test "${ac_cv_sys_largefile_source+set}" = set; then
13077   echo $ECHO_N "(cached) $ECHO_C" >&6
13078 else
13079   while :; do
13080   ac_cv_sys_largefile_source=no
13081   cat >conftest.$ac_ext <<_ACEOF
13082 #line 13082 "configure"
13083 #include "confdefs.h"
13084 #include <stdio.h>
13085 int
13086 main (void)
13087 {
13088 return !fseeko;
13089   ;
13090   return 0;
13091 }
13092 _ACEOF
13093 rm -f conftest.$ac_objext
13094 if { (eval echo "$as_me:13094: \"$ac_compile\"") >&5
13095   (eval $ac_compile) 2>&5
13096   ac_status=$?
13097   echo "$as_me:13097: \$? = $ac_status" >&5
13098   (exit $ac_status); } &&
13099          { ac_try='test -s conftest.$ac_objext'
13100   { (eval echo "$as_me:13100: \"$ac_try\"") >&5
13101   (eval $ac_try) 2>&5
13102   ac_status=$?
13103   echo "$as_me:13103: \$? = $ac_status" >&5
13104   (exit $ac_status); }; }; then
13105   break
13106 else
13107   echo "$as_me: failed program was:" >&5
13108 cat conftest.$ac_ext >&5
13109 fi
13110 rm -f conftest.$ac_objext conftest.$ac_ext
13111   cat >conftest.$ac_ext <<_ACEOF
13112 #line 13112 "configure"
13113 #include "confdefs.h"
13114 #define _LARGEFILE_SOURCE 1
13115 #include <stdio.h>
13116 int
13117 main (void)
13118 {
13119 return !fseeko;
13120   ;
13121   return 0;
13122 }
13123 _ACEOF
13124 rm -f conftest.$ac_objext
13125 if { (eval echo "$as_me:13125: \"$ac_compile\"") >&5
13126   (eval $ac_compile) 2>&5
13127   ac_status=$?
13128   echo "$as_me:13128: \$? = $ac_status" >&5
13129   (exit $ac_status); } &&
13130          { ac_try='test -s conftest.$ac_objext'
13131   { (eval echo "$as_me:13131: \"$ac_try\"") >&5
13132   (eval $ac_try) 2>&5
13133   ac_status=$?
13134   echo "$as_me:13134: \$? = $ac_status" >&5
13135   (exit $ac_status); }; }; then
13136   ac_cv_sys_largefile_source=1; break
13137 else
13138   echo "$as_me: failed program was:" >&5
13139 cat conftest.$ac_ext >&5
13140 fi
13141 rm -f conftest.$ac_objext conftest.$ac_ext
13142   break
13143 done
13144 fi
13145 echo "$as_me:13145: result: $ac_cv_sys_largefile_source" >&5
13146 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13147 if test "$ac_cv_sys_largefile_source" != no; then
13148
13149 cat >>confdefs.h <<EOF
13150 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13151 EOF
13152
13153 fi
13154 rm -rf conftest*
13155
13156 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13157 # in glibc 2.1.3, but that breaks too many other things.
13158 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13159 echo "$as_me:13159: checking for fseeko" >&5
13160 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13161 if test "${ac_cv_func_fseeko+set}" = set; then
13162   echo $ECHO_N "(cached) $ECHO_C" >&6
13163 else
13164   cat >conftest.$ac_ext <<_ACEOF
13165 #line 13165 "configure"
13166 #include "confdefs.h"
13167 #include <stdio.h>
13168 int
13169 main (void)
13170 {
13171 return fseeko && fseeko (stdin, 0, 0);
13172   ;
13173   return 0;
13174 }
13175 _ACEOF
13176 rm -f conftest.$ac_objext conftest$ac_exeext
13177 if { (eval echo "$as_me:13177: \"$ac_link\"") >&5
13178   (eval $ac_link) 2>&5
13179   ac_status=$?
13180   echo "$as_me:13180: \$? = $ac_status" >&5
13181   (exit $ac_status); } &&
13182          { ac_try='test -s conftest$ac_exeext'
13183   { (eval echo "$as_me:13183: \"$ac_try\"") >&5
13184   (eval $ac_try) 2>&5
13185   ac_status=$?
13186   echo "$as_me:13186: \$? = $ac_status" >&5
13187   (exit $ac_status); }; }; then
13188   ac_cv_func_fseeko=yes
13189 else
13190   echo "$as_me: failed program was:" >&5
13191 cat conftest.$ac_ext >&5
13192 ac_cv_func_fseeko=no
13193 fi
13194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13195 fi
13196 echo "$as_me:13196: result: $ac_cv_func_fseeko" >&5
13197 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13198 if test $ac_cv_func_fseeko = yes; then
13199
13200 cat >>confdefs.h <<\EOF
13201 #define HAVE_FSEEKO 1
13202 EOF
13203
13204 fi
13205
13206         # Normally we would collect these definitions in the config.h,
13207         # but (like _XOPEN_SOURCE), some environments rely on having these
13208         # defined before any of the system headers are included.  Another
13209         # case comes up with C++, e.g., on AIX the compiler compiles the
13210         # header files by themselves before looking at the body files it is
13211         # told to compile.  For ncurses, those header files do not include
13212         # the config.h
13213         if test "$ac_cv_sys_large_files" != no
13214         then
13215
13216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13217         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13218
13219         fi
13220         if test "$ac_cv_sys_largefile_source" != no
13221         then
13222
13223         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13224         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13225
13226         fi
13227         if test "$ac_cv_sys_file_offset_bits" != no
13228         then
13229
13230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13231         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13232
13233         fi
13234
13235         echo "$as_me:13235: checking whether to use struct dirent64" >&5
13236 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13237 if test "${cf_cv_struct_dirent64+set}" = set; then
13238   echo $ECHO_N "(cached) $ECHO_C" >&6
13239 else
13240
13241                 cat >conftest.$ac_ext <<_ACEOF
13242 #line 13242 "configure"
13243 #include "confdefs.h"
13244
13245 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13246 #include <sys/types.h>
13247 #include <dirent.h>
13248
13249 int
13250 main (void)
13251 {
13252
13253                 /* if transitional largefile support is setup, this is true */
13254                 extern struct dirent64 * readdir(DIR *);
13255                 struct dirent64 *x = readdir((DIR *)0);
13256                 struct dirent *y = readdir((DIR *)0);
13257                 int z = x - y;
13258
13259   ;
13260   return 0;
13261 }
13262 _ACEOF
13263 rm -f conftest.$ac_objext
13264 if { (eval echo "$as_me:13264: \"$ac_compile\"") >&5
13265   (eval $ac_compile) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit $ac_status); } &&
13269          { ac_try='test -s conftest.$ac_objext'
13270   { (eval echo "$as_me:13270: \"$ac_try\"") >&5
13271   (eval $ac_try) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit $ac_status); }; }; then
13275   cf_cv_struct_dirent64=yes
13276 else
13277   echo "$as_me: failed program was:" >&5
13278 cat conftest.$ac_ext >&5
13279 cf_cv_struct_dirent64=no
13280 fi
13281 rm -f conftest.$ac_objext conftest.$ac_ext
13282
13283 fi
13284 echo "$as_me:13284: result: $cf_cv_struct_dirent64" >&5
13285 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13286         test "$cf_cv_struct_dirent64" = yes &&
13287 cat >>confdefs.h <<\EOF
13288 #define HAVE_STRUCT_DIRENT64 1
13289 EOF
13290
13291         fi
13292
13293 ### Enable compiling-in rcs id's
13294 echo "$as_me:13294: checking if RCS identifiers should be compiled-in" >&5
13295 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13296
13297 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13298 if test "${with_rcs_ids+set}" = set; then
13299   withval="$with_rcs_ids"
13300   with_rcs_ids=$withval
13301 else
13302   with_rcs_ids=no
13303 fi;
13304 echo "$as_me:13304: result: $with_rcs_ids" >&5
13305 echo "${ECHO_T}$with_rcs_ids" >&6
13306 test "$with_rcs_ids" = yes &&
13307 cat >>confdefs.h <<\EOF
13308 #define USE_RCS_IDS 1
13309 EOF
13310
13311 ###############################################################################
13312
13313 ### Note that some functions (such as const) are normally disabled anyway.
13314 echo "$as_me:13314: checking if you want to build with function extensions" >&5
13315 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13316
13317 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13318 if test "${enable_ext_funcs+set}" = set; then
13319   enableval="$enable_ext_funcs"
13320   with_ext_funcs=$enableval
13321 else
13322   with_ext_funcs=yes
13323 fi;
13324 echo "$as_me:13324: result: $with_ext_funcs" >&5
13325 echo "${ECHO_T}$with_ext_funcs" >&6
13326 if test "$with_ext_funcs" = yes ; then
13327         NCURSES_EXT_FUNCS=1
13328
13329 cat >>confdefs.h <<\EOF
13330 #define HAVE_USE_DEFAULT_COLORS 1
13331 EOF
13332
13333 cat >>confdefs.h <<\EOF
13334 #define NCURSES_EXT_FUNCS 1
13335 EOF
13336
13337 else
13338         NCURSES_EXT_FUNCS=0
13339 fi
13340
13341 ###   use option --enable-const to turn on use of const beyond that in XSI.
13342 echo "$as_me:13342: checking for extended use of const keyword" >&5
13343 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13344
13345 # Check whether --enable-const or --disable-const was given.
13346 if test "${enable_const+set}" = set; then
13347   enableval="$enable_const"
13348   with_ext_const=$enableval
13349 else
13350   with_ext_const=no
13351 fi;
13352 echo "$as_me:13352: result: $with_ext_const" >&5
13353 echo "${ECHO_T}$with_ext_const" >&6
13354 NCURSES_CONST='/*nothing*/'
13355 if test "$with_ext_const" = yes ; then
13356         NCURSES_CONST=const
13357 fi
13358
13359 ###############################################################################
13360 # These options are relatively safe to experiment with.
13361
13362 echo "$as_me:13362: checking if you want all development code" >&5
13363 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13364
13365 # Check whether --with-develop or --without-develop was given.
13366 if test "${with_develop+set}" = set; then
13367   withval="$with_develop"
13368   with_develop=$withval
13369 else
13370   with_develop=no
13371 fi;
13372 echo "$as_me:13372: result: $with_develop" >&5
13373 echo "${ECHO_T}$with_develop" >&6
13374
13375 ###############################################################################
13376 # These are just experimental, probably should not be in a package:
13377
13378 # This is still experimental (20080329), but should ultimately be moved to
13379 # the script-block --with-normal, etc.
13380
13381 echo "$as_me:13381: checking if you want to link with the pthread library" >&5
13382 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13383
13384 # Check whether --with-pthread or --without-pthread was given.
13385 if test "${with_pthread+set}" = set; then
13386   withval="$with_pthread"
13387   with_pthread=$withval
13388 else
13389   with_pthread=no
13390 fi;
13391 echo "$as_me:13391: result: $with_pthread" >&5
13392 echo "${ECHO_T}$with_pthread" >&6
13393
13394 if test "$with_pthread" != no ; then
13395         echo "$as_me:13395: checking for pthread.h" >&5
13396 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13397 if test "${ac_cv_header_pthread_h+set}" = set; then
13398   echo $ECHO_N "(cached) $ECHO_C" >&6
13399 else
13400   cat >conftest.$ac_ext <<_ACEOF
13401 #line 13401 "configure"
13402 #include "confdefs.h"
13403 #include <pthread.h>
13404 _ACEOF
13405 if { (eval echo "$as_me:13405: \"$ac_cpp conftest.$ac_ext\"") >&5
13406   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13407   ac_status=$?
13408   egrep -v '^ *\+' conftest.er1 >conftest.err
13409   rm -f conftest.er1
13410   cat conftest.err >&5
13411   echo "$as_me:13411: \$? = $ac_status" >&5
13412   (exit $ac_status); } >/dev/null; then
13413   if test -s conftest.err; then
13414     ac_cpp_err=$ac_c_preproc_warn_flag
13415   else
13416     ac_cpp_err=
13417   fi
13418 else
13419   ac_cpp_err=yes
13420 fi
13421 if test -z "$ac_cpp_err"; then
13422   ac_cv_header_pthread_h=yes
13423 else
13424   echo "$as_me: failed program was:" >&5
13425   cat conftest.$ac_ext >&5
13426   ac_cv_header_pthread_h=no
13427 fi
13428 rm -f conftest.err conftest.$ac_ext
13429 fi
13430 echo "$as_me:13430: result: $ac_cv_header_pthread_h" >&5
13431 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13432 if test $ac_cv_header_pthread_h = yes; then
13433
13434 cat >>confdefs.h <<\EOF
13435 #define HAVE_PTHREADS_H 1
13436 EOF
13437
13438         for cf_lib_pthread in pthread c_r
13439         do
13440             echo "$as_me:13440: checking if we can link with the $cf_lib_pthread library" >&5
13441 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13442             cf_save_LIBS="$LIBS"
13443
13444 cf_add_libs="$LIBS"
13445 # reverse order
13446 cf_add_0lib=
13447 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13448 # filter duplicates
13449 for cf_add_1lib in $cf_add_0lib; do
13450         for cf_add_2lib in $cf_add_libs; do
13451                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13452                         cf_add_1lib=
13453                         break
13454                 fi
13455         done
13456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13457 done
13458 LIBS="$cf_add_libs"
13459
13460             cat >conftest.$ac_ext <<_ACEOF
13461 #line 13461 "configure"
13462 #include "confdefs.h"
13463
13464 #include <pthread.h>
13465
13466 int
13467 main (void)
13468 {
13469
13470                 int rc = pthread_create(0,0,0,0);
13471                 int r2 = pthread_mutexattr_settype(0, 0);
13472
13473   ;
13474   return 0;
13475 }
13476 _ACEOF
13477 rm -f conftest.$ac_objext conftest$ac_exeext
13478 if { (eval echo "$as_me:13478: \"$ac_link\"") >&5
13479   (eval $ac_link) 2>&5
13480   ac_status=$?
13481   echo "$as_me:13481: \$? = $ac_status" >&5
13482   (exit $ac_status); } &&
13483          { ac_try='test -s conftest$ac_exeext'
13484   { (eval echo "$as_me:13484: \"$ac_try\"") >&5
13485   (eval $ac_try) 2>&5
13486   ac_status=$?
13487   echo "$as_me:13487: \$? = $ac_status" >&5
13488   (exit $ac_status); }; }; then
13489   with_pthread=yes
13490 else
13491   echo "$as_me: failed program was:" >&5
13492 cat conftest.$ac_ext >&5
13493 with_pthread=no
13494 fi
13495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13496             LIBS="$cf_save_LIBS"
13497             echo "$as_me:13497: result: $with_pthread" >&5
13498 echo "${ECHO_T}$with_pthread" >&6
13499             test "$with_pthread" = yes && break
13500         done
13501
13502         if test "$with_pthread" = yes ; then
13503
13504 cf_add_libs="$LIBS"
13505 # reverse order
13506 cf_add_0lib=
13507 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13508 # filter duplicates
13509 for cf_add_1lib in $cf_add_0lib; do
13510         for cf_add_2lib in $cf_add_libs; do
13511                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13512                         cf_add_1lib=
13513                         break
13514                 fi
13515         done
13516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13517 done
13518 LIBS="$cf_add_libs"
13519
13520 cat >>confdefs.h <<\EOF
13521 #define HAVE_LIBPTHREADS 1
13522 EOF
13523
13524         else
13525             { { echo "$as_me:13525: error: Cannot link with pthread library" >&5
13526 echo "$as_me: error: Cannot link with pthread library" >&2;}
13527    { (exit 1); exit 1; }; }
13528         fi
13529
13530 fi
13531
13532 fi
13533
13534 echo "$as_me:13534: checking if you want to use weak-symbols for pthreads" >&5
13535 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13536
13537 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13538 if test "${enable_weak_symbols+set}" = set; then
13539   enableval="$enable_weak_symbols"
13540   use_weak_symbols=$withval
13541 else
13542   use_weak_symbols=no
13543 fi;
13544 echo "$as_me:13544: result: $use_weak_symbols" >&5
13545 echo "${ECHO_T}$use_weak_symbols" >&6
13546 if test "$use_weak_symbols" = yes ; then
13547
13548 echo "$as_me:13548: checking if $CC supports weak symbols" >&5
13549 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13550 if test "${cf_cv_weak_symbols+set}" = set; then
13551   echo $ECHO_N "(cached) $ECHO_C" >&6
13552 else
13553
13554 cat >conftest.$ac_ext <<_ACEOF
13555 #line 13555 "configure"
13556 #include "confdefs.h"
13557
13558 #include <stdio.h>
13559 int
13560 main (void)
13561 {
13562
13563 #if defined(__GNUC__)
13564 #  if defined __USE_ISOC99
13565 #    define _cat_pragma(exp)    _Pragma(#exp)
13566 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13567 #  else
13568 #    define _weak_pragma(exp)
13569 #  endif
13570 #  define _declare(name)        __extension__ extern __typeof__(name) name
13571 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13572 #endif
13573
13574 weak_symbol(fopen);
13575
13576   ;
13577   return 0;
13578 }
13579 _ACEOF
13580 rm -f conftest.$ac_objext
13581 if { (eval echo "$as_me:13581: \"$ac_compile\"") >&5
13582   (eval $ac_compile) 2>&5
13583   ac_status=$?
13584   echo "$as_me:13584: \$? = $ac_status" >&5
13585   (exit $ac_status); } &&
13586          { ac_try='test -s conftest.$ac_objext'
13587   { (eval echo "$as_me:13587: \"$ac_try\"") >&5
13588   (eval $ac_try) 2>&5
13589   ac_status=$?
13590   echo "$as_me:13590: \$? = $ac_status" >&5
13591   (exit $ac_status); }; }; then
13592   cf_cv_weak_symbols=yes
13593 else
13594   echo "$as_me: failed program was:" >&5
13595 cat conftest.$ac_ext >&5
13596 cf_cv_weak_symbols=no
13597 fi
13598 rm -f conftest.$ac_objext conftest.$ac_ext
13599
13600 fi
13601 echo "$as_me:13601: result: $cf_cv_weak_symbols" >&5
13602 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13603
13604 else
13605         cf_cv_weak_symbols=no
13606 fi
13607
13608 if test $cf_cv_weak_symbols = yes ; then
13609
13610 cat >>confdefs.h <<\EOF
13611 #define USE_WEAK_SYMBOLS 1
13612 EOF
13613
13614 fi
13615
13616 PTHREAD=
13617 if test "$with_pthread" = "yes" ; then
13618
13619 cat >>confdefs.h <<\EOF
13620 #define USE_PTHREADS 1
13621 EOF
13622
13623         enable_reentrant=yes
13624         if test $cf_cv_weak_symbols = yes ; then
13625                 PTHREAD=-lpthread
13626         fi
13627 fi
13628
13629 # OpenSUSE is installing ncurses6, using reentrant option.
13630 echo "$as_me:13630: checking for _nc_TABSIZE" >&5
13631 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13632 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13633   echo $ECHO_N "(cached) $ECHO_C" >&6
13634 else
13635   cat >conftest.$ac_ext <<_ACEOF
13636 #line 13636 "configure"
13637 #include "confdefs.h"
13638 #define _nc_TABSIZE autoconf_temporary
13639 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13640 #undef _nc_TABSIZE
13641
13642 #ifdef __cplusplus
13643 extern "C"
13644 #endif
13645
13646 /* We use char because int might match the return type of a gcc2
13647    builtin and then its argument prototype would still apply.  */
13648 char _nc_TABSIZE (void);
13649
13650 int
13651 main (void)
13652 {
13653
13654 /* The GNU C library defines stubs for functions which it implements
13655     to always fail with ENOSYS.  Some functions are actually named
13656     something starting with __ and the normal name is an alias.  */
13657 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13658 #error found stub for _nc_TABSIZE
13659 #endif
13660
13661         return _nc_TABSIZE ();
13662   ;
13663   return 0;
13664 }
13665 _ACEOF
13666 rm -f conftest.$ac_objext conftest$ac_exeext
13667 if { (eval echo "$as_me:13667: \"$ac_link\"") >&5
13668   (eval $ac_link) 2>&5
13669   ac_status=$?
13670   echo "$as_me:13670: \$? = $ac_status" >&5
13671   (exit $ac_status); } &&
13672          { ac_try='test -s conftest$ac_exeext'
13673   { (eval echo "$as_me:13673: \"$ac_try\"") >&5
13674   (eval $ac_try) 2>&5
13675   ac_status=$?
13676   echo "$as_me:13676: \$? = $ac_status" >&5
13677   (exit $ac_status); }; }; then
13678   ac_cv_func__nc_TABSIZE=yes
13679 else
13680   echo "$as_me: failed program was:" >&5
13681 cat conftest.$ac_ext >&5
13682 ac_cv_func__nc_TABSIZE=no
13683 fi
13684 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13685 fi
13686 echo "$as_me:13686: result: $ac_cv_func__nc_TABSIZE" >&5
13687 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13688 if test $ac_cv_func__nc_TABSIZE = yes; then
13689   assume_reentrant=yes
13690 else
13691   assume_reentrant=no
13692 fi
13693
13694 # Reentrant code has to be opaque; there's little advantage to making ncurses
13695 # opaque outside of that, so there is no --enable-opaque option.  We can use
13696 # this option without --with-pthreads, but this will be always set for
13697 # pthreads.
13698 echo "$as_me:13698: checking if you want experimental reentrant code" >&5
13699 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13700
13701 # Check whether --enable-reentrant or --disable-reentrant was given.
13702 if test "${enable_reentrant+set}" = set; then
13703   enableval="$enable_reentrant"
13704   with_reentrant=$enableval
13705 else
13706   with_reentrant=$assume_reentrant
13707 fi;
13708 echo "$as_me:13708: result: $with_reentrant" >&5
13709 echo "${ECHO_T}$with_reentrant" >&6
13710 if test "$with_reentrant" = yes ; then
13711         cf_cv_enable_reentrant=1
13712         if test $cf_cv_weak_symbols = yes ; then
13713
13714 # remove pthread library from $LIBS
13715 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13716
13717         elif test "$assume_reentrant" = no ; then
13718                 LIB_SUFFIX="t${LIB_SUFFIX}"
13719         fi
13720
13721 cat >>confdefs.h <<\EOF
13722 #define USE_REENTRANT 1
13723 EOF
13724
13725 else
13726         cf_cv_enable_reentrant=0
13727 fi
13728
13729 ### Allow using a different wrap-prefix
13730 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13731         echo "$as_me:13731: checking for prefix used to wrap public variables" >&5
13732 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13733
13734 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13735 if test "${with_wrap_prefix+set}" = set; then
13736   withval="$with_wrap_prefix"
13737   NCURSES_WRAP_PREFIX=$withval
13738 else
13739   NCURSES_WRAP_PREFIX=_nc_
13740 fi;
13741         echo "$as_me:13741: result: $NCURSES_WRAP_PREFIX" >&5
13742 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13743 else
13744         NCURSES_WRAP_PREFIX=_nc_
13745 fi
13746
13747 cat >>confdefs.h <<EOF
13748 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13749 EOF
13750
13751 ###############################################################################
13752
13753 ###     use option --disable-echo to suppress full display compiling commands
13754
13755 echo "$as_me:13755: checking if you want to see long compiling messages" >&5
13756 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13757
13758 # Check whether --enable-echo or --disable-echo was given.
13759 if test "${enable_echo+set}" = set; then
13760   enableval="$enable_echo"
13761   test "$enableval" != no && enableval=yes
13762         if test "$enableval" != "yes" ; then
13763
13764         ECHO_LT='--silent'
13765         ECHO_LD='@echo linking $@;'
13766         RULE_CC='@echo compiling $<'
13767         SHOW_CC='@echo compiling $@'
13768         ECHO_CC='@'
13769
13770         else
13771
13772         ECHO_LT=''
13773         ECHO_LD=''
13774         RULE_CC=''
13775         SHOW_CC=''
13776         ECHO_CC=''
13777
13778         fi
13779 else
13780   enableval=yes
13781
13782         ECHO_LT=''
13783         ECHO_LD=''
13784         RULE_CC=''
13785         SHOW_CC=''
13786         ECHO_CC=''
13787
13788 fi;
13789 echo "$as_me:13789: result: $enableval" >&5
13790 echo "${ECHO_T}$enableval" >&6
13791
13792 ###     use option --enable-warnings to turn on all gcc warnings
13793 echo "$as_me:13793: checking if you want to see compiler warnings" >&5
13794 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13795
13796 # Check whether --enable-warnings or --disable-warnings was given.
13797 if test "${enable_warnings+set}" = set; then
13798   enableval="$enable_warnings"
13799   with_warnings=$enableval
13800 fi;
13801 echo "$as_me:13801: result: $with_warnings" >&5
13802 echo "${ECHO_T}$with_warnings" >&6
13803
13804 if test "x$with_warnings" = "xyes"; then
13805
13806         ADAFLAGS="$ADAFLAGS -gnatg"
13807
13808 if test "x$have_x" = xyes; then
13809
13810 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
13811 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
13812 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
13813 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
13814 for cf_X_CFLAGS in $X_CFLAGS
13815 do
13816         case "x$cf_X_CFLAGS" in
13817         x-[IUD]*)
13818                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
13819                 ;;
13820         *)
13821                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
13822                 ;;
13823         esac
13824 done
13825
13826 cat >conftest.$ac_ext <<_ACEOF
13827 #line 13827 "configure"
13828 #include "confdefs.h"
13829
13830 #include <stdlib.h>
13831 #include <X11/Intrinsic.h>
13832
13833 int
13834 main (void)
13835 {
13836 String foo = malloc(1)
13837   ;
13838   return 0;
13839 }
13840 _ACEOF
13841 rm -f conftest.$ac_objext
13842 if { (eval echo "$as_me:13842: \"$ac_compile\"") >&5
13843   (eval $ac_compile) 2>&5
13844   ac_status=$?
13845   echo "$as_me:13845: \$? = $ac_status" >&5
13846   (exit $ac_status); } &&
13847          { ac_try='test -s conftest.$ac_objext'
13848   { (eval echo "$as_me:13848: \"$ac_try\"") >&5
13849   (eval $ac_try) 2>&5
13850   ac_status=$?
13851   echo "$as_me:13851: \$? = $ac_status" >&5
13852   (exit $ac_status); }; }; then
13853
13854 echo "$as_me:13854: checking for X11/Xt const-feature" >&5
13855 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
13856 if test "${cf_cv_const_x_string+set}" = set; then
13857   echo $ECHO_N "(cached) $ECHO_C" >&6
13858 else
13859
13860         cat >conftest.$ac_ext <<_ACEOF
13861 #line 13861 "configure"
13862 #include "confdefs.h"
13863
13864 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
13865 #undef  XTSTRINGDEFINES /* X11R5 and later */
13866 #include <stdlib.h>
13867 #include <X11/Intrinsic.h>
13868
13869 int
13870 main (void)
13871 {
13872 String foo = malloc(1); *foo = 0
13873   ;
13874   return 0;
13875 }
13876 _ACEOF
13877 rm -f conftest.$ac_objext
13878 if { (eval echo "$as_me:13878: \"$ac_compile\"") >&5
13879   (eval $ac_compile) 2>&5
13880   ac_status=$?
13881   echo "$as_me:13881: \$? = $ac_status" >&5
13882   (exit $ac_status); } &&
13883          { ac_try='test -s conftest.$ac_objext'
13884   { (eval echo "$as_me:13884: \"$ac_try\"") >&5
13885   (eval $ac_try) 2>&5
13886   ac_status=$?
13887   echo "$as_me:13887: \$? = $ac_status" >&5
13888   (exit $ac_status); }; }; then
13889
13890                         cf_cv_const_x_string=no
13891
13892 else
13893   echo "$as_me: failed program was:" >&5
13894 cat conftest.$ac_ext >&5
13895
13896                         cf_cv_const_x_string=yes
13897
13898 fi
13899 rm -f conftest.$ac_objext conftest.$ac_ext
13900
13901 fi
13902 echo "$as_me:13902: result: $cf_cv_const_x_string" >&5
13903 echo "${ECHO_T}$cf_cv_const_x_string" >&6
13904
13905 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
13906 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
13907 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
13908
13909 case $cf_cv_const_x_string in
13910 (no)
13911
13912         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13913         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13914
13915         ;;
13916 (*)
13917
13918         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13919         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
13920
13921         ;;
13922 esac
13923
13924 else
13925   echo "$as_me: failed program was:" >&5
13926 cat conftest.$ac_ext >&5
13927 fi
13928 rm -f conftest.$ac_objext conftest.$ac_ext
13929  fi
13930 cat > conftest.$ac_ext <<EOF
13931 #line 13931 "${as_me:-configure}"
13932 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13933 EOF
13934 if test "$INTEL_COMPILER" = yes
13935 then
13936 # The "-wdXXX" options suppress warnings:
13937 # remark #1419: external declaration in primary source file
13938 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13939 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13940 # remark #193: zero used for undefined preprocessing identifier
13941 # remark #593: variable "curs_sb_left_arrow" was set but never used
13942 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13943 # remark #869: parameter "tw" was never referenced
13944 # remark #981: operands are evaluated in unspecified order
13945 # warning #279: controlling expression is constant
13946
13947         { echo "$as_me:13947: checking for $CC warning options..." >&5
13948 echo "$as_me: checking for $CC warning options..." >&6;}
13949         cf_save_CFLAGS="$CFLAGS"
13950         EXTRA_CFLAGS="-Wall"
13951         for cf_opt in \
13952                 wd1419 \
13953                 wd1683 \
13954                 wd1684 \
13955                 wd193 \
13956                 wd593 \
13957                 wd279 \
13958                 wd810 \
13959                 wd869 \
13960                 wd981
13961         do
13962                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13963                 if { (eval echo "$as_me:13963: \"$ac_compile\"") >&5
13964   (eval $ac_compile) 2>&5
13965   ac_status=$?
13966   echo "$as_me:13966: \$? = $ac_status" >&5
13967   (exit $ac_status); }; then
13968                         test -n "$verbose" && echo "$as_me:13968: result: ... -$cf_opt" >&5
13969 echo "${ECHO_T}... -$cf_opt" >&6
13970                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13971                 fi
13972         done
13973         CFLAGS="$cf_save_CFLAGS"
13974 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
13975 then
13976         { echo "$as_me:13976: checking for $CC warning options..." >&5
13977 echo "$as_me: checking for $CC warning options..." >&6;}
13978         cf_save_CFLAGS="$CFLAGS"
13979         EXTRA_CFLAGS=
13980         cf_warn_CONST=""
13981         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13982         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13983         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13984         for cf_opt in W Wall \
13985                 Wbad-function-cast \
13986                 Wcast-align \
13987                 Wcast-qual \
13988                 Wdeclaration-after-statement \
13989                 Wextra \
13990                 Winline \
13991                 Wmissing-declarations \
13992                 Wmissing-prototypes \
13993                 Wnested-externs \
13994                 Wpointer-arith \
13995                 Wshadow \
13996                 Wstrict-prototypes \
13997                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
13998         do
13999                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14000                 if { (eval echo "$as_me:14000: \"$ac_compile\"") >&5
14001   (eval $ac_compile) 2>&5
14002   ac_status=$?
14003   echo "$as_me:14003: \$? = $ac_status" >&5
14004   (exit $ac_status); }; then
14005                         test -n "$verbose" && echo "$as_me:14005: result: ... -$cf_opt" >&5
14006 echo "${ECHO_T}... -$cf_opt" >&6
14007                         case $cf_opt in
14008                         (Winline)
14009                                 case $GCC_VERSION in
14010                                 ([34].*)
14011                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14012
14013 echo "${as_me:-configure}:14013: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14014
14015                                         continue;;
14016                                 esac
14017                                 ;;
14018                         (Wpointer-arith)
14019                                 case $GCC_VERSION in
14020                                 ([12].*)
14021                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14022
14023 echo "${as_me:-configure}:14023: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14024
14025                                         continue;;
14026                                 esac
14027                                 ;;
14028                         esac
14029                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14030                 fi
14031         done
14032         CFLAGS="$cf_save_CFLAGS"
14033 fi
14034 rm -rf conftest*
14035
14036 fi
14037
14038 if test "$GCC" = yes
14039 then
14040 cat > conftest.i <<EOF
14041 #ifndef GCC_PRINTF
14042 #define GCC_PRINTF 0
14043 #endif
14044 #ifndef GCC_SCANF
14045 #define GCC_SCANF 0
14046 #endif
14047 #ifndef GCC_NORETURN
14048 #define GCC_NORETURN /* nothing */
14049 #endif
14050 #ifndef GCC_UNUSED
14051 #define GCC_UNUSED /* nothing */
14052 #endif
14053 EOF
14054 if test "$GCC" = yes
14055 then
14056         { echo "$as_me:14056: checking for $CC __attribute__ directives..." >&5
14057 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14058 cat > conftest.$ac_ext <<EOF
14059 #line 14059 "${as_me:-configure}"
14060 #include "confdefs.h"
14061 #include "conftest.h"
14062 #include "conftest.i"
14063 #if     GCC_PRINTF
14064 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14065 #else
14066 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14067 #endif
14068 #if     GCC_SCANF
14069 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14070 #else
14071 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14072 #endif
14073 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14074 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14075 extern void foo(void) GCC_NORETURN;
14076 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14077 EOF
14078         cf_printf_attribute=no
14079         cf_scanf_attribute=no
14080         for cf_attribute in scanf printf unused noreturn
14081         do
14082
14083 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14084
14085                 cf_directive="__attribute__(($cf_attribute))"
14086                 echo "checking for $CC $cf_directive" 1>&5
14087
14088                 case $cf_attribute in
14089                 (printf)
14090                         cf_printf_attribute=yes
14091                         cat >conftest.h <<EOF
14092 #define GCC_$cf_ATTRIBUTE 1
14093 EOF
14094                         ;;
14095                 (scanf)
14096                         cf_scanf_attribute=yes
14097                         cat >conftest.h <<EOF
14098 #define GCC_$cf_ATTRIBUTE 1
14099 EOF
14100                         ;;
14101                 (*)
14102                         cat >conftest.h <<EOF
14103 #define GCC_$cf_ATTRIBUTE $cf_directive
14104 EOF
14105                         ;;
14106                 esac
14107
14108                 if { (eval echo "$as_me:14108: \"$ac_compile\"") >&5
14109   (eval $ac_compile) 2>&5
14110   ac_status=$?
14111   echo "$as_me:14111: \$? = $ac_status" >&5
14112   (exit $ac_status); }; then
14113                         test -n "$verbose" && echo "$as_me:14113: result: ... $cf_attribute" >&5
14114 echo "${ECHO_T}... $cf_attribute" >&6
14115                         cat conftest.h >>confdefs.h
14116                         case $cf_attribute in
14117                         (noreturn)
14118
14119 cat >>confdefs.h <<EOF
14120 #define GCC_NORETURN $cf_directive
14121 EOF
14122
14123                                 ;;
14124                         (printf)
14125                                 cf_value='/* nothing */'
14126                                 if test "$cf_printf_attribute" != no ; then
14127                                         cf_value='__attribute__((format(printf,fmt,var)))'
14128
14129 cat >>confdefs.h <<\EOF
14130 #define GCC_PRINTF 1
14131 EOF
14132
14133                                 fi
14134
14135 cat >>confdefs.h <<EOF
14136 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14137 EOF
14138
14139                                 ;;
14140                         (scanf)
14141                                 cf_value='/* nothing */'
14142                                 if test "$cf_scanf_attribute" != no ; then
14143                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14144
14145 cat >>confdefs.h <<\EOF
14146 #define GCC_SCANF 1
14147 EOF
14148
14149                                 fi
14150
14151 cat >>confdefs.h <<EOF
14152 #define GCC_SCANFLIKE(fmt,var) $cf_value
14153 EOF
14154
14155                                 ;;
14156                         (unused)
14157
14158 cat >>confdefs.h <<EOF
14159 #define GCC_UNUSED $cf_directive
14160 EOF
14161
14162                                 ;;
14163                         esac
14164                 fi
14165         done
14166 else
14167         fgrep define conftest.i >>confdefs.h
14168 fi
14169 rm -rf conftest*
14170 fi
14171
14172 ###     use option --enable-assertions to turn on generation of assertion code
14173 echo "$as_me:14173: checking if you want to enable runtime assertions" >&5
14174 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14175
14176 # Check whether --enable-assertions or --disable-assertions was given.
14177 if test "${enable_assertions+set}" = set; then
14178   enableval="$enable_assertions"
14179   with_assertions=$enableval
14180 else
14181   with_assertions=no
14182 fi;
14183 echo "$as_me:14183: result: $with_assertions" >&5
14184 echo "${ECHO_T}$with_assertions" >&6
14185 if test -n "$GCC"
14186 then
14187         if test "$with_assertions" = no
14188         then
14189                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14190         else
14191
14192         ADAFLAGS="$ADAFLAGS -gnata"
14193
14194         fi
14195 fi
14196
14197 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14198
14199 cat >>confdefs.h <<\EOF
14200 #define HAVE_NC_ALLOC_H 1
14201 EOF
14202
14203 ###     use option --enable-expanded to generate certain macros as functions
14204
14205 # Check whether --enable-expanded or --disable-expanded was given.
14206 if test "${enable_expanded+set}" = set; then
14207   enableval="$enable_expanded"
14208   test "$enableval" = yes &&
14209 cat >>confdefs.h <<\EOF
14210 #define NCURSES_EXPANDED 1
14211 EOF
14212
14213 fi;
14214
14215 ###     use option --disable-macros to suppress macros in favor of functions
14216
14217 # Check whether --enable-macros or --disable-macros was given.
14218 if test "${enable_macros+set}" = set; then
14219   enableval="$enable_macros"
14220   test "$enableval" = no &&
14221 cat >>confdefs.h <<\EOF
14222 #define NCURSES_NOMACROS 1
14223 EOF
14224
14225 fi;
14226
14227 # Normally we only add trace() to the debug-library.  Allow this to be
14228 # extended to all models of the ncurses library:
14229 cf_all_traces=no
14230 case "$CFLAGS $CPPFLAGS" in
14231 (*-DTRACE*)
14232         cf_all_traces=yes
14233         ;;
14234 esac
14235
14236 echo "$as_me:14236: checking whether to add trace feature to all models" >&5
14237 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14238
14239 # Check whether --with-trace or --without-trace was given.
14240 if test "${with_trace+set}" = set; then
14241   withval="$with_trace"
14242   cf_with_trace=$withval
14243 else
14244   cf_with_trace=$cf_all_traces
14245 fi;
14246 echo "$as_me:14246: result: $cf_with_trace" >&5
14247 echo "${ECHO_T}$cf_with_trace" >&6
14248
14249 if test "$cf_with_trace" = yes ; then
14250         ADA_TRACE=TRUE
14251
14252 cf_fix_cppflags=no
14253 cf_new_cflags=
14254 cf_new_cppflags=
14255 cf_new_extra_cppflags=
14256
14257 for cf_add_cflags in -DTRACE
14258 do
14259 case $cf_fix_cppflags in
14260 (no)
14261         case $cf_add_cflags in
14262         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14263                 case $cf_add_cflags in
14264                 (-D*)
14265                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14266
14267                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14268                                 && test -z "${cf_tst_cflags}" \
14269                                 && cf_fix_cppflags=yes
14270
14271                         if test $cf_fix_cppflags = yes ; then
14272
14273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14275
14276                                 continue
14277                         elif test "${cf_tst_cflags}" = "\"'" ; then
14278
14279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14281
14282                                 continue
14283                         fi
14284                         ;;
14285                 esac
14286                 case "$CPPFLAGS" in
14287                 (*$cf_add_cflags)
14288                         ;;
14289                 (*)
14290                         case $cf_add_cflags in
14291                         (-D*)
14292                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14293
14294 CPPFLAGS=`echo "$CPPFLAGS" | \
14295         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14296                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14297
14298                                 ;;
14299                         esac
14300
14301         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14302         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14303
14304                         ;;
14305                 esac
14306                 ;;
14307         (*)
14308
14309         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14310         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14311
14312                 ;;
14313         esac
14314         ;;
14315 (yes)
14316
14317         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14318         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14319
14320         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14321
14322         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14323                 && test -z "${cf_tst_cflags}" \
14324                 && cf_fix_cppflags=no
14325         ;;
14326 esac
14327 done
14328
14329 if test -n "$cf_new_cflags" ; then
14330
14331         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14332         CFLAGS="${CFLAGS}$cf_new_cflags"
14333
14334 fi
14335
14336 if test -n "$cf_new_cppflags" ; then
14337
14338         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14339         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14340
14341 fi
14342
14343 if test -n "$cf_new_extra_cppflags" ; then
14344
14345         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14346         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14347
14348 fi
14349
14350 else
14351         ADA_TRACE=FALSE
14352 fi
14353
14354 echo "$as_me:14354: checking if we want to use GNAT projects" >&5
14355 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14356
14357 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14358 if test "${enable_gnat_projects+set}" = set; then
14359   enableval="$enable_gnat_projects"
14360   test "$enableval" != no && enableval=yes
14361         if test "$enableval" != "yes" ; then
14362     enable_gnat_projects=no
14363         else
14364                 enable_gnat_projects=yes
14365         fi
14366 else
14367   enableval=yes
14368         enable_gnat_projects=yes
14369
14370 fi;
14371 echo "$as_me:14371: result: $enable_gnat_projects" >&5
14372 echo "${ECHO_T}$enable_gnat_projects" >&6
14373
14374 ###     Checks for libraries.
14375 case $cf_cv_system_name in
14376 (*mingw32*)
14377         ;;
14378 (*)
14379 echo "$as_me:14379: checking for gettimeofday" >&5
14380 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14381 if test "${ac_cv_func_gettimeofday+set}" = set; then
14382   echo $ECHO_N "(cached) $ECHO_C" >&6
14383 else
14384   cat >conftest.$ac_ext <<_ACEOF
14385 #line 14385 "configure"
14386 #include "confdefs.h"
14387 #define gettimeofday autoconf_temporary
14388 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14389 #undef gettimeofday
14390
14391 #ifdef __cplusplus
14392 extern "C"
14393 #endif
14394
14395 /* We use char because int might match the return type of a gcc2
14396    builtin and then its argument prototype would still apply.  */
14397 char gettimeofday (void);
14398
14399 int
14400 main (void)
14401 {
14402
14403 /* The GNU C library defines stubs for functions which it implements
14404     to always fail with ENOSYS.  Some functions are actually named
14405     something starting with __ and the normal name is an alias.  */
14406 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14407 #error found stub for gettimeofday
14408 #endif
14409
14410         return gettimeofday ();
14411   ;
14412   return 0;
14413 }
14414 _ACEOF
14415 rm -f conftest.$ac_objext conftest$ac_exeext
14416 if { (eval echo "$as_me:14416: \"$ac_link\"") >&5
14417   (eval $ac_link) 2>&5
14418   ac_status=$?
14419   echo "$as_me:14419: \$? = $ac_status" >&5
14420   (exit $ac_status); } &&
14421          { ac_try='test -s conftest$ac_exeext'
14422   { (eval echo "$as_me:14422: \"$ac_try\"") >&5
14423   (eval $ac_try) 2>&5
14424   ac_status=$?
14425   echo "$as_me:14425: \$? = $ac_status" >&5
14426   (exit $ac_status); }; }; then
14427   ac_cv_func_gettimeofday=yes
14428 else
14429   echo "$as_me: failed program was:" >&5
14430 cat conftest.$ac_ext >&5
14431 ac_cv_func_gettimeofday=no
14432 fi
14433 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14434 fi
14435 echo "$as_me:14435: result: $ac_cv_func_gettimeofday" >&5
14436 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14437 if test $ac_cv_func_gettimeofday = yes; then
14438   cat >>confdefs.h <<\EOF
14439 #define HAVE_GETTIMEOFDAY 1
14440 EOF
14441
14442 else
14443
14444 echo "$as_me:14444: checking for gettimeofday in -lbsd" >&5
14445 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14446 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14447   echo $ECHO_N "(cached) $ECHO_C" >&6
14448 else
14449   ac_check_lib_save_LIBS=$LIBS
14450 LIBS="-lbsd  $LIBS"
14451 cat >conftest.$ac_ext <<_ACEOF
14452 #line 14452 "configure"
14453 #include "confdefs.h"
14454
14455 /* Override any gcc2 internal prototype to avoid an error.  */
14456 #ifdef __cplusplus
14457 extern "C"
14458 #endif
14459 /* We use char because int might match the return type of a gcc2
14460    builtin and then its argument prototype would still apply.  */
14461 char gettimeofday ();
14462 int
14463 main (void)
14464 {
14465 gettimeofday ();
14466   ;
14467   return 0;
14468 }
14469 _ACEOF
14470 rm -f conftest.$ac_objext conftest$ac_exeext
14471 if { (eval echo "$as_me:14471: \"$ac_link\"") >&5
14472   (eval $ac_link) 2>&5
14473   ac_status=$?
14474   echo "$as_me:14474: \$? = $ac_status" >&5
14475   (exit $ac_status); } &&
14476          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_lib_bsd_gettimeofday=yes
14483 else
14484   echo "$as_me: failed program was:" >&5
14485 cat conftest.$ac_ext >&5
14486 ac_cv_lib_bsd_gettimeofday=no
14487 fi
14488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14489 LIBS=$ac_check_lib_save_LIBS
14490 fi
14491 echo "$as_me:14491: result: $ac_cv_lib_bsd_gettimeofday" >&5
14492 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14493 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14494
14495 cat >>confdefs.h <<\EOF
14496 #define HAVE_GETTIMEOFDAY 1
14497 EOF
14498
14499         LIBS="$LIBS -lbsd"
14500 fi
14501
14502 fi
14503         ;;
14504 esac
14505
14506 ###     Checks for header files.
14507 echo "$as_me:14507: checking for ANSI C header files" >&5
14508 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14509 if test "${ac_cv_header_stdc+set}" = set; then
14510   echo $ECHO_N "(cached) $ECHO_C" >&6
14511 else
14512   cat >conftest.$ac_ext <<_ACEOF
14513 #line 14513 "configure"
14514 #include "confdefs.h"
14515 #include <stdlib.h>
14516 #include <stdarg.h>
14517 #include <string.h>
14518 #include <float.h>
14519
14520 _ACEOF
14521 if { (eval echo "$as_me:14521: \"$ac_cpp conftest.$ac_ext\"") >&5
14522   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14523   ac_status=$?
14524   egrep -v '^ *\+' conftest.er1 >conftest.err
14525   rm -f conftest.er1
14526   cat conftest.err >&5
14527   echo "$as_me:14527: \$? = $ac_status" >&5
14528   (exit $ac_status); } >/dev/null; then
14529   if test -s conftest.err; then
14530     ac_cpp_err=$ac_c_preproc_warn_flag
14531   else
14532     ac_cpp_err=
14533   fi
14534 else
14535   ac_cpp_err=yes
14536 fi
14537 if test -z "$ac_cpp_err"; then
14538   ac_cv_header_stdc=yes
14539 else
14540   echo "$as_me: failed program was:" >&5
14541   cat conftest.$ac_ext >&5
14542   ac_cv_header_stdc=no
14543 fi
14544 rm -f conftest.err conftest.$ac_ext
14545
14546 if test $ac_cv_header_stdc = yes; then
14547   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14548   cat >conftest.$ac_ext <<_ACEOF
14549 #line 14549 "configure"
14550 #include "confdefs.h"
14551 #include <string.h>
14552
14553 _ACEOF
14554 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14555   egrep "memchr" >/dev/null 2>&1; then
14556   :
14557 else
14558   ac_cv_header_stdc=no
14559 fi
14560 rm -rf conftest*
14561
14562 fi
14563
14564 if test $ac_cv_header_stdc = yes; then
14565   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14566   cat >conftest.$ac_ext <<_ACEOF
14567 #line 14567 "configure"
14568 #include "confdefs.h"
14569 #include <stdlib.h>
14570
14571 _ACEOF
14572 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14573   egrep "free" >/dev/null 2>&1; then
14574   :
14575 else
14576   ac_cv_header_stdc=no
14577 fi
14578 rm -rf conftest*
14579
14580 fi
14581
14582 if test $ac_cv_header_stdc = yes; then
14583   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14584   if test "$cross_compiling" = yes; then
14585   :
14586 else
14587   cat >conftest.$ac_ext <<_ACEOF
14588 #line 14588 "configure"
14589 #include "confdefs.h"
14590 #include <ctype.h>
14591 #if ((' ' & 0x0FF) == 0x020)
14592 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14593 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14594 #else
14595 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14596                      || ('j' <= (c) && (c) <= 'r') \
14597                      || ('s' <= (c) && (c) <= 'z'))
14598 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14599 #endif
14600
14601 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14602 int
14603 main (void)
14604 {
14605   int i;
14606   for (i = 0; i < 256; i++)
14607     if (XOR (islower (i), ISLOWER (i))
14608         || toupper (i) != TOUPPER (i))
14609       $ac_main_return(2);
14610   $ac_main_return (0);
14611 }
14612 _ACEOF
14613 rm -f conftest$ac_exeext
14614 if { (eval echo "$as_me:14614: \"$ac_link\"") >&5
14615   (eval $ac_link) 2>&5
14616   ac_status=$?
14617   echo "$as_me:14617: \$? = $ac_status" >&5
14618   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14619   { (eval echo "$as_me:14619: \"$ac_try\"") >&5
14620   (eval $ac_try) 2>&5
14621   ac_status=$?
14622   echo "$as_me:14622: \$? = $ac_status" >&5
14623   (exit $ac_status); }; }; then
14624   :
14625 else
14626   echo "$as_me: program exited with status $ac_status" >&5
14627 echo "$as_me: failed program was:" >&5
14628 cat conftest.$ac_ext >&5
14629 ac_cv_header_stdc=no
14630 fi
14631 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14632 fi
14633 fi
14634 fi
14635 echo "$as_me:14635: result: $ac_cv_header_stdc" >&5
14636 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14637 if test $ac_cv_header_stdc = yes; then
14638
14639 cat >>confdefs.h <<\EOF
14640 #define STDC_HEADERS 1
14641 EOF
14642
14643 fi
14644
14645 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14646
14647 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14648                   inttypes.h stdint.h unistd.h
14649 do
14650 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14651 echo "$as_me:14651: checking for $ac_header" >&5
14652 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14653 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14654   echo $ECHO_N "(cached) $ECHO_C" >&6
14655 else
14656   cat >conftest.$ac_ext <<_ACEOF
14657 #line 14657 "configure"
14658 #include "confdefs.h"
14659 $ac_includes_default
14660 #include <$ac_header>
14661 _ACEOF
14662 rm -f conftest.$ac_objext
14663 if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5
14664   (eval $ac_compile) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit $ac_status); } &&
14668          { ac_try='test -s conftest.$ac_objext'
14669   { (eval echo "$as_me:14669: \"$ac_try\"") >&5
14670   (eval $ac_try) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); }; }; then
14674   eval "$as_ac_Header=yes"
14675 else
14676   echo "$as_me: failed program was:" >&5
14677 cat conftest.$ac_ext >&5
14678 eval "$as_ac_Header=no"
14679 fi
14680 rm -f conftest.$ac_objext conftest.$ac_ext
14681 fi
14682 echo "$as_me:14682: result: `eval echo '${'$as_ac_Header'}'`" >&5
14683 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14684 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14685   cat >>confdefs.h <<EOF
14686 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14687 EOF
14688
14689 fi
14690 done
14691
14692 echo "$as_me:14692: checking for signed char" >&5
14693 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14694 if test "${ac_cv_type_signed_char+set}" = set; then
14695   echo $ECHO_N "(cached) $ECHO_C" >&6
14696 else
14697   cat >conftest.$ac_ext <<_ACEOF
14698 #line 14698 "configure"
14699 #include "confdefs.h"
14700 $ac_includes_default
14701 int
14702 main (void)
14703 {
14704 if ((signed char *) 0)
14705   return 0;
14706 if (sizeof (signed char))
14707   return 0;
14708   ;
14709   return 0;
14710 }
14711 _ACEOF
14712 rm -f conftest.$ac_objext
14713 if { (eval echo "$as_me:14713: \"$ac_compile\"") >&5
14714   (eval $ac_compile) 2>&5
14715   ac_status=$?
14716   echo "$as_me:14716: \$? = $ac_status" >&5
14717   (exit $ac_status); } &&
14718          { ac_try='test -s conftest.$ac_objext'
14719   { (eval echo "$as_me:14719: \"$ac_try\"") >&5
14720   (eval $ac_try) 2>&5
14721   ac_status=$?
14722   echo "$as_me:14722: \$? = $ac_status" >&5
14723   (exit $ac_status); }; }; then
14724   ac_cv_type_signed_char=yes
14725 else
14726   echo "$as_me: failed program was:" >&5
14727 cat conftest.$ac_ext >&5
14728 ac_cv_type_signed_char=no
14729 fi
14730 rm -f conftest.$ac_objext conftest.$ac_ext
14731 fi
14732 echo "$as_me:14732: result: $ac_cv_type_signed_char" >&5
14733 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14734
14735 echo "$as_me:14735: checking size of signed char" >&5
14736 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14737 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14738   echo $ECHO_N "(cached) $ECHO_C" >&6
14739 else
14740   if test "$ac_cv_type_signed_char" = yes; then
14741   if test "$cross_compiling" = yes; then
14742   # Depending upon the size, compute the lo and hi bounds.
14743 cat >conftest.$ac_ext <<_ACEOF
14744 #line 14744 "configure"
14745 #include "confdefs.h"
14746 $ac_includes_default
14747 int
14748 main (void)
14749 {
14750 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14751   ;
14752   return 0;
14753 }
14754 _ACEOF
14755 rm -f conftest.$ac_objext
14756 if { (eval echo "$as_me:14756: \"$ac_compile\"") >&5
14757   (eval $ac_compile) 2>&5
14758   ac_status=$?
14759   echo "$as_me:14759: \$? = $ac_status" >&5
14760   (exit $ac_status); } &&
14761          { ac_try='test -s conftest.$ac_objext'
14762   { (eval echo "$as_me:14762: \"$ac_try\"") >&5
14763   (eval $ac_try) 2>&5
14764   ac_status=$?
14765   echo "$as_me:14765: \$? = $ac_status" >&5
14766   (exit $ac_status); }; }; then
14767   ac_lo=0 ac_mid=0
14768   while :; do
14769     cat >conftest.$ac_ext <<_ACEOF
14770 #line 14770 "configure"
14771 #include "confdefs.h"
14772 $ac_includes_default
14773 int
14774 main (void)
14775 {
14776 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14777   ;
14778   return 0;
14779 }
14780 _ACEOF
14781 rm -f conftest.$ac_objext
14782 if { (eval echo "$as_me:14782: \"$ac_compile\"") >&5
14783   (eval $ac_compile) 2>&5
14784   ac_status=$?
14785   echo "$as_me:14785: \$? = $ac_status" >&5
14786   (exit $ac_status); } &&
14787          { ac_try='test -s conftest.$ac_objext'
14788   { (eval echo "$as_me:14788: \"$ac_try\"") >&5
14789   (eval $ac_try) 2>&5
14790   ac_status=$?
14791   echo "$as_me:14791: \$? = $ac_status" >&5
14792   (exit $ac_status); }; }; then
14793   ac_hi=$ac_mid; break
14794 else
14795   echo "$as_me: failed program was:" >&5
14796 cat conftest.$ac_ext >&5
14797 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14798 fi
14799 rm -f conftest.$ac_objext conftest.$ac_ext
14800   done
14801 else
14802   echo "$as_me: failed program was:" >&5
14803 cat conftest.$ac_ext >&5
14804 ac_hi=-1 ac_mid=-1
14805   while :; do
14806     cat >conftest.$ac_ext <<_ACEOF
14807 #line 14807 "configure"
14808 #include "confdefs.h"
14809 $ac_includes_default
14810 int
14811 main (void)
14812 {
14813 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14814   ;
14815   return 0;
14816 }
14817 _ACEOF
14818 rm -f conftest.$ac_objext
14819 if { (eval echo "$as_me:14819: \"$ac_compile\"") >&5
14820   (eval $ac_compile) 2>&5
14821   ac_status=$?
14822   echo "$as_me:14822: \$? = $ac_status" >&5
14823   (exit $ac_status); } &&
14824          { ac_try='test -s conftest.$ac_objext'
14825   { (eval echo "$as_me:14825: \"$ac_try\"") >&5
14826   (eval $ac_try) 2>&5
14827   ac_status=$?
14828   echo "$as_me:14828: \$? = $ac_status" >&5
14829   (exit $ac_status); }; }; then
14830   ac_lo=$ac_mid; break
14831 else
14832   echo "$as_me: failed program was:" >&5
14833 cat conftest.$ac_ext >&5
14834 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14835 fi
14836 rm -f conftest.$ac_objext conftest.$ac_ext
14837   done
14838 fi
14839 rm -f conftest.$ac_objext conftest.$ac_ext
14840 # Binary search between lo and hi bounds.
14841 while test "x$ac_lo" != "x$ac_hi"; do
14842   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14843   cat >conftest.$ac_ext <<_ACEOF
14844 #line 14844 "configure"
14845 #include "confdefs.h"
14846 $ac_includes_default
14847 int
14848 main (void)
14849 {
14850 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14851   ;
14852   return 0;
14853 }
14854 _ACEOF
14855 rm -f conftest.$ac_objext
14856 if { (eval echo "$as_me:14856: \"$ac_compile\"") >&5
14857   (eval $ac_compile) 2>&5
14858   ac_status=$?
14859   echo "$as_me:14859: \$? = $ac_status" >&5
14860   (exit $ac_status); } &&
14861          { ac_try='test -s conftest.$ac_objext'
14862   { (eval echo "$as_me:14862: \"$ac_try\"") >&5
14863   (eval $ac_try) 2>&5
14864   ac_status=$?
14865   echo "$as_me:14865: \$? = $ac_status" >&5
14866   (exit $ac_status); }; }; then
14867   ac_hi=$ac_mid
14868 else
14869   echo "$as_me: failed program was:" >&5
14870 cat conftest.$ac_ext >&5
14871 ac_lo=`expr $ac_mid + 1`
14872 fi
14873 rm -f conftest.$ac_objext conftest.$ac_ext
14874 done
14875 ac_cv_sizeof_signed_char=$ac_lo
14876 else
14877   if test "$cross_compiling" = yes; then
14878   { { echo "$as_me:14878: error: cannot run test program while cross compiling" >&5
14879 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14880    { (exit 1); exit 1; }; }
14881 else
14882   cat >conftest.$ac_ext <<_ACEOF
14883 #line 14883 "configure"
14884 #include "confdefs.h"
14885 $ac_includes_default
14886 int
14887 main (void)
14888 {
14889 FILE *f = fopen ("conftest.val", "w");
14890 if (!f)
14891   $ac_main_return (1);
14892 fprintf (f, "%d", (sizeof (signed char)));
14893 fclose (f);
14894   ;
14895   return 0;
14896 }
14897 _ACEOF
14898 rm -f conftest$ac_exeext
14899 if { (eval echo "$as_me:14899: \"$ac_link\"") >&5
14900   (eval $ac_link) 2>&5
14901   ac_status=$?
14902   echo "$as_me:14902: \$? = $ac_status" >&5
14903   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14904   { (eval echo "$as_me:14904: \"$ac_try\"") >&5
14905   (eval $ac_try) 2>&5
14906   ac_status=$?
14907   echo "$as_me:14907: \$? = $ac_status" >&5
14908   (exit $ac_status); }; }; then
14909   ac_cv_sizeof_signed_char=`cat conftest.val`
14910 else
14911   echo "$as_me: program exited with status $ac_status" >&5
14912 echo "$as_me: failed program was:" >&5
14913 cat conftest.$ac_ext >&5
14914 fi
14915 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14916 fi
14917 fi
14918 rm -f conftest.val
14919 else
14920   ac_cv_sizeof_signed_char=0
14921 fi
14922 fi
14923 echo "$as_me:14923: result: $ac_cv_sizeof_signed_char" >&5
14924 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14925 cat >>confdefs.h <<EOF
14926 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14927 EOF
14928
14929 echo "$as_me:14929: checking for ANSI C header files" >&5
14930 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14931 if test "${ac_cv_header_stdc+set}" = set; then
14932   echo $ECHO_N "(cached) $ECHO_C" >&6
14933 else
14934   cat >conftest.$ac_ext <<_ACEOF
14935 #line 14935 "configure"
14936 #include "confdefs.h"
14937 #include <stdlib.h>
14938 #include <stdarg.h>
14939 #include <string.h>
14940 #include <float.h>
14941
14942 _ACEOF
14943 if { (eval echo "$as_me:14943: \"$ac_cpp conftest.$ac_ext\"") >&5
14944   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14945   ac_status=$?
14946   egrep -v '^ *\+' conftest.er1 >conftest.err
14947   rm -f conftest.er1
14948   cat conftest.err >&5
14949   echo "$as_me:14949: \$? = $ac_status" >&5
14950   (exit $ac_status); } >/dev/null; then
14951   if test -s conftest.err; then
14952     ac_cpp_err=$ac_c_preproc_warn_flag
14953   else
14954     ac_cpp_err=
14955   fi
14956 else
14957   ac_cpp_err=yes
14958 fi
14959 if test -z "$ac_cpp_err"; then
14960   ac_cv_header_stdc=yes
14961 else
14962   echo "$as_me: failed program was:" >&5
14963   cat conftest.$ac_ext >&5
14964   ac_cv_header_stdc=no
14965 fi
14966 rm -f conftest.err conftest.$ac_ext
14967
14968 if test $ac_cv_header_stdc = yes; then
14969   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14970   cat >conftest.$ac_ext <<_ACEOF
14971 #line 14971 "configure"
14972 #include "confdefs.h"
14973 #include <string.h>
14974
14975 _ACEOF
14976 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14977   egrep "memchr" >/dev/null 2>&1; then
14978   :
14979 else
14980   ac_cv_header_stdc=no
14981 fi
14982 rm -rf conftest*
14983
14984 fi
14985
14986 if test $ac_cv_header_stdc = yes; then
14987   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14988   cat >conftest.$ac_ext <<_ACEOF
14989 #line 14989 "configure"
14990 #include "confdefs.h"
14991 #include <stdlib.h>
14992
14993 _ACEOF
14994 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14995   egrep "free" >/dev/null 2>&1; then
14996   :
14997 else
14998   ac_cv_header_stdc=no
14999 fi
15000 rm -rf conftest*
15001
15002 fi
15003
15004 if test $ac_cv_header_stdc = yes; then
15005   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15006   if test "$cross_compiling" = yes; then
15007   :
15008 else
15009   cat >conftest.$ac_ext <<_ACEOF
15010 #line 15010 "configure"
15011 #include "confdefs.h"
15012 #include <ctype.h>
15013 #if ((' ' & 0x0FF) == 0x020)
15014 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15015 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15016 #else
15017 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15018                      || ('j' <= (c) && (c) <= 'r') \
15019                      || ('s' <= (c) && (c) <= 'z'))
15020 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15021 #endif
15022
15023 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15024 int
15025 main (void)
15026 {
15027   int i;
15028   for (i = 0; i < 256; i++)
15029     if (XOR (islower (i), ISLOWER (i))
15030         || toupper (i) != TOUPPER (i))
15031       $ac_main_return(2);
15032   $ac_main_return (0);
15033 }
15034 _ACEOF
15035 rm -f conftest$ac_exeext
15036 if { (eval echo "$as_me:15036: \"$ac_link\"") >&5
15037   (eval $ac_link) 2>&5
15038   ac_status=$?
15039   echo "$as_me:15039: \$? = $ac_status" >&5
15040   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15041   { (eval echo "$as_me:15041: \"$ac_try\"") >&5
15042   (eval $ac_try) 2>&5
15043   ac_status=$?
15044   echo "$as_me:15044: \$? = $ac_status" >&5
15045   (exit $ac_status); }; }; then
15046   :
15047 else
15048   echo "$as_me: program exited with status $ac_status" >&5
15049 echo "$as_me: failed program was:" >&5
15050 cat conftest.$ac_ext >&5
15051 ac_cv_header_stdc=no
15052 fi
15053 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15054 fi
15055 fi
15056 fi
15057 echo "$as_me:15057: result: $ac_cv_header_stdc" >&5
15058 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15059 if test $ac_cv_header_stdc = yes; then
15060
15061 cat >>confdefs.h <<\EOF
15062 #define STDC_HEADERS 1
15063 EOF
15064
15065 fi
15066
15067 ac_header_dirent=no
15068 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
15069   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
15070 echo "$as_me:15070: checking for $ac_hdr that defines DIR" >&5
15071 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
15072 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15073   echo $ECHO_N "(cached) $ECHO_C" >&6
15074 else
15075   cat >conftest.$ac_ext <<_ACEOF
15076 #line 15076 "configure"
15077 #include "confdefs.h"
15078 #include <sys/types.h>
15079 #include <$ac_hdr>
15080
15081 int
15082 main (void)
15083 {
15084 if ((DIR *) 0)
15085 return 0;
15086   ;
15087   return 0;
15088 }
15089 _ACEOF
15090 rm -f conftest.$ac_objext
15091 if { (eval echo "$as_me:15091: \"$ac_compile\"") >&5
15092   (eval $ac_compile) 2>&5
15093   ac_status=$?
15094   echo "$as_me:15094: \$? = $ac_status" >&5
15095   (exit $ac_status); } &&
15096          { ac_try='test -s conftest.$ac_objext'
15097   { (eval echo "$as_me:15097: \"$ac_try\"") >&5
15098   (eval $ac_try) 2>&5
15099   ac_status=$?
15100   echo "$as_me:15100: \$? = $ac_status" >&5
15101   (exit $ac_status); }; }; then
15102   eval "$as_ac_Header=yes"
15103 else
15104   echo "$as_me: failed program was:" >&5
15105 cat conftest.$ac_ext >&5
15106 eval "$as_ac_Header=no"
15107 fi
15108 rm -f conftest.$ac_objext conftest.$ac_ext
15109 fi
15110 echo "$as_me:15110: result: `eval echo '${'$as_ac_Header'}'`" >&5
15111 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15112 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15113   cat >>confdefs.h <<EOF
15114 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15115 EOF
15116
15117 ac_header_dirent=$ac_hdr; break
15118 fi
15119
15120 done
15121 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
15122 if test $ac_header_dirent = dirent.h; then
15123   echo "$as_me:15123: checking for opendir in -ldir" >&5
15124 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
15125 if test "${ac_cv_lib_dir_opendir+set}" = set; then
15126   echo $ECHO_N "(cached) $ECHO_C" >&6
15127 else
15128   ac_check_lib_save_LIBS=$LIBS
15129 LIBS="-ldir  $LIBS"
15130 cat >conftest.$ac_ext <<_ACEOF
15131 #line 15131 "configure"
15132 #include "confdefs.h"
15133
15134 /* Override any gcc2 internal prototype to avoid an error.  */
15135 #ifdef __cplusplus
15136 extern "C"
15137 #endif
15138 /* We use char because int might match the return type of a gcc2
15139    builtin and then its argument prototype would still apply.  */
15140 char opendir ();
15141 int
15142 main (void)
15143 {
15144 opendir ();
15145   ;
15146   return 0;
15147 }
15148 _ACEOF
15149 rm -f conftest.$ac_objext conftest$ac_exeext
15150 if { (eval echo "$as_me:15150: \"$ac_link\"") >&5
15151   (eval $ac_link) 2>&5
15152   ac_status=$?
15153   echo "$as_me:15153: \$? = $ac_status" >&5
15154   (exit $ac_status); } &&
15155          { ac_try='test -s conftest$ac_exeext'
15156   { (eval echo "$as_me:15156: \"$ac_try\"") >&5
15157   (eval $ac_try) 2>&5
15158   ac_status=$?
15159   echo "$as_me:15159: \$? = $ac_status" >&5
15160   (exit $ac_status); }; }; then
15161   ac_cv_lib_dir_opendir=yes
15162 else
15163   echo "$as_me: failed program was:" >&5
15164 cat conftest.$ac_ext >&5
15165 ac_cv_lib_dir_opendir=no
15166 fi
15167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15168 LIBS=$ac_check_lib_save_LIBS
15169 fi
15170 echo "$as_me:15170: result: $ac_cv_lib_dir_opendir" >&5
15171 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15172 if test $ac_cv_lib_dir_opendir = yes; then
15173   LIBS="$LIBS -ldir"
15174 fi
15175
15176 else
15177   echo "$as_me:15177: checking for opendir in -lx" >&5
15178 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15179 if test "${ac_cv_lib_x_opendir+set}" = set; then
15180   echo $ECHO_N "(cached) $ECHO_C" >&6
15181 else
15182   ac_check_lib_save_LIBS=$LIBS
15183 LIBS="-lx  $LIBS"
15184 cat >conftest.$ac_ext <<_ACEOF
15185 #line 15185 "configure"
15186 #include "confdefs.h"
15187
15188 /* Override any gcc2 internal prototype to avoid an error.  */
15189 #ifdef __cplusplus
15190 extern "C"
15191 #endif
15192 /* We use char because int might match the return type of a gcc2
15193    builtin and then its argument prototype would still apply.  */
15194 char opendir ();
15195 int
15196 main (void)
15197 {
15198 opendir ();
15199   ;
15200   return 0;
15201 }
15202 _ACEOF
15203 rm -f conftest.$ac_objext conftest$ac_exeext
15204 if { (eval echo "$as_me:15204: \"$ac_link\"") >&5
15205   (eval $ac_link) 2>&5
15206   ac_status=$?
15207   echo "$as_me:15207: \$? = $ac_status" >&5
15208   (exit $ac_status); } &&
15209          { ac_try='test -s conftest$ac_exeext'
15210   { (eval echo "$as_me:15210: \"$ac_try\"") >&5
15211   (eval $ac_try) 2>&5
15212   ac_status=$?
15213   echo "$as_me:15213: \$? = $ac_status" >&5
15214   (exit $ac_status); }; }; then
15215   ac_cv_lib_x_opendir=yes
15216 else
15217   echo "$as_me: failed program was:" >&5
15218 cat conftest.$ac_ext >&5
15219 ac_cv_lib_x_opendir=no
15220 fi
15221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15222 LIBS=$ac_check_lib_save_LIBS
15223 fi
15224 echo "$as_me:15224: result: $ac_cv_lib_x_opendir" >&5
15225 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15226 if test $ac_cv_lib_x_opendir = yes; then
15227   LIBS="$LIBS -lx"
15228 fi
15229
15230 fi
15231
15232 echo "$as_me:15232: checking whether time.h and sys/time.h may both be included" >&5
15233 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15234 if test "${ac_cv_header_time+set}" = set; then
15235   echo $ECHO_N "(cached) $ECHO_C" >&6
15236 else
15237   cat >conftest.$ac_ext <<_ACEOF
15238 #line 15238 "configure"
15239 #include "confdefs.h"
15240 #include <sys/types.h>
15241 #include <sys/time.h>
15242 #include <time.h>
15243
15244 int
15245 main (void)
15246 {
15247 if ((struct tm *) 0)
15248 return 0;
15249   ;
15250   return 0;
15251 }
15252 _ACEOF
15253 rm -f conftest.$ac_objext
15254 if { (eval echo "$as_me:15254: \"$ac_compile\"") >&5
15255   (eval $ac_compile) 2>&5
15256   ac_status=$?
15257   echo "$as_me:15257: \$? = $ac_status" >&5
15258   (exit $ac_status); } &&
15259          { ac_try='test -s conftest.$ac_objext'
15260   { (eval echo "$as_me:15260: \"$ac_try\"") >&5
15261   (eval $ac_try) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); }; }; then
15265   ac_cv_header_time=yes
15266 else
15267   echo "$as_me: failed program was:" >&5
15268 cat conftest.$ac_ext >&5
15269 ac_cv_header_time=no
15270 fi
15271 rm -f conftest.$ac_objext conftest.$ac_ext
15272 fi
15273 echo "$as_me:15273: result: $ac_cv_header_time" >&5
15274 echo "${ECHO_T}$ac_cv_header_time" >&6
15275 if test $ac_cv_header_time = yes; then
15276
15277 cat >>confdefs.h <<\EOF
15278 #define TIME_WITH_SYS_TIME 1
15279 EOF
15280
15281 fi
15282
15283 ###     checks for compiler characteristics
15284 ac_ext=c
15285 ac_cpp='$CPP $CPPFLAGS'
15286 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15287 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15288 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15289 ac_main_return=return
15290
15291 echo "$as_me:15291: checking for an ANSI C-conforming const" >&5
15292 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15293 if test "${ac_cv_c_const+set}" = set; then
15294   echo $ECHO_N "(cached) $ECHO_C" >&6
15295 else
15296   cat >conftest.$ac_ext <<_ACEOF
15297 #line 15297 "configure"
15298 #include "confdefs.h"
15299
15300 int
15301 main (void)
15302 {
15303 /* FIXME: Include the comments suggested by Paul. */
15304 #ifndef __cplusplus
15305   /* Ultrix mips cc rejects this.  */
15306   typedef int charset[2];
15307   const charset x;
15308   /* SunOS 4.1.1 cc rejects this.  */
15309   char const *const *ccp;
15310   char **p;
15311   /* NEC SVR4.0.2 mips cc rejects this.  */
15312   struct point {int x, y;};
15313   static struct point const zero = {0,0};
15314   /* AIX XL C 1.02.0.0 rejects this.
15315      It does not let you subtract one const X* pointer from another in
15316      an arm of an if-expression whose if-part is not a constant
15317      expression */
15318   const char *g = "string";
15319   ccp = &g + (g ? g-g : 0);
15320   /* HPUX 7.0 cc rejects these. */
15321   ++ccp;
15322   p = (char**) ccp;
15323   ccp = (char const *const *) p;
15324   { /* SCO 3.2v4 cc rejects this.  */
15325     char *t;
15326     char const *s = 0 ? (char *) 0 : (char const *) 0;
15327
15328     *t++ = 0;
15329   }
15330   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15331     int x[] = {25, 17};
15332     const int *foo = &x[0];
15333     ++foo;
15334   }
15335   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15336     typedef const int *iptr;
15337     iptr p = 0;
15338     ++p;
15339   }
15340   { /* AIX XL C 1.02.0.0 rejects this saying
15341        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15342     struct s { int j; const int *ap[3]; };
15343     struct s *b; b->j = 5;
15344   }
15345   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15346     const int foo = 10;
15347   }
15348 #endif
15349
15350   ;
15351   return 0;
15352 }
15353 _ACEOF
15354 rm -f conftest.$ac_objext
15355 if { (eval echo "$as_me:15355: \"$ac_compile\"") >&5
15356   (eval $ac_compile) 2>&5
15357   ac_status=$?
15358   echo "$as_me:15358: \$? = $ac_status" >&5
15359   (exit $ac_status); } &&
15360          { ac_try='test -s conftest.$ac_objext'
15361   { (eval echo "$as_me:15361: \"$ac_try\"") >&5
15362   (eval $ac_try) 2>&5
15363   ac_status=$?
15364   echo "$as_me:15364: \$? = $ac_status" >&5
15365   (exit $ac_status); }; }; then
15366   ac_cv_c_const=yes
15367 else
15368   echo "$as_me: failed program was:" >&5
15369 cat conftest.$ac_ext >&5
15370 ac_cv_c_const=no
15371 fi
15372 rm -f conftest.$ac_objext conftest.$ac_ext
15373 fi
15374 echo "$as_me:15374: result: $ac_cv_c_const" >&5
15375 echo "${ECHO_T}$ac_cv_c_const" >&6
15376 if test $ac_cv_c_const = no; then
15377
15378 cat >>confdefs.h <<\EOF
15379 #define const
15380 EOF
15381
15382 fi
15383
15384 ###     Checks for external-data
15385
15386 echo "$as_me:15386: checking if data-only library module links" >&5
15387 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15388 if test "${cf_cv_link_dataonly+set}" = set; then
15389   echo $ECHO_N "(cached) $ECHO_C" >&6
15390 else
15391
15392         rm -f conftest.a
15393         cat >conftest.$ac_ext <<EOF
15394 #line 15394 "configure"
15395 int     testdata[3] = { 123, 456, 789 };
15396 EOF
15397         if { (eval echo "$as_me:15397: \"$ac_compile\"") >&5
15398   (eval $ac_compile) 2>&5
15399   ac_status=$?
15400   echo "$as_me:15400: \$? = $ac_status" >&5
15401   (exit $ac_status); } ; then
15402                 mv conftest.o data.o && \
15403                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15404         fi
15405         rm -f conftest.$ac_ext data.o
15406         cat >conftest.$ac_ext <<EOF
15407 #line 15407 "configure"
15408 int     testfunc(void)
15409 {
15410 #if defined(NeXT)
15411         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15412 #else
15413         extern int testdata[3];
15414         return testdata[0] == 123
15415            &&  testdata[1] == 456
15416            &&  testdata[2] == 789;
15417 #endif
15418 }
15419 EOF
15420         if { (eval echo "$as_me:15420: \"$ac_compile\"") >&5
15421   (eval $ac_compile) 2>&5
15422   ac_status=$?
15423   echo "$as_me:15423: \$? = $ac_status" >&5
15424   (exit $ac_status); }; then
15425                 mv conftest.o func.o && \
15426                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15427         fi
15428         rm -f conftest.$ac_ext func.o
15429         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15430         cf_saveLIBS="$LIBS"
15431         LIBS="conftest.a $LIBS"
15432         if test "$cross_compiling" = yes; then
15433   cf_cv_link_dataonly=unknown
15434 else
15435   cat >conftest.$ac_ext <<_ACEOF
15436 #line 15436 "configure"
15437 #include "confdefs.h"
15438
15439         int main(void)
15440         {
15441                 extern int testfunc();
15442                 ${cf_cv_main_return:-return} (!testfunc());
15443         }
15444
15445 _ACEOF
15446 rm -f conftest$ac_exeext
15447 if { (eval echo "$as_me:15447: \"$ac_link\"") >&5
15448   (eval $ac_link) 2>&5
15449   ac_status=$?
15450   echo "$as_me:15450: \$? = $ac_status" >&5
15451   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15452   { (eval echo "$as_me:15452: \"$ac_try\"") >&5
15453   (eval $ac_try) 2>&5
15454   ac_status=$?
15455   echo "$as_me:15455: \$? = $ac_status" >&5
15456   (exit $ac_status); }; }; then
15457   cf_cv_link_dataonly=yes
15458 else
15459   echo "$as_me: program exited with status $ac_status" >&5
15460 echo "$as_me: failed program was:" >&5
15461 cat conftest.$ac_ext >&5
15462 cf_cv_link_dataonly=no
15463 fi
15464 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15465 fi
15466         LIBS="$cf_saveLIBS"
15467
15468 fi
15469
15470 echo "$as_me:15470: result: $cf_cv_link_dataonly" >&5
15471 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15472
15473 if test "$cf_cv_link_dataonly" = no ; then
15474
15475 cat >>confdefs.h <<\EOF
15476 #define BROKEN_LINKER 1
15477 EOF
15478
15479         BROKEN_LINKER=1
15480 fi
15481
15482 ###     Checks for library functions.
15483
15484 for ac_header in \
15485 unistd.h \
15486
15487 do
15488 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15489 echo "$as_me:15489: checking for $ac_header" >&5
15490 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15491 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15492   echo $ECHO_N "(cached) $ECHO_C" >&6
15493 else
15494   cat >conftest.$ac_ext <<_ACEOF
15495 #line 15495 "configure"
15496 #include "confdefs.h"
15497 #include <$ac_header>
15498 _ACEOF
15499 if { (eval echo "$as_me:15499: \"$ac_cpp conftest.$ac_ext\"") >&5
15500   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15501   ac_status=$?
15502   egrep -v '^ *\+' conftest.er1 >conftest.err
15503   rm -f conftest.er1
15504   cat conftest.err >&5
15505   echo "$as_me:15505: \$? = $ac_status" >&5
15506   (exit $ac_status); } >/dev/null; then
15507   if test -s conftest.err; then
15508     ac_cpp_err=$ac_c_preproc_warn_flag
15509   else
15510     ac_cpp_err=
15511   fi
15512 else
15513   ac_cpp_err=yes
15514 fi
15515 if test -z "$ac_cpp_err"; then
15516   eval "$as_ac_Header=yes"
15517 else
15518   echo "$as_me: failed program was:" >&5
15519   cat conftest.$ac_ext >&5
15520   eval "$as_ac_Header=no"
15521 fi
15522 rm -f conftest.err conftest.$ac_ext
15523 fi
15524 echo "$as_me:15524: result: `eval echo '${'$as_ac_Header'}'`" >&5
15525 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15526 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15527   cat >>confdefs.h <<EOF
15528 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15529 EOF
15530
15531 fi
15532 done
15533
15534 echo "$as_me:15534: checking for working mkstemp" >&5
15535 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15536 if test "${cf_cv_func_mkstemp+set}" = set; then
15537   echo $ECHO_N "(cached) $ECHO_C" >&6
15538 else
15539
15540 rm -rf conftest*
15541 if test "$cross_compiling" = yes; then
15542   cf_cv_func_mkstemp=maybe
15543 else
15544   cat >conftest.$ac_ext <<_ACEOF
15545 #line 15545 "configure"
15546 #include "confdefs.h"
15547
15548 #include <sys/types.h>
15549 #ifdef HAVE_UNISTD_H
15550 #include <unistd.h>
15551 #endif
15552 #include <stdlib.h>
15553 #include <stdio.h>
15554 #include <string.h>
15555 #include <sys/stat.h>
15556 int main(void)
15557 {
15558         char *tmpl = "conftestXXXXXX";
15559         char name[2][80];
15560         int n;
15561         int result = 0;
15562         int fd;
15563         struct stat sb;
15564
15565         umask(077);
15566         for (n = 0; n < 2; ++n) {
15567                 strcpy(name[n], tmpl);
15568                 if ((fd = mkstemp(name[n])) >= 0) {
15569                         if (!strcmp(name[n], tmpl)
15570                          || stat(name[n], &sb) != 0
15571                          || (sb.st_mode & S_IFMT) != S_IFREG
15572                          || (sb.st_mode & 077) != 0) {
15573                                 result = 1;
15574                         }
15575                         close(fd);
15576                 }
15577         }
15578         if (result == 0
15579          && !strcmp(name[0], name[1]))
15580                 result = 1;
15581         ${cf_cv_main_return:-return}(result);
15582 }
15583
15584 _ACEOF
15585 rm -f conftest$ac_exeext
15586 if { (eval echo "$as_me:15586: \"$ac_link\"") >&5
15587   (eval $ac_link) 2>&5
15588   ac_status=$?
15589   echo "$as_me:15589: \$? = $ac_status" >&5
15590   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15591   { (eval echo "$as_me:15591: \"$ac_try\"") >&5
15592   (eval $ac_try) 2>&5
15593   ac_status=$?
15594   echo "$as_me:15594: \$? = $ac_status" >&5
15595   (exit $ac_status); }; }; then
15596   cf_cv_func_mkstemp=yes
15597
15598 else
15599   echo "$as_me: program exited with status $ac_status" >&5
15600 echo "$as_me: failed program was:" >&5
15601 cat conftest.$ac_ext >&5
15602 cf_cv_func_mkstemp=no
15603
15604 fi
15605 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15606 fi
15607
15608 fi
15609 echo "$as_me:15609: result: $cf_cv_func_mkstemp" >&5
15610 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15611 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15612         echo "$as_me:15612: checking for mkstemp" >&5
15613 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15614 if test "${ac_cv_func_mkstemp+set}" = set; then
15615   echo $ECHO_N "(cached) $ECHO_C" >&6
15616 else
15617   cat >conftest.$ac_ext <<_ACEOF
15618 #line 15618 "configure"
15619 #include "confdefs.h"
15620 #define mkstemp autoconf_temporary
15621 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15622 #undef mkstemp
15623
15624 #ifdef __cplusplus
15625 extern "C"
15626 #endif
15627
15628 /* We use char because int might match the return type of a gcc2
15629    builtin and then its argument prototype would still apply.  */
15630 char mkstemp (void);
15631
15632 int
15633 main (void)
15634 {
15635
15636 /* The GNU C library defines stubs for functions which it implements
15637     to always fail with ENOSYS.  Some functions are actually named
15638     something starting with __ and the normal name is an alias.  */
15639 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15640 #error found stub for mkstemp
15641 #endif
15642
15643         return mkstemp ();
15644   ;
15645   return 0;
15646 }
15647 _ACEOF
15648 rm -f conftest.$ac_objext conftest$ac_exeext
15649 if { (eval echo "$as_me:15649: \"$ac_link\"") >&5
15650   (eval $ac_link) 2>&5
15651   ac_status=$?
15652   echo "$as_me:15652: \$? = $ac_status" >&5
15653   (exit $ac_status); } &&
15654          { ac_try='test -s conftest$ac_exeext'
15655   { (eval echo "$as_me:15655: \"$ac_try\"") >&5
15656   (eval $ac_try) 2>&5
15657   ac_status=$?
15658   echo "$as_me:15658: \$? = $ac_status" >&5
15659   (exit $ac_status); }; }; then
15660   ac_cv_func_mkstemp=yes
15661 else
15662   echo "$as_me: failed program was:" >&5
15663 cat conftest.$ac_ext >&5
15664 ac_cv_func_mkstemp=no
15665 fi
15666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15667 fi
15668 echo "$as_me:15668: result: $ac_cv_func_mkstemp" >&5
15669 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15670
15671 fi
15672 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15673
15674 cat >>confdefs.h <<\EOF
15675 #define HAVE_MKSTEMP 1
15676 EOF
15677
15678 fi
15679
15680 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15681         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15682         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15683 fi
15684
15685 cf_with_ada=yes
15686 if test "$cf_with_ada" != "no" ; then
15687
15688 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
15689 do
15690
15691 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15692
15693         unset ac_cv_path_cf_TEMP_gnat
15694         unset cf_TEMP_gnat
15695         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
15696 set dummy $cf_prog_gnat; ac_word=$2
15697 echo "$as_me:15697: checking for $ac_word" >&5
15698 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15699 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
15700   echo $ECHO_N "(cached) $ECHO_C" >&6
15701 else
15702   case $cf_TEMP_gnat in
15703   [\\/]* | ?:[\\/]*)
15704   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
15705   ;;
15706   *)
15707   ac_save_IFS=$IFS; IFS=$ac_path_separator
15708 ac_dummy="$PATH"
15709 for ac_dir in $ac_dummy; do
15710   IFS=$ac_save_IFS
15711   test -z "$ac_dir" && ac_dir=.
15712   if $as_executable_p "$ac_dir/$ac_word"; then
15713    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
15714    echo "$as_me:15714: found $ac_dir/$ac_word" >&5
15715    break
15716 fi
15717 done
15718
15719   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
15720   ;;
15721 esac
15722 fi
15723 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
15724
15725 if test -n "$cf_TEMP_gnat"; then
15726   echo "$as_me:15726: result: $cf_TEMP_gnat" >&5
15727 echo "${ECHO_T}$cf_TEMP_gnat" >&6
15728 else
15729   echo "$as_me:15729: result: no" >&5
15730 echo "${ECHO_T}no" >&6
15731 fi
15732
15733         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
15734
15735         if test "x$cf_TEMP_gnat" != xno; then
15736                 unset cf_cv_gnat_version
15737                 unset cf_TEMP_gnat
15738
15739 echo "$as_me:15739: checking for $cf_prog_gnat version" >&5
15740 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
15741 if test "${cf_cv_gnat_version+set}" = set; then
15742   echo $ECHO_N "(cached) $ECHO_C" >&6
15743 else
15744
15745 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
15746         grep '[0-9].[0-9][0-9]*' |\
15747         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15748
15749 fi
15750 echo "$as_me:15750: result: $cf_cv_gnat_version" >&5
15751 echo "${ECHO_T}$cf_cv_gnat_version" >&6
15752 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
15753 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
15754
15755         fi
15756         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
15757
15758         unset cf_TEMP_gnat
15759         unset cf_cv_gnat_version
15760         unset ac_cv_path_cf_TEMP_gnat
15761 done
15762
15763 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
15764         cf_ada_make=
15765         cf_cv_prog_gnat_correct=no
15766 else
15767         cf_ada_make=gnatmake
15768         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
15769                 # gprconfig is newer than gnatmake; we can continue...
15770                 cf_ada_config="##"
15771         else
15772                 rm -rf conftest* *~conftest*
15773                 if mkdir conftest.src
15774                 then
15775                         cf_ada_config=""
15776                         cd conftest.src
15777                         for cf_gprconfig in Ada C
15778                         do
15779                                 echo "$as_me:15779: checking for gprconfig name for $cf_gprconfig" >&5
15780 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15781                                 if test $cf_gprconfig = C
15782                                 then
15783                                         for cf_gprconfig_param in \
15784                                                 $cf_gprconfig,,,,GNATGCC \
15785                                                 $cf_gprconfig,,,,GCC \
15786                                                 $cf_gprconfig
15787                                         do
15788                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15789                                                 test -n "$cf_gprconfig_value" && break
15790                                         done
15791                                 else
15792                                         cf_gprconfig_param=$cf_gprconfig
15793                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15794                                 fi
15795                                 if test -n "$cf_gprconfig_value"
15796                                 then
15797                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15798                                         echo "$as_me:15798: result: $cf_gprconfig_value" >&5
15799 echo "${ECHO_T}$cf_gprconfig_value" >&6
15800                                 else
15801                                         echo "$as_me:15801: result: missing" >&5
15802 echo "${ECHO_T}missing" >&6
15803                                         cf_ada_config="#"
15804                                         break
15805                                 fi
15806                         done
15807                         cd ..
15808                         rm -rf conftest* *~conftest*
15809                 fi
15810         fi
15811         if test "x$cf_ada_config" != "x#"
15812         then
15813
15814 echo "$as_me:15814: checking for gnat version" >&5
15815 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15816 if test "${cf_cv_gnat_version+set}" = set; then
15817   echo $ECHO_N "(cached) $ECHO_C" >&6
15818 else
15819
15820 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
15821         grep '[0-9].[0-9][0-9]*' |\
15822         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15823
15824 fi
15825 echo "$as_me:15825: result: $cf_cv_gnat_version" >&5
15826 echo "${ECHO_T}$cf_cv_gnat_version" >&6
15827 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
15828
15829 case $cf_cv_gnat_version in
15830 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15831         cf_cv_prog_gnat_correct=yes
15832         ;;
15833 (*)
15834         { echo "$as_me:15834: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15835 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15836         cf_cv_prog_gnat_correct=no
15837         ;;
15838 esac
15839
15840                 # Extract the first word of "m4", so it can be a program name with args.
15841 set dummy m4; ac_word=$2
15842 echo "$as_me:15842: checking for $ac_word" >&5
15843 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15844 if test "${ac_cv_prog_M4_exists+set}" = set; then
15845   echo $ECHO_N "(cached) $ECHO_C" >&6
15846 else
15847   if test -n "$M4_exists"; then
15848   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15849 else
15850   ac_save_IFS=$IFS; IFS=$ac_path_separator
15851 ac_dummy="$PATH"
15852 for ac_dir in $ac_dummy; do
15853   IFS=$ac_save_IFS
15854   test -z "$ac_dir" && ac_dir=.
15855   $as_executable_p "$ac_dir/$ac_word" || continue
15856 ac_cv_prog_M4_exists="yes"
15857 echo "$as_me:15857: found $ac_dir/$ac_word" >&5
15858 break
15859 done
15860
15861   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15862 fi
15863 fi
15864 M4_exists=$ac_cv_prog_M4_exists
15865 if test -n "$M4_exists"; then
15866   echo "$as_me:15866: result: $M4_exists" >&5
15867 echo "${ECHO_T}$M4_exists" >&6
15868 else
15869   echo "$as_me:15869: result: no" >&5
15870 echo "${ECHO_T}no" >&6
15871 fi
15872
15873                 if test "$ac_cv_prog_M4_exists" = no; then
15874                         cf_cv_prog_gnat_correct=no
15875                         { echo "$as_me:15875: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
15876 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
15877                 fi
15878                 if test "$cf_cv_prog_gnat_correct" = yes; then
15879                         echo "$as_me:15879: checking if GNAT works" >&5
15880 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15881
15882 rm -rf conftest* *~conftest*
15883 cat >>conftest.ads <<CF_EOF
15884 procedure conftest;
15885 CF_EOF
15886 cat >>conftest.adb <<CF_EOF
15887 with Text_IO;
15888 with GNAT.OS_Lib;
15889 procedure conftest is
15890 begin
15891    Text_IO.Put ("Hello World");
15892    Text_IO.New_Line;
15893    GNAT.OS_Lib.OS_Exit (0);
15894 end conftest;
15895 CF_EOF
15896 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15897    if ( ./conftest 1>&5 2>&1 ) ; then
15898       cf_cv_prog_gnat_correct=yes
15899    else
15900       cf_cv_prog_gnat_correct=no
15901    fi
15902 else
15903    cf_cv_prog_gnat_correct=no
15904 fi
15905 rm -rf conftest* *~conftest*
15906
15907                         echo "$as_me:15907: result: $cf_cv_prog_gnat_correct" >&5
15908 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15909                 fi
15910         else
15911                 cf_cv_prog_gnat_correct=no
15912         fi
15913 fi
15914
15915         if test "$cf_cv_prog_gnat_correct" = yes; then
15916
15917         echo "$as_me:15917: checking optimization options for ADAFLAGS" >&5
15918 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15919         case "$CFLAGS" in
15920         (*-g*)
15921
15922         ADAFLAGS="$ADAFLAGS -g"
15923
15924                 ;;
15925         esac
15926         case "$CFLAGS" in
15927         (*-O*)
15928                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15929
15930         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15931
15932                 ;;
15933         esac
15934         echo "$as_me:15934: result: $ADAFLAGS" >&5
15935 echo "${ECHO_T}$ADAFLAGS" >&6
15936
15937 echo "$as_me:15937: checking if GNATPREP supports -T option" >&5
15938 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15939 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15940   echo $ECHO_N "(cached) $ECHO_C" >&6
15941 else
15942
15943 cf_cv_gnatprep_opt_t=no
15944 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15945
15946 fi
15947 echo "$as_me:15947: result: $cf_cv_gnatprep_opt_t" >&5
15948 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15949 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15950
15951 echo "$as_me:15951: checking if GNAT supports generics" >&5
15952 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15953 case $cf_cv_gnat_version in
15954 (3.[1-9]*|[4-9].*)
15955         cf_gnat_generics=yes
15956         ;;
15957 (*)
15958         cf_gnat_generics=no
15959         ;;
15960 esac
15961 echo "$as_me:15961: result: $cf_gnat_generics" >&5
15962 echo "${ECHO_T}$cf_gnat_generics" >&6
15963
15964 if test "$cf_gnat_generics" = yes
15965 then
15966         cf_compile_generics=generics
15967         cf_generic_objects="\${GENOBJS}"
15968 else
15969         cf_compile_generics=
15970         cf_generic_objects=
15971 fi
15972
15973 echo "$as_me:15973: checking if GNAT supports SIGINT" >&5
15974 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15975 if test "${cf_cv_gnat_sigint+set}" = set; then
15976   echo $ECHO_N "(cached) $ECHO_C" >&6
15977 else
15978
15979 rm -rf conftest* *~conftest*
15980 cat >>conftest.ads <<CF_EOF
15981 with Ada.Interrupts.Names;
15982
15983 package ConfTest is
15984
15985    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15986    pragma Unreserve_All_Interrupts;
15987    pragma Warnings (On);
15988
15989    protected Process is
15990       procedure Stop;
15991       function Continue return Boolean;
15992       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
15993    private
15994       Done : Boolean := False;
15995    end Process;
15996
15997 end ConfTest;
15998 CF_EOF
15999 cat >>conftest.adb <<CF_EOF
16000 package body ConfTest is
16001    protected body Process is
16002       procedure Stop is
16003       begin
16004          Done := True;
16005       end Stop;
16006       function Continue return Boolean is
16007       begin
16008          return not Done;
16009       end Continue;
16010    end Process;
16011 end ConfTest;
16012 CF_EOF
16013 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16014       cf_cv_gnat_sigint=yes
16015 else
16016    cf_cv_gnat_sigint=no
16017 fi
16018 rm -rf conftest* *~conftest*
16019
16020 fi
16021 echo "$as_me:16021: result: $cf_cv_gnat_sigint" >&5
16022 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16023
16024 if test $cf_cv_gnat_sigint = yes ; then
16025         USE_GNAT_SIGINT=""
16026 else
16027         USE_GNAT_SIGINT="#"
16028 fi
16029
16030 cf_gnat_libraries=no
16031 cf_gnat_projects=no
16032
16033 if test "$enable_gnat_projects" != no ; then
16034 echo "$as_me:16034: checking if GNAT supports project files" >&5
16035 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16036 case $cf_cv_gnat_version in
16037 (3.[0-9]*)
16038         ;;
16039 (*)
16040         case $cf_cv_system_name in
16041         (cygwin*|msys*)
16042                 ;;
16043         (*)
16044                 rm -rf conftest* *~conftest*
16045                 if mkdir conftest.src conftest.bin conftest.lib
16046                 then
16047                         cd conftest.src
16048                         rm -rf conftest* *~conftest*
16049                         cat >>library.gpr <<CF_EOF
16050 project Library is
16051   Kind := External ("LIB_KIND");
16052   for Library_Name use "ConfTest";
16053   for Object_Dir use ".";
16054   for Library_ALI_Dir use External("LIBRARY_DIR");
16055   for Library_Version use External ("SONAME");
16056   for Library_Kind use Kind;
16057   for Library_Dir use External("BUILD_DIR");
16058   Source_Dir := External ("SOURCE_DIR");
16059   for Source_Dirs use (Source_Dir);
16060 end Library;
16061 CF_EOF
16062                         cat >>confpackage.ads <<CF_EOF
16063 package ConfPackage is
16064    procedure conftest;
16065 end ConfPackage;
16066 CF_EOF
16067                         cat >>confpackage.adb <<CF_EOF
16068 with Text_IO;
16069 package body ConfPackage is
16070    procedure conftest is
16071    begin
16072       Text_IO.Put ("Hello World");
16073       Text_IO.New_Line;
16074    end conftest;
16075 end ConfPackage;
16076 CF_EOF
16077                         if ( $cf_ada_make $ADAFLAGS \
16078                                         -Plibrary.gpr \
16079                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
16080                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
16081                                         -XSOURCE_DIR=`pwd` \
16082                                         -XSONAME=libConfTest.so.1 \
16083                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
16084                                 cf_gnat_projects=yes
16085                         fi
16086                         cd ..
16087                 fi
16088                 if test -f conftest.lib/confpackage.ali
16089                 then
16090                         cf_gnat_libraries=yes
16091                 fi
16092                 rm -rf conftest* *~conftest*
16093                 ;;
16094         esac
16095         ;;
16096 esac
16097 echo "$as_me:16097: result: $cf_gnat_projects" >&5
16098 echo "${ECHO_T}$cf_gnat_projects" >&6
16099 fi # enable_gnat_projects
16100
16101 if test $cf_gnat_projects = yes
16102 then
16103         echo "$as_me:16103: checking if GNAT supports libraries" >&5
16104 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
16105         echo "$as_me:16105: result: $cf_gnat_libraries" >&5
16106 echo "${ECHO_T}$cf_gnat_libraries" >&6
16107 fi
16108
16109 if test "$cf_gnat_projects" = yes
16110 then
16111         USE_OLD_MAKERULES="#"
16112         USE_GNAT_PROJECTS=""
16113 else
16114         USE_OLD_MAKERULES=""
16115         USE_GNAT_PROJECTS="#"
16116 fi
16117
16118 if test "$cf_gnat_libraries" = yes
16119 then
16120         USE_GNAT_LIBRARIES=""
16121 else
16122         USE_GNAT_LIBRARIES="#"
16123 fi
16124
16125 echo "$as_me:16125: checking for ada-compiler" >&5
16126 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
16127
16128 # Check whether --with-ada-compiler or --without-ada-compiler was given.
16129 if test "${with_ada_compiler+set}" = set; then
16130   withval="$with_ada_compiler"
16131   cf_ada_compiler=$withval
16132 else
16133   cf_ada_compiler=gnatmake
16134 fi;
16135
16136 echo "$as_me:16136: result: $cf_ada_compiler" >&5
16137 echo "${ECHO_T}$cf_ada_compiler" >&6
16138
16139                 cf_ada_package=terminal_interface
16140
16141 echo "$as_me:16141: checking for ada-include" >&5
16142 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
16143
16144 # Check whether --with-ada-include or --without-ada-include was given.
16145 if test "${with_ada_include+set}" = set; then
16146   withval="$with_ada_include"
16147
16148 else
16149   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
16150 fi; if test -n "$prefix/share/ada/adainclude" ; then
16151
16152 if test "x$prefix" != xNONE; then
16153         cf_path_syntax="$prefix"
16154 else
16155         cf_path_syntax="$ac_default_prefix"
16156 fi
16157
16158 case ".$withval" in
16159 (.\$\(*\)*|.\'*\'*)
16160         ;;
16161 (..|./*|.\\*)
16162         ;;
16163 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16164         ;;
16165 (.\${*prefix}*|.\${*dir}*)
16166         eval withval="$withval"
16167         case ".$withval" in
16168         (.NONE/*)
16169                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16170                 ;;
16171         esac
16172         ;;
16173 (.no|.NONE/*)
16174         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16175         ;;
16176 (*)
16177         { { echo "$as_me:16177: error: expected a pathname, not \"$withval\"" >&5
16178 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16179    { (exit 1); exit 1; }; }
16180         ;;
16181 esac
16182
16183 fi
16184 eval ADA_INCLUDE="$withval"
16185
16186 echo "$as_me:16186: result: $ADA_INCLUDE" >&5
16187 echo "${ECHO_T}$ADA_INCLUDE" >&6
16188
16189 echo "$as_me:16189: checking for ada-objects" >&5
16190 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
16191
16192 # Check whether --with-ada-objects or --without-ada-objects was given.
16193 if test "${with_ada_objects+set}" = set; then
16194   withval="$with_ada_objects"
16195
16196 else
16197   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16198 fi; if test -n "$prefix/lib/ada/adalib" ; then
16199
16200 if test "x$prefix" != xNONE; then
16201         cf_path_syntax="$prefix"
16202 else
16203         cf_path_syntax="$ac_default_prefix"
16204 fi
16205
16206 case ".$withval" in
16207 (.\$\(*\)*|.\'*\'*)
16208         ;;
16209 (..|./*|.\\*)
16210         ;;
16211 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16212         ;;
16213 (.\${*prefix}*|.\${*dir}*)
16214         eval withval="$withval"
16215         case ".$withval" in
16216         (.NONE/*)
16217                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16218                 ;;
16219         esac
16220         ;;
16221 (.no|.NONE/*)
16222         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16223         ;;
16224 (*)
16225         { { echo "$as_me:16225: error: expected a pathname, not \"$withval\"" >&5
16226 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16227    { (exit 1); exit 1; }; }
16228         ;;
16229 esac
16230
16231 fi
16232 eval ADA_OBJECTS="$withval"
16233
16234 echo "$as_me:16234: result: $ADA_OBJECTS" >&5
16235 echo "${ECHO_T}$ADA_OBJECTS" >&6
16236
16237 echo "$as_me:16237: checking if an Ada95 shared-library should be built" >&5
16238 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16239
16240 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16241 if test "${with_ada_sharedlib+set}" = set; then
16242   withval="$with_ada_sharedlib"
16243   with_ada_sharedlib=$withval
16244 else
16245   with_ada_sharedlib=no
16246 fi;
16247 echo "$as_me:16247: result: $with_ada_sharedlib" >&5
16248 echo "${ECHO_T}$with_ada_sharedlib" >&6
16249
16250 if test "x$with_ada_sharedlib" != xno
16251 then
16252         if test "x$cf_gnat_projects" != xyes
16253         then
16254                 { echo "$as_me:16254: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16255 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16256                 with_ada_sharedlib=no
16257         fi
16258 fi
16259
16260 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16261 MAKE_ADA_SHAREDLIB="#"
16262
16263 if test "x$with_ada_sharedlib" != xno
16264 then
16265         MAKE_ADA_SHAREDLIB=
16266         if test "x$with_ada_sharedlib" != xyes
16267         then
16268                 ADA_SHAREDLIB="$with_ada_sharedlib"
16269         fi
16270 fi
16271
16272                 # allow the Ada binding to be renamed
16273
16274 echo "$as_me:16274: checking for ada-libname" >&5
16275 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
16276
16277 # Check whether --with-ada-libname or --without-ada-libname was given.
16278 if test "${with_ada_libname+set}" = set; then
16279   withval="$with_ada_libname"
16280   ADA_LIBNAME=$withval
16281 else
16282   ADA_LIBNAME=AdaCurses
16283 fi;
16284 case "x$ADA_LIBNAME" in
16285 (x|xyes|xno)
16286         ADA_LIBNAME=AdaCurses
16287         ;;
16288 esac
16289
16290 echo "$as_me:16290: result: $ADA_LIBNAME" >&5
16291 echo "${ECHO_T}$ADA_LIBNAME" >&6
16292
16293         else
16294                 { { echo "$as_me:16294: error: No usable Ada compiler found" >&5
16295 echo "$as_me: error: No usable Ada compiler found" >&2;}
16296    { (exit 1); exit 1; }; }
16297         fi
16298 else
16299         { { echo "$as_me:16299: error: The Ada compiler is needed for this package" >&5
16300 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16301    { (exit 1); exit 1; }; }
16302 fi
16303
16304 ################################################################################
16305
16306 # not needed
16307 TINFO_LDFLAGS2=
16308
16309 TINFO_LIBS=
16310
16311 ### Construct the list of include-directories to be generated
16312
16313 if test "$srcdir" != "."; then
16314         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16315 fi
16316 CPPFLAGS="-I../include $CPPFLAGS"
16317 if test "$srcdir" != "."; then
16318         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16319 fi
16320 CPPFLAGS="-I. $CPPFLAGS"
16321
16322 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16323 if test "$srcdir" != "."; then
16324         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16325 fi
16326 if test "$GCC" != yes; then
16327         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16328 elif test "$includedir" != "/usr/include"; then
16329         if test "$includedir" = '${prefix}/include' ; then
16330                 if test x$prefix != x/usr ; then
16331                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16332                 fi
16333         else
16334                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16335         fi
16336 fi
16337
16338 ### Build up pieces for makefile rules
16339 echo "$as_me:16339: checking default library suffix" >&5
16340 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16341
16342         case $DFT_LWR_MODEL in
16343         (libtool) DFT_ARG_SUFFIX=''   ;;
16344         (normal)  DFT_ARG_SUFFIX=''   ;;
16345         (debug)   DFT_ARG_SUFFIX='_g' ;;
16346         (profile) DFT_ARG_SUFFIX='_p' ;;
16347         (shared)  DFT_ARG_SUFFIX=''   ;;
16348         esac
16349         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16350 echo "$as_me:16350: result: $DFT_ARG_SUFFIX" >&5
16351 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16352
16353 echo "$as_me:16353: checking default library-dependency suffix" >&5
16354 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16355
16356         case X$DFT_LWR_MODEL in
16357         (Xlibtool)
16358                 DFT_LIB_SUFFIX='.la'
16359                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16360                 ;;
16361         (Xdebug)
16362                 DFT_LIB_SUFFIX='_g.a'
16363                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16364                 ;;
16365         (Xprofile)
16366                 DFT_LIB_SUFFIX='_p.a'
16367                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16368                 ;;
16369         (Xshared)
16370                 case $cf_cv_system_name in
16371                 (aix[5-7]*)
16372                         DFT_LIB_SUFFIX='.so'
16373                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16374                         ;;
16375                 (cygwin*|msys*|mingw*)
16376                         DFT_LIB_SUFFIX='.dll'
16377                         DFT_DEP_SUFFIX='.dll.a'
16378                         ;;
16379                 (darwin*)
16380                         DFT_LIB_SUFFIX='.dylib'
16381                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16382                         ;;
16383                 (hpux*)
16384                         case $target in
16385                         (ia64*)
16386                                 DFT_LIB_SUFFIX='.so'
16387                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16388                                 ;;
16389                         (*)
16390                                 DFT_LIB_SUFFIX='.sl'
16391                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16392                                 ;;
16393                         esac
16394                         ;;
16395                 (*)
16396                         DFT_LIB_SUFFIX='.so'
16397                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16398                         ;;
16399                 esac
16400                 ;;
16401         (*)
16402                 DFT_LIB_SUFFIX='.a'
16403                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16404                 ;;
16405         esac
16406         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16407         then
16408                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16409                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16410         fi
16411 echo "$as_me:16411: result: $DFT_DEP_SUFFIX" >&5
16412 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16413
16414 echo "$as_me:16414: checking default object directory" >&5
16415 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16416
16417         case $DFT_LWR_MODEL in
16418         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16419         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16420         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16421         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16422         (shared)
16423                 case $cf_cv_system_name in
16424                 (cygwin|msys)
16425                         DFT_OBJ_SUBDIR='objects' ;;
16426                 (*)
16427                         DFT_OBJ_SUBDIR='obj_s' ;;
16428                 esac
16429         esac
16430 echo "$as_me:16430: result: $DFT_OBJ_SUBDIR" >&5
16431 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16432
16433 ### Set up low-level terminfo dependencies for makefiles.
16434
16435 if test "$DFT_LWR_MODEL" = shared ; then
16436         case $cf_cv_system_name in
16437         (cygwin*)
16438                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16439                 ;;
16440         (msys*)
16441                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16442                 ;;
16443         esac
16444 fi
16445
16446 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
16447
16448 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
16449
16450 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16451
16452 ### Construct the list of subdirectories for which we'll customize makefiles
16453 ### with the appropriate compile-rules.
16454
16455 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16456
16457 cat >>confdefs.h <<EOF
16458 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16459 EOF
16460
16461 ### Now that we're done running tests, add the compiler-warnings, if any
16462
16463 cf_fix_cppflags=no
16464 cf_new_cflags=
16465 cf_new_cppflags=
16466 cf_new_extra_cppflags=
16467
16468 for cf_add_cflags in $EXTRA_CFLAGS
16469 do
16470 case $cf_fix_cppflags in
16471 (no)
16472         case $cf_add_cflags in
16473         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16474                 case $cf_add_cflags in
16475                 (-D*)
16476                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16477
16478                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16479                                 && test -z "${cf_tst_cflags}" \
16480                                 && cf_fix_cppflags=yes
16481
16482                         if test $cf_fix_cppflags = yes ; then
16483
16484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16486
16487                                 continue
16488                         elif test "${cf_tst_cflags}" = "\"'" ; then
16489
16490         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16491         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16492
16493                                 continue
16494                         fi
16495                         ;;
16496                 esac
16497                 case "$CPPFLAGS" in
16498                 (*$cf_add_cflags)
16499                         ;;
16500                 (*)
16501                         case $cf_add_cflags in
16502                         (-D*)
16503                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16504
16505 CPPFLAGS=`echo "$CPPFLAGS" | \
16506         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16507                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16508
16509                                 ;;
16510                         esac
16511
16512         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16513         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16514
16515                         ;;
16516                 esac
16517                 ;;
16518         (*)
16519
16520         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16521         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16522
16523                 ;;
16524         esac
16525         ;;
16526 (yes)
16527
16528         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16529         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16530
16531         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16532
16533         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16534                 && test -z "${cf_tst_cflags}" \
16535                 && cf_fix_cppflags=no
16536         ;;
16537 esac
16538 done
16539
16540 if test -n "$cf_new_cflags" ; then
16541
16542         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16543         CFLAGS="${CFLAGS}$cf_new_cflags"
16544
16545 fi
16546
16547 if test -n "$cf_new_cppflags" ; then
16548
16549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16550         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16551
16552 fi
16553
16554 if test -n "$cf_new_extra_cppflags" ; then
16555
16556         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16557         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16558
16559 fi
16560
16561 ################################################################################
16562
16563 TEST_ARG2=
16564
16565 TEST_LIBS2=
16566
16567 NCURSES_SHLIB2="sh -c"
16568
16569 ADA_SUBDIRS="include gen src doc"
16570 if test "x$cf_with_tests" != "xno" ; then
16571         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16572 fi
16573 for cf_dir in $ADA_SUBDIRS
16574 do
16575         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16576 done
16577
16578 NCURSES_TREE="#"
16579
16580 EXTERNAL_TREE=
16581
16582 # match layout used by make-tar.sh
16583 ADAHTML_DIR=../doc/ada
16584
16585 if test "x$cross_compiling" = xyes ; then
16586         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16587 else
16588         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16589 fi
16590
16591 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"
16592 ac_config_commands="$ac_config_commands default"
16593 cat >confcache <<\_ACEOF
16594 # This file is a shell script that caches the results of configure
16595 # tests run on this system so they can be shared between configure
16596 # scripts and configure runs, see configure's option --config-cache.
16597 # It is not useful on other systems.  If it contains results you don't
16598 # want to keep, you may remove or edit it.
16599 #
16600 # config.status only pays attention to the cache file if you give it
16601 # the --recheck option to rerun configure.
16602 #
16603 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16604 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16605 # following values.
16606
16607 _ACEOF
16608
16609 # The following way of writing the cache mishandles newlines in values,
16610 # but we know of no workaround that is simple, portable, and efficient.
16611 # So, don't put newlines in cache variables' values.
16612 # Ultrix sh set writes to stderr and can't be redirected directly,
16613 # and sets the high bit in the cache file unless we assign to the vars.
16614 {
16615   (set) 2>&1 |
16616     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16617     *ac_space=\ *)
16618       # `set' does not quote correctly, so add quotes (double-quote
16619       # substitution turns \\\\ into \\, and sed turns \\ into \).
16620       sed -n \
16621         "s/'/'\\\\''/g;
16622           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16623       ;;
16624     *)
16625       # `set' quotes correctly as required by POSIX, so do not add quotes.
16626       sed -n \
16627         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16628       ;;
16629     esac;
16630 } |
16631   sed '
16632      t clear
16633      : clear
16634      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16635      t end
16636      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16637      : end' >>confcache
16638 if cmp -s $cache_file confcache; then :; else
16639   if test -w $cache_file; then
16640     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16641     cat confcache >$cache_file
16642   else
16643     echo "not updating unwritable cache $cache_file"
16644   fi
16645 fi
16646 rm -f confcache
16647
16648 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16649 # Let make expand exec_prefix.
16650 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16651
16652 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16653 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16654 # trailing colons and then remove the whole line if VPATH becomes empty
16655 # (actually we leave an empty line to preserve line numbers).
16656 if test "x$srcdir" = x.; then
16657   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16658 s/:*\$(srcdir):*/:/;
16659 s/:*\${srcdir}:*/:/;
16660 s/:*@srcdir@:*/:/;
16661 s/^\([^=]*=[    ]*\):*/\1/;
16662 s/:*$//;
16663 s/^[^=]*=[      ]*$//;
16664 }'
16665 fi
16666
16667 DEFS=-DHAVE_CONFIG_H
16668
16669 : ${CONFIG_STATUS=./config.status}
16670 ac_clean_files_save=$ac_clean_files
16671 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16672 { echo "$as_me:16672: creating $CONFIG_STATUS" >&5
16673 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16674 cat >$CONFIG_STATUS <<_ACEOF
16675 #! $SHELL
16676 # Generated automatically by configure.
16677 # Run this file to recreate the current configuration.
16678 # Compiler output produced by configure, useful for debugging
16679 # configure, is in config.log if it exists.
16680
16681 debug=false
16682 SHELL=\${CONFIG_SHELL-$SHELL}
16683 ac_cs_invocation="\$0 \$@"
16684
16685 _ACEOF
16686
16687 cat >>$CONFIG_STATUS <<\_ACEOF
16688 # Be Bourne compatible
16689 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16690   emulate sh
16691   NULLCMD=:
16692 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16693   set -o posix
16694 fi
16695
16696 # Name of the executable.
16697 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16698
16699 if expr a : '\(a\)' >/dev/null 2>&1; then
16700   as_expr=expr
16701 else
16702   as_expr=false
16703 fi
16704
16705 rm -f conf$$ conf$$.exe conf$$.file
16706 echo >conf$$.file
16707 if ln -s conf$$.file conf$$ 2>/dev/null; then
16708   # We could just check for DJGPP; but this test a) works b) is more generic
16709   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16710   if test -f conf$$.exe; then
16711     # Don't use ln at all; we don't have any links
16712     as_ln_s='cp -p'
16713   else
16714     as_ln_s='ln -s'
16715   fi
16716 elif ln conf$$.file conf$$ 2>/dev/null; then
16717   as_ln_s=ln
16718 else
16719   as_ln_s='cp -p'
16720 fi
16721 rm -f conf$$ conf$$.exe conf$$.file
16722
16723 as_executable_p="test -f"
16724
16725 # Support unset when possible.
16726 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16727   as_unset=unset
16728 else
16729   as_unset=false
16730 fi
16731
16732 # NLS nuisances.
16733 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16734 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16735 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16736 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16737 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16738 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16739 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16740 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16741
16742 # IFS
16743 # We need space, tab and new line, in precisely that order.
16744 as_nl='
16745 '
16746 IFS="   $as_nl"
16747
16748 # CDPATH.
16749 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16750
16751 exec 6>&1
16752
16753 _ACEOF
16754
16755 # Files that config.status was made for.
16756 if test -n "$ac_config_files"; then
16757   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16758 fi
16759
16760 if test -n "$ac_config_headers"; then
16761   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16762 fi
16763
16764 if test -n "$ac_config_links"; then
16765   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16766 fi
16767
16768 if test -n "$ac_config_commands"; then
16769   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16770 fi
16771
16772 cat >>$CONFIG_STATUS <<\EOF
16773
16774 ac_cs_usage="\
16775 \`$as_me' instantiates files from templates according to the
16776 current configuration.
16777
16778 Usage: $0 [OPTIONS] [FILE]...
16779
16780   -h, --help       print this help, then exit
16781   -V, --version    print version number, then exit
16782   -d, --debug      don't remove temporary files
16783       --recheck    update $as_me by reconfiguring in the same conditions
16784   --file=FILE[:TEMPLATE]
16785                    instantiate the configuration file FILE
16786   --header=FILE[:TEMPLATE]
16787                    instantiate the configuration header FILE
16788
16789 Configuration files:
16790 $config_files
16791
16792 Configuration headers:
16793 $config_headers
16794
16795 Configuration commands:
16796 $config_commands
16797
16798 Report bugs to <dickey@invisible-island.net>."
16799 EOF
16800
16801 cat >>$CONFIG_STATUS <<EOF
16802 ac_cs_version="\\
16803 config.status
16804 configured by $0, generated by GNU Autoconf 2.52.20200111,
16805   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16806
16807 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16808 Free Software Foundation, Inc.
16809 This config.status script is free software; the Free Software Foundation
16810 gives unlimited permission to copy, distribute and modify it."
16811 srcdir=$srcdir
16812 INSTALL="$INSTALL"
16813 EOF
16814
16815 cat >>$CONFIG_STATUS <<\EOF
16816 # If no file are specified by the user, then we need to provide default
16817 # value.  By we need to know if files were specified by the user.
16818 ac_need_defaults=:
16819 while test $# != 0
16820 do
16821   case $1 in
16822   --*=*)
16823     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16824     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16825     shift
16826     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16827     shift
16828     ;;
16829   -*);;
16830   *) # This is not an option, so the user has probably given explicit
16831      # arguments.
16832      ac_need_defaults=false;;
16833   esac
16834
16835   case $1 in
16836   # Handling of the options.
16837 EOF
16838 cat >>$CONFIG_STATUS <<EOF
16839   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16840     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16841     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16842 EOF
16843 cat >>$CONFIG_STATUS <<\EOF
16844   --version | --vers* | -V )
16845     echo "$ac_cs_version"; exit 0 ;;
16846   --he | --h)
16847     # Conflict between --help and --header
16848     { { echo "$as_me:16848: error: ambiguous option: $1
16849 Try \`$0 --help' for more information." >&5
16850 echo "$as_me: error: ambiguous option: $1
16851 Try \`$0 --help' for more information." >&2;}
16852    { (exit 1); exit 1; }; };;
16853   --help | --hel | -h )
16854     echo "$ac_cs_usage"; exit 0 ;;
16855   --debug | --d* | -d )
16856     debug=: ;;
16857   --file | --fil | --fi | --f )
16858     shift
16859     CONFIG_FILES="$CONFIG_FILES $1"
16860     ac_need_defaults=false;;
16861   --header | --heade | --head | --hea )
16862     shift
16863     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16864     ac_need_defaults=false;;
16865
16866   # This is an error.
16867   -*) { { echo "$as_me:16867: error: unrecognized option: $1
16868 Try \`$0 --help' for more information." >&5
16869 echo "$as_me: error: unrecognized option: $1
16870 Try \`$0 --help' for more information." >&2;}
16871    { (exit 1); exit 1; }; } ;;
16872
16873   *) ac_config_targets="$ac_config_targets $1" ;;
16874
16875   esac
16876   shift
16877 done
16878
16879 exec 5>>config.log
16880 cat >&5 << _ACEOF
16881
16882 ## ----------------------- ##
16883 ## Running config.status.  ##
16884 ## ----------------------- ##
16885
16886 This file was extended by $as_me 2.52.20200111, executed with
16887   CONFIG_FILES    = $CONFIG_FILES
16888   CONFIG_HEADERS  = $CONFIG_HEADERS
16889   CONFIG_LINKS    = $CONFIG_LINKS
16890   CONFIG_COMMANDS = $CONFIG_COMMANDS
16891   > $ac_cs_invocation
16892 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16893
16894 _ACEOF
16895 EOF
16896
16897 cat >>$CONFIG_STATUS <<EOF
16898 #
16899 # INIT-COMMANDS section.
16900 #
16901
16902 ### Special initialization commands, used to pass information from the
16903 ### configuration-run into config.status
16904
16905 AWK="$AWK"
16906 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16907 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16908 LIB_NAME="$LIB_NAME"
16909 LIB_PREFIX="$LIB_PREFIX"
16910 LIB_SUFFIX="$LIB_SUFFIX"
16911 LN_S="$LN_S"
16912 NCURSES_MAJOR="$NCURSES_MAJOR"
16913 NCURSES_MINOR="$NCURSES_MINOR"
16914 NCURSES_PATCH="$NCURSES_PATCH"
16915 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16916 cf_cv_abi_version="$cf_cv_abi_version"
16917 cf_cv_rel_version="$cf_cv_rel_version"
16918 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16919 cf_cv_shared_soname='$cf_cv_shared_soname'
16920 cf_cv_shlib_version="$cf_cv_shlib_version"
16921 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16922 cf_cv_system_name="$cf_cv_system_name"
16923 host="$host"
16924 target="$target"
16925
16926 EOF
16927
16928 cat >>$CONFIG_STATUS <<\EOF
16929 for ac_config_target in $ac_config_targets
16930 do
16931   case "$ac_config_target" in
16932   # Handling of arguments.
16933   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16934   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
16935   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16936   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16937   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16938   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16939   *) { { echo "$as_me:16939: error: invalid argument: $ac_config_target" >&5
16940 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16941    { (exit 1); exit 1; }; };;
16942   esac
16943 done
16944
16945 # If the user did not use the arguments to specify the items to instantiate,
16946 # then the envvar interface is used.  Set only those that are not.
16947 # We use the long form for the default assignment because of an extremely
16948 # bizarre bug on SunOS 4.1.3.
16949 if $ac_need_defaults; then
16950   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16951   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16952   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16953 fi
16954
16955 # Create a temporary directory, and hook for its removal unless debugging.
16956 $debug ||
16957 {
16958   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16959   trap '{ (exit 1); exit 1; }' 1 2 13 15
16960 }
16961
16962 # Create a (secure) tmp directory for tmp files.
16963 : ${TMPDIR=/tmp}
16964 {
16965   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16966   test -n "$tmp" && test -d "$tmp"
16967 }  ||
16968 {
16969   tmp=$TMPDIR/cs$$-$RANDOM
16970   (umask 077 && mkdir $tmp)
16971 } ||
16972 {
16973    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16974    { (exit 1); exit 1; }
16975 }
16976
16977 EOF
16978
16979 cat >>$CONFIG_STATUS <<EOF
16980
16981 #
16982 # CONFIG_FILES section.
16983 #
16984
16985 # No need to generate the scripts if there are no CONFIG_FILES.
16986 # This happens for instance when ./config.status config.h
16987 if test -n "\$CONFIG_FILES"; then
16988   # Protect against being on the right side of a sed subst in config.status.
16989   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16990    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16991 s,@SHELL@,$SHELL,;t t
16992 s,@exec_prefix@,$exec_prefix,;t t
16993 s,@prefix@,$prefix,;t t
16994 s,@program_transform_name@,$program_transform_name,;t t
16995 s,@bindir@,$bindir,;t t
16996 s,@sbindir@,$sbindir,;t t
16997 s,@libexecdir@,$libexecdir,;t t
16998 s,@datarootdir@,$datarootdir,;t t
16999 s,@datadir@,$datadir,;t t
17000 s,@sysconfdir@,$sysconfdir,;t t
17001 s,@sharedstatedir@,$sharedstatedir,;t t
17002 s,@localstatedir@,$localstatedir,;t t
17003 s,@runstatedir@,$runstatedir,;t t
17004 s,@libdir@,$libdir,;t t
17005 s,@includedir@,$includedir,;t t
17006 s,@oldincludedir@,$oldincludedir,;t t
17007 s,@infodir@,$infodir,;t t
17008 s,@mandir@,$mandir,;t t
17009 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17010 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17011 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17012 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17013 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17014 s,@build_alias@,$build_alias,;t t
17015 s,@host_alias@,$host_alias,;t t
17016 s,@target_alias@,$target_alias,;t t
17017 s,@ECHO_C@,$ECHO_C,;t t
17018 s,@ECHO_N@,$ECHO_N,;t t
17019 s,@ECHO_T@,$ECHO_T,;t t
17020 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17021 s,@DEFS@,$DEFS,;t t
17022 s,@LIBS@,$LIBS,;t t
17023 s,@top_builddir@,$top_builddir,;t t
17024 s,@build@,$build,;t t
17025 s,@build_cpu@,$build_cpu,;t t
17026 s,@build_vendor@,$build_vendor,;t t
17027 s,@build_os@,$build_os,;t t
17028 s,@host@,$host,;t t
17029 s,@host_cpu@,$host_cpu,;t t
17030 s,@host_vendor@,$host_vendor,;t t
17031 s,@host_os@,$host_os,;t t
17032 s,@target@,$target,;t t
17033 s,@target_cpu@,$target_cpu,;t t
17034 s,@target_vendor@,$target_vendor,;t t
17035 s,@target_os@,$target_os,;t t
17036 s,@CC@,$CC,;t t
17037 s,@CFLAGS@,$CFLAGS,;t t
17038 s,@LDFLAGS@,$LDFLAGS,;t t
17039 s,@CPPFLAGS@,$CPPFLAGS,;t t
17040 s,@ac_ct_CC@,$ac_ct_CC,;t t
17041 s,@EXEEXT@,$EXEEXT,;t t
17042 s,@OBJEXT@,$OBJEXT,;t t
17043 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17044 s,@CPP@,$CPP,;t t
17045 s,@AWK@,$AWK,;t t
17046 s,@EGREP@,$EGREP,;t t
17047 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17048 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17049 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17050 s,@LN_S@,$LN_S,;t t
17051 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17052 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17053 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17054 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17055 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17056 s,@SET_MAKE@,$SET_MAKE,;t t
17057 s,@CTAGS@,$CTAGS,;t t
17058 s,@ETAGS@,$ETAGS,;t t
17059 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17060 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17061 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17062 s,@RANLIB@,$RANLIB,;t t
17063 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17064 s,@LD@,$LD,;t t
17065 s,@ac_ct_LD@,$ac_ct_LD,;t t
17066 s,@AR@,$AR,;t t
17067 s,@ac_ct_AR@,$ac_ct_AR,;t t
17068 s,@ARFLAGS@,$ARFLAGS,;t t
17069 s,@DESTDIR@,$DESTDIR,;t t
17070 s,@BUILD_CC@,$BUILD_CC,;t t
17071 s,@BUILD_CPP@,$BUILD_CPP,;t t
17072 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17073 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17074 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17075 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17076 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17077 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17078 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17079 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17080 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17081 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17082 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17083 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17084 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17085 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17086 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17087 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17088 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17089 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17090 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17091 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17092 s,@CC_G_OPT@,$CC_G_OPT,;t t
17093 s,@LD_MODEL@,$LD_MODEL,;t t
17094 s,@shlibdir@,$shlibdir,;t t
17095 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17096 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17097 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17098 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17099 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17100 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17101 s,@LINK_PROGS@,$LINK_PROGS,;t t
17102 s,@LINK_TESTS@,$LINK_TESTS,;t t
17103 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17104 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17105 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17106 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17107 s,@RPATH_LIST@,$RPATH_LIST,;t t
17108 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17109 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17110 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17111 s,@PTHREAD@,$PTHREAD,;t t
17112 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17113 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17114 s,@ECHO_LT@,$ECHO_LT,;t t
17115 s,@ECHO_LD@,$ECHO_LD,;t t
17116 s,@RULE_CC@,$RULE_CC,;t t
17117 s,@SHOW_CC@,$SHOW_CC,;t t
17118 s,@ECHO_CC@,$ECHO_CC,;t t
17119 s,@ADAFLAGS@,$ADAFLAGS,;t t
17120 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17121 s,@ADA_TRACE@,$ADA_TRACE,;t t
17122 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17123 s,@M4_exists@,$M4_exists,;t t
17124 s,@cf_ada_make@,$cf_ada_make,;t t
17125 s,@cf_ada_config@,$cf_ada_config,;t t
17126 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17127 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17128 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17129 s,@cf_compile_generics@,$cf_compile_generics,;t t
17130 s,@cf_generic_objects@,$cf_generic_objects,;t t
17131 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17132 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17133 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17134 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17135 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17136 s,@cf_ada_package@,$cf_ada_package,;t t
17137 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17138 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17139 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17140 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17141 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
17142 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17143 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17144 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17145 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17146 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17147 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17148 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17149 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17150 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17151 s,@TEST_ARG2@,$TEST_ARG2,;t t
17152 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17153 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17154 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17155 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17156 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17157 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17158 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17159 CEOF
17160
17161 EOF
17162
17163   cat >>$CONFIG_STATUS <<\EOF
17164   # Split the substitutions into bite-sized pieces for seds with
17165   # small command number limits, like on Digital OSF/1 and HP-UX.
17166   ac_max_sed_lines=48
17167   ac_sed_frag=1 # Number of current file.
17168   ac_beg=1 # First line for current file.
17169   ac_end=$ac_max_sed_lines # Line after last line for current file.
17170   ac_more_lines=:
17171   ac_sed_cmds=
17172   while $ac_more_lines; do
17173     if test $ac_beg -gt 1; then
17174       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17175     else
17176       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17177     fi
17178     if test ! -s $tmp/subs.frag; then
17179       ac_more_lines=false
17180     else
17181       # The purpose of the label and of the branching condition is to
17182       # speed up the sed processing (if there are no `@' at all, there
17183       # is no need to browse any of the substitutions).
17184       # These are the two extra sed commands mentioned above.
17185       (echo ':t
17186   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17187       # It is possible to make a multiline substitution using escaped newlines.
17188       # Ensure that we do not split the substitution between script fragments.
17189       ac_BEG=$ac_end
17190       ac_END=`expr $ac_end + $ac_max_sed_lines`
17191       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
17192       if test -s $tmp/subs.next; then
17193         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
17194         if test ! -s $tmp/subs.edit; then
17195           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
17196           if test ! -s $tmp/subs.edit; then
17197             if test $ac_beg -gt 1; then
17198               ac_end=`expr $ac_end - 1`
17199               continue
17200             fi
17201           fi
17202         fi
17203       fi
17204
17205       if test -z "$ac_sed_cmds"; then
17206         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17207       else
17208         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17209       fi
17210       ac_sed_frag=`expr $ac_sed_frag + 1`
17211       ac_beg=$ac_end
17212       ac_end=`expr $ac_end + $ac_max_sed_lines`
17213     fi
17214   done
17215   if test -z "$ac_sed_cmds"; then
17216     ac_sed_cmds=cat
17217   fi
17218 fi # test -n "$CONFIG_FILES"
17219
17220 EOF
17221 cat >>$CONFIG_STATUS <<\EOF
17222 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17223   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17224   case $ac_file in
17225   - | *:- | *:-:* ) # input from stdin
17226         cat >$tmp/stdin
17227         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17228         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17229   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17230         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17231   * )   ac_file_in=$ac_file.in ;;
17232   esac
17233
17234   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17235   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17236          X"$ac_file" : 'X\(//\)[^/]' \| \
17237          X"$ac_file" : 'X\(//\)$' \| \
17238          X"$ac_file" : 'X\(/\)' \| \
17239          .     : '\(.\)' 2>/dev/null ||
17240 echo X"$ac_file" |
17241     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17242           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17243           /^X\(\/\/\)$/{ s//\1/; q; }
17244           /^X\(\/\).*/{ s//\1/; q; }
17245           s/.*/./; q'`
17246   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17247     { case "$ac_dir" in
17248   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17249   *)                      as_incr_dir=.;;
17250 esac
17251 as_dummy="$ac_dir"
17252 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17253   case $as_mkdir_dir in
17254     # Skip DOS drivespec
17255     ?:) as_incr_dir=$as_mkdir_dir ;;
17256     *)
17257       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17258       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17259     ;;
17260   esac
17261 done; }
17262
17263     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17264     # A "../" for each directory in $ac_dir_suffix.
17265     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17266   else
17267     ac_dir_suffix= ac_dots=
17268   fi
17269
17270   case $srcdir in
17271   .)  ac_srcdir=.
17272       if test -z "$ac_dots"; then
17273          ac_top_srcdir=.
17274       else
17275          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17276       fi ;;
17277   [\\/]* | ?:[\\/]* )
17278       ac_srcdir=$srcdir$ac_dir_suffix;
17279       ac_top_srcdir=$srcdir ;;
17280   *) # Relative path.
17281     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17282     ac_top_srcdir=$ac_dots$srcdir ;;
17283   esac
17284
17285   case $INSTALL in
17286   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17287   *) ac_INSTALL=$ac_dots$INSTALL ;;
17288   esac
17289
17290   if test x"$ac_file" != x-; then
17291     { echo "$as_me:17291: creating $ac_file" >&5
17292 echo "$as_me: creating $ac_file" >&6;}
17293     rm -f "$ac_file"
17294   fi
17295   # Let's still pretend it is `configure' which instantiates (i.e., don't
17296   # use $as_me), people would be surprised to read:
17297   #    /* config.h.  Generated automatically by config.status.  */
17298   configure_input="Generated automatically from `echo $ac_file_in |
17299                                                  sed 's,.*/,,'` by configure."
17300
17301   # First look for the input files in the build tree, otherwise in the
17302   # src tree.
17303   ac_file_inputs=`IFS=:
17304     for f in $ac_file_in; do
17305       case $f in
17306       -) echo $tmp/stdin ;;
17307       [\\/$]*)
17308          # Absolute (can't be DOS-style, as IFS=:)
17309          test -f "$f" || { { echo "$as_me:17309: error: cannot find input file: $f" >&5
17310 echo "$as_me: error: cannot find input file: $f" >&2;}
17311    { (exit 1); exit 1; }; }
17312          echo $f;;
17313       *) # Relative
17314          if test -f "$f"; then
17315            # Build tree
17316            echo $f
17317          elif test -f "$srcdir/$f"; then
17318            # Source tree
17319            echo $srcdir/$f
17320          else
17321            # /dev/null tree
17322            { { echo "$as_me:17322: error: cannot find input file: $f" >&5
17323 echo "$as_me: error: cannot find input file: $f" >&2;}
17324    { (exit 1); exit 1; }; }
17325          fi;;
17326       esac
17327     done` || { (exit 1); exit 1; }
17328 EOF
17329 cat >>$CONFIG_STATUS <<\EOF
17330   ac_warn_datarootdir=no
17331   if test x"$ac_file" != x-; then
17332     for ac_item in $ac_file_inputs
17333     do
17334       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17335       if test -n "$ac_seen"; then
17336         ac_used=`grep '@datarootdir@' $ac_item`
17337         if test -z "$ac_used"; then
17338           { echo "$as_me:17338: WARNING: datarootdir was used implicitly but not set:
17339 $ac_seen" >&5
17340 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17341 $ac_seen" >&2;}
17342           ac_warn_datarootdir=yes
17343         fi
17344       fi
17345       ac_seen=`grep '${datarootdir}' $ac_item`
17346       if test -n "$ac_seen"; then
17347         { echo "$as_me:17347: WARNING: datarootdir was used explicitly but not set:
17348 $ac_seen" >&5
17349 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17350 $ac_seen" >&2;}
17351         ac_warn_datarootdir=yes
17352       fi
17353     done
17354   fi
17355
17356 if test "x$ac_warn_datarootdir" = xyes; then
17357   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17358 fi
17359
17360 EOF
17361 cat >>$CONFIG_STATUS <<EOF
17362   sed "$ac_vpsub
17363 $extrasub
17364 EOF
17365 cat >>$CONFIG_STATUS <<\EOF
17366 :t
17367 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17368 s,@configure_input@,$configure_input,;t t
17369 s,@srcdir@,$ac_srcdir,;t t
17370 s,@top_srcdir@,$ac_top_srcdir,;t t
17371 s,@INSTALL@,$ac_INSTALL,;t t
17372 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17373   rm -f $tmp/stdin
17374   if test x"$ac_file" != x-; then
17375     cp $tmp/out $ac_file
17376
17377     for ac_name in prefix exec_prefix datarootdir
17378     do
17379         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17380         if test -n "$ac_seen"; then
17381             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17382             if test -z "$ac_init"; then
17383               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17384               { echo "$as_me:17384: WARNING: Variable $ac_name is used but was not set:
17385 $ac_seen" >&5
17386 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17387 $ac_seen" >&2;}
17388             fi
17389         fi
17390     done
17391     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17392     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17393     if test -s $tmp/out; then
17394       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17395       { echo "$as_me:17395: WARNING: Some variables may not be substituted:
17396 $ac_seen" >&5
17397 echo "$as_me: WARNING: Some variables may not be substituted:
17398 $ac_seen" >&2;}
17399     fi
17400   else
17401     cat $tmp/out
17402   fi
17403   rm -f $tmp/out
17404
17405 done
17406 EOF
17407 cat >>$CONFIG_STATUS <<\EOF
17408
17409 #
17410 # CONFIG_HEADER section.
17411 #
17412
17413 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17414 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17415 #
17416 # ac_d sets the value in "#define NAME VALUE" lines.
17417 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17418 ac_dB='[        ].*$,\1#\2'
17419 ac_dC=' '
17420 ac_dD=',;t'
17421 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17422 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17423 ac_iB='\([      ]\),\1#\2define\3'
17424 ac_iC=' '
17425 ac_iD='\4,;t'
17426 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17427 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17428 ac_uB='$,\1#\2define\3'
17429 ac_uC=' '
17430 ac_uD=',;t'
17431
17432 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17433   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17434   case $ac_file in
17435   - | *:- | *:-:* ) # input from stdin
17436         cat >$tmp/stdin
17437         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17438         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17439   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17440         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17441   * )   ac_file_in=$ac_file.in ;;
17442   esac
17443
17444   test x"$ac_file" != x- && { echo "$as_me:17444: creating $ac_file" >&5
17445 echo "$as_me: creating $ac_file" >&6;}
17446
17447   # First look for the input files in the build tree, otherwise in the
17448   # src tree.
17449   ac_file_inputs=`IFS=:
17450     for f in $ac_file_in; do
17451       case $f in
17452       -) echo $tmp/stdin ;;
17453       [\\/$]*)
17454          # Absolute (can't be DOS-style, as IFS=:)
17455          test -f "$f" || { { echo "$as_me:17455: error: cannot find input file: $f" >&5
17456 echo "$as_me: error: cannot find input file: $f" >&2;}
17457    { (exit 1); exit 1; }; }
17458          echo $f;;
17459       *) # Relative
17460          if test -f "$f"; then
17461            # Build tree
17462            echo $f
17463          elif test -f "$srcdir/$f"; then
17464            # Source tree
17465            echo $srcdir/$f
17466          else
17467            # /dev/null tree
17468            { { echo "$as_me:17468: error: cannot find input file: $f" >&5
17469 echo "$as_me: error: cannot find input file: $f" >&2;}
17470    { (exit 1); exit 1; }; }
17471          fi;;
17472       esac
17473     done` || { (exit 1); exit 1; }
17474   # Remove the trailing spaces.
17475   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17476
17477 EOF
17478
17479 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17480 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17481 # be either 'cat' or 'sort'.
17482 cat confdefs.h | uniq >conftest.vals
17483
17484 # Break up conftest.vals because some shells have a limit on
17485 # the size of here documents, and old seds have small limits too.
17486
17487 rm -f conftest.tail
17488 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17489 while grep . conftest.vals >/dev/null
17490 do
17491   # Write chunks of a limited-size here document to conftest.frag.
17492   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17493   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17494   echo 'CEOF' >> $CONFIG_STATUS
17495   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17496   rm -f conftest.vals
17497   mv conftest.tail conftest.vals
17498 done
17499 rm -f conftest.vals
17500
17501 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17502 # marker @DEFS@.
17503 echo '  cat >> conftest.edit <<CEOF
17504 /@DEFS@/r conftest.frag
17505 /@DEFS@/d
17506 CEOF
17507 sed -f conftest.edit $tmp/in > $tmp/out
17508 rm -f $tmp/in
17509 mv $tmp/out $tmp/in
17510 rm -f conftest.edit conftest.frag
17511 ' >> $CONFIG_STATUS
17512
17513 cat >>$CONFIG_STATUS <<\EOF
17514   # Let's still pretend it is `configure' which instantiates (i.e., don't
17515   # use $as_me), people would be surprised to read:
17516   #    /* config.h.  Generated automatically by config.status.  */
17517   if test x"$ac_file" = x-; then
17518     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17519   else
17520     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17521   fi
17522   cat $tmp/in >>$tmp/config.h
17523   rm -f $tmp/in
17524   if test x"$ac_file" != x-; then
17525     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17526       { echo "$as_me:17526: $ac_file is unchanged" >&5
17527 echo "$as_me: $ac_file is unchanged" >&6;}
17528     else
17529       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17530          X"$ac_file" : 'X\(//\)[^/]' \| \
17531          X"$ac_file" : 'X\(//\)$' \| \
17532          X"$ac_file" : 'X\(/\)' \| \
17533          .     : '\(.\)' 2>/dev/null ||
17534 echo X"$ac_file" |
17535     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17536           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17537           /^X\(\/\/\)$/{ s//\1/; q; }
17538           /^X\(\/\).*/{ s//\1/; q; }
17539           s/.*/./; q'`
17540       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17541         { case "$ac_dir" in
17542   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17543   *)                      as_incr_dir=.;;
17544 esac
17545 as_dummy="$ac_dir"
17546 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17547   case $as_mkdir_dir in
17548     # Skip DOS drivespec
17549     ?:) as_incr_dir=$as_mkdir_dir ;;
17550     *)
17551       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17552       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17553     ;;
17554   esac
17555 done; }
17556
17557       fi
17558       rm -f $ac_file
17559       mv $tmp/config.h $ac_file
17560     fi
17561   else
17562     cat $tmp/config.h
17563     rm -f $tmp/config.h
17564   fi
17565 done
17566 EOF
17567 cat >>$CONFIG_STATUS <<\EOF
17568 #
17569 # CONFIG_COMMANDS section.
17570 #
17571 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17572   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17573   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17574
17575   case $ac_dest in
17576     default )
17577 if test -z "$USE_OLD_MAKERULES" ; then
17578         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17579 fi
17580  ;;
17581   esac
17582 done
17583 EOF
17584
17585 cat >>$CONFIG_STATUS <<\EOF
17586
17587 { (exit 0); exit 0; }
17588 EOF
17589 chmod +x $CONFIG_STATUS
17590 ac_clean_files=$ac_clean_files_save
17591
17592 # configure is writing to config.log, and then calls config.status.
17593 # config.status does its own redirection, appending to config.log.
17594 # Unfortunately, on DOS this fails, as config.log is still kept open
17595 # by configure, so config.status won't be able to write to it; its
17596 # output is simply discarded.  So we exec the FD to /dev/null,
17597 # effectively closing config.log, so it can be properly (re)opened and
17598 # appended to by config.status.  When coming back to configure, we
17599 # need to make the FD available again.
17600 if test "$no_create" != yes; then
17601   ac_cs_success=:
17602   exec 5>/dev/null
17603   $SHELL $CONFIG_STATUS || ac_cs_success=false
17604   exec 5>>config.log
17605   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17606   # would make configure fail if this is the last instruction.
17607   $ac_cs_success || { (exit 1); exit 1; }
17608 fi
17609 ${MAKE:-make} preinstall