]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
f9047c5eb0b9621d91b85e54abda8b1904e18160
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.66 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20181006.
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
752 Some influential environment variables:
753   CC          C compiler command
754   CFLAGS      C compiler flags
755   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
756               nonstandard directory <lib dir>
757   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
758               headers in a nonstandard directory <include dir>
759   CPP         C preprocessor
760
761 Use these variables to override the choices made by `configure' or to help
762 it to find libraries and programs with nonstandard names/locations.
763
764 EOF
765 fi
766
767 if test "$ac_init_help" = "recursive"; then
768   # If there are subdirs, report their specific --help.
769   ac_popdir=`pwd`
770   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
771     cd $ac_subdir
772     # A "../" for each directory in /$ac_subdir.
773     ac_dots=`echo $ac_subdir |
774              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
775
776     case $srcdir in
777     .) # No --srcdir option.  We are building in place.
778       ac_sub_srcdir=$srcdir ;;
779     [\\/]* | ?:[\\/]* ) # Absolute path.
780       ac_sub_srcdir=$srcdir/$ac_subdir ;;
781     *) # Relative path.
782       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
783     esac
784
785     # Check for guested configure; otherwise get Cygnus style configure.
786     if test -f $ac_sub_srcdir/configure.gnu; then
787       echo
788       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
789     elif test -f $ac_sub_srcdir/configure; then
790       echo
791       $SHELL $ac_sub_srcdir/configure  --help=recursive
792     elif test -f $ac_sub_srcdir/configure.ac ||
793            test -f $ac_sub_srcdir/configure.in; then
794       echo
795       $ac_configure --help
796     else
797       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
798     fi
799     cd $ac_popdir
800   done
801 fi
802
803 test -n "$ac_init_help" && exit 0
804 if $ac_init_version; then
805   cat <<\EOF
806
807 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
808 Free Software Foundation, Inc.
809 This configure script is free software; the Free Software Foundation
810 gives unlimited permission to copy, distribute and modify it.
811 EOF
812   exit 0
813 fi
814 exec 5>config.log
815 cat >&5 <<EOF
816 This file contains any messages produced by compilers while
817 running configure, to aid debugging if configure makes a mistake.
818
819 It was created by $as_me, which was
820 generated by GNU Autoconf 2.52.20181006.  Invocation command line was
821
822   $ $0 $@
823
824 EOF
825 {
826 cat <<_ASUNAME
827 ## ---------- ##
828 ## Platform.  ##
829 ## ---------- ##
830
831 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
832 uname -m = `(uname -m) 2>/dev/null || echo unknown`
833 uname -r = `(uname -r) 2>/dev/null || echo unknown`
834 uname -s = `(uname -s) 2>/dev/null || echo unknown`
835 uname -v = `(uname -v) 2>/dev/null || echo unknown`
836
837 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
838 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
839
840 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
841 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
842 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
843 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
844 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
845 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
846 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
847
848 PATH = $PATH
849
850 _ASUNAME
851 } >&5
852
853 cat >&5 <<EOF
854 ## ------------ ##
855 ## Core tests.  ##
856 ## ------------ ##
857
858 EOF
859
860 # Keep a trace of the command line.
861 # Strip out --no-create and --no-recursion so they do not pile up.
862 # Also quote any args containing shell meta-characters.
863 ac_configure_args=
864 ac_sep=
865 for ac_arg
866 do
867   case $ac_arg in
868   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
869   | --no-cr | --no-c) ;;
870   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
871   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
872   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
873     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
874     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
875     ac_sep=" " ;;
876   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
877      ac_sep=" " ;;
878   esac
879   # Get rid of the leading space.
880 done
881
882 # When interrupted or exit'd, cleanup temporary files, and complete
883 # config.log.  We remove comments because anyway the quotes in there
884 # would cause problems or look ugly.
885 trap 'exit_status=$?
886   # Save into config.log some information that might help in debugging.
887   echo >&5
888   echo "## ----------------- ##" >&5
889   echo "## Cache variables.  ##" >&5
890   echo "## ----------------- ##" >&5
891   echo >&5
892   # The following way of writing the cache mishandles newlines in values,
893 {
894   (set) 2>&1 |
895     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
896     *ac_space=\ *)
897       sed -n \
898         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
899           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
900       ;;
901     *)
902       sed -n \
903         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
904       ;;
905     esac;
906 } >&5
907   sed "/^$/d" confdefs.h >conftest.log
908   if test -s conftest.log; then
909     echo >&5
910     echo "## ------------ ##" >&5
911     echo "## confdefs.h.  ##" >&5
912     echo "## ------------ ##" >&5
913     echo >&5
914     cat conftest.log >&5
915   fi
916   (echo; echo) >&5
917   test "$ac_signal" != 0 &&
918     echo "$as_me: caught signal $ac_signal" >&5
919   echo "$as_me: exit $exit_status" >&5
920   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
921     exit $exit_status
922      ' 0
923 for ac_signal in 1 2 13 15; do
924   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
925 done
926 ac_signal=0
927
928 # confdefs.h avoids OS command line length limits that DEFS can exceed.
929 rm -rf conftest* confdefs.h
930 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
931 echo >confdefs.h
932
933 # Let the site file select an alternate cache file if it wants to.
934 # Prefer explicitly selected file to automatically selected ones.
935 if test -z "$CONFIG_SITE"; then
936   if test "x$prefix" != xNONE; then
937     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
938   else
939     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
940   fi
941 fi
942 for ac_site_file in $CONFIG_SITE; do
943   if test -r "$ac_site_file"; then
944     { echo "$as_me:944: loading site script $ac_site_file" >&5
945 echo "$as_me: loading site script $ac_site_file" >&6;}
946     cat "$ac_site_file" >&5
947     . "$ac_site_file"
948   fi
949 done
950
951 if test -r "$cache_file"; then
952   # Some versions of bash will fail to source /dev/null (special
953   # files actually), so we avoid doing that.
954   if test -f "$cache_file"; then
955     { echo "$as_me:955: loading cache $cache_file" >&5
956 echo "$as_me: loading cache $cache_file" >&6;}
957     case $cache_file in
958       [\\/]* | ?:[\\/]* ) . $cache_file;;
959       *)                      . ./$cache_file;;
960     esac
961   fi
962 else
963   { echo "$as_me:963: creating cache $cache_file" >&5
964 echo "$as_me: creating cache $cache_file" >&6;}
965   >$cache_file
966 fi
967
968 # Check that the precious variables saved in the cache have kept the same
969 # value.
970 ac_cache_corrupted=false
971 for ac_var in `(set) 2>&1 |
972                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
973   eval ac_old_set=\$ac_cv_env_${ac_var}_set
974   eval ac_new_set=\$ac_env_${ac_var}_set
975   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
976   eval ac_new_val="\$ac_env_${ac_var}_value"
977   case $ac_old_set,$ac_new_set in
978     set,)
979       { echo "$as_me:979: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
980 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
981       ac_cache_corrupted=: ;;
982     ,set)
983       { echo "$as_me:983: error: \`$ac_var' was not set in the previous run" >&5
984 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
985       ac_cache_corrupted=: ;;
986     ,);;
987     *)
988       if test "x$ac_old_val" != "x$ac_new_val"; then
989         { echo "$as_me:989: error: \`$ac_var' has changed since the previous run:" >&5
990 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
991         { echo "$as_me:991:   former value:  $ac_old_val" >&5
992 echo "$as_me:   former value:  $ac_old_val" >&2;}
993         { echo "$as_me:993:   current value: $ac_new_val" >&5
994 echo "$as_me:   current value: $ac_new_val" >&2;}
995         ac_cache_corrupted=:
996       fi;;
997   esac
998   # Pass precious variables to config.status.  It doesn't matter if
999   # we pass some twice (in addition to the command line arguments).
1000   if test "$ac_new_set" = set; then
1001     case $ac_new_val in
1002     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1003       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1004       ac_configure_args="$ac_configure_args '$ac_arg'"
1005       ;;
1006     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1007        ;;
1008     esac
1009   fi
1010 done
1011 if $ac_cache_corrupted; then
1012   { echo "$as_me:1012: error: changes in the environment can compromise the build" >&5
1013 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1014   { { echo "$as_me:1014: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1015 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1016    { (exit 1); exit 1; }; }
1017 fi
1018
1019 ac_ext=c
1020 ac_cpp='$CPP $CPPFLAGS'
1021 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1022 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1023 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1024 ac_main_return=return
1025
1026 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1027   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1028                    ECHO_T='     ' ;;
1029   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1030   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1031 esac
1032 echo "#! $SHELL" >conftest.sh
1033 echo  "exit 0"   >>conftest.sh
1034 chmod +x conftest.sh
1035 if { (echo "$as_me:1035: PATH=\".;.\"; conftest.sh") >&5
1036   (PATH=".;."; conftest.sh) 2>&5
1037   ac_status=$?
1038   echo "$as_me:1038: \$? = $ac_status" >&5
1039   (exit $ac_status); }; then
1040   ac_path_separator=';'
1041 else
1042   ac_path_separator=:
1043 fi
1044 PATH_SEPARATOR="$ac_path_separator"
1045 rm -f conftest.sh
1046
1047 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1048
1049 top_builddir=`pwd`
1050
1051 ac_aux_dir=
1052 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1053   if test -f $ac_dir/install-sh; then
1054     ac_aux_dir=$ac_dir
1055     ac_install_sh="$ac_aux_dir/install-sh -c"
1056     break
1057   elif test -f $ac_dir/install.sh; then
1058     ac_aux_dir=$ac_dir
1059     ac_install_sh="$ac_aux_dir/install.sh -c"
1060     break
1061   elif test -f $ac_dir/shtool; then
1062     ac_aux_dir=$ac_dir
1063     ac_install_sh="$ac_aux_dir/shtool install -c"
1064     break
1065   fi
1066 done
1067 if test -z "$ac_aux_dir"; then
1068   { { echo "$as_me:1068: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1069 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1070    { (exit 1); exit 1; }; }
1071 fi
1072 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1073 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1074 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1075
1076 # Make sure we can run config.sub.
1077 $ac_config_sub sun4 >/dev/null 2>&1 ||
1078   { { echo "$as_me:1078: error: cannot run $ac_config_sub" >&5
1079 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1080    { (exit 1); exit 1; }; }
1081
1082 echo "$as_me:1082: checking build system type" >&5
1083 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1084 if test "${ac_cv_build+set}" = set; then
1085   echo $ECHO_N "(cached) $ECHO_C" >&6
1086 else
1087   ac_cv_build_alias=$build_alias
1088 test -z "$ac_cv_build_alias" &&
1089   ac_cv_build_alias=`$ac_config_guess`
1090 test -z "$ac_cv_build_alias" &&
1091   { { echo "$as_me:1091: error: cannot guess build type; you must specify one" >&5
1092 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1093    { (exit 1); exit 1; }; }
1094 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1095   { { echo "$as_me:1095: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1096 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1097    { (exit 1); exit 1; }; }
1098
1099 fi
1100 echo "$as_me:1100: result: $ac_cv_build" >&5
1101 echo "${ECHO_T}$ac_cv_build" >&6
1102 build=$ac_cv_build
1103 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1104 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1105 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1106
1107 echo "$as_me:1107: checking host system type" >&5
1108 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1109 if test "${ac_cv_host+set}" = set; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   ac_cv_host_alias=$host_alias
1113 test -z "$ac_cv_host_alias" &&
1114   ac_cv_host_alias=$ac_cv_build_alias
1115 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1116   { { echo "$as_me:1116: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1117 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1118    { (exit 1); exit 1; }; }
1119
1120 fi
1121 echo "$as_me:1121: result: $ac_cv_host" >&5
1122 echo "${ECHO_T}$ac_cv_host" >&6
1123 host=$ac_cv_host
1124 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1125 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1126 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1127
1128 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1129         echo "$as_me:1129: checking target system type" >&5
1130 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1131 if test "${ac_cv_target+set}" = set; then
1132   echo $ECHO_N "(cached) $ECHO_C" >&6
1133 else
1134   ac_cv_target_alias=$target_alias
1135 test "x$ac_cv_target_alias" = "x" &&
1136   ac_cv_target_alias=$ac_cv_host_alias
1137 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1138   { { echo "$as_me:1138: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1139 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1140    { (exit 1); exit 1; }; }
1141
1142 fi
1143 echo "$as_me:1143: result: $ac_cv_target" >&5
1144 echo "${ECHO_T}$ac_cv_target" >&6
1145 target=$ac_cv_target
1146 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1147 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1148 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1149
1150 # The aliases save the names the user supplied, while $host etc.
1151 # will get canonicalized.
1152 test -n "$target_alias" &&
1153   test "$program_prefix$program_suffix$program_transform_name" = \
1154     NONENONEs,x,x, &&
1155   program_prefix=${target_alias}-
1156         system_name="$host_os"
1157 else
1158         system_name="`(uname -s -r) 2>/dev/null`"
1159         if test -z "$system_name" ; then
1160                 system_name="`(hostname) 2>/dev/null`"
1161         fi
1162 fi
1163 test -n "$system_name" &&
1164 cat >>confdefs.h <<EOF
1165 #define SYSTEM_NAME "$system_name"
1166 EOF
1167
1168 if test "${cf_cv_system_name+set}" = set; then
1169   echo $ECHO_N "(cached) $ECHO_C" >&6
1170 else
1171   cf_cv_system_name="$system_name"
1172 fi
1173
1174 test -z "$system_name" && system_name="$cf_cv_system_name"
1175 test -n "$cf_cv_system_name" && echo "$as_me:1175: result: Configuring for $cf_cv_system_name" >&5
1176 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1177
1178 if test ".$system_name" != ".$cf_cv_system_name" ; then
1179         echo "$as_me:1179: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1180 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1181         { { echo "$as_me:1181: error: \"Please remove config.cache and try again.\"" >&5
1182 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1183    { (exit 1); exit 1; }; }
1184 fi
1185
1186 # Check whether --with-system-type or --without-system-type was given.
1187 if test "${with_system_type+set}" = set; then
1188   withval="$with_system_type"
1189   { echo "$as_me:1189: WARNING: overriding system type to $withval" >&5
1190 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1191         cf_cv_system_name=$withval
1192         host_os=$withval
1193
1194 fi;
1195
1196 ###     Save the given $CFLAGS to allow user-override.
1197 cf_user_CFLAGS="$CFLAGS"
1198
1199 ###     Default install-location
1200
1201 echo "$as_me:1201: checking for prefix" >&5
1202 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1203 if test "x$prefix" = "xNONE" ; then
1204         case "$cf_cv_system_name" in
1205                 # non-vendor systems don't have a conflict
1206         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1207                 prefix=/usr
1208                 ;;
1209         (*)     prefix=$ac_default_prefix
1210                 ;;
1211         esac
1212 fi
1213 echo "$as_me:1213: result: $prefix" >&5
1214 echo "${ECHO_T}$prefix" >&6
1215
1216 if test "x$prefix" = "xNONE" ; then
1217 echo "$as_me:1217: checking for default include-directory" >&5
1218 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1219 test -n "$verbose" && echo 1>&6
1220 for cf_symbol in \
1221         $includedir \
1222         $includedir/ncurses \
1223         $prefix/include \
1224         $prefix/include/ncurses \
1225         /usr/local/include \
1226         /usr/local/include/ncurses \
1227         /usr/include \
1228         /usr/include/ncurses
1229 do
1230         cf_dir=`eval echo $cf_symbol`
1231         if test -f $cf_dir/curses.h ; then
1232         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1233                 includedir="$cf_symbol"
1234                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1235                 break
1236         fi
1237         fi
1238         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1239 done
1240 echo "$as_me:1240: result: $includedir" >&5
1241 echo "${ECHO_T}$includedir" >&6
1242 fi
1243
1244 ###     Checks for programs.
1245
1246 ac_ext=c
1247 ac_cpp='$CPP $CPPFLAGS'
1248 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1249 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1250 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1251 ac_main_return=return
1252 if test -n "$ac_tool_prefix"; then
1253   for ac_prog in gnatgcc gcc cc
1254   do
1255     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1256 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1257 echo "$as_me:1257: checking for $ac_word" >&5
1258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1259 if test "${ac_cv_prog_CC+set}" = set; then
1260   echo $ECHO_N "(cached) $ECHO_C" >&6
1261 else
1262   if test -n "$CC"; then
1263   ac_cv_prog_CC="$CC" # Let the user override the test.
1264 else
1265   ac_save_IFS=$IFS; IFS=$ac_path_separator
1266 ac_dummy="$PATH"
1267 for ac_dir in $ac_dummy; do
1268   IFS=$ac_save_IFS
1269   test -z "$ac_dir" && ac_dir=.
1270   $as_executable_p "$ac_dir/$ac_word" || continue
1271 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1272 echo "$as_me:1272: found $ac_dir/$ac_word" >&5
1273 break
1274 done
1275
1276 fi
1277 fi
1278 CC=$ac_cv_prog_CC
1279 if test -n "$CC"; then
1280   echo "$as_me:1280: result: $CC" >&5
1281 echo "${ECHO_T}$CC" >&6
1282 else
1283   echo "$as_me:1283: result: no" >&5
1284 echo "${ECHO_T}no" >&6
1285 fi
1286
1287     test -n "$CC" && break
1288   done
1289 fi
1290 if test -z "$CC"; then
1291   ac_ct_CC=$CC
1292   for ac_prog in gnatgcc gcc cc
1293 do
1294   # Extract the first word of "$ac_prog", so it can be a program name with args.
1295 set dummy $ac_prog; ac_word=$2
1296 echo "$as_me:1296: checking for $ac_word" >&5
1297 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1298 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1299   echo $ECHO_N "(cached) $ECHO_C" >&6
1300 else
1301   if test -n "$ac_ct_CC"; then
1302   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1303 else
1304   ac_save_IFS=$IFS; IFS=$ac_path_separator
1305 ac_dummy="$PATH"
1306 for ac_dir in $ac_dummy; do
1307   IFS=$ac_save_IFS
1308   test -z "$ac_dir" && ac_dir=.
1309   $as_executable_p "$ac_dir/$ac_word" || continue
1310 ac_cv_prog_ac_ct_CC="$ac_prog"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 fi
1316 fi
1317 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1318 if test -n "$ac_ct_CC"; then
1319   echo "$as_me:1319: result: $ac_ct_CC" >&5
1320 echo "${ECHO_T}$ac_ct_CC" >&6
1321 else
1322   echo "$as_me:1322: result: no" >&5
1323 echo "${ECHO_T}no" >&6
1324 fi
1325
1326   test -n "$ac_ct_CC" && break
1327 done
1328
1329   CC=$ac_ct_CC
1330 fi
1331
1332 test -z "$CC" && { { echo "$as_me:1332: error: no acceptable cc found in \$PATH" >&5
1333 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1334    { (exit 1); exit 1; }; }
1335
1336 # Provide some information about the compiler.
1337 echo "$as_me:1337:" \
1338      "checking for C compiler version" >&5
1339 ac_compiler=`set X $ac_compile; echo $2`
1340 { (eval echo "$as_me:1340: \"$ac_compiler --version </dev/null >&5\"") >&5
1341   (eval $ac_compiler --version </dev/null >&5) 2>&5
1342   ac_status=$?
1343   echo "$as_me:1343: \$? = $ac_status" >&5
1344   (exit $ac_status); }
1345 { (eval echo "$as_me:1345: \"$ac_compiler -v </dev/null >&5\"") >&5
1346   (eval $ac_compiler -v </dev/null >&5) 2>&5
1347   ac_status=$?
1348   echo "$as_me:1348: \$? = $ac_status" >&5
1349   (exit $ac_status); }
1350 { (eval echo "$as_me:1350: \"$ac_compiler -V </dev/null >&5\"") >&5
1351   (eval $ac_compiler -V </dev/null >&5) 2>&5
1352   ac_status=$?
1353   echo "$as_me:1353: \$? = $ac_status" >&5
1354   (exit $ac_status); }
1355
1356 cat >conftest.$ac_ext <<_ACEOF
1357 #line 1357 "configure"
1358 #include "confdefs.h"
1359
1360 int
1361 main (void)
1362 {
1363
1364   ;
1365   return 0;
1366 }
1367 _ACEOF
1368 ac_clean_files_save=$ac_clean_files
1369 ac_clean_files="$ac_clean_files a.out a.exe"
1370 # Try to create an executable without -o first, disregard a.out.
1371 # It will help us diagnose broken compilers, and finding out an intuition
1372 # of exeext.
1373 echo "$as_me:1373: checking for C compiler default output" >&5
1374 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1375 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1376 if { (eval echo "$as_me:1376: \"$ac_link_default\"") >&5
1377   (eval $ac_link_default) 2>&5
1378   ac_status=$?
1379   echo "$as_me:1379: \$? = $ac_status" >&5
1380   (exit $ac_status); }; then
1381   # Find the output, starting from the most likely.  This scheme is
1382 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1383 # resort.
1384 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1385                 ls a.out conftest 2>/dev/null;
1386                 ls a.* conftest.* 2>/dev/null`; do
1387   case $ac_file in
1388     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1389     a.out ) # We found the default executable, but exeext='' is most
1390             # certainly right.
1391             break;;
1392     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1393           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1394           export ac_cv_exeext
1395           break;;
1396     * ) break;;
1397   esac
1398 done
1399 else
1400   echo "$as_me: failed program was:" >&5
1401 cat conftest.$ac_ext >&5
1402 { { echo "$as_me:1402: error: C compiler cannot create executables" >&5
1403 echo "$as_me: error: C compiler cannot create executables" >&2;}
1404    { (exit 77); exit 77; }; }
1405 fi
1406
1407 ac_exeext=$ac_cv_exeext
1408 echo "$as_me:1408: result: $ac_file" >&5
1409 echo "${ECHO_T}$ac_file" >&6
1410
1411 # Check the compiler produces executables we can run.  If not, either
1412 # the compiler is broken, or we cross compile.
1413 echo "$as_me:1413: checking whether the C compiler works" >&5
1414 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1415 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1416 # If not cross compiling, check that we can run a simple program.
1417 if test "$cross_compiling" != yes; then
1418   if { ac_try='./$ac_file'
1419   { (eval echo "$as_me:1419: \"$ac_try\"") >&5
1420   (eval $ac_try) 2>&5
1421   ac_status=$?
1422   echo "$as_me:1422: \$? = $ac_status" >&5
1423   (exit $ac_status); }; }; then
1424     cross_compiling=no
1425   else
1426     if test "$cross_compiling" = maybe; then
1427         cross_compiling=yes
1428     else
1429         { { echo "$as_me:1429: error: cannot run C compiled programs.
1430 If you meant to cross compile, use \`--host'." >&5
1431 echo "$as_me: error: cannot run C compiled programs.
1432 If you meant to cross compile, use \`--host'." >&2;}
1433    { (exit 1); exit 1; }; }
1434     fi
1435   fi
1436 fi
1437 echo "$as_me:1437: result: yes" >&5
1438 echo "${ECHO_T}yes" >&6
1439
1440 rm -f a.out a.exe conftest$ac_cv_exeext
1441 ac_clean_files=$ac_clean_files_save
1442 # Check the compiler produces executables we can run.  If not, either
1443 # the compiler is broken, or we cross compile.
1444 echo "$as_me:1444: checking whether we are cross compiling" >&5
1445 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1446 echo "$as_me:1446: result: $cross_compiling" >&5
1447 echo "${ECHO_T}$cross_compiling" >&6
1448
1449 echo "$as_me:1449: checking for executable suffix" >&5
1450 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1451 if { (eval echo "$as_me:1451: \"$ac_link\"") >&5
1452   (eval $ac_link) 2>&5
1453   ac_status=$?
1454   echo "$as_me:1454: \$? = $ac_status" >&5
1455   (exit $ac_status); }; then
1456   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1457 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1458 # work properly (i.e., refer to `conftest.exe'), while it won't with
1459 # `rm'.
1460 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1461   case $ac_file in
1462     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1463     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1464           export ac_cv_exeext
1465           break;;
1466     * ) break;;
1467   esac
1468 done
1469 else
1470   { { echo "$as_me:1470: error: cannot compute EXEEXT: cannot compile and link" >&5
1471 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1472    { (exit 1); exit 1; }; }
1473 fi
1474
1475 rm -f conftest$ac_cv_exeext
1476 echo "$as_me:1476: result: $ac_cv_exeext" >&5
1477 echo "${ECHO_T}$ac_cv_exeext" >&6
1478
1479 rm -f conftest.$ac_ext
1480 EXEEXT=$ac_cv_exeext
1481 ac_exeext=$EXEEXT
1482 echo "$as_me:1482: checking for object suffix" >&5
1483 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1484 if test "${ac_cv_objext+set}" = set; then
1485   echo $ECHO_N "(cached) $ECHO_C" >&6
1486 else
1487   cat >conftest.$ac_ext <<_ACEOF
1488 #line 1488 "configure"
1489 #include "confdefs.h"
1490
1491 int
1492 main (void)
1493 {
1494
1495   ;
1496   return 0;
1497 }
1498 _ACEOF
1499 rm -f conftest.o conftest.obj
1500 if { (eval echo "$as_me:1500: \"$ac_compile\"") >&5
1501   (eval $ac_compile) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit $ac_status); }; then
1505   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1506   case $ac_file in
1507     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1508     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1509        break;;
1510   esac
1511 done
1512 else
1513   echo "$as_me: failed program was:" >&5
1514 cat conftest.$ac_ext >&5
1515 { { echo "$as_me:1515: error: cannot compute OBJEXT: cannot compile" >&5
1516 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1517    { (exit 1); exit 1; }; }
1518 fi
1519
1520 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1521 fi
1522 echo "$as_me:1522: result: $ac_cv_objext" >&5
1523 echo "${ECHO_T}$ac_cv_objext" >&6
1524 OBJEXT=$ac_cv_objext
1525 ac_objext=$OBJEXT
1526 echo "$as_me:1526: checking whether we are using the GNU C compiler" >&5
1527 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1528 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1529   echo $ECHO_N "(cached) $ECHO_C" >&6
1530 else
1531   cat >conftest.$ac_ext <<_ACEOF
1532 #line 1532 "configure"
1533 #include "confdefs.h"
1534
1535 int
1536 main (void)
1537 {
1538 #ifndef __GNUC__
1539        choke me
1540 #endif
1541
1542   ;
1543   return 0;
1544 }
1545 _ACEOF
1546 rm -f conftest.$ac_objext
1547 if { (eval echo "$as_me:1547: \"$ac_compile\"") >&5
1548   (eval $ac_compile) 2>&5
1549   ac_status=$?
1550   echo "$as_me:1550: \$? = $ac_status" >&5
1551   (exit $ac_status); } &&
1552          { ac_try='test -s conftest.$ac_objext'
1553   { (eval echo "$as_me:1553: \"$ac_try\"") >&5
1554   (eval $ac_try) 2>&5
1555   ac_status=$?
1556   echo "$as_me:1556: \$? = $ac_status" >&5
1557   (exit $ac_status); }; }; then
1558   ac_compiler_gnu=yes
1559 else
1560   echo "$as_me: failed program was:" >&5
1561 cat conftest.$ac_ext >&5
1562 ac_compiler_gnu=no
1563 fi
1564 rm -f conftest.$ac_objext conftest.$ac_ext
1565 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1566
1567 fi
1568 echo "$as_me:1568: result: $ac_cv_c_compiler_gnu" >&5
1569 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1570 GCC=`test $ac_compiler_gnu = yes && echo yes`
1571 ac_test_CFLAGS=${CFLAGS+set}
1572 ac_save_CFLAGS=$CFLAGS
1573 CFLAGS="-g"
1574 echo "$as_me:1574: checking whether $CC accepts -g" >&5
1575 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1576 if test "${ac_cv_prog_cc_g+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main (void)
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.$ac_objext
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); } &&
1597          { ac_try='test -s conftest.$ac_objext'
1598   { (eval echo "$as_me:1598: \"$ac_try\"") >&5
1599   (eval $ac_try) 2>&5
1600   ac_status=$?
1601   echo "$as_me:1601: \$? = $ac_status" >&5
1602   (exit $ac_status); }; }; then
1603   ac_cv_prog_cc_g=yes
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 ac_cv_prog_cc_g=no
1608 fi
1609 rm -f conftest.$ac_objext conftest.$ac_ext
1610 fi
1611 echo "$as_me:1611: result: $ac_cv_prog_cc_g" >&5
1612 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1613 if test "$ac_test_CFLAGS" = set; then
1614   CFLAGS=$ac_save_CFLAGS
1615 elif test $ac_cv_prog_cc_g = yes; then
1616   if test "$GCC" = yes; then
1617     CFLAGS="-g -O2"
1618   else
1619     CFLAGS="-g"
1620   fi
1621 else
1622   if test "$GCC" = yes; then
1623     CFLAGS="-O2"
1624   else
1625     CFLAGS=
1626   fi
1627 fi
1628 # Some people use a C++ compiler to compile C.  Since we use `exit',
1629 # in C++ we need to declare it.  In case someone uses the same compiler
1630 # for both compiling C and C++ we need to have the C++ compiler decide
1631 # the declaration of exit, since it's the most demanding environment.
1632 cat >conftest.$ac_ext <<_ACEOF
1633 #ifndef __cplusplus
1634   choke me
1635 #endif
1636 _ACEOF
1637 rm -f conftest.$ac_objext
1638 if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
1639   (eval $ac_compile) 2>&5
1640   ac_status=$?
1641   echo "$as_me:1641: \$? = $ac_status" >&5
1642   (exit $ac_status); } &&
1643          { ac_try='test -s conftest.$ac_objext'
1644   { (eval echo "$as_me:1644: \"$ac_try\"") >&5
1645   (eval $ac_try) 2>&5
1646   ac_status=$?
1647   echo "$as_me:1647: \$? = $ac_status" >&5
1648   (exit $ac_status); }; }; then
1649   for ac_declaration in \
1650    ''\
1651    '#include <stdlib.h>' \
1652    'extern "C" void std::exit (int) throw (); using std::exit;' \
1653    'extern "C" void std::exit (int); using std::exit;' \
1654    'extern "C" void exit (int) throw ();' \
1655    'extern "C" void exit (int);' \
1656    'void exit (int);'
1657 do
1658   cat >conftest.$ac_ext <<_ACEOF
1659 #line 1659 "configure"
1660 #include "confdefs.h"
1661 #include <stdlib.h>
1662 $ac_declaration
1663 int
1664 main (void)
1665 {
1666 exit (42);
1667   ;
1668   return 0;
1669 }
1670 _ACEOF
1671 rm -f conftest.$ac_objext
1672 if { (eval echo "$as_me:1672: \"$ac_compile\"") >&5
1673   (eval $ac_compile) 2>&5
1674   ac_status=$?
1675   echo "$as_me:1675: \$? = $ac_status" >&5
1676   (exit $ac_status); } &&
1677          { ac_try='test -s conftest.$ac_objext'
1678   { (eval echo "$as_me:1678: \"$ac_try\"") >&5
1679   (eval $ac_try) 2>&5
1680   ac_status=$?
1681   echo "$as_me:1681: \$? = $ac_status" >&5
1682   (exit $ac_status); }; }; then
1683   :
1684 else
1685   echo "$as_me: failed program was:" >&5
1686 cat conftest.$ac_ext >&5
1687 continue
1688 fi
1689 rm -f conftest.$ac_objext conftest.$ac_ext
1690   cat >conftest.$ac_ext <<_ACEOF
1691 #line 1691 "configure"
1692 #include "confdefs.h"
1693 $ac_declaration
1694 int
1695 main (void)
1696 {
1697 exit (42);
1698   ;
1699   return 0;
1700 }
1701 _ACEOF
1702 rm -f conftest.$ac_objext
1703 if { (eval echo "$as_me:1703: \"$ac_compile\"") >&5
1704   (eval $ac_compile) 2>&5
1705   ac_status=$?
1706   echo "$as_me:1706: \$? = $ac_status" >&5
1707   (exit $ac_status); } &&
1708          { ac_try='test -s conftest.$ac_objext'
1709   { (eval echo "$as_me:1709: \"$ac_try\"") >&5
1710   (eval $ac_try) 2>&5
1711   ac_status=$?
1712   echo "$as_me:1712: \$? = $ac_status" >&5
1713   (exit $ac_status); }; }; then
1714   break
1715 else
1716   echo "$as_me: failed program was:" >&5
1717 cat conftest.$ac_ext >&5
1718 fi
1719 rm -f conftest.$ac_objext conftest.$ac_ext
1720 done
1721 rm -rf conftest*
1722 if test -n "$ac_declaration"; then
1723   echo '#ifdef __cplusplus' >>confdefs.h
1724   echo $ac_declaration      >>confdefs.h
1725   echo '#endif'             >>confdefs.h
1726 fi
1727
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat conftest.$ac_ext >&5
1731 fi
1732 rm -f conftest.$ac_objext conftest.$ac_ext
1733 ac_ext=c
1734 ac_cpp='$CPP $CPPFLAGS'
1735 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1736 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1737 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1738 ac_main_return=return
1739
1740 GCC_VERSION=none
1741 if test "$GCC" = yes ; then
1742         echo "$as_me:1742: checking version of $CC" >&5
1743 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1744         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.].*//'`"
1745         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1746         echo "$as_me:1746: result: $GCC_VERSION" >&5
1747 echo "${ECHO_T}$GCC_VERSION" >&6
1748 fi
1749
1750 echo "$as_me:1750: checking for $CC option to accept ANSI C" >&5
1751 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1752 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1753   echo $ECHO_N "(cached) $ECHO_C" >&6
1754 else
1755   ac_cv_prog_cc_stdc=no
1756 ac_save_CC=$CC
1757 cat >conftest.$ac_ext <<_ACEOF
1758 #line 1758 "configure"
1759 #include "confdefs.h"
1760 #include <stdarg.h>
1761 #include <stdio.h>
1762 #include <sys/types.h>
1763 #include <sys/stat.h>
1764 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1765 struct buf { int x; };
1766 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1767 static char *e (p, i)
1768      char **p;
1769      int i;
1770 {
1771   return p[i];
1772 }
1773 static char *f (char * (*g) (char **, int), char **p, ...)
1774 {
1775   char *s;
1776   va_list v;
1777   va_start (v,p);
1778   s = g (p, va_arg (v,int));
1779   va_end (v);
1780   return s;
1781 }
1782 int test (int i, double x);
1783 struct s1 {int (*f) (int a);};
1784 struct s2 {int (*f) (double a);};
1785 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1786 int argc;
1787 char **argv;
1788 int
1789 main (void)
1790 {
1791 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1792   ;
1793   return 0;
1794 }
1795 _ACEOF
1796 # Don't try gcc -ansi; that turns off useful extensions and
1797 # breaks some systems' header files.
1798 # AIX                   -qlanglvl=ansi
1799 # Ultrix and OSF/1      -std1
1800 # HP-UX 10.20 and later -Ae
1801 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1802 # SVR4                  -Xc -D__EXTENSIONS__
1803 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1804 do
1805   CC="$ac_save_CC $ac_arg"
1806   rm -f conftest.$ac_objext
1807 if { (eval echo "$as_me:1807: \"$ac_compile\"") >&5
1808   (eval $ac_compile) 2>&5
1809   ac_status=$?
1810   echo "$as_me:1810: \$? = $ac_status" >&5
1811   (exit $ac_status); } &&
1812          { ac_try='test -s conftest.$ac_objext'
1813   { (eval echo "$as_me:1813: \"$ac_try\"") >&5
1814   (eval $ac_try) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit $ac_status); }; }; then
1818   ac_cv_prog_cc_stdc=$ac_arg
1819 break
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext
1825 done
1826 rm -f conftest.$ac_ext conftest.$ac_objext
1827 CC=$ac_save_CC
1828
1829 fi
1830
1831 case "x$ac_cv_prog_cc_stdc" in
1832   x|xno)
1833     echo "$as_me:1833: result: none needed" >&5
1834 echo "${ECHO_T}none needed" >&6 ;;
1835   *)
1836     echo "$as_me:1836: result: $ac_cv_prog_cc_stdc" >&5
1837 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1838     CC="$CC $ac_cv_prog_cc_stdc" ;;
1839 esac
1840
1841 # This should have been defined by AC_PROG_CC
1842 : ${CC:=cc}
1843
1844 echo "$as_me:1844: checking \$CFLAGS variable" >&5
1845 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1846 case "x$CFLAGS" in
1847 (*-[IUD]*)
1848         echo "$as_me:1848: result: broken" >&5
1849 echo "${ECHO_T}broken" >&6
1850         { echo "$as_me:1850: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1851 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1852         cf_flags="$CFLAGS"
1853         CFLAGS=
1854         for cf_arg in $cf_flags
1855         do
1856
1857 cf_fix_cppflags=no
1858 cf_new_cflags=
1859 cf_new_cppflags=
1860 cf_new_extra_cppflags=
1861
1862 for cf_add_cflags in $cf_arg
1863 do
1864 case $cf_fix_cppflags in
1865 (no)
1866         case $cf_add_cflags in
1867         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1868                 case $cf_add_cflags in
1869                 (-D*)
1870                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1871
1872                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1873                                 && test -z "${cf_tst_cflags}" \
1874                                 && cf_fix_cppflags=yes
1875
1876                         if test $cf_fix_cppflags = yes ; then
1877
1878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1880
1881                                 continue
1882                         elif test "${cf_tst_cflags}" = "\"'" ; then
1883
1884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1886
1887                                 continue
1888                         fi
1889                         ;;
1890                 esac
1891                 case "$CPPFLAGS" in
1892                 (*$cf_add_cflags)
1893                         ;;
1894                 (*)
1895                         case $cf_add_cflags in
1896                         (-D*)
1897                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1898
1899 CPPFLAGS=`echo "$CPPFLAGS" | \
1900         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1901                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1902
1903                                 ;;
1904                         esac
1905
1906         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
1907         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
1908
1909                         ;;
1910                 esac
1911                 ;;
1912         (*)
1913
1914         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
1915         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
1916
1917                 ;;
1918         esac
1919         ;;
1920 (yes)
1921
1922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1924
1925         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1926
1927         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1928                 && test -z "${cf_tst_cflags}" \
1929                 && cf_fix_cppflags=no
1930         ;;
1931 esac
1932 done
1933
1934 if test -n "$cf_new_cflags" ; then
1935
1936         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1937         CFLAGS="${CFLAGS}$cf_new_cflags"
1938
1939 fi
1940
1941 if test -n "$cf_new_cppflags" ; then
1942
1943         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
1944         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
1945
1946 fi
1947
1948 if test -n "$cf_new_extra_cppflags" ; then
1949
1950         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
1951         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
1952
1953 fi
1954
1955         done
1956         ;;
1957 (*)
1958         echo "$as_me:1958: result: ok" >&5
1959 echo "${ECHO_T}ok" >&6
1960         ;;
1961 esac
1962
1963 echo "$as_me:1963: checking \$CC variable" >&5
1964 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1965 case "$CC" in
1966 (*[\ \  ]-*)
1967         echo "$as_me:1967: result: broken" >&5
1968 echo "${ECHO_T}broken" >&6
1969         { echo "$as_me:1969: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1970 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1971         # humor him...
1972         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1973         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1974         CC="$cf_prog"
1975         for cf_arg in $cf_flags
1976         do
1977                 case "x$cf_arg" in
1978                 (x-[IUDfgOW]*)
1979
1980 cf_fix_cppflags=no
1981 cf_new_cflags=
1982 cf_new_cppflags=
1983 cf_new_extra_cppflags=
1984
1985 for cf_add_cflags in $cf_arg
1986 do
1987 case $cf_fix_cppflags in
1988 (no)
1989         case $cf_add_cflags in
1990         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1991                 case $cf_add_cflags in
1992                 (-D*)
1993                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1994
1995                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1996                                 && test -z "${cf_tst_cflags}" \
1997                                 && cf_fix_cppflags=yes
1998
1999                         if test $cf_fix_cppflags = yes ; then
2000
2001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2003
2004                                 continue
2005                         elif test "${cf_tst_cflags}" = "\"'" ; then
2006
2007         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2008         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2009
2010                                 continue
2011                         fi
2012                         ;;
2013                 esac
2014                 case "$CPPFLAGS" in
2015                 (*$cf_add_cflags)
2016                         ;;
2017                 (*)
2018                         case $cf_add_cflags in
2019                         (-D*)
2020                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2021
2022 CPPFLAGS=`echo "$CPPFLAGS" | \
2023         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2024                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2025
2026                                 ;;
2027                         esac
2028
2029         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2030         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2031
2032                         ;;
2033                 esac
2034                 ;;
2035         (*)
2036
2037         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2038         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2039
2040                 ;;
2041         esac
2042         ;;
2043 (yes)
2044
2045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2047
2048         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2049
2050         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2051                 && test -z "${cf_tst_cflags}" \
2052                 && cf_fix_cppflags=no
2053         ;;
2054 esac
2055 done
2056
2057 if test -n "$cf_new_cflags" ; then
2058
2059         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2060         CFLAGS="${CFLAGS}$cf_new_cflags"
2061
2062 fi
2063
2064 if test -n "$cf_new_cppflags" ; then
2065
2066         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2067         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2068
2069 fi
2070
2071 if test -n "$cf_new_extra_cppflags" ; then
2072
2073         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2074         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2075
2076 fi
2077
2078                         ;;
2079                 (*)
2080                         CC="$CC $cf_arg"
2081                         ;;
2082                 esac
2083         done
2084         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2085
2086 echo "${as_me:-configure}:2086: testing resulting CC: '$CC' ..." 1>&5
2087
2088         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2089
2090 echo "${as_me:-configure}:2090: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2091
2092         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2093
2094 echo "${as_me:-configure}:2094: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2095
2096         ;;
2097 (*)
2098         echo "$as_me:2098: result: ok" >&5
2099 echo "${ECHO_T}ok" >&6
2100         ;;
2101 esac
2102
2103 ac_ext=c
2104 ac_cpp='$CPP $CPPFLAGS'
2105 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2106 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2107 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2108 ac_main_return=return
2109 echo "$as_me:2109: checking how to run the C preprocessor" >&5
2110 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2111 # On Suns, sometimes $CPP names a directory.
2112 if test -n "$CPP" && test -d "$CPP"; then
2113   CPP=
2114 fi
2115 if test -z "$CPP"; then
2116   if test "${ac_cv_prog_CPP+set}" = set; then
2117   echo $ECHO_N "(cached) $ECHO_C" >&6
2118 else
2119       # Double quotes because CPP needs to be expanded
2120     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2121     do
2122       ac_preproc_ok=false
2123 for ac_c_preproc_warn_flag in '' yes
2124 do
2125   # Use a header file that comes with gcc, so configuring glibc
2126   # with a fresh cross-compiler works.
2127   # On the NeXT, cc -E runs the code through the compiler's parser,
2128   # not just through cpp. "Syntax error" is here to catch this case.
2129   cat >conftest.$ac_ext <<_ACEOF
2130 #line 2130 "configure"
2131 #include "confdefs.h"
2132 #include <assert.h>
2133                      Syntax error
2134 _ACEOF
2135 if { (eval echo "$as_me:2135: \"$ac_cpp conftest.$ac_ext\"") >&5
2136   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2137   ac_status=$?
2138   egrep -v '^ *\+' conftest.er1 >conftest.err
2139   rm -f conftest.er1
2140   cat conftest.err >&5
2141   echo "$as_me:2141: \$? = $ac_status" >&5
2142   (exit $ac_status); } >/dev/null; then
2143   if test -s conftest.err; then
2144     ac_cpp_err=$ac_c_preproc_warn_flag
2145   else
2146     ac_cpp_err=
2147   fi
2148 else
2149   ac_cpp_err=yes
2150 fi
2151 if test -z "$ac_cpp_err"; then
2152   :
2153 else
2154   echo "$as_me: failed program was:" >&5
2155   cat conftest.$ac_ext >&5
2156   # Broken: fails on valid input.
2157 continue
2158 fi
2159 rm -f conftest.err conftest.$ac_ext
2160
2161   # OK, works on sane cases.  Now check whether non-existent headers
2162   # can be detected and how.
2163   cat >conftest.$ac_ext <<_ACEOF
2164 #line 2164 "configure"
2165 #include "confdefs.h"
2166 #include <ac_nonexistent.h>
2167 _ACEOF
2168 if { (eval echo "$as_me:2168: \"$ac_cpp conftest.$ac_ext\"") >&5
2169   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2170   ac_status=$?
2171   egrep -v '^ *\+' conftest.er1 >conftest.err
2172   rm -f conftest.er1
2173   cat conftest.err >&5
2174   echo "$as_me:2174: \$? = $ac_status" >&5
2175   (exit $ac_status); } >/dev/null; then
2176   if test -s conftest.err; then
2177     ac_cpp_err=$ac_c_preproc_warn_flag
2178   else
2179     ac_cpp_err=
2180   fi
2181 else
2182   ac_cpp_err=yes
2183 fi
2184 if test -z "$ac_cpp_err"; then
2185   # Broken: success on invalid input.
2186 continue
2187 else
2188   echo "$as_me: failed program was:" >&5
2189   cat conftest.$ac_ext >&5
2190   # Passes both tests.
2191 ac_preproc_ok=:
2192 break
2193 fi
2194 rm -f conftest.err conftest.$ac_ext
2195
2196 done
2197 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2198 rm -f conftest.err conftest.$ac_ext
2199 if $ac_preproc_ok; then
2200   break
2201 fi
2202
2203     done
2204     ac_cv_prog_CPP=$CPP
2205
2206 fi
2207   CPP=$ac_cv_prog_CPP
2208 else
2209   ac_cv_prog_CPP=$CPP
2210 fi
2211 echo "$as_me:2211: result: $CPP" >&5
2212 echo "${ECHO_T}$CPP" >&6
2213 ac_preproc_ok=false
2214 for ac_c_preproc_warn_flag in '' yes
2215 do
2216   # Use a header file that comes with gcc, so configuring glibc
2217   # with a fresh cross-compiler works.
2218   # On the NeXT, cc -E runs the code through the compiler's parser,
2219   # not just through cpp. "Syntax error" is here to catch this case.
2220   cat >conftest.$ac_ext <<_ACEOF
2221 #line 2221 "configure"
2222 #include "confdefs.h"
2223 #include <assert.h>
2224                      Syntax error
2225 _ACEOF
2226 if { (eval echo "$as_me:2226: \"$ac_cpp conftest.$ac_ext\"") >&5
2227   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2228   ac_status=$?
2229   egrep -v '^ *\+' conftest.er1 >conftest.err
2230   rm -f conftest.er1
2231   cat conftest.err >&5
2232   echo "$as_me:2232: \$? = $ac_status" >&5
2233   (exit $ac_status); } >/dev/null; then
2234   if test -s conftest.err; then
2235     ac_cpp_err=$ac_c_preproc_warn_flag
2236   else
2237     ac_cpp_err=
2238   fi
2239 else
2240   ac_cpp_err=yes
2241 fi
2242 if test -z "$ac_cpp_err"; then
2243   :
2244 else
2245   echo "$as_me: failed program was:" >&5
2246   cat conftest.$ac_ext >&5
2247   # Broken: fails on valid input.
2248 continue
2249 fi
2250 rm -f conftest.err conftest.$ac_ext
2251
2252   # OK, works on sane cases.  Now check whether non-existent headers
2253   # can be detected and how.
2254   cat >conftest.$ac_ext <<_ACEOF
2255 #line 2255 "configure"
2256 #include "confdefs.h"
2257 #include <ac_nonexistent.h>
2258 _ACEOF
2259 if { (eval echo "$as_me:2259: \"$ac_cpp conftest.$ac_ext\"") >&5
2260   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2261   ac_status=$?
2262   egrep -v '^ *\+' conftest.er1 >conftest.err
2263   rm -f conftest.er1
2264   cat conftest.err >&5
2265   echo "$as_me:2265: \$? = $ac_status" >&5
2266   (exit $ac_status); } >/dev/null; then
2267   if test -s conftest.err; then
2268     ac_cpp_err=$ac_c_preproc_warn_flag
2269   else
2270     ac_cpp_err=
2271   fi
2272 else
2273   ac_cpp_err=yes
2274 fi
2275 if test -z "$ac_cpp_err"; then
2276   # Broken: success on invalid input.
2277 continue
2278 else
2279   echo "$as_me: failed program was:" >&5
2280   cat conftest.$ac_ext >&5
2281   # Passes both tests.
2282 ac_preproc_ok=:
2283 break
2284 fi
2285 rm -f conftest.err conftest.$ac_ext
2286
2287 done
2288 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2289 rm -f conftest.err conftest.$ac_ext
2290 if $ac_preproc_ok; then
2291   :
2292 else
2293   { { echo "$as_me:2293: error: C preprocessor \"$CPP\" fails sanity check" >&5
2294 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2295    { (exit 1); exit 1; }; }
2296 fi
2297
2298 ac_ext=c
2299 ac_cpp='$CPP $CPPFLAGS'
2300 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2301 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2302 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2303 ac_main_return=return
2304
2305 if test $ac_cv_c_compiler_gnu = yes; then
2306     echo "$as_me:2306: checking whether $CC needs -traditional" >&5
2307 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2308 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2309   echo $ECHO_N "(cached) $ECHO_C" >&6
2310 else
2311     ac_pattern="Autoconf.*'x'"
2312   cat >conftest.$ac_ext <<_ACEOF
2313 #line 2313 "configure"
2314 #include "confdefs.h"
2315 #include <sgtty.h>
2316 int Autoconf = TIOCGETP;
2317 _ACEOF
2318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2319   egrep "$ac_pattern" >/dev/null 2>&1; then
2320   ac_cv_prog_gcc_traditional=yes
2321 else
2322   ac_cv_prog_gcc_traditional=no
2323 fi
2324 rm -rf conftest*
2325
2326   if test $ac_cv_prog_gcc_traditional = no; then
2327     cat >conftest.$ac_ext <<_ACEOF
2328 #line 2328 "configure"
2329 #include "confdefs.h"
2330 #include <termio.h>
2331 int Autoconf = TCGETA;
2332 _ACEOF
2333 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2334   egrep "$ac_pattern" >/dev/null 2>&1; then
2335   ac_cv_prog_gcc_traditional=yes
2336 fi
2337 rm -rf conftest*
2338
2339   fi
2340 fi
2341 echo "$as_me:2341: result: $ac_cv_prog_gcc_traditional" >&5
2342 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2343   if test $ac_cv_prog_gcc_traditional = yes; then
2344     CC="$CC -traditional"
2345   fi
2346 fi
2347
2348 echo "$as_me:2348: checking whether $CC understands -c and -o together" >&5
2349 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2350 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2351   echo $ECHO_N "(cached) $ECHO_C" >&6
2352 else
2353
2354 cat > conftest.$ac_ext <<CF_EOF
2355 int main(void)
2356 {
2357         ${cf_cv_main_return:-return}(0);
2358 }
2359 CF_EOF
2360 # We do the test twice because some compilers refuse to overwrite an
2361 # existing .o file with -o, though they will create one.
2362 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2363 if { (eval echo "$as_me:2363: \"$ac_try\"") >&5
2364   (eval $ac_try) 2>&5
2365   ac_status=$?
2366   echo "$as_me:2366: \$? = $ac_status" >&5
2367   (exit $ac_status); } &&
2368   test -f conftest2.$ac_objext && { (eval echo "$as_me:2368: \"$ac_try\"") >&5
2369   (eval $ac_try) 2>&5
2370   ac_status=$?
2371   echo "$as_me:2371: \$? = $ac_status" >&5
2372   (exit $ac_status); };
2373 then
2374   eval cf_cv_prog_CC_c_o=yes
2375 else
2376   eval cf_cv_prog_CC_c_o=no
2377 fi
2378 rm -rf conftest*
2379
2380 fi
2381 if test $cf_cv_prog_CC_c_o = yes; then
2382   echo "$as_me:2382: result: yes" >&5
2383 echo "${ECHO_T}yes" >&6
2384 else
2385   echo "$as_me:2385: result: no" >&5
2386 echo "${ECHO_T}no" >&6
2387 fi
2388
2389 test "$program_prefix" != NONE &&
2390   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2391 # Use a double $ so make ignores it.
2392 test "$program_suffix" != NONE &&
2393   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2394 # Double any \ or $.  echo might interpret backslashes.
2395 # By default was `s,x,x', remove it if useless.
2396 cat <<\_ACEOF >conftest.sed
2397 s/[\\$]/&&/g;s/;s,x,x,$//
2398 _ACEOF
2399 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2400 rm conftest.sed
2401
2402 for ac_prog in mawk gawk nawk awk
2403 do
2404   # Extract the first word of "$ac_prog", so it can be a program name with args.
2405 set dummy $ac_prog; ac_word=$2
2406 echo "$as_me:2406: checking for $ac_word" >&5
2407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2408 if test "${ac_cv_prog_AWK+set}" = set; then
2409   echo $ECHO_N "(cached) $ECHO_C" >&6
2410 else
2411   if test -n "$AWK"; then
2412   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2413 else
2414   ac_save_IFS=$IFS; IFS=$ac_path_separator
2415 ac_dummy="$PATH"
2416 for ac_dir in $ac_dummy; do
2417   IFS=$ac_save_IFS
2418   test -z "$ac_dir" && ac_dir=.
2419   $as_executable_p "$ac_dir/$ac_word" || continue
2420 ac_cv_prog_AWK="$ac_prog"
2421 echo "$as_me:2421: found $ac_dir/$ac_word" >&5
2422 break
2423 done
2424
2425 fi
2426 fi
2427 AWK=$ac_cv_prog_AWK
2428 if test -n "$AWK"; then
2429   echo "$as_me:2429: result: $AWK" >&5
2430 echo "${ECHO_T}$AWK" >&6
2431 else
2432   echo "$as_me:2432: result: no" >&5
2433 echo "${ECHO_T}no" >&6
2434 fi
2435
2436   test -n "$AWK" && break
2437 done
2438
2439 test -z "$AWK" && { { echo "$as_me:2439: error: No awk program found" >&5
2440 echo "$as_me: error: No awk program found" >&2;}
2441    { (exit 1); exit 1; }; }
2442
2443 echo "$as_me:2443: checking for egrep" >&5
2444 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2445 if test "${ac_cv_prog_egrep+set}" = set; then
2446   echo $ECHO_N "(cached) $ECHO_C" >&6
2447 else
2448   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2449                 then ac_cv_prog_egrep='grep -E'
2450                 else ac_cv_prog_egrep='egrep'
2451         fi
2452 fi
2453 echo "$as_me:2453: result: $ac_cv_prog_egrep" >&5
2454 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2455         EGREP=$ac_cv_prog_egrep
2456
2457         test -z "$EGREP" && { { echo "$as_me:2457: error: No egrep program found" >&5
2458 echo "$as_me: error: No egrep program found" >&2;}
2459    { (exit 1); exit 1; }; }
2460
2461 # Find a good install program.  We prefer a C program (faster),
2462 # so one script is as good as another.  But avoid the broken or
2463 # incompatible versions:
2464 # SysV /etc/install, /usr/sbin/install
2465 # SunOS /usr/etc/install
2466 # IRIX /sbin/install
2467 # AIX /bin/install
2468 # AmigaOS /C/install, which installs bootblocks on floppy discs
2469 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2470 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2471 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2472 # ./install, which can be erroneously created by make from ./install.sh.
2473 echo "$as_me:2473: checking for a BSD compatible install" >&5
2474 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2475 if test -z "$INSTALL"; then
2476 if test "${ac_cv_path_install+set}" = set; then
2477   echo $ECHO_N "(cached) $ECHO_C" >&6
2478 else
2479     ac_save_IFS=$IFS; IFS=$ac_path_separator
2480   for ac_dir in $PATH; do
2481     IFS=$ac_save_IFS
2482     # Account for people who put trailing slashes in PATH elements.
2483     case $ac_dir/ in
2484     / | ./ | .// | /cC/* \
2485     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2486     | /usr/ucb/* ) ;;
2487     *)
2488       # OSF1 and SCO ODT 3.0 have their own names for install.
2489       # Don't use installbsd from OSF since it installs stuff as root
2490       # by default.
2491       for ac_prog in ginstall scoinst install; do
2492         if $as_executable_p "$ac_dir/$ac_prog"; then
2493           if test $ac_prog = install &&
2494             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2495             # AIX install.  It has an incompatible calling convention.
2496             :
2497           elif test $ac_prog = install &&
2498             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2499             # program-specific install script used by HP pwplus--don't use.
2500             :
2501           else
2502             ac_cv_path_install="$ac_dir/$ac_prog -c"
2503             break 2
2504           fi
2505         fi
2506       done
2507       ;;
2508     esac
2509   done
2510
2511 fi
2512   if test "${ac_cv_path_install+set}" = set; then
2513     INSTALL=$ac_cv_path_install
2514   else
2515     # As a last resort, use the slow shell script.  We don't cache a
2516     # path for INSTALL within a source directory, because that will
2517     # break other packages using the cache if that directory is
2518     # removed, or if the path is relative.
2519     INSTALL=$ac_install_sh
2520   fi
2521 fi
2522 echo "$as_me:2522: result: $INSTALL" >&5
2523 echo "${ECHO_T}$INSTALL" >&6
2524
2525 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2526 # It thinks the first close brace ends the variable substitution.
2527 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2528
2529 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2530
2531 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2532
2533 echo "$as_me:2533: checking whether ln -s works" >&5
2534 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2535 LN_S=$as_ln_s
2536 if test "$LN_S" = "ln -s"; then
2537   echo "$as_me:2537: result: yes" >&5
2538 echo "${ECHO_T}yes" >&6
2539 else
2540   echo "$as_me:2540: result: no, using $LN_S" >&5
2541 echo "${ECHO_T}no, using $LN_S" >&6
2542 fi
2543
2544 echo "$as_me:2544: checking if $LN_S -f options work" >&5
2545 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2546
2547 rm -f conf$$.src conf$$dst
2548 echo >conf$$.dst
2549 echo first >conf$$.src
2550 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2551         cf_prog_ln_sf=yes
2552 else
2553         cf_prog_ln_sf=no
2554 fi
2555 rm -f conf$$.dst conf$$src
2556 echo "$as_me:2556: result: $cf_prog_ln_sf" >&5
2557 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2558
2559 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2560
2561 # Find a good install program.  We prefer a C program (faster),
2562 # so one script is as good as another.  But avoid the broken or
2563 # incompatible versions:
2564 # SysV /etc/install, /usr/sbin/install
2565 # SunOS /usr/etc/install
2566 # IRIX /sbin/install
2567 # AIX /bin/install
2568 # AmigaOS /C/install, which installs bootblocks on floppy discs
2569 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2570 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2571 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2572 # ./install, which can be erroneously created by make from ./install.sh.
2573 echo "$as_me:2573: checking for a BSD compatible install" >&5
2574 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2575 if test -z "$INSTALL"; then
2576 if test "${ac_cv_path_install+set}" = set; then
2577   echo $ECHO_N "(cached) $ECHO_C" >&6
2578 else
2579     ac_save_IFS=$IFS; IFS=$ac_path_separator
2580   for ac_dir in $PATH; do
2581     IFS=$ac_save_IFS
2582     # Account for people who put trailing slashes in PATH elements.
2583     case $ac_dir/ in
2584     / | ./ | .// | /cC/* \
2585     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2586     | /usr/ucb/* ) ;;
2587     *)
2588       # OSF1 and SCO ODT 3.0 have their own names for install.
2589       # Don't use installbsd from OSF since it installs stuff as root
2590       # by default.
2591       for ac_prog in ginstall scoinst install; do
2592         if $as_executable_p "$ac_dir/$ac_prog"; then
2593           if test $ac_prog = install &&
2594             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2595             # AIX install.  It has an incompatible calling convention.
2596             :
2597           elif test $ac_prog = install &&
2598             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2599             # program-specific install script used by HP pwplus--don't use.
2600             :
2601           else
2602             ac_cv_path_install="$ac_dir/$ac_prog -c"
2603             break 2
2604           fi
2605         fi
2606       done
2607       ;;
2608     esac
2609   done
2610
2611 fi
2612   if test "${ac_cv_path_install+set}" = set; then
2613     INSTALL=$ac_cv_path_install
2614   else
2615     # As a last resort, use the slow shell script.  We don't cache a
2616     # path for INSTALL within a source directory, because that will
2617     # break other packages using the cache if that directory is
2618     # removed, or if the path is relative.
2619     INSTALL=$ac_install_sh
2620   fi
2621 fi
2622 echo "$as_me:2622: result: $INSTALL" >&5
2623 echo "${ECHO_T}$INSTALL" >&6
2624
2625 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2626 # It thinks the first close brace ends the variable substitution.
2627 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2628
2629 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2630
2631 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2632
2633 case $INSTALL in
2634 (/*)
2635         ;;
2636 (*)
2637         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2638         test -z "$cf_dir" && cf_dir=.
2639         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2640         ;;
2641 esac
2642
2643 echo "$as_me:2643: checking if you want to install stripped executables" >&5
2644 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2645
2646 # Check whether --enable-stripping or --disable-stripping was given.
2647 if test "${enable_stripping+set}" = set; then
2648   enableval="$enable_stripping"
2649   test "$enableval" != no && enableval=yes
2650         if test "$enableval" != "yes" ; then
2651     with_stripping=no
2652         else
2653                 with_stripping=yes
2654         fi
2655 else
2656   enableval=yes
2657         with_stripping=yes
2658
2659 fi;
2660 echo "$as_me:2660: result: $with_stripping" >&5
2661 echo "${ECHO_T}$with_stripping" >&6
2662
2663 if test "$with_stripping" = yes
2664 then
2665         INSTALL_OPT_S="-s"
2666 else
2667         INSTALL_OPT_S=
2668 fi
2669
2670 : ${INSTALL:=install}
2671 echo "$as_me:2671: checking if install accepts -p option" >&5
2672 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2673 if test "${cf_cv_install_p+set}" = set; then
2674   echo $ECHO_N "(cached) $ECHO_C" >&6
2675 else
2676
2677         rm -rf conftest*
2678         date >conftest.in
2679         mkdir conftest.out
2680         sleep 3
2681         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2682         then
2683                 if test -f conftest.out/conftest.in
2684                 then
2685                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2686                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2687                         if test -s conftest.err
2688                         then
2689                                 cf_cv_install_p=no
2690                         else
2691                                 cf_cv_install_p=yes
2692                         fi
2693                 else
2694                         cf_cv_install_p=no
2695                 fi
2696         else
2697                 cf_cv_install_p=no
2698         fi
2699         rm -rf conftest*
2700
2701 fi
2702 echo "$as_me:2702: result: $cf_cv_install_p" >&5
2703 echo "${ECHO_T}$cf_cv_install_p" >&6
2704
2705 echo "$as_me:2705: checking if install needs to be told about ownership" >&5
2706 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2707 case `$ac_config_guess` in
2708 (*minix)
2709         with_install_o=yes
2710         ;;
2711 (*)
2712         with_install_o=no
2713         ;;
2714 esac
2715
2716 echo "$as_me:2716: result: $with_install_o" >&5
2717 echo "${ECHO_T}$with_install_o" >&6
2718 if test "x$with_install_o" = xyes
2719 then
2720         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'`
2721 else
2722         INSTALL_OPT_O=
2723 fi
2724
2725 echo "$as_me:2725: checking for long file names" >&5
2726 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2727 if test "${ac_cv_sys_long_file_names+set}" = set; then
2728   echo $ECHO_N "(cached) $ECHO_C" >&6
2729 else
2730   ac_cv_sys_long_file_names=yes
2731 # Test for long file names in all the places we know might matter:
2732 #      .                the current directory, where building will happen
2733 #      $prefix/lib      where we will be installing things
2734 #      $exec_prefix/lib likewise
2735 # eval it to expand exec_prefix.
2736 #      $TMPDIR          if set, where it might want to write temporary files
2737 # if $TMPDIR is not set:
2738 #      /tmp             where it might want to write temporary files
2739 #      /var/tmp         likewise
2740 #      /usr/tmp         likewise
2741 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2742   ac_tmpdirs=$TMPDIR
2743 else
2744   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2745 fi
2746 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2747   test -d $ac_dir || continue
2748   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2749   ac_xdir=$ac_dir/cf$$
2750   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2751   ac_tf1=$ac_xdir/conftest9012345
2752   ac_tf2=$ac_xdir/conftest9012346
2753   (echo 1 >$ac_tf1) 2>/dev/null
2754   (echo 2 >$ac_tf2) 2>/dev/null
2755   ac_val=`cat $ac_tf1 2>/dev/null`
2756   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2757     ac_cv_sys_long_file_names=no
2758     rm -rf $ac_xdir 2>/dev/null
2759     break
2760   fi
2761   rm -rf $ac_xdir 2>/dev/null
2762 done
2763 fi
2764 echo "$as_me:2764: result: $ac_cv_sys_long_file_names" >&5
2765 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2766 if test $ac_cv_sys_long_file_names = yes; then
2767
2768 cat >>confdefs.h <<\EOF
2769 #define HAVE_LONG_FILE_NAMES 1
2770 EOF
2771
2772 fi
2773
2774 # if we find pkg-config, check if we should install the ".pc" files.
2775
2776 echo "$as_me:2776: checking if you want to use pkg-config" >&5
2777 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2778
2779 # Check whether --with-pkg-config or --without-pkg-config was given.
2780 if test "${with_pkg_config+set}" = set; then
2781   withval="$with_pkg_config"
2782   cf_pkg_config=$withval
2783 else
2784   cf_pkg_config=yes
2785 fi;
2786 echo "$as_me:2786: result: $cf_pkg_config" >&5
2787 echo "${ECHO_T}$cf_pkg_config" >&6
2788
2789 case $cf_pkg_config in
2790 (no)
2791         PKG_CONFIG=none
2792         ;;
2793 (yes)
2794
2795 if test -n "$ac_tool_prefix"; then
2796   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2797 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2798 echo "$as_me:2798: checking for $ac_word" >&5
2799 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2800 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2801   echo $ECHO_N "(cached) $ECHO_C" >&6
2802 else
2803   case $PKG_CONFIG in
2804   [\\/]* | ?:[\\/]*)
2805   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2806   ;;
2807   *)
2808   ac_save_IFS=$IFS; IFS=$ac_path_separator
2809 ac_dummy="$PATH"
2810 for ac_dir in $ac_dummy; do
2811   IFS=$ac_save_IFS
2812   test -z "$ac_dir" && ac_dir=.
2813   if $as_executable_p "$ac_dir/$ac_word"; then
2814    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2815    echo "$as_me:2815: found $ac_dir/$ac_word" >&5
2816    break
2817 fi
2818 done
2819
2820   ;;
2821 esac
2822 fi
2823 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2824
2825 if test -n "$PKG_CONFIG"; then
2826   echo "$as_me:2826: result: $PKG_CONFIG" >&5
2827 echo "${ECHO_T}$PKG_CONFIG" >&6
2828 else
2829   echo "$as_me:2829: result: no" >&5
2830 echo "${ECHO_T}no" >&6
2831 fi
2832
2833 fi
2834 if test -z "$ac_cv_path_PKG_CONFIG"; then
2835   ac_pt_PKG_CONFIG=$PKG_CONFIG
2836   # Extract the first word of "pkg-config", so it can be a program name with args.
2837 set dummy pkg-config; ac_word=$2
2838 echo "$as_me:2838: checking for $ac_word" >&5
2839 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2840 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2841   echo $ECHO_N "(cached) $ECHO_C" >&6
2842 else
2843   case $ac_pt_PKG_CONFIG in
2844   [\\/]* | ?:[\\/]*)
2845   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2846   ;;
2847   *)
2848   ac_save_IFS=$IFS; IFS=$ac_path_separator
2849 ac_dummy="$PATH"
2850 for ac_dir in $ac_dummy; do
2851   IFS=$ac_save_IFS
2852   test -z "$ac_dir" && ac_dir=.
2853   if $as_executable_p "$ac_dir/$ac_word"; then
2854    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2855    echo "$as_me:2855: found $ac_dir/$ac_word" >&5
2856    break
2857 fi
2858 done
2859
2860   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2861   ;;
2862 esac
2863 fi
2864 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2865
2866 if test -n "$ac_pt_PKG_CONFIG"; then
2867   echo "$as_me:2867: result: $ac_pt_PKG_CONFIG" >&5
2868 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2869 else
2870   echo "$as_me:2870: result: no" >&5
2871 echo "${ECHO_T}no" >&6
2872 fi
2873
2874   PKG_CONFIG=$ac_pt_PKG_CONFIG
2875 else
2876   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2877 fi
2878
2879         ;;
2880 (*)
2881         PKG_CONFIG=$withval
2882         ;;
2883 esac
2884
2885 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2886 if test "$PKG_CONFIG" != none ; then
2887
2888 if test "x$prefix" != xNONE; then
2889         cf_path_syntax="$prefix"
2890 else
2891         cf_path_syntax="$ac_default_prefix"
2892 fi
2893
2894 case ".$PKG_CONFIG" in
2895 (.\$\(*\)*|.\'*\'*)
2896         ;;
2897 (..|./*|.\\*)
2898         ;;
2899 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2900         ;;
2901 (.\${*prefix}*|.\${*dir}*)
2902         eval PKG_CONFIG="$PKG_CONFIG"
2903         case ".$PKG_CONFIG" in
2904         (.NONE/*)
2905                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2906                 ;;
2907         esac
2908         ;;
2909 (.no|.NONE/*)
2910         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2911         ;;
2912 (*)
2913         { { echo "$as_me:2913: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2914 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2915    { (exit 1); exit 1; }; }
2916         ;;
2917 esac
2918
2919 elif test "x$cf_pkg_config" != xno ; then
2920         { echo "$as_me:2920: WARNING: pkg-config is not installed" >&5
2921 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2922 fi
2923
2924 case $PKG_CONFIG in
2925 (no|none|yes)
2926         echo "$as_me:2926: checking for pkg-config library directory" >&5
2927 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2928         ;;
2929 (*)
2930         echo "$as_me:2930: checking for $PKG_CONFIG library directory" >&5
2931 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2932         ;;
2933 esac
2934
2935 PKG_CONFIG_LIBDIR=no
2936
2937 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2938 if test "${with_pkg_config_libdir+set}" = set; then
2939   withval="$with_pkg_config_libdir"
2940   PKG_CONFIG_LIBDIR=$withval
2941 else
2942   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2943 fi;
2944
2945 case x$PKG_CONFIG_LIBDIR in
2946 (x/*)
2947         ;;
2948 (xyes)
2949         # Look for the library directory using the same prefix as the executable
2950         if test "x$PKG_CONFIG" = xnone
2951         then
2952                 cf_path=$prefix
2953         else
2954                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2955         fi
2956
2957         # If you don't like using the default architecture, you have to specify the
2958         # intended library directory and corresponding compiler/linker options.
2959         #
2960         # This case allows for Debian's 2014-flavor of multiarch, along with the
2961         # most common variations before that point.  Some other variants spell the
2962         # directory differently, e.g., "pkg-config", and put it in unusual places.
2963         # pkg-config has always been poorly standardized, which is ironic...
2964         case x`(arch) 2>/dev/null` in
2965         (*64)
2966                 cf_search_path="\
2967                         $cf_path/lib/*64-linux-gnu \
2968                         $cf_path/share \
2969                         $cf_path/lib64 \
2970                         $cf_path/lib32 \
2971                         $cf_path/lib"
2972                 ;;
2973         (*)
2974                 cf_search_path="\
2975                         $cf_path/lib/*-linux-gnu \
2976                         $cf_path/share \
2977                         $cf_path/lib32 \
2978                         $cf_path/lib \
2979                         $cf_path/libdata"
2980                 ;;
2981         esac
2982
2983         test -n "$verbose" && echo "    list..." 1>&6
2984
2985 echo "${as_me:-configure}:2985: testing list... ..." 1>&5
2986
2987         for cf_config in $cf_search_path
2988         do
2989                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2990
2991 echo "${as_me:-configure}:2991: testing checking $cf_config/pkgconfig ..." 1>&5
2992
2993                 if test -d $cf_config/pkgconfig
2994                 then
2995                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2996                         echo "$as_me:2996: checking done" >&5
2997 echo $ECHO_N "checking done... $ECHO_C" >&6
2998                         break
2999                 fi
3000         done
3001         ;;
3002 (*)
3003         ;;
3004 esac
3005
3006 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3007         echo "$as_me:3007: result: $PKG_CONFIG_LIBDIR" >&5
3008 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3009 fi
3010
3011 echo "$as_me:3011: checking if you want to build test-programs" >&5
3012 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3013
3014 # Check whether --with-tests or --without-tests was given.
3015 if test "${with_tests+set}" = set; then
3016   withval="$with_tests"
3017   cf_with_tests=$withval
3018 else
3019   cf_with_tests=yes
3020 fi;
3021 echo "$as_me:3021: result: $cf_with_tests" >&5
3022 echo "${ECHO_T}$cf_with_tests" >&6
3023
3024 echo "$as_me:3024: checking if we should assume mixed-case filenames" >&5
3025 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3026
3027 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3028 if test "${enable_mixed_case+set}" = set; then
3029   enableval="$enable_mixed_case"
3030   enable_mixedcase=$enableval
3031 else
3032   enable_mixedcase=auto
3033 fi;
3034 echo "$as_me:3034: result: $enable_mixedcase" >&5
3035 echo "${ECHO_T}$enable_mixedcase" >&6
3036 if test "$enable_mixedcase" = "auto" ; then
3037
3038 echo "$as_me:3038: checking if filesystem supports mixed-case filenames" >&5
3039 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3040 if test "${cf_cv_mixedcase+set}" = set; then
3041   echo $ECHO_N "(cached) $ECHO_C" >&6
3042 else
3043
3044 if test "$cross_compiling" = yes ; then
3045         case $target_alias in
3046         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3047                 cf_cv_mixedcase=no
3048                 ;;
3049         (*)
3050                 cf_cv_mixedcase=yes
3051                 ;;
3052         esac
3053 else
3054         rm -f conftest CONFTEST
3055         echo test >conftest
3056         if test -f CONFTEST ; then
3057                 cf_cv_mixedcase=no
3058         else
3059                 cf_cv_mixedcase=yes
3060         fi
3061         rm -f conftest CONFTEST
3062 fi
3063
3064 fi
3065 echo "$as_me:3065: result: $cf_cv_mixedcase" >&5
3066 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3067 test "$cf_cv_mixedcase" = yes &&
3068 cat >>confdefs.h <<\EOF
3069 #define MIXEDCASE_FILENAMES 1
3070 EOF
3071
3072 else
3073         cf_cv_mixedcase=$enable_mixedcase
3074         if test "$enable_mixedcase" = "yes" ; then
3075                 cat >>confdefs.h <<\EOF
3076 #define MIXEDCASE_FILENAMES 1
3077 EOF
3078
3079         fi
3080 fi
3081
3082 # do this after mixed-case option (tags/TAGS is not as important as tic).
3083 echo "$as_me:3083: checking whether ${MAKE-make} sets \${MAKE}" >&5
3084 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3085 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3086 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3087   echo $ECHO_N "(cached) $ECHO_C" >&6
3088 else
3089   cat >conftest.make <<\EOF
3090 all:
3091         @echo 'ac_maketemp="${MAKE}"'
3092 EOF
3093 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3094 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3095 if test -n "$ac_maketemp"; then
3096   eval ac_cv_prog_make_${ac_make}_set=yes
3097 else
3098   eval ac_cv_prog_make_${ac_make}_set=no
3099 fi
3100 rm -f conftest.make
3101 fi
3102 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3103   echo "$as_me:3103: result: yes" >&5
3104 echo "${ECHO_T}yes" >&6
3105   SET_MAKE=
3106 else
3107   echo "$as_me:3107: result: no" >&5
3108 echo "${ECHO_T}no" >&6
3109   SET_MAKE="MAKE=${MAKE-make}"
3110 fi
3111
3112 for ac_prog in exctags ctags
3113 do
3114   # Extract the first word of "$ac_prog", so it can be a program name with args.
3115 set dummy $ac_prog; ac_word=$2
3116 echo "$as_me:3116: checking for $ac_word" >&5
3117 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3118 if test "${ac_cv_prog_CTAGS+set}" = set; then
3119   echo $ECHO_N "(cached) $ECHO_C" >&6
3120 else
3121   if test -n "$CTAGS"; then
3122   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3123 else
3124   ac_save_IFS=$IFS; IFS=$ac_path_separator
3125 ac_dummy="$PATH"
3126 for ac_dir in $ac_dummy; do
3127   IFS=$ac_save_IFS
3128   test -z "$ac_dir" && ac_dir=.
3129   $as_executable_p "$ac_dir/$ac_word" || continue
3130 ac_cv_prog_CTAGS="$ac_prog"
3131 echo "$as_me:3131: found $ac_dir/$ac_word" >&5
3132 break
3133 done
3134
3135 fi
3136 fi
3137 CTAGS=$ac_cv_prog_CTAGS
3138 if test -n "$CTAGS"; then
3139   echo "$as_me:3139: result: $CTAGS" >&5
3140 echo "${ECHO_T}$CTAGS" >&6
3141 else
3142   echo "$as_me:3142: result: no" >&5
3143 echo "${ECHO_T}no" >&6
3144 fi
3145
3146   test -n "$CTAGS" && break
3147 done
3148
3149 for ac_prog in exetags etags
3150 do
3151   # Extract the first word of "$ac_prog", so it can be a program name with args.
3152 set dummy $ac_prog; ac_word=$2
3153 echo "$as_me:3153: checking for $ac_word" >&5
3154 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3155 if test "${ac_cv_prog_ETAGS+set}" = set; then
3156   echo $ECHO_N "(cached) $ECHO_C" >&6
3157 else
3158   if test -n "$ETAGS"; then
3159   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3160 else
3161   ac_save_IFS=$IFS; IFS=$ac_path_separator
3162 ac_dummy="$PATH"
3163 for ac_dir in $ac_dummy; do
3164   IFS=$ac_save_IFS
3165   test -z "$ac_dir" && ac_dir=.
3166   $as_executable_p "$ac_dir/$ac_word" || continue
3167 ac_cv_prog_ETAGS="$ac_prog"
3168 echo "$as_me:3168: found $ac_dir/$ac_word" >&5
3169 break
3170 done
3171
3172 fi
3173 fi
3174 ETAGS=$ac_cv_prog_ETAGS
3175 if test -n "$ETAGS"; then
3176   echo "$as_me:3176: result: $ETAGS" >&5
3177 echo "${ECHO_T}$ETAGS" >&6
3178 else
3179   echo "$as_me:3179: result: no" >&5
3180 echo "${ECHO_T}no" >&6
3181 fi
3182
3183   test -n "$ETAGS" && break
3184 done
3185
3186 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3187 set dummy ${CTAGS:-ctags}; ac_word=$2
3188 echo "$as_me:3188: checking for $ac_word" >&5
3189 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3190 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3191   echo $ECHO_N "(cached) $ECHO_C" >&6
3192 else
3193   if test -n "$MAKE_LOWER_TAGS"; then
3194   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3195 else
3196   ac_save_IFS=$IFS; IFS=$ac_path_separator
3197 ac_dummy="$PATH"
3198 for ac_dir in $ac_dummy; do
3199   IFS=$ac_save_IFS
3200   test -z "$ac_dir" && ac_dir=.
3201   $as_executable_p "$ac_dir/$ac_word" || continue
3202 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3203 echo "$as_me:3203: found $ac_dir/$ac_word" >&5
3204 break
3205 done
3206
3207   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3208 fi
3209 fi
3210 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3211 if test -n "$MAKE_LOWER_TAGS"; then
3212   echo "$as_me:3212: result: $MAKE_LOWER_TAGS" >&5
3213 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3214 else
3215   echo "$as_me:3215: result: no" >&5
3216 echo "${ECHO_T}no" >&6
3217 fi
3218
3219 if test "$cf_cv_mixedcase" = yes ; then
3220         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3221 set dummy ${ETAGS:-etags}; ac_word=$2
3222 echo "$as_me:3222: checking for $ac_word" >&5
3223 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3224 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3225   echo $ECHO_N "(cached) $ECHO_C" >&6
3226 else
3227   if test -n "$MAKE_UPPER_TAGS"; then
3228   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3229 else
3230   ac_save_IFS=$IFS; IFS=$ac_path_separator
3231 ac_dummy="$PATH"
3232 for ac_dir in $ac_dummy; do
3233   IFS=$ac_save_IFS
3234   test -z "$ac_dir" && ac_dir=.
3235   $as_executable_p "$ac_dir/$ac_word" || continue
3236 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3237 echo "$as_me:3237: found $ac_dir/$ac_word" >&5
3238 break
3239 done
3240
3241   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3242 fi
3243 fi
3244 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3245 if test -n "$MAKE_UPPER_TAGS"; then
3246   echo "$as_me:3246: result: $MAKE_UPPER_TAGS" >&5
3247 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3248 else
3249   echo "$as_me:3249: result: no" >&5
3250 echo "${ECHO_T}no" >&6
3251 fi
3252
3253 else
3254         MAKE_UPPER_TAGS=no
3255 fi
3256
3257 if test "$MAKE_UPPER_TAGS" = yes ; then
3258         MAKE_UPPER_TAGS=
3259 else
3260         MAKE_UPPER_TAGS="#"
3261 fi
3262
3263 if test "$MAKE_LOWER_TAGS" = yes ; then
3264         MAKE_LOWER_TAGS=
3265 else
3266         MAKE_LOWER_TAGS="#"
3267 fi
3268
3269 echo "$as_me:3269: checking for makeflags variable" >&5
3270 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3271 if test "${cf_cv_makeflags+set}" = set; then
3272   echo $ECHO_N "(cached) $ECHO_C" >&6
3273 else
3274
3275         cf_cv_makeflags=''
3276         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3277         do
3278                 cat >cf_makeflags.tmp <<CF_EOF
3279 SHELL = $SHELL
3280 all :
3281         @ echo '.$cf_option'
3282 CF_EOF
3283                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3284                 case "$cf_result" in
3285                 (.*k|.*kw)
3286                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3287                         case "$cf_result" in
3288                         (.*CC=*)        cf_cv_makeflags=
3289                                 ;;
3290                         (*)     cf_cv_makeflags=$cf_option
3291                                 ;;
3292                         esac
3293                         break
3294                         ;;
3295                 (.-)
3296                         ;;
3297                 (*)
3298
3299 echo "${as_me:-configure}:3299: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3300
3301                         ;;
3302                 esac
3303         done
3304         rm -f cf_makeflags.tmp
3305
3306 fi
3307 echo "$as_me:3307: result: $cf_cv_makeflags" >&5
3308 echo "${ECHO_T}$cf_cv_makeflags" >&6
3309
3310 if test -n "$ac_tool_prefix"; then
3311   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3312 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3313 echo "$as_me:3313: checking for $ac_word" >&5
3314 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3315 if test "${ac_cv_prog_RANLIB+set}" = set; then
3316   echo $ECHO_N "(cached) $ECHO_C" >&6
3317 else
3318   if test -n "$RANLIB"; then
3319   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3320 else
3321   ac_save_IFS=$IFS; IFS=$ac_path_separator
3322 ac_dummy="$PATH"
3323 for ac_dir in $ac_dummy; do
3324   IFS=$ac_save_IFS
3325   test -z "$ac_dir" && ac_dir=.
3326   $as_executable_p "$ac_dir/$ac_word" || continue
3327 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3328 echo "$as_me:3328: found $ac_dir/$ac_word" >&5
3329 break
3330 done
3331
3332 fi
3333 fi
3334 RANLIB=$ac_cv_prog_RANLIB
3335 if test -n "$RANLIB"; then
3336   echo "$as_me:3336: result: $RANLIB" >&5
3337 echo "${ECHO_T}$RANLIB" >&6
3338 else
3339   echo "$as_me:3339: result: no" >&5
3340 echo "${ECHO_T}no" >&6
3341 fi
3342
3343 fi
3344 if test -z "$ac_cv_prog_RANLIB"; then
3345   ac_ct_RANLIB=$RANLIB
3346   # Extract the first word of "ranlib", so it can be a program name with args.
3347 set dummy ranlib; ac_word=$2
3348 echo "$as_me:3348: checking for $ac_word" >&5
3349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3350 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3351   echo $ECHO_N "(cached) $ECHO_C" >&6
3352 else
3353   if test -n "$ac_ct_RANLIB"; then
3354   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3355 else
3356   ac_save_IFS=$IFS; IFS=$ac_path_separator
3357 ac_dummy="$PATH"
3358 for ac_dir in $ac_dummy; do
3359   IFS=$ac_save_IFS
3360   test -z "$ac_dir" && ac_dir=.
3361   $as_executable_p "$ac_dir/$ac_word" || continue
3362 ac_cv_prog_ac_ct_RANLIB="ranlib"
3363 echo "$as_me:3363: found $ac_dir/$ac_word" >&5
3364 break
3365 done
3366
3367   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3368 fi
3369 fi
3370 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3371 if test -n "$ac_ct_RANLIB"; then
3372   echo "$as_me:3372: result: $ac_ct_RANLIB" >&5
3373 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3374 else
3375   echo "$as_me:3375: result: no" >&5
3376 echo "${ECHO_T}no" >&6
3377 fi
3378
3379   RANLIB=$ac_ct_RANLIB
3380 else
3381   RANLIB="$ac_cv_prog_RANLIB"
3382 fi
3383
3384 if test -n "$ac_tool_prefix"; then
3385   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3386 set dummy ${ac_tool_prefix}ld; ac_word=$2
3387 echo "$as_me:3387: checking for $ac_word" >&5
3388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3389 if test "${ac_cv_prog_LD+set}" = set; then
3390   echo $ECHO_N "(cached) $ECHO_C" >&6
3391 else
3392   if test -n "$LD"; then
3393   ac_cv_prog_LD="$LD" # Let the user override the test.
3394 else
3395   ac_save_IFS=$IFS; IFS=$ac_path_separator
3396 ac_dummy="$PATH"
3397 for ac_dir in $ac_dummy; do
3398   IFS=$ac_save_IFS
3399   test -z "$ac_dir" && ac_dir=.
3400   $as_executable_p "$ac_dir/$ac_word" || continue
3401 ac_cv_prog_LD="${ac_tool_prefix}ld"
3402 echo "$as_me:3402: found $ac_dir/$ac_word" >&5
3403 break
3404 done
3405
3406 fi
3407 fi
3408 LD=$ac_cv_prog_LD
3409 if test -n "$LD"; then
3410   echo "$as_me:3410: result: $LD" >&5
3411 echo "${ECHO_T}$LD" >&6
3412 else
3413   echo "$as_me:3413: result: no" >&5
3414 echo "${ECHO_T}no" >&6
3415 fi
3416
3417 fi
3418 if test -z "$ac_cv_prog_LD"; then
3419   ac_ct_LD=$LD
3420   # Extract the first word of "ld", so it can be a program name with args.
3421 set dummy ld; ac_word=$2
3422 echo "$as_me:3422: checking for $ac_word" >&5
3423 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3424 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3425   echo $ECHO_N "(cached) $ECHO_C" >&6
3426 else
3427   if test -n "$ac_ct_LD"; then
3428   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3429 else
3430   ac_save_IFS=$IFS; IFS=$ac_path_separator
3431 ac_dummy="$PATH"
3432 for ac_dir in $ac_dummy; do
3433   IFS=$ac_save_IFS
3434   test -z "$ac_dir" && ac_dir=.
3435   $as_executable_p "$ac_dir/$ac_word" || continue
3436 ac_cv_prog_ac_ct_LD="ld"
3437 echo "$as_me:3437: found $ac_dir/$ac_word" >&5
3438 break
3439 done
3440
3441   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3442 fi
3443 fi
3444 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3445 if test -n "$ac_ct_LD"; then
3446   echo "$as_me:3446: result: $ac_ct_LD" >&5
3447 echo "${ECHO_T}$ac_ct_LD" >&6
3448 else
3449   echo "$as_me:3449: result: no" >&5
3450 echo "${ECHO_T}no" >&6
3451 fi
3452
3453   LD=$ac_ct_LD
3454 else
3455   LD="$ac_cv_prog_LD"
3456 fi
3457
3458 if test -n "$ac_tool_prefix"; then
3459   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3460 set dummy ${ac_tool_prefix}ar; ac_word=$2
3461 echo "$as_me:3461: checking for $ac_word" >&5
3462 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3463 if test "${ac_cv_prog_AR+set}" = set; then
3464   echo $ECHO_N "(cached) $ECHO_C" >&6
3465 else
3466   if test -n "$AR"; then
3467   ac_cv_prog_AR="$AR" # Let the user override the test.
3468 else
3469   ac_save_IFS=$IFS; IFS=$ac_path_separator
3470 ac_dummy="$PATH"
3471 for ac_dir in $ac_dummy; do
3472   IFS=$ac_save_IFS
3473   test -z "$ac_dir" && ac_dir=.
3474   $as_executable_p "$ac_dir/$ac_word" || continue
3475 ac_cv_prog_AR="${ac_tool_prefix}ar"
3476 echo "$as_me:3476: found $ac_dir/$ac_word" >&5
3477 break
3478 done
3479
3480 fi
3481 fi
3482 AR=$ac_cv_prog_AR
3483 if test -n "$AR"; then
3484   echo "$as_me:3484: result: $AR" >&5
3485 echo "${ECHO_T}$AR" >&6
3486 else
3487   echo "$as_me:3487: result: no" >&5
3488 echo "${ECHO_T}no" >&6
3489 fi
3490
3491 fi
3492 if test -z "$ac_cv_prog_AR"; then
3493   ac_ct_AR=$AR
3494   # Extract the first word of "ar", so it can be a program name with args.
3495 set dummy ar; ac_word=$2
3496 echo "$as_me:3496: checking for $ac_word" >&5
3497 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3498 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3499   echo $ECHO_N "(cached) $ECHO_C" >&6
3500 else
3501   if test -n "$ac_ct_AR"; then
3502   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3503 else
3504   ac_save_IFS=$IFS; IFS=$ac_path_separator
3505 ac_dummy="$PATH"
3506 for ac_dir in $ac_dummy; do
3507   IFS=$ac_save_IFS
3508   test -z "$ac_dir" && ac_dir=.
3509   $as_executable_p "$ac_dir/$ac_word" || continue
3510 ac_cv_prog_ac_ct_AR="ar"
3511 echo "$as_me:3511: found $ac_dir/$ac_word" >&5
3512 break
3513 done
3514
3515   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3516 fi
3517 fi
3518 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3519 if test -n "$ac_ct_AR"; then
3520   echo "$as_me:3520: result: $ac_ct_AR" >&5
3521 echo "${ECHO_T}$ac_ct_AR" >&6
3522 else
3523   echo "$as_me:3523: result: no" >&5
3524 echo "${ECHO_T}no" >&6
3525 fi
3526
3527   AR=$ac_ct_AR
3528 else
3529   AR="$ac_cv_prog_AR"
3530 fi
3531
3532 if test -n "$ac_tool_prefix"; then
3533   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3534 set dummy ${ac_tool_prefix}ar; ac_word=$2
3535 echo "$as_me:3535: checking for $ac_word" >&5
3536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3537 if test "${ac_cv_prog_AR+set}" = set; then
3538   echo $ECHO_N "(cached) $ECHO_C" >&6
3539 else
3540   if test -n "$AR"; then
3541   ac_cv_prog_AR="$AR" # Let the user override the test.
3542 else
3543   ac_save_IFS=$IFS; IFS=$ac_path_separator
3544 ac_dummy="$PATH"
3545 for ac_dir in $ac_dummy; do
3546   IFS=$ac_save_IFS
3547   test -z "$ac_dir" && ac_dir=.
3548   $as_executable_p "$ac_dir/$ac_word" || continue
3549 ac_cv_prog_AR="${ac_tool_prefix}ar"
3550 echo "$as_me:3550: found $ac_dir/$ac_word" >&5
3551 break
3552 done
3553
3554 fi
3555 fi
3556 AR=$ac_cv_prog_AR
3557 if test -n "$AR"; then
3558   echo "$as_me:3558: result: $AR" >&5
3559 echo "${ECHO_T}$AR" >&6
3560 else
3561   echo "$as_me:3561: result: no" >&5
3562 echo "${ECHO_T}no" >&6
3563 fi
3564
3565 fi
3566 if test -z "$ac_cv_prog_AR"; then
3567   ac_ct_AR=$AR
3568   # Extract the first word of "ar", so it can be a program name with args.
3569 set dummy ar; ac_word=$2
3570 echo "$as_me:3570: checking for $ac_word" >&5
3571 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3572 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3573   echo $ECHO_N "(cached) $ECHO_C" >&6
3574 else
3575   if test -n "$ac_ct_AR"; then
3576   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3577 else
3578   ac_save_IFS=$IFS; IFS=$ac_path_separator
3579 ac_dummy="$PATH"
3580 for ac_dir in $ac_dummy; do
3581   IFS=$ac_save_IFS
3582   test -z "$ac_dir" && ac_dir=.
3583   $as_executable_p "$ac_dir/$ac_word" || continue
3584 ac_cv_prog_ac_ct_AR="ar"
3585 echo "$as_me:3585: found $ac_dir/$ac_word" >&5
3586 break
3587 done
3588
3589   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3590 fi
3591 fi
3592 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3593 if test -n "$ac_ct_AR"; then
3594   echo "$as_me:3594: result: $ac_ct_AR" >&5
3595 echo "${ECHO_T}$ac_ct_AR" >&6
3596 else
3597   echo "$as_me:3597: result: no" >&5
3598 echo "${ECHO_T}no" >&6
3599 fi
3600
3601   AR=$ac_ct_AR
3602 else
3603   AR="$ac_cv_prog_AR"
3604 fi
3605
3606 echo "$as_me:3606: checking for options to update archives" >&5
3607 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3608 if test "${cf_cv_ar_flags+set}" = set; then
3609   echo $ECHO_N "(cached) $ECHO_C" >&6
3610 else
3611
3612         cf_cv_ar_flags=unknown
3613         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3614         do
3615
3616                 # check if $ARFLAGS already contains this choice
3617                 if test "x$ARFLAGS" != "x" ; then
3618                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3619                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3620                                 cf_cv_ar_flags=
3621                                 break
3622                         fi
3623                 fi
3624
3625                 rm -f conftest.$ac_cv_objext
3626                 rm -f conftest.a
3627
3628                 cat >conftest.$ac_ext <<EOF
3629 #line 3629 "configure"
3630 int     testdata[3] = { 123, 456, 789 };
3631 EOF
3632                 if { (eval echo "$as_me:3632: \"$ac_compile\"") >&5
3633   (eval $ac_compile) 2>&5
3634   ac_status=$?
3635   echo "$as_me:3635: \$? = $ac_status" >&5
3636   (exit $ac_status); } ; then
3637                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3638                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3639                         if test -f conftest.a ; then
3640                                 cf_cv_ar_flags=$cf_ar_flags
3641                                 break
3642                         fi
3643                 else
3644                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3645
3646 echo "${as_me:-configure}:3646: testing cannot compile test-program ..." 1>&5
3647
3648                         break
3649                 fi
3650         done
3651         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3652
3653 fi
3654 echo "$as_me:3654: result: $cf_cv_ar_flags" >&5
3655 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3656
3657 if test -n "$ARFLAGS" ; then
3658         if test -n "$cf_cv_ar_flags" ; then
3659                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3660         fi
3661 else
3662         ARFLAGS=$cf_cv_ar_flags
3663 fi
3664
3665         echo "$as_me:3665: checking for PATH separator" >&5
3666 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3667         case $cf_cv_system_name in
3668         (os2*)  PATH_SEPARATOR=';'  ;;
3669         (*)     ${PATH_SEPARATOR:=':'}  ;;
3670         esac
3671
3672         echo "$as_me:3672: result: $PATH_SEPARATOR" >&5
3673 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3674
3675 echo "$as_me:3675: checking if you have specified an install-prefix" >&5
3676 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3677
3678 # Check whether --with-install-prefix or --without-install-prefix was given.
3679 if test "${with_install_prefix+set}" = set; then
3680   withval="$with_install_prefix"
3681   case "$withval" in
3682         (yes|no)
3683                 ;;
3684         (*)     DESTDIR="$withval"
3685                 ;;
3686         esac
3687 fi;
3688 echo "$as_me:3688: result: $DESTDIR" >&5
3689 echo "${ECHO_T}$DESTDIR" >&6
3690
3691 ###############################################################################
3692
3693 # If we're cross-compiling, allow the user to override the tools and their
3694 # options.  The configure script is oriented toward identifying the host
3695 # compiler, etc., but we need a build compiler to generate parts of the source.
3696
3697 if test "$cross_compiling" = yes ; then
3698
3699         # defaults that we might want to override
3700         : ${BUILD_CFLAGS:=''}
3701         : ${BUILD_CPPFLAGS:=''}
3702         : ${BUILD_LDFLAGS:=''}
3703         : ${BUILD_LIBS:=''}
3704         : ${BUILD_EXEEXT:='$x'}
3705         : ${BUILD_OBJEXT:='o'}
3706
3707 # Check whether --with-build-cc or --without-build-cc was given.
3708 if test "${with_build_cc+set}" = set; then
3709   withval="$with_build_cc"
3710   BUILD_CC="$withval"
3711 else
3712   for ac_prog in gcc clang c99 c89 cc cl
3713 do
3714   # Extract the first word of "$ac_prog", so it can be a program name with args.
3715 set dummy $ac_prog; ac_word=$2
3716 echo "$as_me:3716: checking for $ac_word" >&5
3717 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3718 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3719   echo $ECHO_N "(cached) $ECHO_C" >&6
3720 else
3721   if test -n "$BUILD_CC"; then
3722   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3723 else
3724   ac_save_IFS=$IFS; IFS=$ac_path_separator
3725 ac_dummy="$PATH"
3726 for ac_dir in $ac_dummy; do
3727   IFS=$ac_save_IFS
3728   test -z "$ac_dir" && ac_dir=.
3729   $as_executable_p "$ac_dir/$ac_word" || continue
3730 ac_cv_prog_BUILD_CC="$ac_prog"
3731 echo "$as_me:3731: found $ac_dir/$ac_word" >&5
3732 break
3733 done
3734
3735 fi
3736 fi
3737 BUILD_CC=$ac_cv_prog_BUILD_CC
3738 if test -n "$BUILD_CC"; then
3739   echo "$as_me:3739: result: $BUILD_CC" >&5
3740 echo "${ECHO_T}$BUILD_CC" >&6
3741 else
3742   echo "$as_me:3742: result: no" >&5
3743 echo "${ECHO_T}no" >&6
3744 fi
3745
3746   test -n "$BUILD_CC" && break
3747 done
3748 test -n "$BUILD_CC" || BUILD_CC="none"
3749
3750 fi;
3751         echo "$as_me:3751: checking for native build C compiler" >&5
3752 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3753         echo "$as_me:3753: result: $BUILD_CC" >&5
3754 echo "${ECHO_T}$BUILD_CC" >&6
3755
3756         echo "$as_me:3756: checking for native build C preprocessor" >&5
3757 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3758
3759 # Check whether --with-build-cpp or --without-build-cpp was given.
3760 if test "${with_build_cpp+set}" = set; then
3761   withval="$with_build_cpp"
3762   BUILD_CPP="$withval"
3763 else
3764   BUILD_CPP='${BUILD_CC} -E'
3765 fi;
3766         echo "$as_me:3766: result: $BUILD_CPP" >&5
3767 echo "${ECHO_T}$BUILD_CPP" >&6
3768
3769         echo "$as_me:3769: checking for native build C flags" >&5
3770 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3771
3772 # Check whether --with-build-cflags or --without-build-cflags was given.
3773 if test "${with_build_cflags+set}" = set; then
3774   withval="$with_build_cflags"
3775   BUILD_CFLAGS="$withval"
3776 fi;
3777         echo "$as_me:3777: result: $BUILD_CFLAGS" >&5
3778 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3779
3780         echo "$as_me:3780: checking for native build C preprocessor-flags" >&5
3781 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3782
3783 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3784 if test "${with_build_cppflags+set}" = set; then
3785   withval="$with_build_cppflags"
3786   BUILD_CPPFLAGS="$withval"
3787 fi;
3788         echo "$as_me:3788: result: $BUILD_CPPFLAGS" >&5
3789 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3790
3791         echo "$as_me:3791: checking for native build linker-flags" >&5
3792 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3793
3794 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3795 if test "${with_build_ldflags+set}" = set; then
3796   withval="$with_build_ldflags"
3797   BUILD_LDFLAGS="$withval"
3798 fi;
3799         echo "$as_me:3799: result: $BUILD_LDFLAGS" >&5
3800 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3801
3802         echo "$as_me:3802: checking for native build linker-libraries" >&5
3803 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3804
3805 # Check whether --with-build-libs or --without-build-libs was given.
3806 if test "${with_build_libs+set}" = set; then
3807   withval="$with_build_libs"
3808   BUILD_LIBS="$withval"
3809 fi;
3810         echo "$as_me:3810: result: $BUILD_LIBS" >&5
3811 echo "${ECHO_T}$BUILD_LIBS" >&6
3812
3813         # this assumes we're on Unix.
3814         BUILD_EXEEXT=
3815         BUILD_OBJEXT=o
3816
3817         : ${BUILD_CC:='${CC}'}
3818
3819         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3820                 { { echo "$as_me:3820: error: Cross-build requires two compilers.
3821 Use --with-build-cc to specify the native compiler." >&5
3822 echo "$as_me: error: Cross-build requires two compilers.
3823 Use --with-build-cc to specify the native compiler." >&2;}
3824    { (exit 1); exit 1; }; }
3825         fi
3826
3827 else
3828         : ${BUILD_CC:='${CC}'}
3829         : ${BUILD_CPP:='${CPP}'}
3830         : ${BUILD_CFLAGS:='${CFLAGS}'}
3831         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3832         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3833         : ${BUILD_LIBS:='${LIBS}'}
3834         : ${BUILD_EXEEXT:='$x'}
3835         : ${BUILD_OBJEXT:='o'}
3836 fi
3837
3838 ###############################################################################
3839
3840 ### Options to allow the user to specify the set of libraries which are used.
3841 ### Use "--without-normal --with-shared" to allow the default model to be
3842 ### shared, for example.
3843 cf_list_models=""
3844
3845 echo "$as_me:3845: checking if you want to build shared C-objects" >&5
3846 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3847
3848 # Check whether --with-shared or --without-shared was given.
3849 if test "${with_shared+set}" = set; then
3850   withval="$with_shared"
3851   with_shared=$withval
3852 else
3853   with_shared=no
3854 fi;
3855 echo "$as_me:3855: result: $with_shared" >&5
3856 echo "${ECHO_T}$with_shared" >&6
3857 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3858
3859 echo "$as_me:3859: checking for specified models" >&5
3860 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3861 test -z "$cf_list_models" && cf_list_models=normal
3862 echo "$as_me:3862: result: $cf_list_models" >&5
3863 echo "${ECHO_T}$cf_list_models" >&6
3864
3865 ### Use the first model as the default, and save its suffix for use in building
3866 ### up test-applications.
3867 echo "$as_me:3867: checking for default model" >&5
3868 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3869 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3870 echo "$as_me:3870: result: $DFT_LWR_MODEL" >&5
3871 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3872
3873 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3874
3875 echo "$as_me:3875: checking for specific curses-directory" >&5
3876 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3877
3878 # Check whether --with-curses-dir or --without-curses-dir was given.
3879 if test "${with_curses_dir+set}" = set; then
3880   withval="$with_curses_dir"
3881   cf_cv_curses_dir=$withval
3882 else
3883   cf_cv_curses_dir=no
3884 fi;
3885 echo "$as_me:3885: result: $cf_cv_curses_dir" >&5
3886 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3887
3888 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3889 then
3890
3891 if test "x$prefix" != xNONE; then
3892         cf_path_syntax="$prefix"
3893 else
3894         cf_path_syntax="$ac_default_prefix"
3895 fi
3896
3897 case ".$withval" in
3898 (.\$\(*\)*|.\'*\'*)
3899         ;;
3900 (..|./*|.\\*)
3901         ;;
3902 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3903         ;;
3904 (.\${*prefix}*|.\${*dir}*)
3905         eval withval="$withval"
3906         case ".$withval" in
3907         (.NONE/*)
3908                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3909                 ;;
3910         esac
3911         ;;
3912 (.no|.NONE/*)
3913         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3914         ;;
3915 (*)
3916         { { echo "$as_me:3916: error: expected a pathname, not \"$withval\"" >&5
3917 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3918    { (exit 1); exit 1; }; }
3919         ;;
3920 esac
3921
3922         if test -d "$cf_cv_curses_dir"
3923         then
3924
3925 if test -n "$cf_cv_curses_dir/include" ; then
3926   for cf_add_incdir in $cf_cv_curses_dir/include
3927   do
3928         while test $cf_add_incdir != /usr/include
3929         do
3930           if test -d $cf_add_incdir
3931           then
3932                 cf_have_incdir=no
3933                 if test -n "$CFLAGS$CPPFLAGS" ; then
3934                   # a loop is needed to ensure we can add subdirs of existing dirs
3935                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3936                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3937                           cf_have_incdir=yes; break
3938                         fi
3939                   done
3940                 fi
3941
3942                 if test "$cf_have_incdir" = no ; then
3943                   if test "$cf_add_incdir" = /usr/local/include ; then
3944                         if test "$GCC" = yes
3945                         then
3946                           cf_save_CPPFLAGS=$CPPFLAGS
3947
3948         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3949         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
3950
3951                           cat >conftest.$ac_ext <<_ACEOF
3952 #line 3952 "configure"
3953 #include "confdefs.h"
3954 #include <stdio.h>
3955 int
3956 main (void)
3957 {
3958 printf("Hello")
3959   ;
3960   return 0;
3961 }
3962 _ACEOF
3963 rm -f conftest.$ac_objext
3964 if { (eval echo "$as_me:3964: \"$ac_compile\"") >&5
3965   (eval $ac_compile) 2>&5
3966   ac_status=$?
3967   echo "$as_me:3967: \$? = $ac_status" >&5
3968   (exit $ac_status); } &&
3969          { ac_try='test -s conftest.$ac_objext'
3970   { (eval echo "$as_me:3970: \"$ac_try\"") >&5
3971   (eval $ac_try) 2>&5
3972   ac_status=$?
3973   echo "$as_me:3973: \$? = $ac_status" >&5
3974   (exit $ac_status); }; }; then
3975   :
3976 else
3977   echo "$as_me: failed program was:" >&5
3978 cat conftest.$ac_ext >&5
3979 cf_have_incdir=yes
3980 fi
3981 rm -f conftest.$ac_objext conftest.$ac_ext
3982                           CPPFLAGS=$cf_save_CPPFLAGS
3983                         fi
3984                   fi
3985                 fi
3986
3987                 if test "$cf_have_incdir" = no ; then
3988                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3989
3990 echo "${as_me:-configure}:3990: testing adding $cf_add_incdir to include-path ..." 1>&5
3991
3992                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3993
3994                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3995                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3996                   cf_add_incdir="$cf_top_incdir"
3997                 else
3998                   break
3999                 fi
4000           else
4001                 break
4002           fi
4003         done
4004   done
4005 fi
4006
4007 if test -n "$cf_cv_curses_dir/lib" ; then
4008         for cf_add_libdir in $cf_cv_curses_dir/lib
4009         do
4010                 if test $cf_add_libdir = /usr/lib ; then
4011                         :
4012                 elif test -d $cf_add_libdir
4013                 then
4014                         cf_have_libdir=no
4015                         if test -n "$LDFLAGS$LIBS" ; then
4016                                 # a loop is needed to ensure we can add subdirs of existing dirs
4017                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4018                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4019                                                 cf_have_libdir=yes; break
4020                                         fi
4021                                 done
4022                         fi
4023                         if test "$cf_have_libdir" = no ; then
4024                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4025
4026 echo "${as_me:-configure}:4026: testing adding $cf_add_libdir to library-path ..." 1>&5
4027
4028                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4029                         fi
4030                 fi
4031         done
4032 fi
4033
4034         fi
4035 fi
4036
4037 cf_ncuconfig_root=ncurses
4038 cf_have_ncuconfig=no
4039
4040 if test "x${PKG_CONFIG:=none}" != xnone; then
4041         echo "$as_me:4041: checking pkg-config for $cf_ncuconfig_root" >&5
4042 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4043         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4044                 echo "$as_me:4044: result: yes" >&5
4045 echo "${ECHO_T}yes" >&6
4046
4047                 echo "$as_me:4047: checking if the $cf_ncuconfig_root package files work" >&5
4048 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4049                 cf_have_ncuconfig=unknown
4050
4051                 cf_save_CPPFLAGS="$CPPFLAGS"
4052                 cf_save_LIBS="$LIBS"
4053
4054 cf_fix_cppflags=no
4055 cf_new_cflags=
4056 cf_new_cppflags=
4057 cf_new_extra_cppflags=
4058
4059 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
4060 do
4061 case $cf_fix_cppflags in
4062 (no)
4063         case $cf_add_cflags in
4064         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4065                 case $cf_add_cflags in
4066                 (-D*)
4067                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4068
4069                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4070                                 && test -z "${cf_tst_cflags}" \
4071                                 && cf_fix_cppflags=yes
4072
4073                         if test $cf_fix_cppflags = yes ; then
4074
4075         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4076         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4077
4078                                 continue
4079                         elif test "${cf_tst_cflags}" = "\"'" ; then
4080
4081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4083
4084                                 continue
4085                         fi
4086                         ;;
4087                 esac
4088                 case "$CPPFLAGS" in
4089                 (*$cf_add_cflags)
4090                         ;;
4091                 (*)
4092                         case $cf_add_cflags in
4093                         (-D*)
4094                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4095
4096 CPPFLAGS=`echo "$CPPFLAGS" | \
4097         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4098                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4099
4100                                 ;;
4101                         esac
4102
4103         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4104         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4105
4106                         ;;
4107                 esac
4108                 ;;
4109         (*)
4110
4111         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4112         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4113
4114                 ;;
4115         esac
4116         ;;
4117 (yes)
4118
4119         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4120         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4121
4122         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4123
4124         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4125                 && test -z "${cf_tst_cflags}" \
4126                 && cf_fix_cppflags=no
4127         ;;
4128 esac
4129 done
4130
4131 if test -n "$cf_new_cflags" ; then
4132
4133         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4134         CFLAGS="${CFLAGS}$cf_new_cflags"
4135
4136 fi
4137
4138 if test -n "$cf_new_cppflags" ; then
4139
4140         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4141         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4142
4143 fi
4144
4145 if test -n "$cf_new_extra_cppflags" ; then
4146
4147         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4148         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4149
4150 fi
4151
4152 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4153 # Filter out duplicates - this happens with badly-designed ".pc" files...
4154 for cf_add_1lib in $LIBS
4155 do
4156         for cf_add_2lib in $cf_add_libs
4157         do
4158                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4159                 then
4160                         cf_add_1lib=
4161                         break
4162                 fi
4163         done
4164         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4165 done
4166 LIBS="$cf_add_libs"
4167
4168                 cat >conftest.$ac_ext <<_ACEOF
4169 #line 4169 "configure"
4170 #include "confdefs.h"
4171 #include <${cf_cv_ncurses_header:-curses.h}>
4172 int
4173 main (void)
4174 {
4175 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4176   ;
4177   return 0;
4178 }
4179 _ACEOF
4180 rm -f conftest.$ac_objext conftest$ac_exeext
4181 if { (eval echo "$as_me:4181: \"$ac_link\"") >&5
4182   (eval $ac_link) 2>&5
4183   ac_status=$?
4184   echo "$as_me:4184: \$? = $ac_status" >&5
4185   (exit $ac_status); } &&
4186          { ac_try='test -s conftest$ac_exeext'
4187   { (eval echo "$as_me:4187: \"$ac_try\"") >&5
4188   (eval $ac_try) 2>&5
4189   ac_status=$?
4190   echo "$as_me:4190: \$? = $ac_status" >&5
4191   (exit $ac_status); }; }; then
4192   if test "$cross_compiling" = yes; then
4193   cf_have_ncuconfig=maybe
4194 else
4195   cat >conftest.$ac_ext <<_ACEOF
4196 #line 4196 "configure"
4197 #include "confdefs.h"
4198 #include <${cf_cv_ncurses_header:-curses.h}>
4199                                 int main(void)
4200                                 { char *xx = curses_version(); return (xx == 0); }
4201 _ACEOF
4202 rm -f conftest$ac_exeext
4203 if { (eval echo "$as_me:4203: \"$ac_link\"") >&5
4204   (eval $ac_link) 2>&5
4205   ac_status=$?
4206   echo "$as_me:4206: \$? = $ac_status" >&5
4207   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4208   { (eval echo "$as_me:4208: \"$ac_try\"") >&5
4209   (eval $ac_try) 2>&5
4210   ac_status=$?
4211   echo "$as_me:4211: \$? = $ac_status" >&5
4212   (exit $ac_status); }; }; then
4213   cf_have_ncuconfig=yes
4214 else
4215   echo "$as_me: program exited with status $ac_status" >&5
4216 echo "$as_me: failed program was:" >&5
4217 cat conftest.$ac_ext >&5
4218 cf_have_ncuconfig=no
4219 fi
4220 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4221 fi
4222 else
4223   echo "$as_me: failed program was:" >&5
4224 cat conftest.$ac_ext >&5
4225 cf_have_ncuconfig=no
4226 fi
4227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4228                 echo "$as_me:4228: result: $cf_have_ncuconfig" >&5
4229 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4230                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4231                 if test "$cf_have_ncuconfig" != "yes"
4232                 then
4233                         CPPFLAGS="$cf_save_CPPFLAGS"
4234                         LIBS="$cf_save_LIBS"
4235                         NCURSES_CONFIG_PKG=none
4236                 else
4237
4238 cat >>confdefs.h <<\EOF
4239 #define NCURSES 1
4240 EOF
4241
4242                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4243
4244 echo "$as_me:4244: checking for terminfo header" >&5
4245 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4246 if test "${cf_cv_term_header+set}" = set; then
4247   echo $ECHO_N "(cached) $ECHO_C" >&6
4248 else
4249
4250 case ${cf_cv_ncurses_header} in
4251 (*/ncurses.h|*/ncursesw.h)
4252         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4253         ;;
4254 (*)
4255         cf_term_header=term.h
4256         ;;
4257 esac
4258
4259 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4260 do
4261 cat >conftest.$ac_ext <<_ACEOF
4262 #line 4262 "configure"
4263 #include "confdefs.h"
4264 #include <stdio.h>
4265 #include <${cf_cv_ncurses_header:-curses.h}>
4266 #include <$cf_test>
4267
4268 int
4269 main (void)
4270 {
4271 int x = auto_left_margin
4272   ;
4273   return 0;
4274 }
4275 _ACEOF
4276 rm -f conftest.$ac_objext
4277 if { (eval echo "$as_me:4277: \"$ac_compile\"") >&5
4278   (eval $ac_compile) 2>&5
4279   ac_status=$?
4280   echo "$as_me:4280: \$? = $ac_status" >&5
4281   (exit $ac_status); } &&
4282          { ac_try='test -s conftest.$ac_objext'
4283   { (eval echo "$as_me:4283: \"$ac_try\"") >&5
4284   (eval $ac_try) 2>&5
4285   ac_status=$?
4286   echo "$as_me:4286: \$? = $ac_status" >&5
4287   (exit $ac_status); }; }; then
4288
4289         cf_cv_term_header="$cf_test"
4290 else
4291   echo "$as_me: failed program was:" >&5
4292 cat conftest.$ac_ext >&5
4293
4294         cf_cv_term_header=unknown
4295
4296 fi
4297 rm -f conftest.$ac_objext conftest.$ac_ext
4298         test "$cf_cv_term_header" != unknown && break
4299 done
4300
4301 fi
4302 echo "$as_me:4302: result: $cf_cv_term_header" >&5
4303 echo "${ECHO_T}$cf_cv_term_header" >&6
4304
4305 # Set definitions to allow ifdef'ing to accommodate subdirectories
4306
4307 case $cf_cv_term_header in
4308 (*term.h)
4309
4310 cat >>confdefs.h <<\EOF
4311 #define HAVE_TERM_H 1
4312 EOF
4313
4314         ;;
4315 esac
4316
4317 case $cf_cv_term_header in
4318 (ncurses/term.h)
4319
4320 cat >>confdefs.h <<\EOF
4321 #define HAVE_NCURSES_TERM_H 1
4322 EOF
4323
4324         ;;
4325 (ncursesw/term.h)
4326
4327 cat >>confdefs.h <<\EOF
4328 #define HAVE_NCURSESW_TERM_H 1
4329 EOF
4330
4331         ;;
4332 esac
4333
4334                 fi
4335
4336         else
4337                 echo "$as_me:4337: result: no" >&5
4338 echo "${ECHO_T}no" >&6
4339                 NCURSES_CONFIG_PKG=none
4340         fi
4341 else
4342         NCURSES_CONFIG_PKG=none
4343 fi
4344
4345 if test "x$cf_have_ncuconfig" = "xno"; then
4346         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4347
4348 if test -n "$ac_tool_prefix"; then
4349   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4350   do
4351     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4352 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4353 echo "$as_me:4353: checking for $ac_word" >&5
4354 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4355 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4356   echo $ECHO_N "(cached) $ECHO_C" >&6
4357 else
4358   if test -n "$NCURSES_CONFIG"; then
4359   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4360 else
4361   ac_save_IFS=$IFS; IFS=$ac_path_separator
4362 ac_dummy="$PATH"
4363 for ac_dir in $ac_dummy; do
4364   IFS=$ac_save_IFS
4365   test -z "$ac_dir" && ac_dir=.
4366   $as_executable_p "$ac_dir/$ac_word" || continue
4367 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4368 echo "$as_me:4368: found $ac_dir/$ac_word" >&5
4369 break
4370 done
4371
4372 fi
4373 fi
4374 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4375 if test -n "$NCURSES_CONFIG"; then
4376   echo "$as_me:4376: result: $NCURSES_CONFIG" >&5
4377 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4378 else
4379   echo "$as_me:4379: result: no" >&5
4380 echo "${ECHO_T}no" >&6
4381 fi
4382
4383     test -n "$NCURSES_CONFIG" && break
4384   done
4385 fi
4386 if test -z "$NCURSES_CONFIG"; then
4387   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4388   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4389 do
4390   # Extract the first word of "$ac_prog", so it can be a program name with args.
4391 set dummy $ac_prog; ac_word=$2
4392 echo "$as_me:4392: checking for $ac_word" >&5
4393 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4394 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4395   echo $ECHO_N "(cached) $ECHO_C" >&6
4396 else
4397   if test -n "$ac_ct_NCURSES_CONFIG"; then
4398   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4399 else
4400   ac_save_IFS=$IFS; IFS=$ac_path_separator
4401 ac_dummy="$PATH"
4402 for ac_dir in $ac_dummy; do
4403   IFS=$ac_save_IFS
4404   test -z "$ac_dir" && ac_dir=.
4405   $as_executable_p "$ac_dir/$ac_word" || continue
4406 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4407 echo "$as_me:4407: found $ac_dir/$ac_word" >&5
4408 break
4409 done
4410
4411 fi
4412 fi
4413 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4414 if test -n "$ac_ct_NCURSES_CONFIG"; then
4415   echo "$as_me:4415: result: $ac_ct_NCURSES_CONFIG" >&5
4416 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4417 else
4418   echo "$as_me:4418: result: no" >&5
4419 echo "${ECHO_T}no" >&6
4420 fi
4421
4422   test -n "$ac_ct_NCURSES_CONFIG" && break
4423 done
4424 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4425
4426   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4427 fi
4428
4429         if test "$NCURSES_CONFIG" != none ; then
4430
4431 cf_fix_cppflags=no
4432 cf_new_cflags=
4433 cf_new_cppflags=
4434 cf_new_extra_cppflags=
4435
4436 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4437 do
4438 case $cf_fix_cppflags in
4439 (no)
4440         case $cf_add_cflags in
4441         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4442                 case $cf_add_cflags in
4443                 (-D*)
4444                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4445
4446                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4447                                 && test -z "${cf_tst_cflags}" \
4448                                 && cf_fix_cppflags=yes
4449
4450                         if test $cf_fix_cppflags = yes ; then
4451
4452         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4453         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4454
4455                                 continue
4456                         elif test "${cf_tst_cflags}" = "\"'" ; then
4457
4458         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4459         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4460
4461                                 continue
4462                         fi
4463                         ;;
4464                 esac
4465                 case "$CPPFLAGS" in
4466                 (*$cf_add_cflags)
4467                         ;;
4468                 (*)
4469                         case $cf_add_cflags in
4470                         (-D*)
4471                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4472
4473 CPPFLAGS=`echo "$CPPFLAGS" | \
4474         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4475                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4476
4477                                 ;;
4478                         esac
4479
4480         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4481         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4482
4483                         ;;
4484                 esac
4485                 ;;
4486         (*)
4487
4488         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4489         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4490
4491                 ;;
4492         esac
4493         ;;
4494 (yes)
4495
4496         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4497         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4498
4499         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4500
4501         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4502                 && test -z "${cf_tst_cflags}" \
4503                 && cf_fix_cppflags=no
4504         ;;
4505 esac
4506 done
4507
4508 if test -n "$cf_new_cflags" ; then
4509
4510         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4511         CFLAGS="${CFLAGS}$cf_new_cflags"
4512
4513 fi
4514
4515 if test -n "$cf_new_cppflags" ; then
4516
4517         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4518         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4519
4520 fi
4521
4522 if test -n "$cf_new_extra_cppflags" ; then
4523
4524         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4525         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4526
4527 fi
4528
4529 cf_add_libs="`$NCURSES_CONFIG --libs`"
4530 # Filter out duplicates - this happens with badly-designed ".pc" files...
4531 for cf_add_1lib in $LIBS
4532 do
4533         for cf_add_2lib in $cf_add_libs
4534         do
4535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4536                 then
4537                         cf_add_1lib=
4538                         break
4539                 fi
4540         done
4541         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4542 done
4543 LIBS="$cf_add_libs"
4544
4545                 # even with config script, some packages use no-override for curses.h
4546
4547 echo "$as_me:4547: checking if we have identified curses headers" >&5
4548 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4549 if test "${cf_cv_ncurses_header+set}" = set; then
4550   echo $ECHO_N "(cached) $ECHO_C" >&6
4551 else
4552
4553 cf_cv_ncurses_header=none
4554 for cf_header in \
4555         ncurses.h ncurses/ncurses.h \
4556         curses.h ncurses/curses.h
4557 do
4558 cat >conftest.$ac_ext <<_ACEOF
4559 #line 4559 "configure"
4560 #include "confdefs.h"
4561 #include <${cf_header}>
4562 int
4563 main (void)
4564 {
4565 initscr(); tgoto("?", 0,0)
4566   ;
4567   return 0;
4568 }
4569 _ACEOF
4570 rm -f conftest.$ac_objext
4571 if { (eval echo "$as_me:4571: \"$ac_compile\"") >&5
4572   (eval $ac_compile) 2>&5
4573   ac_status=$?
4574   echo "$as_me:4574: \$? = $ac_status" >&5
4575   (exit $ac_status); } &&
4576          { ac_try='test -s conftest.$ac_objext'
4577   { (eval echo "$as_me:4577: \"$ac_try\"") >&5
4578   (eval $ac_try) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit $ac_status); }; }; then
4582   cf_cv_ncurses_header=$cf_header; break
4583 else
4584   echo "$as_me: failed program was:" >&5
4585 cat conftest.$ac_ext >&5
4586 fi
4587 rm -f conftest.$ac_objext conftest.$ac_ext
4588 done
4589
4590 fi
4591 echo "$as_me:4591: result: $cf_cv_ncurses_header" >&5
4592 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4593
4594 if test "$cf_cv_ncurses_header" = none ; then
4595         { { echo "$as_me:4595: error: No curses header-files found" >&5
4596 echo "$as_me: error: No curses header-files found" >&2;}
4597    { (exit 1); exit 1; }; }
4598 fi
4599
4600 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4601
4602 for ac_header in $cf_cv_ncurses_header
4603 do
4604 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4605 echo "$as_me:4605: checking for $ac_header" >&5
4606 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4607 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4608   echo $ECHO_N "(cached) $ECHO_C" >&6
4609 else
4610   cat >conftest.$ac_ext <<_ACEOF
4611 #line 4611 "configure"
4612 #include "confdefs.h"
4613 #include <$ac_header>
4614 _ACEOF
4615 if { (eval echo "$as_me:4615: \"$ac_cpp conftest.$ac_ext\"") >&5
4616   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4617   ac_status=$?
4618   egrep -v '^ *\+' conftest.er1 >conftest.err
4619   rm -f conftest.er1
4620   cat conftest.err >&5
4621   echo "$as_me:4621: \$? = $ac_status" >&5
4622   (exit $ac_status); } >/dev/null; then
4623   if test -s conftest.err; then
4624     ac_cpp_err=$ac_c_preproc_warn_flag
4625   else
4626     ac_cpp_err=
4627   fi
4628 else
4629   ac_cpp_err=yes
4630 fi
4631 if test -z "$ac_cpp_err"; then
4632   eval "$as_ac_Header=yes"
4633 else
4634   echo "$as_me: failed program was:" >&5
4635   cat conftest.$ac_ext >&5
4636   eval "$as_ac_Header=no"
4637 fi
4638 rm -f conftest.err conftest.$ac_ext
4639 fi
4640 echo "$as_me:4640: result: `eval echo '${'$as_ac_Header'}'`" >&5
4641 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4642 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4643   cat >>confdefs.h <<EOF
4644 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4645 EOF
4646
4647 fi
4648 done
4649
4650 cat >>confdefs.h <<\EOF
4651 #define NCURSES 1
4652 EOF
4653
4654 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4655
4656                 cat >>confdefs.h <<EOF
4657 #define $cf_nculib_ROOT 1
4658 EOF
4659
4660                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4661
4662         else
4663
4664 cf_ncuhdr_root=ncurses
4665
4666 test -n "$cf_cv_curses_dir" && \
4667 test "$cf_cv_curses_dir" != "no" && { \
4668
4669 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4670   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4671   do
4672         while test $cf_add_incdir != /usr/include
4673         do
4674           if test -d $cf_add_incdir
4675           then
4676                 cf_have_incdir=no
4677                 if test -n "$CFLAGS$CPPFLAGS" ; then
4678                   # a loop is needed to ensure we can add subdirs of existing dirs
4679                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4680                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4681                           cf_have_incdir=yes; break
4682                         fi
4683                   done
4684                 fi
4685
4686                 if test "$cf_have_incdir" = no ; then
4687                   if test "$cf_add_incdir" = /usr/local/include ; then
4688                         if test "$GCC" = yes
4689                         then
4690                           cf_save_CPPFLAGS=$CPPFLAGS
4691
4692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4693         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4694
4695                           cat >conftest.$ac_ext <<_ACEOF
4696 #line 4696 "configure"
4697 #include "confdefs.h"
4698 #include <stdio.h>
4699 int
4700 main (void)
4701 {
4702 printf("Hello")
4703   ;
4704   return 0;
4705 }
4706 _ACEOF
4707 rm -f conftest.$ac_objext
4708 if { (eval echo "$as_me:4708: \"$ac_compile\"") >&5
4709   (eval $ac_compile) 2>&5
4710   ac_status=$?
4711   echo "$as_me:4711: \$? = $ac_status" >&5
4712   (exit $ac_status); } &&
4713          { ac_try='test -s conftest.$ac_objext'
4714   { (eval echo "$as_me:4714: \"$ac_try\"") >&5
4715   (eval $ac_try) 2>&5
4716   ac_status=$?
4717   echo "$as_me:4717: \$? = $ac_status" >&5
4718   (exit $ac_status); }; }; then
4719   :
4720 else
4721   echo "$as_me: failed program was:" >&5
4722 cat conftest.$ac_ext >&5
4723 cf_have_incdir=yes
4724 fi
4725 rm -f conftest.$ac_objext conftest.$ac_ext
4726                           CPPFLAGS=$cf_save_CPPFLAGS
4727                         fi
4728                   fi
4729                 fi
4730
4731                 if test "$cf_have_incdir" = no ; then
4732                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4733
4734 echo "${as_me:-configure}:4734: testing adding $cf_add_incdir to include-path ..." 1>&5
4735
4736                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4737
4738                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4739                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4740                   cf_add_incdir="$cf_top_incdir"
4741                 else
4742                   break
4743                 fi
4744           else
4745                 break
4746           fi
4747         done
4748   done
4749 fi
4750
4751 }
4752
4753 echo "$as_me:4753: checking for $cf_ncuhdr_root header in include-path" >&5
4754 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4755 if test "${cf_cv_ncurses_h+set}" = set; then
4756   echo $ECHO_N "(cached) $ECHO_C" >&6
4757 else
4758
4759         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4760         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4761         for cf_header in $cf_header_list
4762         do
4763
4764         cat >conftest.$ac_ext <<_ACEOF
4765 #line 4765 "configure"
4766 #include "confdefs.h"
4767
4768 #include <$cf_header>
4769 int
4770 main (void)
4771 {
4772
4773 #ifdef NCURSES_VERSION
4774
4775 printf("%s\n", NCURSES_VERSION);
4776 #else
4777 #ifdef __NCURSES_H
4778 printf("old\n");
4779 #else
4780         make an error
4781 #endif
4782 #endif
4783
4784   ;
4785   return 0;
4786 }
4787 _ACEOF
4788 rm -f conftest.$ac_objext
4789 if { (eval echo "$as_me:4789: \"$ac_compile\"") >&5
4790   (eval $ac_compile) 2>&5
4791   ac_status=$?
4792   echo "$as_me:4792: \$? = $ac_status" >&5
4793   (exit $ac_status); } &&
4794          { ac_try='test -s conftest.$ac_objext'
4795   { (eval echo "$as_me:4795: \"$ac_try\"") >&5
4796   (eval $ac_try) 2>&5
4797   ac_status=$?
4798   echo "$as_me:4798: \$? = $ac_status" >&5
4799   (exit $ac_status); }; }; then
4800   cf_cv_ncurses_h=$cf_header
4801
4802 else
4803   echo "$as_me: failed program was:" >&5
4804 cat conftest.$ac_ext >&5
4805 cf_cv_ncurses_h=no
4806 fi
4807 rm -f conftest.$ac_objext conftest.$ac_ext
4808
4809                 test "$cf_cv_ncurses_h" != no && break
4810         done
4811
4812 fi
4813 echo "$as_me:4813: result: $cf_cv_ncurses_h" >&5
4814 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4815
4816 if test "$cf_cv_ncurses_h" != no ; then
4817         cf_cv_ncurses_header=$cf_cv_ncurses_h
4818 else
4819
4820 echo "$as_me:4820: checking for $cf_ncuhdr_root include-path" >&5
4821 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4822 if test "${cf_cv_ncurses_h2+set}" = set; then
4823   echo $ECHO_N "(cached) $ECHO_C" >&6
4824 else
4825
4826         test -n "$verbose" && echo
4827
4828 cf_search=
4829
4830 # collect the current set of include-directories from compiler flags
4831 cf_header_path_list=""
4832 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4833         for cf_header_path in $CPPFLAGS $CFLAGS
4834         do
4835                 case $cf_header_path in
4836                 (-I*)
4837                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4838
4839 test "x$cf_header_path" != "xNONE" && \
4840 test -d "$cf_header_path" && \
4841  {
4842         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4843         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4844         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4845         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4846         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4847         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"
4848 }
4849
4850                         cf_header_path_list="$cf_header_path_list $cf_search"
4851                         ;;
4852                 esac
4853         done
4854 fi
4855
4856 # add the variations for the package we are looking for
4857
4858 cf_search=
4859
4860 test "x$prefix" != "xNONE" && \
4861 test -d "$prefix" && \
4862  {
4863         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4864         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4865         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4866         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4867         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4868         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4869 }
4870
4871 for cf_subdir_prefix in \
4872         /usr \
4873         /usr/local \
4874         /usr/pkg \
4875         /opt \
4876         /opt/local \
4877         $HOME
4878 do
4879
4880 test "x$cf_subdir_prefix" != "x$prefix" && \
4881 test -d "$cf_subdir_prefix" && \
4882 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4883         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4884         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4885         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4886         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4887         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4888         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"
4889 }
4890
4891 done
4892
4893 test "$includedir" != NONE && \
4894 test "$includedir" != "/usr/include" && \
4895 test -d "$includedir" && {
4896         test -d $includedir &&    cf_search="$cf_search $includedir"
4897         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4898 }
4899
4900 test "$oldincludedir" != NONE && \
4901 test "$oldincludedir" != "/usr/include" && \
4902 test -d "$oldincludedir" && {
4903         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4904         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4905 }
4906
4907 cf_search="$cf_search $cf_header_path_list"
4908
4909         test -n "$verbose" && echo search path $cf_search
4910         cf_save2_CPPFLAGS="$CPPFLAGS"
4911         for cf_incdir in $cf_search
4912         do
4913
4914 if test -n "$cf_incdir" ; then
4915   for cf_add_incdir in $cf_incdir
4916   do
4917         while test $cf_add_incdir != /usr/include
4918         do
4919           if test -d $cf_add_incdir
4920           then
4921                 cf_have_incdir=no
4922                 if test -n "$CFLAGS$CPPFLAGS" ; then
4923                   # a loop is needed to ensure we can add subdirs of existing dirs
4924                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4925                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4926                           cf_have_incdir=yes; break
4927                         fi
4928                   done
4929                 fi
4930
4931                 if test "$cf_have_incdir" = no ; then
4932                   if test "$cf_add_incdir" = /usr/local/include ; then
4933                         if test "$GCC" = yes
4934                         then
4935                           cf_save_CPPFLAGS=$CPPFLAGS
4936
4937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4938         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4939
4940                           cat >conftest.$ac_ext <<_ACEOF
4941 #line 4941 "configure"
4942 #include "confdefs.h"
4943 #include <stdio.h>
4944 int
4945 main (void)
4946 {
4947 printf("Hello")
4948   ;
4949   return 0;
4950 }
4951 _ACEOF
4952 rm -f conftest.$ac_objext
4953 if { (eval echo "$as_me:4953: \"$ac_compile\"") >&5
4954   (eval $ac_compile) 2>&5
4955   ac_status=$?
4956   echo "$as_me:4956: \$? = $ac_status" >&5
4957   (exit $ac_status); } &&
4958          { ac_try='test -s conftest.$ac_objext'
4959   { (eval echo "$as_me:4959: \"$ac_try\"") >&5
4960   (eval $ac_try) 2>&5
4961   ac_status=$?
4962   echo "$as_me:4962: \$? = $ac_status" >&5
4963   (exit $ac_status); }; }; then
4964   :
4965 else
4966   echo "$as_me: failed program was:" >&5
4967 cat conftest.$ac_ext >&5
4968 cf_have_incdir=yes
4969 fi
4970 rm -f conftest.$ac_objext conftest.$ac_ext
4971                           CPPFLAGS=$cf_save_CPPFLAGS
4972                         fi
4973                   fi
4974                 fi
4975
4976                 if test "$cf_have_incdir" = no ; then
4977                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4978
4979 echo "${as_me:-configure}:4979: testing adding $cf_add_incdir to include-path ..." 1>&5
4980
4981                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4982
4983                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4984                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4985                   cf_add_incdir="$cf_top_incdir"
4986                 else
4987                   break
4988                 fi
4989           else
4990                 break
4991           fi
4992         done
4993   done
4994 fi
4995
4996                 for cf_header in \
4997                         ncurses.h \
4998                         curses.h
4999                 do
5000
5001         cat >conftest.$ac_ext <<_ACEOF
5002 #line 5002 "configure"
5003 #include "confdefs.h"
5004
5005 #include <$cf_header>
5006 int
5007 main (void)
5008 {
5009
5010 #ifdef NCURSES_VERSION
5011
5012 printf("%s\n", NCURSES_VERSION);
5013 #else
5014 #ifdef __NCURSES_H
5015 printf("old\n");
5016 #else
5017         make an error
5018 #endif
5019 #endif
5020
5021   ;
5022   return 0;
5023 }
5024 _ACEOF
5025 rm -f conftest.$ac_objext
5026 if { (eval echo "$as_me:5026: \"$ac_compile\"") >&5
5027   (eval $ac_compile) 2>&5
5028   ac_status=$?
5029   echo "$as_me:5029: \$? = $ac_status" >&5
5030   (exit $ac_status); } &&
5031          { ac_try='test -s conftest.$ac_objext'
5032   { (eval echo "$as_me:5032: \"$ac_try\"") >&5
5033   (eval $ac_try) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit $ac_status); }; }; then
5037   cf_cv_ncurses_h2=$cf_header
5038
5039 else
5040   echo "$as_me: failed program was:" >&5
5041 cat conftest.$ac_ext >&5
5042 cf_cv_ncurses_h2=no
5043 fi
5044 rm -f conftest.$ac_objext conftest.$ac_ext
5045
5046                         if test "$cf_cv_ncurses_h2" != no ; then
5047                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5048                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5049                                 break
5050                         fi
5051                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5052                 done
5053                 CPPFLAGS="$cf_save2_CPPFLAGS"
5054                 test "$cf_cv_ncurses_h2" != no && break
5055         done
5056         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5056: error: not found" >&5
5057 echo "$as_me: error: not found" >&2;}
5058    { (exit 1); exit 1; }; }
5059
5060 fi
5061 echo "$as_me:5061: result: $cf_cv_ncurses_h2" >&5
5062 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5063
5064         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5065         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5066         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5067                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5068         fi
5069
5070 if test -n "$cf_1st_incdir" ; then
5071   for cf_add_incdir in $cf_1st_incdir
5072   do
5073         while test $cf_add_incdir != /usr/include
5074         do
5075           if test -d $cf_add_incdir
5076           then
5077                 cf_have_incdir=no
5078                 if test -n "$CFLAGS$CPPFLAGS" ; then
5079                   # a loop is needed to ensure we can add subdirs of existing dirs
5080                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5081                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5082                           cf_have_incdir=yes; break
5083                         fi
5084                   done
5085                 fi
5086
5087                 if test "$cf_have_incdir" = no ; then
5088                   if test "$cf_add_incdir" = /usr/local/include ; then
5089                         if test "$GCC" = yes
5090                         then
5091                           cf_save_CPPFLAGS=$CPPFLAGS
5092
5093         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5094         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5095
5096                           cat >conftest.$ac_ext <<_ACEOF
5097 #line 5097 "configure"
5098 #include "confdefs.h"
5099 #include <stdio.h>
5100 int
5101 main (void)
5102 {
5103 printf("Hello")
5104   ;
5105   return 0;
5106 }
5107 _ACEOF
5108 rm -f conftest.$ac_objext
5109 if { (eval echo "$as_me:5109: \"$ac_compile\"") >&5
5110   (eval $ac_compile) 2>&5
5111   ac_status=$?
5112   echo "$as_me:5112: \$? = $ac_status" >&5
5113   (exit $ac_status); } &&
5114          { ac_try='test -s conftest.$ac_objext'
5115   { (eval echo "$as_me:5115: \"$ac_try\"") >&5
5116   (eval $ac_try) 2>&5
5117   ac_status=$?
5118   echo "$as_me:5118: \$? = $ac_status" >&5
5119   (exit $ac_status); }; }; then
5120   :
5121 else
5122   echo "$as_me: failed program was:" >&5
5123 cat conftest.$ac_ext >&5
5124 cf_have_incdir=yes
5125 fi
5126 rm -f conftest.$ac_objext conftest.$ac_ext
5127                           CPPFLAGS=$cf_save_CPPFLAGS
5128                         fi
5129                   fi
5130                 fi
5131
5132                 if test "$cf_have_incdir" = no ; then
5133                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5134
5135 echo "${as_me:-configure}:5135: testing adding $cf_add_incdir to include-path ..." 1>&5
5136
5137                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5138
5139                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5140                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5141                   cf_add_incdir="$cf_top_incdir"
5142                 else
5143                   break
5144                 fi
5145           else
5146                 break
5147           fi
5148         done
5149   done
5150 fi
5151
5152 fi
5153
5154 # Set definitions to allow ifdef'ing for ncurses.h
5155
5156 case $cf_cv_ncurses_header in
5157 (*ncurses.h)
5158
5159 cat >>confdefs.h <<\EOF
5160 #define HAVE_NCURSES_H 1
5161 EOF
5162
5163         ;;
5164 esac
5165
5166 case $cf_cv_ncurses_header in
5167 (ncurses/curses.h|ncurses/ncurses.h)
5168
5169 cat >>confdefs.h <<\EOF
5170 #define HAVE_NCURSES_NCURSES_H 1
5171 EOF
5172
5173         ;;
5174 (ncursesw/curses.h|ncursesw/ncurses.h)
5175
5176 cat >>confdefs.h <<\EOF
5177 #define HAVE_NCURSESW_NCURSES_H 1
5178 EOF
5179
5180         ;;
5181 esac
5182
5183 echo "$as_me:5183: checking for terminfo header" >&5
5184 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5185 if test "${cf_cv_term_header+set}" = set; then
5186   echo $ECHO_N "(cached) $ECHO_C" >&6
5187 else
5188
5189 case ${cf_cv_ncurses_header} in
5190 (*/ncurses.h|*/ncursesw.h)
5191         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5192         ;;
5193 (*)
5194         cf_term_header=term.h
5195         ;;
5196 esac
5197
5198 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5199 do
5200 cat >conftest.$ac_ext <<_ACEOF
5201 #line 5201 "configure"
5202 #include "confdefs.h"
5203 #include <stdio.h>
5204 #include <${cf_cv_ncurses_header:-curses.h}>
5205 #include <$cf_test>
5206
5207 int
5208 main (void)
5209 {
5210 int x = auto_left_margin
5211   ;
5212   return 0;
5213 }
5214 _ACEOF
5215 rm -f conftest.$ac_objext
5216 if { (eval echo "$as_me:5216: \"$ac_compile\"") >&5
5217   (eval $ac_compile) 2>&5
5218   ac_status=$?
5219   echo "$as_me:5219: \$? = $ac_status" >&5
5220   (exit $ac_status); } &&
5221          { ac_try='test -s conftest.$ac_objext'
5222   { (eval echo "$as_me:5222: \"$ac_try\"") >&5
5223   (eval $ac_try) 2>&5
5224   ac_status=$?
5225   echo "$as_me:5225: \$? = $ac_status" >&5
5226   (exit $ac_status); }; }; then
5227
5228         cf_cv_term_header="$cf_test"
5229 else
5230   echo "$as_me: failed program was:" >&5
5231 cat conftest.$ac_ext >&5
5232
5233         cf_cv_term_header=unknown
5234
5235 fi
5236 rm -f conftest.$ac_objext conftest.$ac_ext
5237         test "$cf_cv_term_header" != unknown && break
5238 done
5239
5240 fi
5241 echo "$as_me:5241: result: $cf_cv_term_header" >&5
5242 echo "${ECHO_T}$cf_cv_term_header" >&6
5243
5244 # Set definitions to allow ifdef'ing to accommodate subdirectories
5245
5246 case $cf_cv_term_header in
5247 (*term.h)
5248
5249 cat >>confdefs.h <<\EOF
5250 #define HAVE_TERM_H 1
5251 EOF
5252
5253         ;;
5254 esac
5255
5256 case $cf_cv_term_header in
5257 (ncurses/term.h)
5258
5259 cat >>confdefs.h <<\EOF
5260 #define HAVE_NCURSES_TERM_H 1
5261 EOF
5262
5263         ;;
5264 (ncursesw/term.h)
5265
5266 cat >>confdefs.h <<\EOF
5267 #define HAVE_NCURSESW_TERM_H 1
5268 EOF
5269
5270         ;;
5271 esac
5272
5273 # some applications need this, but should check for NCURSES_VERSION
5274
5275 cat >>confdefs.h <<\EOF
5276 #define NCURSES 1
5277 EOF
5278
5279 echo "$as_me:5279: checking for ncurses version" >&5
5280 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5281 if test "${cf_cv_ncurses_version+set}" = set; then
5282   echo $ECHO_N "(cached) $ECHO_C" >&6
5283 else
5284
5285         cf_cv_ncurses_version=no
5286         cf_tempfile=out$$
5287         rm -f $cf_tempfile
5288         if test "$cross_compiling" = yes; then
5289
5290         # This will not work if the preprocessor splits the line after the
5291         # Autoconf token.  The 'unproto' program does that.
5292         cat > conftest.$ac_ext <<EOF
5293 #include <${cf_cv_ncurses_header:-curses.h}>
5294 #undef Autoconf
5295 #ifdef NCURSES_VERSION
5296 Autoconf NCURSES_VERSION
5297 #else
5298 #ifdef __NCURSES_H
5299 Autoconf "old"
5300 #endif
5301 ;
5302 #endif
5303 EOF
5304         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5305         { (eval echo "$as_me:5305: \"$cf_try\"") >&5
5306   (eval $cf_try) 2>&5
5307   ac_status=$?
5308   echo "$as_me:5308: \$? = $ac_status" >&5
5309   (exit $ac_status); }
5310         if test -f conftest.out ; then
5311                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5312                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5313                 rm -f conftest.out
5314         fi
5315
5316 else
5317   cat >conftest.$ac_ext <<_ACEOF
5318 #line 5318 "configure"
5319 #include "confdefs.h"
5320
5321 #include <${cf_cv_ncurses_header:-curses.h}>
5322 #include <stdio.h>
5323 int main(void)
5324 {
5325         FILE *fp = fopen("$cf_tempfile", "w");
5326 #ifdef NCURSES_VERSION
5327 # ifdef NCURSES_VERSION_PATCH
5328         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5329 # else
5330         fprintf(fp, "%s\n", NCURSES_VERSION);
5331 # endif
5332 #else
5333 # ifdef __NCURSES_H
5334         fprintf(fp, "old\n");
5335 # else
5336         make an error
5337 # endif
5338 #endif
5339         ${cf_cv_main_return:-return}(0);
5340 }
5341 _ACEOF
5342 rm -f conftest$ac_exeext
5343 if { (eval echo "$as_me:5343: \"$ac_link\"") >&5
5344   (eval $ac_link) 2>&5
5345   ac_status=$?
5346   echo "$as_me:5346: \$? = $ac_status" >&5
5347   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5348   { (eval echo "$as_me:5348: \"$ac_try\"") >&5
5349   (eval $ac_try) 2>&5
5350   ac_status=$?
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit $ac_status); }; }; then
5353
5354         cf_cv_ncurses_version=`cat $cf_tempfile`
5355 else
5356   echo "$as_me: program exited with status $ac_status" >&5
5357 echo "$as_me: failed program was:" >&5
5358 cat conftest.$ac_ext >&5
5359 fi
5360 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5361 fi
5362         rm -f $cf_tempfile
5363
5364 fi
5365 echo "$as_me:5365: result: $cf_cv_ncurses_version" >&5
5366 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5367 test "$cf_cv_ncurses_version" = no ||
5368 cat >>confdefs.h <<\EOF
5369 #define NCURSES 1
5370 EOF
5371
5372 cf_nculib_root=ncurses
5373         # This works, except for the special case where we find gpm, but
5374         # ncurses is in a nonstandard location via $LIBS, and we really want
5375         # to link gpm.
5376 cf_ncurses_LIBS=""
5377 cf_ncurses_SAVE="$LIBS"
5378 echo "$as_me:5378: checking for Gpm_Open in -lgpm" >&5
5379 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5380 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5381   echo $ECHO_N "(cached) $ECHO_C" >&6
5382 else
5383   ac_check_lib_save_LIBS=$LIBS
5384 LIBS="-lgpm  $LIBS"
5385 cat >conftest.$ac_ext <<_ACEOF
5386 #line 5386 "configure"
5387 #include "confdefs.h"
5388
5389 /* Override any gcc2 internal prototype to avoid an error.  */
5390 #ifdef __cplusplus
5391 extern "C"
5392 #endif
5393 /* We use char because int might match the return type of a gcc2
5394    builtin and then its argument prototype would still apply.  */
5395 char Gpm_Open ();
5396 int
5397 main (void)
5398 {
5399 Gpm_Open ();
5400   ;
5401   return 0;
5402 }
5403 _ACEOF
5404 rm -f conftest.$ac_objext conftest$ac_exeext
5405 if { (eval echo "$as_me:5405: \"$ac_link\"") >&5
5406   (eval $ac_link) 2>&5
5407   ac_status=$?
5408   echo "$as_me:5408: \$? = $ac_status" >&5
5409   (exit $ac_status); } &&
5410          { ac_try='test -s conftest$ac_exeext'
5411   { (eval echo "$as_me:5411: \"$ac_try\"") >&5
5412   (eval $ac_try) 2>&5
5413   ac_status=$?
5414   echo "$as_me:5414: \$? = $ac_status" >&5
5415   (exit $ac_status); }; }; then
5416   ac_cv_lib_gpm_Gpm_Open=yes
5417 else
5418   echo "$as_me: failed program was:" >&5
5419 cat conftest.$ac_ext >&5
5420 ac_cv_lib_gpm_Gpm_Open=no
5421 fi
5422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5423 LIBS=$ac_check_lib_save_LIBS
5424 fi
5425 echo "$as_me:5425: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5426 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5427 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5428   echo "$as_me:5428: checking for initscr in -lgpm" >&5
5429 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5430 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5431   echo $ECHO_N "(cached) $ECHO_C" >&6
5432 else
5433   ac_check_lib_save_LIBS=$LIBS
5434 LIBS="-lgpm  $LIBS"
5435 cat >conftest.$ac_ext <<_ACEOF
5436 #line 5436 "configure"
5437 #include "confdefs.h"
5438
5439 /* Override any gcc2 internal prototype to avoid an error.  */
5440 #ifdef __cplusplus
5441 extern "C"
5442 #endif
5443 /* We use char because int might match the return type of a gcc2
5444    builtin and then its argument prototype would still apply.  */
5445 char initscr ();
5446 int
5447 main (void)
5448 {
5449 initscr ();
5450   ;
5451   return 0;
5452 }
5453 _ACEOF
5454 rm -f conftest.$ac_objext conftest$ac_exeext
5455 if { (eval echo "$as_me:5455: \"$ac_link\"") >&5
5456   (eval $ac_link) 2>&5
5457   ac_status=$?
5458   echo "$as_me:5458: \$? = $ac_status" >&5
5459   (exit $ac_status); } &&
5460          { ac_try='test -s conftest$ac_exeext'
5461   { (eval echo "$as_me:5461: \"$ac_try\"") >&5
5462   (eval $ac_try) 2>&5
5463   ac_status=$?
5464   echo "$as_me:5464: \$? = $ac_status" >&5
5465   (exit $ac_status); }; }; then
5466   ac_cv_lib_gpm_initscr=yes
5467 else
5468   echo "$as_me: failed program was:" >&5
5469 cat conftest.$ac_ext >&5
5470 ac_cv_lib_gpm_initscr=no
5471 fi
5472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5473 LIBS=$ac_check_lib_save_LIBS
5474 fi
5475 echo "$as_me:5475: result: $ac_cv_lib_gpm_initscr" >&5
5476 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5477 if test $ac_cv_lib_gpm_initscr = yes; then
5478   LIBS="$cf_ncurses_SAVE"
5479 else
5480   cf_ncurses_LIBS="-lgpm"
5481 fi
5482
5483 fi
5484
5485 case $host_os in
5486 (freebsd*)
5487         # This is only necessary if you are linking against an obsolete
5488         # version of ncurses (but it should do no harm, since it's static).
5489         if test "$cf_nculib_root" = ncurses ; then
5490                 echo "$as_me:5490: checking for tgoto in -lmytinfo" >&5
5491 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5492 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5493   echo $ECHO_N "(cached) $ECHO_C" >&6
5494 else
5495   ac_check_lib_save_LIBS=$LIBS
5496 LIBS="-lmytinfo  $LIBS"
5497 cat >conftest.$ac_ext <<_ACEOF
5498 #line 5498 "configure"
5499 #include "confdefs.h"
5500
5501 /* Override any gcc2 internal prototype to avoid an error.  */
5502 #ifdef __cplusplus
5503 extern "C"
5504 #endif
5505 /* We use char because int might match the return type of a gcc2
5506    builtin and then its argument prototype would still apply.  */
5507 char tgoto ();
5508 int
5509 main (void)
5510 {
5511 tgoto ();
5512   ;
5513   return 0;
5514 }
5515 _ACEOF
5516 rm -f conftest.$ac_objext conftest$ac_exeext
5517 if { (eval echo "$as_me:5517: \"$ac_link\"") >&5
5518   (eval $ac_link) 2>&5
5519   ac_status=$?
5520   echo "$as_me:5520: \$? = $ac_status" >&5
5521   (exit $ac_status); } &&
5522          { ac_try='test -s conftest$ac_exeext'
5523   { (eval echo "$as_me:5523: \"$ac_try\"") >&5
5524   (eval $ac_try) 2>&5
5525   ac_status=$?
5526   echo "$as_me:5526: \$? = $ac_status" >&5
5527   (exit $ac_status); }; }; then
5528   ac_cv_lib_mytinfo_tgoto=yes
5529 else
5530   echo "$as_me: failed program was:" >&5
5531 cat conftest.$ac_ext >&5
5532 ac_cv_lib_mytinfo_tgoto=no
5533 fi
5534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5535 LIBS=$ac_check_lib_save_LIBS
5536 fi
5537 echo "$as_me:5537: result: $ac_cv_lib_mytinfo_tgoto" >&5
5538 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5539 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5540   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5541 fi
5542
5543         fi
5544         ;;
5545 esac
5546
5547 cf_add_libs="$cf_ncurses_LIBS"
5548 # Filter out duplicates - this happens with badly-designed ".pc" files...
5549 for cf_add_1lib in $LIBS
5550 do
5551         for cf_add_2lib in $cf_add_libs
5552         do
5553                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5554                 then
5555                         cf_add_1lib=
5556                         break
5557                 fi
5558         done
5559         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5560 done
5561 LIBS="$cf_add_libs"
5562
5563 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5564 then
5565
5566 cf_add_libs="-l$cf_nculib_root"
5567 # Filter out duplicates - this happens with badly-designed ".pc" files...
5568 for cf_add_1lib in $LIBS
5569 do
5570         for cf_add_2lib in $cf_add_libs
5571         do
5572                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5573                 then
5574                         cf_add_1lib=
5575                         break
5576                 fi
5577         done
5578         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5579 done
5580 LIBS="$cf_add_libs"
5581
5582 else
5583
5584         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5585         cf_libdir=""
5586         echo "$as_me:5586: checking for initscr" >&5
5587 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5588 if test "${ac_cv_func_initscr+set}" = set; then
5589   echo $ECHO_N "(cached) $ECHO_C" >&6
5590 else
5591   cat >conftest.$ac_ext <<_ACEOF
5592 #line 5592 "configure"
5593 #include "confdefs.h"
5594 #define initscr autoconf_temporary
5595 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5596 #undef initscr
5597
5598 #ifdef __cplusplus
5599 extern "C"
5600 #endif
5601
5602 /* We use char because int might match the return type of a gcc2
5603    builtin and then its argument prototype would still apply.  */
5604 char initscr (void);
5605
5606 int
5607 main (void)
5608 {
5609
5610 /* The GNU C library defines stubs for functions which it implements
5611     to always fail with ENOSYS.  Some functions are actually named
5612     something starting with __ and the normal name is an alias.  */
5613 #if defined (__stub_initscr) || defined (__stub___initscr)
5614 #error found stub for initscr
5615 #endif
5616
5617         return initscr ();
5618   ;
5619   return 0;
5620 }
5621 _ACEOF
5622 rm -f conftest.$ac_objext conftest$ac_exeext
5623 if { (eval echo "$as_me:5623: \"$ac_link\"") >&5
5624   (eval $ac_link) 2>&5
5625   ac_status=$?
5626   echo "$as_me:5626: \$? = $ac_status" >&5
5627   (exit $ac_status); } &&
5628          { ac_try='test -s conftest$ac_exeext'
5629   { (eval echo "$as_me:5629: \"$ac_try\"") >&5
5630   (eval $ac_try) 2>&5
5631   ac_status=$?
5632   echo "$as_me:5632: \$? = $ac_status" >&5
5633   (exit $ac_status); }; }; then
5634   ac_cv_func_initscr=yes
5635 else
5636   echo "$as_me: failed program was:" >&5
5637 cat conftest.$ac_ext >&5
5638 ac_cv_func_initscr=no
5639 fi
5640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5641 fi
5642 echo "$as_me:5642: result: $ac_cv_func_initscr" >&5
5643 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5644 if test $ac_cv_func_initscr = yes; then
5645   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5646 else
5647
5648                 cf_save_LIBS="$LIBS"
5649                 echo "$as_me:5649: checking for initscr in -l$cf_nculib_root" >&5
5650 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5651                 LIBS="-l$cf_nculib_root $LIBS"
5652                 cat >conftest.$ac_ext <<_ACEOF
5653 #line 5653 "configure"
5654 #include "confdefs.h"
5655 #include <${cf_cv_ncurses_header:-curses.h}>
5656 int
5657 main (void)
5658 {
5659 initscr()
5660   ;
5661   return 0;
5662 }
5663 _ACEOF
5664 rm -f conftest.$ac_objext conftest$ac_exeext
5665 if { (eval echo "$as_me:5665: \"$ac_link\"") >&5
5666   (eval $ac_link) 2>&5
5667   ac_status=$?
5668   echo "$as_me:5668: \$? = $ac_status" >&5
5669   (exit $ac_status); } &&
5670          { ac_try='test -s conftest$ac_exeext'
5671   { (eval echo "$as_me:5671: \"$ac_try\"") >&5
5672   (eval $ac_try) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit $ac_status); }; }; then
5676   echo "$as_me:5676: result: yes" >&5
5677 echo "${ECHO_T}yes" >&6
5678                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5679
5680 else
5681   echo "$as_me: failed program was:" >&5
5682 cat conftest.$ac_ext >&5
5683 echo "$as_me:5683: result: no" >&5
5684 echo "${ECHO_T}no" >&6
5685
5686 cf_search=
5687 cf_library_path_list=""
5688 if test -n "${LDFLAGS}${LIBS}" ; then
5689         for cf_library_path in $LDFLAGS $LIBS
5690         do
5691                 case $cf_library_path in
5692                 (-L*)
5693                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5694
5695 test "x$cf_library_path" != "xNONE" && \
5696 test -d "$cf_library_path" && \
5697  {
5698         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5699         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5700         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5701         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5702         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5703         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"
5704 }
5705
5706                         cf_library_path_list="$cf_library_path_list $cf_search"
5707                         ;;
5708                 esac
5709         done
5710 fi
5711
5712 cf_search=
5713
5714 test "x$prefix" != "xNONE" && \
5715 test -d "$prefix" && \
5716  {
5717         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5718         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5719         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5720         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5721         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5722         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5723 }
5724
5725 for cf_subdir_prefix in \
5726         /usr \
5727         /usr/local \
5728         /usr/pkg \
5729         /opt \
5730         /opt/local \
5731         $HOME
5732 do
5733
5734 test "x$cf_subdir_prefix" != "x$prefix" && \
5735 test -d "$cf_subdir_prefix" && \
5736 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5737         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5738         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5739         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5740         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5741         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5742         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"
5743 }
5744
5745 done
5746
5747 cf_search="$cf_library_path_list $cf_search"
5748
5749                         for cf_libdir in $cf_search
5750                         do
5751                                 echo "$as_me:5751: checking for -l$cf_nculib_root in $cf_libdir" >&5
5752 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5753                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5754                                 cat >conftest.$ac_ext <<_ACEOF
5755 #line 5755 "configure"
5756 #include "confdefs.h"
5757 #include <${cf_cv_ncurses_header:-curses.h}>
5758 int
5759 main (void)
5760 {
5761 initscr()
5762   ;
5763   return 0;
5764 }
5765 _ACEOF
5766 rm -f conftest.$ac_objext conftest$ac_exeext
5767 if { (eval echo "$as_me:5767: \"$ac_link\"") >&5
5768   (eval $ac_link) 2>&5
5769   ac_status=$?
5770   echo "$as_me:5770: \$? = $ac_status" >&5
5771   (exit $ac_status); } &&
5772          { ac_try='test -s conftest$ac_exeext'
5773   { (eval echo "$as_me:5773: \"$ac_try\"") >&5
5774   (eval $ac_try) 2>&5
5775   ac_status=$?
5776   echo "$as_me:5776: \$? = $ac_status" >&5
5777   (exit $ac_status); }; }; then
5778   echo "$as_me:5778: result: yes" >&5
5779 echo "${ECHO_T}yes" >&6
5780                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5781                                          break
5782 else
5783   echo "$as_me: failed program was:" >&5
5784 cat conftest.$ac_ext >&5
5785 echo "$as_me:5785: result: no" >&5
5786 echo "${ECHO_T}no" >&6
5787                                          LIBS="$cf_save_LIBS"
5788 fi
5789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5790                         done
5791
5792 fi
5793 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5794
5795 fi
5796
5797 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5798
5799 if test $cf_found_library = no ; then
5800         { { echo "$as_me:5800: error: Cannot link $cf_nculib_root library" >&5
5801 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5802    { (exit 1); exit 1; }; }
5803 fi
5804
5805 fi
5806
5807 if test -n "$cf_ncurses_LIBS" ; then
5808         echo "$as_me:5808: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5809 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5810         cf_ncurses_SAVE="$LIBS"
5811         for p in $cf_ncurses_LIBS ; do
5812                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5813                 if test "$q" != "$LIBS" ; then
5814                         LIBS="$q"
5815                 fi
5816         done
5817         cat >conftest.$ac_ext <<_ACEOF
5818 #line 5818 "configure"
5819 #include "confdefs.h"
5820 #include <${cf_cv_ncurses_header:-curses.h}>
5821 int
5822 main (void)
5823 {
5824 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5825   ;
5826   return 0;
5827 }
5828 _ACEOF
5829 rm -f conftest.$ac_objext conftest$ac_exeext
5830 if { (eval echo "$as_me:5830: \"$ac_link\"") >&5
5831   (eval $ac_link) 2>&5
5832   ac_status=$?
5833   echo "$as_me:5833: \$? = $ac_status" >&5
5834   (exit $ac_status); } &&
5835          { ac_try='test -s conftest$ac_exeext'
5836   { (eval echo "$as_me:5836: \"$ac_try\"") >&5
5837   (eval $ac_try) 2>&5
5838   ac_status=$?
5839   echo "$as_me:5839: \$? = $ac_status" >&5
5840   (exit $ac_status); }; }; then
5841   echo "$as_me:5841: result: yes" >&5
5842 echo "${ECHO_T}yes" >&6
5843 else
5844   echo "$as_me: failed program was:" >&5
5845 cat conftest.$ac_ext >&5
5846 echo "$as_me:5846: result: no" >&5
5847 echo "${ECHO_T}no" >&6
5848                  LIBS="$cf_ncurses_SAVE"
5849 fi
5850 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5851 fi
5852
5853 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5854
5855 cat >>confdefs.h <<EOF
5856 #define $cf_nculib_ROOT 1
5857 EOF
5858
5859         fi
5860 else
5861         NCURSES_CONFIG=none
5862 fi
5863
5864 echo "$as_me:5864: checking if you want wide-character code" >&5
5865 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5866
5867 # Check whether --enable-widec or --disable-widec was given.
5868 if test "${enable_widec+set}" = set; then
5869   enableval="$enable_widec"
5870   with_widec=$enableval
5871 else
5872   with_widec=no
5873 fi;
5874 echo "$as_me:5874: result: $with_widec" >&5
5875 echo "${ECHO_T}$with_widec" >&6
5876 if test "$with_widec" = yes ; then
5877
5878 echo "$as_me:5878: checking for multibyte character support" >&5
5879 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5880 if test "${cf_cv_utf8_lib+set}" = set; then
5881   echo $ECHO_N "(cached) $ECHO_C" >&6
5882 else
5883
5884         cf_save_LIBS="$LIBS"
5885         cat >conftest.$ac_ext <<_ACEOF
5886 #line 5886 "configure"
5887 #include "confdefs.h"
5888
5889 #include <stdlib.h>
5890 int
5891 main (void)
5892 {
5893 putwc(0,0);
5894   ;
5895   return 0;
5896 }
5897 _ACEOF
5898 rm -f conftest.$ac_objext conftest$ac_exeext
5899 if { (eval echo "$as_me:5899: \"$ac_link\"") >&5
5900   (eval $ac_link) 2>&5
5901   ac_status=$?
5902   echo "$as_me:5902: \$? = $ac_status" >&5
5903   (exit $ac_status); } &&
5904          { ac_try='test -s conftest$ac_exeext'
5905   { (eval echo "$as_me:5905: \"$ac_try\"") >&5
5906   (eval $ac_try) 2>&5
5907   ac_status=$?
5908   echo "$as_me:5908: \$? = $ac_status" >&5
5909   (exit $ac_status); }; }; then
5910   cf_cv_utf8_lib=yes
5911 else
5912   echo "$as_me: failed program was:" >&5
5913 cat conftest.$ac_ext >&5
5914
5915 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5916 # will be set on completion of the AC_TRY_LINK below.
5917 cf_cv_header_path_utf8=
5918 cf_cv_library_path_utf8=
5919
5920 echo "${as_me:-configure}:5920: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5921
5922 cf_save_LIBS="$LIBS"
5923
5924 cat >conftest.$ac_ext <<_ACEOF
5925 #line 5925 "configure"
5926 #include "confdefs.h"
5927
5928 #include <libutf8.h>
5929 int
5930 main (void)
5931 {
5932 putwc(0,0);
5933   ;
5934   return 0;
5935 }
5936 _ACEOF
5937 rm -f conftest.$ac_objext conftest$ac_exeext
5938 if { (eval echo "$as_me:5938: \"$ac_link\"") >&5
5939   (eval $ac_link) 2>&5
5940   ac_status=$?
5941   echo "$as_me:5941: \$? = $ac_status" >&5
5942   (exit $ac_status); } &&
5943          { ac_try='test -s conftest$ac_exeext'
5944   { (eval echo "$as_me:5944: \"$ac_try\"") >&5
5945   (eval $ac_try) 2>&5
5946   ac_status=$?
5947   echo "$as_me:5947: \$? = $ac_status" >&5
5948   (exit $ac_status); }; }; then
5949
5950         cf_cv_find_linkage_utf8=yes
5951         cf_cv_header_path_utf8=/usr/include
5952         cf_cv_library_path_utf8=/usr/lib
5953
5954 else
5955   echo "$as_me: failed program was:" >&5
5956 cat conftest.$ac_ext >&5
5957
5958 LIBS="-lutf8  $cf_save_LIBS"
5959
5960 cat >conftest.$ac_ext <<_ACEOF
5961 #line 5961 "configure"
5962 #include "confdefs.h"
5963
5964 #include <libutf8.h>
5965 int
5966 main (void)
5967 {
5968 putwc(0,0);
5969   ;
5970   return 0;
5971 }
5972 _ACEOF
5973 rm -f conftest.$ac_objext conftest$ac_exeext
5974 if { (eval echo "$as_me:5974: \"$ac_link\"") >&5
5975   (eval $ac_link) 2>&5
5976   ac_status=$?
5977   echo "$as_me:5977: \$? = $ac_status" >&5
5978   (exit $ac_status); } &&
5979          { ac_try='test -s conftest$ac_exeext'
5980   { (eval echo "$as_me:5980: \"$ac_try\"") >&5
5981   (eval $ac_try) 2>&5
5982   ac_status=$?
5983   echo "$as_me:5983: \$? = $ac_status" >&5
5984   (exit $ac_status); }; }; then
5985
5986         cf_cv_find_linkage_utf8=yes
5987         cf_cv_header_path_utf8=/usr/include
5988         cf_cv_library_path_utf8=/usr/lib
5989         cf_cv_library_file_utf8="-lutf8"
5990
5991 else
5992   echo "$as_me: failed program was:" >&5
5993 cat conftest.$ac_ext >&5
5994
5995         cf_cv_find_linkage_utf8=no
5996         LIBS="$cf_save_LIBS"
5997
5998         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5999
6000 echo "${as_me:-configure}:6000: testing find linkage for utf8 library ..." 1>&5
6001
6002 echo "${as_me:-configure}:6002: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6003
6004         cf_save_CPPFLAGS="$CPPFLAGS"
6005         cf_test_CPPFLAGS="$CPPFLAGS"
6006
6007 cf_search=
6008
6009 # collect the current set of include-directories from compiler flags
6010 cf_header_path_list=""
6011 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6012         for cf_header_path in $CPPFLAGS $CFLAGS
6013         do
6014                 case $cf_header_path in
6015                 (-I*)
6016                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6017
6018 test "x$cf_header_path" != "xNONE" && \
6019 test -d "$cf_header_path" && \
6020  {
6021         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6022         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6023         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6024         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6025         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6026         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6027 }
6028
6029                         cf_header_path_list="$cf_header_path_list $cf_search"
6030                         ;;
6031                 esac
6032         done
6033 fi
6034
6035 # add the variations for the package we are looking for
6036
6037 cf_search=
6038
6039 test "x$prefix" != "xNONE" && \
6040 test -d "$prefix" && \
6041  {
6042         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6043         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6044         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6045         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6046         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6047         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6048 }
6049
6050 for cf_subdir_prefix in \
6051         /usr \
6052         /usr/local \
6053         /usr/pkg \
6054         /opt \
6055         /opt/local \
6056         $HOME
6057 do
6058
6059 test "x$cf_subdir_prefix" != "x$prefix" && \
6060 test -d "$cf_subdir_prefix" && \
6061 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6062         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6063         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6064         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6065         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6066         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6067         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6068 }
6069
6070 done
6071
6072 test "$includedir" != NONE && \
6073 test "$includedir" != "/usr/include" && \
6074 test -d "$includedir" && {
6075         test -d $includedir &&    cf_search="$cf_search $includedir"
6076         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6077 }
6078
6079 test "$oldincludedir" != NONE && \
6080 test "$oldincludedir" != "/usr/include" && \
6081 test -d "$oldincludedir" && {
6082         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6083         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6084 }
6085
6086 cf_search="$cf_search $cf_header_path_list"
6087
6088         for cf_cv_header_path_utf8 in $cf_search
6089         do
6090                 if test -d $cf_cv_header_path_utf8 ; then
6091                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6092
6093 echo "${as_me:-configure}:6093: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6094
6095                         CPPFLAGS="$cf_save_CPPFLAGS"
6096
6097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6098         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6099
6100                         cat >conftest.$ac_ext <<_ACEOF
6101 #line 6101 "configure"
6102 #include "confdefs.h"
6103
6104 #include <libutf8.h>
6105 int
6106 main (void)
6107 {
6108 putwc(0,0);
6109   ;
6110   return 0;
6111 }
6112 _ACEOF
6113 rm -f conftest.$ac_objext
6114 if { (eval echo "$as_me:6114: \"$ac_compile\"") >&5
6115   (eval $ac_compile) 2>&5
6116   ac_status=$?
6117   echo "$as_me:6117: \$? = $ac_status" >&5
6118   (exit $ac_status); } &&
6119          { ac_try='test -s conftest.$ac_objext'
6120   { (eval echo "$as_me:6120: \"$ac_try\"") >&5
6121   (eval $ac_try) 2>&5
6122   ac_status=$?
6123   echo "$as_me:6123: \$? = $ac_status" >&5
6124   (exit $ac_status); }; }; then
6125
6126                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6127
6128 echo "${as_me:-configure}:6128: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6129
6130                                 cf_cv_find_linkage_utf8=maybe
6131                                 cf_test_CPPFLAGS="$CPPFLAGS"
6132                                 break
6133 else
6134   echo "$as_me: failed program was:" >&5
6135 cat conftest.$ac_ext >&5
6136
6137                                 CPPFLAGS="$cf_save_CPPFLAGS"
6138
6139 fi
6140 rm -f conftest.$ac_objext conftest.$ac_ext
6141                 fi
6142         done
6143
6144         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6145
6146 echo "${as_me:-configure}:6146: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6147
6148                 cf_save_LIBS="$LIBS"
6149                 cf_save_LDFLAGS="$LDFLAGS"
6150
6151                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6152
6153 cf_search=
6154 cf_library_path_list=""
6155 if test -n "${LDFLAGS}${LIBS}" ; then
6156         for cf_library_path in $LDFLAGS $LIBS
6157         do
6158                 case $cf_library_path in
6159                 (-L*)
6160                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6161
6162 test "x$cf_library_path" != "xNONE" && \
6163 test -d "$cf_library_path" && \
6164  {
6165         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6166         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6167         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6168         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6169         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6170         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6171 }
6172
6173                         cf_library_path_list="$cf_library_path_list $cf_search"
6174                         ;;
6175                 esac
6176         done
6177 fi
6178
6179 cf_search=
6180
6181 test "x$prefix" != "xNONE" && \
6182 test -d "$prefix" && \
6183  {
6184         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6185         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6186         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6187         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6188         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6189         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6190 }
6191
6192 for cf_subdir_prefix in \
6193         /usr \
6194         /usr/local \
6195         /usr/pkg \
6196         /opt \
6197         /opt/local \
6198         $HOME
6199 do
6200
6201 test "x$cf_subdir_prefix" != "x$prefix" && \
6202 test -d "$cf_subdir_prefix" && \
6203 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6204         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6205         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6206         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6207         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6208         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6209         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6210 }
6211
6212 done
6213
6214 cf_search="$cf_library_path_list $cf_search"
6215
6216                         for cf_cv_library_path_utf8 in $cf_search
6217                         do
6218                                 if test -d $cf_cv_library_path_utf8 ; then
6219                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6220
6221 echo "${as_me:-configure}:6221: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6222
6223                                         CPPFLAGS="$cf_test_CPPFLAGS"
6224                                         LIBS="-lutf8  $cf_save_LIBS"
6225                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6226                                         cat >conftest.$ac_ext <<_ACEOF
6227 #line 6227 "configure"
6228 #include "confdefs.h"
6229
6230 #include <libutf8.h>
6231 int
6232 main (void)
6233 {
6234 putwc(0,0);
6235   ;
6236   return 0;
6237 }
6238 _ACEOF
6239 rm -f conftest.$ac_objext conftest$ac_exeext
6240 if { (eval echo "$as_me:6240: \"$ac_link\"") >&5
6241   (eval $ac_link) 2>&5
6242   ac_status=$?
6243   echo "$as_me:6243: \$? = $ac_status" >&5
6244   (exit $ac_status); } &&
6245          { ac_try='test -s conftest$ac_exeext'
6246   { (eval echo "$as_me:6246: \"$ac_try\"") >&5
6247   (eval $ac_try) 2>&5
6248   ac_status=$?
6249   echo "$as_me:6249: \$? = $ac_status" >&5
6250   (exit $ac_status); }; }; then
6251
6252                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6253
6254 echo "${as_me:-configure}:6254: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6255
6256                                         cf_cv_find_linkage_utf8=yes
6257                                         cf_cv_library_file_utf8="-lutf8"
6258                                         break
6259 else
6260   echo "$as_me: failed program was:" >&5
6261 cat conftest.$ac_ext >&5
6262
6263                                         CPPFLAGS="$cf_save_CPPFLAGS"
6264                                         LIBS="$cf_save_LIBS"
6265                                         LDFLAGS="$cf_save_LDFLAGS"
6266
6267 fi
6268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6269                                 fi
6270                         done
6271                         CPPFLAGS="$cf_save_CPPFLAGS"
6272                         LDFLAGS="$cf_save_LDFLAGS"
6273                 fi
6274
6275         else
6276                 cf_cv_find_linkage_utf8=no
6277         fi
6278
6279 fi
6280 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6281
6282 fi
6283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6284
6285 LIBS="$cf_save_LIBS"
6286
6287 if test "$cf_cv_find_linkage_utf8" = yes ; then
6288 cf_cv_utf8_lib=add-on
6289 else
6290 cf_cv_utf8_lib=no
6291 fi
6292
6293 fi
6294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6295 fi
6296 echo "$as_me:6296: result: $cf_cv_utf8_lib" >&5
6297 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6298
6299 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6300 # ncurses/ncursesw:
6301 if test "$cf_cv_utf8_lib" = "add-on" ; then
6302
6303 cat >>confdefs.h <<\EOF
6304 #define HAVE_LIBUTF8_H 1
6305 EOF
6306
6307 if test -n "$cf_cv_header_path_utf8" ; then
6308   for cf_add_incdir in $cf_cv_header_path_utf8
6309   do
6310         while test $cf_add_incdir != /usr/include
6311         do
6312           if test -d $cf_add_incdir
6313           then
6314                 cf_have_incdir=no
6315                 if test -n "$CFLAGS$CPPFLAGS" ; then
6316                   # a loop is needed to ensure we can add subdirs of existing dirs
6317                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6318                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6319                           cf_have_incdir=yes; break
6320                         fi
6321                   done
6322                 fi
6323
6324                 if test "$cf_have_incdir" = no ; then
6325                   if test "$cf_add_incdir" = /usr/local/include ; then
6326                         if test "$GCC" = yes
6327                         then
6328                           cf_save_CPPFLAGS=$CPPFLAGS
6329
6330         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6331         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6332
6333                           cat >conftest.$ac_ext <<_ACEOF
6334 #line 6334 "configure"
6335 #include "confdefs.h"
6336 #include <stdio.h>
6337 int
6338 main (void)
6339 {
6340 printf("Hello")
6341   ;
6342   return 0;
6343 }
6344 _ACEOF
6345 rm -f conftest.$ac_objext
6346 if { (eval echo "$as_me:6346: \"$ac_compile\"") >&5
6347   (eval $ac_compile) 2>&5
6348   ac_status=$?
6349   echo "$as_me:6349: \$? = $ac_status" >&5
6350   (exit $ac_status); } &&
6351          { ac_try='test -s conftest.$ac_objext'
6352   { (eval echo "$as_me:6352: \"$ac_try\"") >&5
6353   (eval $ac_try) 2>&5
6354   ac_status=$?
6355   echo "$as_me:6355: \$? = $ac_status" >&5
6356   (exit $ac_status); }; }; then
6357   :
6358 else
6359   echo "$as_me: failed program was:" >&5
6360 cat conftest.$ac_ext >&5
6361 cf_have_incdir=yes
6362 fi
6363 rm -f conftest.$ac_objext conftest.$ac_ext
6364                           CPPFLAGS=$cf_save_CPPFLAGS
6365                         fi
6366                   fi
6367                 fi
6368
6369                 if test "$cf_have_incdir" = no ; then
6370                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6371
6372 echo "${as_me:-configure}:6372: testing adding $cf_add_incdir to include-path ..." 1>&5
6373
6374                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6375
6376                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6377                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6378                   cf_add_incdir="$cf_top_incdir"
6379                 else
6380                   break
6381                 fi
6382           else
6383                 break
6384           fi
6385         done
6386   done
6387 fi
6388
6389 if test -n "$cf_cv_library_path_utf8" ; then
6390         for cf_add_libdir in $cf_cv_library_path_utf8
6391         do
6392                 if test $cf_add_libdir = /usr/lib ; then
6393                         :
6394                 elif test -d $cf_add_libdir
6395                 then
6396                         cf_have_libdir=no
6397                         if test -n "$LDFLAGS$LIBS" ; then
6398                                 # a loop is needed to ensure we can add subdirs of existing dirs
6399                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6400                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6401                                                 cf_have_libdir=yes; break
6402                                         fi
6403                                 done
6404                         fi
6405                         if test "$cf_have_libdir" = no ; then
6406                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6407
6408 echo "${as_me:-configure}:6408: testing adding $cf_add_libdir to library-path ..." 1>&5
6409
6410                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6411                         fi
6412                 fi
6413         done
6414 fi
6415
6416 cf_add_libs="$cf_cv_library_file_utf8"
6417 # Filter out duplicates - this happens with badly-designed ".pc" files...
6418 for cf_add_1lib in $LIBS
6419 do
6420         for cf_add_2lib in $cf_add_libs
6421         do
6422                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6423                 then
6424                         cf_add_1lib=
6425                         break
6426                 fi
6427         done
6428         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6429 done
6430 LIBS="$cf_add_libs"
6431
6432 fi
6433
6434 cf_ncuconfig_root=ncursesw
6435 cf_have_ncuconfig=no
6436
6437 if test "x${PKG_CONFIG:=none}" != xnone; then
6438         echo "$as_me:6438: checking pkg-config for $cf_ncuconfig_root" >&5
6439 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6440         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6441                 echo "$as_me:6441: result: yes" >&5
6442 echo "${ECHO_T}yes" >&6
6443
6444                 echo "$as_me:6444: checking if the $cf_ncuconfig_root package files work" >&5
6445 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6446                 cf_have_ncuconfig=unknown
6447
6448                 cf_save_CPPFLAGS="$CPPFLAGS"
6449                 cf_save_LIBS="$LIBS"
6450
6451 cf_fix_cppflags=no
6452 cf_new_cflags=
6453 cf_new_cppflags=
6454 cf_new_extra_cppflags=
6455
6456 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
6457 do
6458 case $cf_fix_cppflags in
6459 (no)
6460         case $cf_add_cflags in
6461         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6462                 case $cf_add_cflags in
6463                 (-D*)
6464                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6465
6466                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6467                                 && test -z "${cf_tst_cflags}" \
6468                                 && cf_fix_cppflags=yes
6469
6470                         if test $cf_fix_cppflags = yes ; then
6471
6472         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6473         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6474
6475                                 continue
6476                         elif test "${cf_tst_cflags}" = "\"'" ; then
6477
6478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6480
6481                                 continue
6482                         fi
6483                         ;;
6484                 esac
6485                 case "$CPPFLAGS" in
6486                 (*$cf_add_cflags)
6487                         ;;
6488                 (*)
6489                         case $cf_add_cflags in
6490                         (-D*)
6491                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6492
6493 CPPFLAGS=`echo "$CPPFLAGS" | \
6494         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6495                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6496
6497                                 ;;
6498                         esac
6499
6500         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6501         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6502
6503                         ;;
6504                 esac
6505                 ;;
6506         (*)
6507
6508         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6509         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6510
6511                 ;;
6512         esac
6513         ;;
6514 (yes)
6515
6516         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6517         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6518
6519         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6520
6521         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6522                 && test -z "${cf_tst_cflags}" \
6523                 && cf_fix_cppflags=no
6524         ;;
6525 esac
6526 done
6527
6528 if test -n "$cf_new_cflags" ; then
6529
6530         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6531         CFLAGS="${CFLAGS}$cf_new_cflags"
6532
6533 fi
6534
6535 if test -n "$cf_new_cppflags" ; then
6536
6537         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6538         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6539
6540 fi
6541
6542 if test -n "$cf_new_extra_cppflags" ; then
6543
6544         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6545         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6546
6547 fi
6548
6549 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6550 # Filter out duplicates - this happens with badly-designed ".pc" files...
6551 for cf_add_1lib in $LIBS
6552 do
6553         for cf_add_2lib in $cf_add_libs
6554         do
6555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6556                 then
6557                         cf_add_1lib=
6558                         break
6559                 fi
6560         done
6561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6562 done
6563 LIBS="$cf_add_libs"
6564
6565                 cat >conftest.$ac_ext <<_ACEOF
6566 #line 6566 "configure"
6567 #include "confdefs.h"
6568 #include <${cf_cv_ncurses_header:-curses.h}>
6569 int
6570 main (void)
6571 {
6572 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6573   ;
6574   return 0;
6575 }
6576 _ACEOF
6577 rm -f conftest.$ac_objext conftest$ac_exeext
6578 if { (eval echo "$as_me:6578: \"$ac_link\"") >&5
6579   (eval $ac_link) 2>&5
6580   ac_status=$?
6581   echo "$as_me:6581: \$? = $ac_status" >&5
6582   (exit $ac_status); } &&
6583          { ac_try='test -s conftest$ac_exeext'
6584   { (eval echo "$as_me:6584: \"$ac_try\"") >&5
6585   (eval $ac_try) 2>&5
6586   ac_status=$?
6587   echo "$as_me:6587: \$? = $ac_status" >&5
6588   (exit $ac_status); }; }; then
6589   if test "$cross_compiling" = yes; then
6590   cf_have_ncuconfig=maybe
6591 else
6592   cat >conftest.$ac_ext <<_ACEOF
6593 #line 6593 "configure"
6594 #include "confdefs.h"
6595 #include <${cf_cv_ncurses_header:-curses.h}>
6596                                 int main(void)
6597                                 { char *xx = curses_version(); return (xx == 0); }
6598 _ACEOF
6599 rm -f conftest$ac_exeext
6600 if { (eval echo "$as_me:6600: \"$ac_link\"") >&5
6601   (eval $ac_link) 2>&5
6602   ac_status=$?
6603   echo "$as_me:6603: \$? = $ac_status" >&5
6604   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6605   { (eval echo "$as_me:6605: \"$ac_try\"") >&5
6606   (eval $ac_try) 2>&5
6607   ac_status=$?
6608   echo "$as_me:6608: \$? = $ac_status" >&5
6609   (exit $ac_status); }; }; then
6610   cf_have_ncuconfig=yes
6611 else
6612   echo "$as_me: program exited with status $ac_status" >&5
6613 echo "$as_me: failed program was:" >&5
6614 cat conftest.$ac_ext >&5
6615 cf_have_ncuconfig=no
6616 fi
6617 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6618 fi
6619 else
6620   echo "$as_me: failed program was:" >&5
6621 cat conftest.$ac_ext >&5
6622 cf_have_ncuconfig=no
6623 fi
6624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6625                 echo "$as_me:6625: result: $cf_have_ncuconfig" >&5
6626 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6627                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6628                 if test "$cf_have_ncuconfig" != "yes"
6629                 then
6630                         CPPFLAGS="$cf_save_CPPFLAGS"
6631                         LIBS="$cf_save_LIBS"
6632                         NCURSES_CONFIG_PKG=none
6633                 else
6634
6635 cat >>confdefs.h <<\EOF
6636 #define NCURSES 1
6637 EOF
6638
6639                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6640
6641 echo "$as_me:6641: checking for terminfo header" >&5
6642 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6643 if test "${cf_cv_term_header+set}" = set; then
6644   echo $ECHO_N "(cached) $ECHO_C" >&6
6645 else
6646
6647 case ${cf_cv_ncurses_header} in
6648 (*/ncurses.h|*/ncursesw.h)
6649         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6650         ;;
6651 (*)
6652         cf_term_header=term.h
6653         ;;
6654 esac
6655
6656 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6657 do
6658 cat >conftest.$ac_ext <<_ACEOF
6659 #line 6659 "configure"
6660 #include "confdefs.h"
6661 #include <stdio.h>
6662 #include <${cf_cv_ncurses_header:-curses.h}>
6663 #include <$cf_test>
6664
6665 int
6666 main (void)
6667 {
6668 int x = auto_left_margin
6669   ;
6670   return 0;
6671 }
6672 _ACEOF
6673 rm -f conftest.$ac_objext
6674 if { (eval echo "$as_me:6674: \"$ac_compile\"") >&5
6675   (eval $ac_compile) 2>&5
6676   ac_status=$?
6677   echo "$as_me:6677: \$? = $ac_status" >&5
6678   (exit $ac_status); } &&
6679          { ac_try='test -s conftest.$ac_objext'
6680   { (eval echo "$as_me:6680: \"$ac_try\"") >&5
6681   (eval $ac_try) 2>&5
6682   ac_status=$?
6683   echo "$as_me:6683: \$? = $ac_status" >&5
6684   (exit $ac_status); }; }; then
6685
6686         cf_cv_term_header="$cf_test"
6687 else
6688   echo "$as_me: failed program was:" >&5
6689 cat conftest.$ac_ext >&5
6690
6691         cf_cv_term_header=unknown
6692
6693 fi
6694 rm -f conftest.$ac_objext conftest.$ac_ext
6695         test "$cf_cv_term_header" != unknown && break
6696 done
6697
6698 fi
6699 echo "$as_me:6699: result: $cf_cv_term_header" >&5
6700 echo "${ECHO_T}$cf_cv_term_header" >&6
6701
6702 # Set definitions to allow ifdef'ing to accommodate subdirectories
6703
6704 case $cf_cv_term_header in
6705 (*term.h)
6706
6707 cat >>confdefs.h <<\EOF
6708 #define HAVE_TERM_H 1
6709 EOF
6710
6711         ;;
6712 esac
6713
6714 case $cf_cv_term_header in
6715 (ncurses/term.h)
6716
6717 cat >>confdefs.h <<\EOF
6718 #define HAVE_NCURSES_TERM_H 1
6719 EOF
6720
6721         ;;
6722 (ncursesw/term.h)
6723
6724 cat >>confdefs.h <<\EOF
6725 #define HAVE_NCURSESW_TERM_H 1
6726 EOF
6727
6728         ;;
6729 esac
6730
6731                 fi
6732
6733         else
6734                 echo "$as_me:6734: result: no" >&5
6735 echo "${ECHO_T}no" >&6
6736                 NCURSES_CONFIG_PKG=none
6737         fi
6738 else
6739         NCURSES_CONFIG_PKG=none
6740 fi
6741
6742 if test "x$cf_have_ncuconfig" = "xno"; then
6743         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6744
6745 if test -n "$ac_tool_prefix"; then
6746   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6747   do
6748     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6749 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6750 echo "$as_me:6750: checking for $ac_word" >&5
6751 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6752 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6753   echo $ECHO_N "(cached) $ECHO_C" >&6
6754 else
6755   if test -n "$NCURSES_CONFIG"; then
6756   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6757 else
6758   ac_save_IFS=$IFS; IFS=$ac_path_separator
6759 ac_dummy="$PATH"
6760 for ac_dir in $ac_dummy; do
6761   IFS=$ac_save_IFS
6762   test -z "$ac_dir" && ac_dir=.
6763   $as_executable_p "$ac_dir/$ac_word" || continue
6764 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6765 echo "$as_me:6765: found $ac_dir/$ac_word" >&5
6766 break
6767 done
6768
6769 fi
6770 fi
6771 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6772 if test -n "$NCURSES_CONFIG"; then
6773   echo "$as_me:6773: result: $NCURSES_CONFIG" >&5
6774 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6775 else
6776   echo "$as_me:6776: result: no" >&5
6777 echo "${ECHO_T}no" >&6
6778 fi
6779
6780     test -n "$NCURSES_CONFIG" && break
6781   done
6782 fi
6783 if test -z "$NCURSES_CONFIG"; then
6784   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6785   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6786 do
6787   # Extract the first word of "$ac_prog", so it can be a program name with args.
6788 set dummy $ac_prog; ac_word=$2
6789 echo "$as_me:6789: checking for $ac_word" >&5
6790 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6791 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6792   echo $ECHO_N "(cached) $ECHO_C" >&6
6793 else
6794   if test -n "$ac_ct_NCURSES_CONFIG"; then
6795   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6796 else
6797   ac_save_IFS=$IFS; IFS=$ac_path_separator
6798 ac_dummy="$PATH"
6799 for ac_dir in $ac_dummy; do
6800   IFS=$ac_save_IFS
6801   test -z "$ac_dir" && ac_dir=.
6802   $as_executable_p "$ac_dir/$ac_word" || continue
6803 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6804 echo "$as_me:6804: found $ac_dir/$ac_word" >&5
6805 break
6806 done
6807
6808 fi
6809 fi
6810 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6811 if test -n "$ac_ct_NCURSES_CONFIG"; then
6812   echo "$as_me:6812: result: $ac_ct_NCURSES_CONFIG" >&5
6813 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6814 else
6815   echo "$as_me:6815: result: no" >&5
6816 echo "${ECHO_T}no" >&6
6817 fi
6818
6819   test -n "$ac_ct_NCURSES_CONFIG" && break
6820 done
6821 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6822
6823   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6824 fi
6825
6826         if test "$NCURSES_CONFIG" != none ; then
6827
6828 cf_fix_cppflags=no
6829 cf_new_cflags=
6830 cf_new_cppflags=
6831 cf_new_extra_cppflags=
6832
6833 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
6834 do
6835 case $cf_fix_cppflags in
6836 (no)
6837         case $cf_add_cflags in
6838         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6839                 case $cf_add_cflags in
6840                 (-D*)
6841                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6842
6843                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6844                                 && test -z "${cf_tst_cflags}" \
6845                                 && cf_fix_cppflags=yes
6846
6847                         if test $cf_fix_cppflags = yes ; then
6848
6849         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6850         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6851
6852                                 continue
6853                         elif test "${cf_tst_cflags}" = "\"'" ; then
6854
6855         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6856         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6857
6858                                 continue
6859                         fi
6860                         ;;
6861                 esac
6862                 case "$CPPFLAGS" in
6863                 (*$cf_add_cflags)
6864                         ;;
6865                 (*)
6866                         case $cf_add_cflags in
6867                         (-D*)
6868                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6869
6870 CPPFLAGS=`echo "$CPPFLAGS" | \
6871         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6872                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6873
6874                                 ;;
6875                         esac
6876
6877         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6878         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6879
6880                         ;;
6881                 esac
6882                 ;;
6883         (*)
6884
6885         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6886         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6887
6888                 ;;
6889         esac
6890         ;;
6891 (yes)
6892
6893         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6894         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6895
6896         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6897
6898         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6899                 && test -z "${cf_tst_cflags}" \
6900                 && cf_fix_cppflags=no
6901         ;;
6902 esac
6903 done
6904
6905 if test -n "$cf_new_cflags" ; then
6906
6907         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6908         CFLAGS="${CFLAGS}$cf_new_cflags"
6909
6910 fi
6911
6912 if test -n "$cf_new_cppflags" ; then
6913
6914         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6915         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6916
6917 fi
6918
6919 if test -n "$cf_new_extra_cppflags" ; then
6920
6921         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6922         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6923
6924 fi
6925
6926 cf_add_libs="`$NCURSES_CONFIG --libs`"
6927 # Filter out duplicates - this happens with badly-designed ".pc" files...
6928 for cf_add_1lib in $LIBS
6929 do
6930         for cf_add_2lib in $cf_add_libs
6931         do
6932                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6933                 then
6934                         cf_add_1lib=
6935                         break
6936                 fi
6937         done
6938         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6939 done
6940 LIBS="$cf_add_libs"
6941
6942                 # even with config script, some packages use no-override for curses.h
6943
6944 echo "$as_me:6944: checking if we have identified curses headers" >&5
6945 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6946 if test "${cf_cv_ncurses_header+set}" = set; then
6947   echo $ECHO_N "(cached) $ECHO_C" >&6
6948 else
6949
6950 cf_cv_ncurses_header=none
6951 for cf_header in \
6952         ncurses.h ncursesw/ncurses.h \
6953         curses.h ncursesw/curses.h
6954 do
6955 cat >conftest.$ac_ext <<_ACEOF
6956 #line 6956 "configure"
6957 #include "confdefs.h"
6958 #include <${cf_header}>
6959 int
6960 main (void)
6961 {
6962 initscr(); tgoto("?", 0,0)
6963   ;
6964   return 0;
6965 }
6966 _ACEOF
6967 rm -f conftest.$ac_objext
6968 if { (eval echo "$as_me:6968: \"$ac_compile\"") >&5
6969   (eval $ac_compile) 2>&5
6970   ac_status=$?
6971   echo "$as_me:6971: \$? = $ac_status" >&5
6972   (exit $ac_status); } &&
6973          { ac_try='test -s conftest.$ac_objext'
6974   { (eval echo "$as_me:6974: \"$ac_try\"") >&5
6975   (eval $ac_try) 2>&5
6976   ac_status=$?
6977   echo "$as_me:6977: \$? = $ac_status" >&5
6978   (exit $ac_status); }; }; then
6979   cf_cv_ncurses_header=$cf_header; break
6980 else
6981   echo "$as_me: failed program was:" >&5
6982 cat conftest.$ac_ext >&5
6983 fi
6984 rm -f conftest.$ac_objext conftest.$ac_ext
6985 done
6986
6987 fi
6988 echo "$as_me:6988: result: $cf_cv_ncurses_header" >&5
6989 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6990
6991 if test "$cf_cv_ncurses_header" = none ; then
6992         { { echo "$as_me:6992: error: No curses header-files found" >&5
6993 echo "$as_me: error: No curses header-files found" >&2;}
6994    { (exit 1); exit 1; }; }
6995 fi
6996
6997 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6998
6999 for ac_header in $cf_cv_ncurses_header
7000 do
7001 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7002 echo "$as_me:7002: checking for $ac_header" >&5
7003 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7004 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7005   echo $ECHO_N "(cached) $ECHO_C" >&6
7006 else
7007   cat >conftest.$ac_ext <<_ACEOF
7008 #line 7008 "configure"
7009 #include "confdefs.h"
7010 #include <$ac_header>
7011 _ACEOF
7012 if { (eval echo "$as_me:7012: \"$ac_cpp conftest.$ac_ext\"") >&5
7013   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7014   ac_status=$?
7015   egrep -v '^ *\+' conftest.er1 >conftest.err
7016   rm -f conftest.er1
7017   cat conftest.err >&5
7018   echo "$as_me:7018: \$? = $ac_status" >&5
7019   (exit $ac_status); } >/dev/null; then
7020   if test -s conftest.err; then
7021     ac_cpp_err=$ac_c_preproc_warn_flag
7022   else
7023     ac_cpp_err=
7024   fi
7025 else
7026   ac_cpp_err=yes
7027 fi
7028 if test -z "$ac_cpp_err"; then
7029   eval "$as_ac_Header=yes"
7030 else
7031   echo "$as_me: failed program was:" >&5
7032   cat conftest.$ac_ext >&5
7033   eval "$as_ac_Header=no"
7034 fi
7035 rm -f conftest.err conftest.$ac_ext
7036 fi
7037 echo "$as_me:7037: result: `eval echo '${'$as_ac_Header'}'`" >&5
7038 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7039 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7040   cat >>confdefs.h <<EOF
7041 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7042 EOF
7043
7044 fi
7045 done
7046
7047 cat >>confdefs.h <<\EOF
7048 #define NCURSES 1
7049 EOF
7050
7051 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7052
7053                 cat >>confdefs.h <<EOF
7054 #define $cf_nculib_ROOT 1
7055 EOF
7056
7057                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7058
7059         else
7060
7061 cf_ncuhdr_root=ncursesw
7062
7063 test -n "$cf_cv_curses_dir" && \
7064 test "$cf_cv_curses_dir" != "no" && { \
7065
7066 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7067   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7068   do
7069         while test $cf_add_incdir != /usr/include
7070         do
7071           if test -d $cf_add_incdir
7072           then
7073                 cf_have_incdir=no
7074                 if test -n "$CFLAGS$CPPFLAGS" ; then
7075                   # a loop is needed to ensure we can add subdirs of existing dirs
7076                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7077                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7078                           cf_have_incdir=yes; break
7079                         fi
7080                   done
7081                 fi
7082
7083                 if test "$cf_have_incdir" = no ; then
7084                   if test "$cf_add_incdir" = /usr/local/include ; then
7085                         if test "$GCC" = yes
7086                         then
7087                           cf_save_CPPFLAGS=$CPPFLAGS
7088
7089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7090         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7091
7092                           cat >conftest.$ac_ext <<_ACEOF
7093 #line 7093 "configure"
7094 #include "confdefs.h"
7095 #include <stdio.h>
7096 int
7097 main (void)
7098 {
7099 printf("Hello")
7100   ;
7101   return 0;
7102 }
7103 _ACEOF
7104 rm -f conftest.$ac_objext
7105 if { (eval echo "$as_me:7105: \"$ac_compile\"") >&5
7106   (eval $ac_compile) 2>&5
7107   ac_status=$?
7108   echo "$as_me:7108: \$? = $ac_status" >&5
7109   (exit $ac_status); } &&
7110          { ac_try='test -s conftest.$ac_objext'
7111   { (eval echo "$as_me:7111: \"$ac_try\"") >&5
7112   (eval $ac_try) 2>&5
7113   ac_status=$?
7114   echo "$as_me:7114: \$? = $ac_status" >&5
7115   (exit $ac_status); }; }; then
7116   :
7117 else
7118   echo "$as_me: failed program was:" >&5
7119 cat conftest.$ac_ext >&5
7120 cf_have_incdir=yes
7121 fi
7122 rm -f conftest.$ac_objext conftest.$ac_ext
7123                           CPPFLAGS=$cf_save_CPPFLAGS
7124                         fi
7125                   fi
7126                 fi
7127
7128                 if test "$cf_have_incdir" = no ; then
7129                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7130
7131 echo "${as_me:-configure}:7131: testing adding $cf_add_incdir to include-path ..." 1>&5
7132
7133                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7134
7135                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7136                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7137                   cf_add_incdir="$cf_top_incdir"
7138                 else
7139                   break
7140                 fi
7141           else
7142                 break
7143           fi
7144         done
7145   done
7146 fi
7147
7148 }
7149
7150 echo "$as_me:7150: checking for $cf_ncuhdr_root header in include-path" >&5
7151 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7152 if test "${cf_cv_ncurses_h+set}" = set; then
7153   echo $ECHO_N "(cached) $ECHO_C" >&6
7154 else
7155
7156         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7157         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7158         for cf_header in $cf_header_list
7159         do
7160
7161         cat >conftest.$ac_ext <<_ACEOF
7162 #line 7162 "configure"
7163 #include "confdefs.h"
7164
7165 #define _XOPEN_SOURCE_EXTENDED
7166 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7167 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7168
7169 #include <$cf_header>
7170 int
7171 main (void)
7172 {
7173
7174 #ifdef NCURSES_VERSION
7175
7176 #ifndef WACS_BSSB
7177         make an error
7178 #endif
7179
7180 printf("%s\n", NCURSES_VERSION);
7181 #else
7182 #ifdef __NCURSES_H
7183 printf("old\n");
7184 #else
7185         make an error
7186 #endif
7187 #endif
7188
7189   ;
7190   return 0;
7191 }
7192 _ACEOF
7193 rm -f conftest.$ac_objext
7194 if { (eval echo "$as_me:7194: \"$ac_compile\"") >&5
7195   (eval $ac_compile) 2>&5
7196   ac_status=$?
7197   echo "$as_me:7197: \$? = $ac_status" >&5
7198   (exit $ac_status); } &&
7199          { ac_try='test -s conftest.$ac_objext'
7200   { (eval echo "$as_me:7200: \"$ac_try\"") >&5
7201   (eval $ac_try) 2>&5
7202   ac_status=$?
7203   echo "$as_me:7203: \$? = $ac_status" >&5
7204   (exit $ac_status); }; }; then
7205   cf_cv_ncurses_h=$cf_header
7206
7207 else
7208   echo "$as_me: failed program was:" >&5
7209 cat conftest.$ac_ext >&5
7210 cf_cv_ncurses_h=no
7211 fi
7212 rm -f conftest.$ac_objext conftest.$ac_ext
7213
7214                 test "$cf_cv_ncurses_h" != no && break
7215         done
7216
7217 fi
7218 echo "$as_me:7218: result: $cf_cv_ncurses_h" >&5
7219 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7220
7221 if test "$cf_cv_ncurses_h" != no ; then
7222         cf_cv_ncurses_header=$cf_cv_ncurses_h
7223 else
7224
7225 echo "$as_me:7225: checking for $cf_ncuhdr_root include-path" >&5
7226 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7227 if test "${cf_cv_ncurses_h2+set}" = set; then
7228   echo $ECHO_N "(cached) $ECHO_C" >&6
7229 else
7230
7231         test -n "$verbose" && echo
7232
7233 cf_search=
7234
7235 # collect the current set of include-directories from compiler flags
7236 cf_header_path_list=""
7237 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7238         for cf_header_path in $CPPFLAGS $CFLAGS
7239         do
7240                 case $cf_header_path in
7241                 (-I*)
7242                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7243
7244 test "x$cf_header_path" != "xNONE" && \
7245 test -d "$cf_header_path" && \
7246  {
7247         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7248         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7249         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7250         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7251         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7252         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"
7253 }
7254
7255                         cf_header_path_list="$cf_header_path_list $cf_search"
7256                         ;;
7257                 esac
7258         done
7259 fi
7260
7261 # add the variations for the package we are looking for
7262
7263 cf_search=
7264
7265 test "x$prefix" != "xNONE" && \
7266 test -d "$prefix" && \
7267  {
7268         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7269         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7270         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7271         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7272         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7273         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7274 }
7275
7276 for cf_subdir_prefix in \
7277         /usr \
7278         /usr/local \
7279         /usr/pkg \
7280         /opt \
7281         /opt/local \
7282         $HOME
7283 do
7284
7285 test "x$cf_subdir_prefix" != "x$prefix" && \
7286 test -d "$cf_subdir_prefix" && \
7287 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7288         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7289         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7290         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7291         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7292         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7293         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"
7294 }
7295
7296 done
7297
7298 test "$includedir" != NONE && \
7299 test "$includedir" != "/usr/include" && \
7300 test -d "$includedir" && {
7301         test -d $includedir &&    cf_search="$cf_search $includedir"
7302         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7303 }
7304
7305 test "$oldincludedir" != NONE && \
7306 test "$oldincludedir" != "/usr/include" && \
7307 test -d "$oldincludedir" && {
7308         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7309         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7310 }
7311
7312 cf_search="$cf_search $cf_header_path_list"
7313
7314         test -n "$verbose" && echo search path $cf_search
7315         cf_save2_CPPFLAGS="$CPPFLAGS"
7316         for cf_incdir in $cf_search
7317         do
7318
7319 if test -n "$cf_incdir" ; then
7320   for cf_add_incdir in $cf_incdir
7321   do
7322         while test $cf_add_incdir != /usr/include
7323         do
7324           if test -d $cf_add_incdir
7325           then
7326                 cf_have_incdir=no
7327                 if test -n "$CFLAGS$CPPFLAGS" ; then
7328                   # a loop is needed to ensure we can add subdirs of existing dirs
7329                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7330                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7331                           cf_have_incdir=yes; break
7332                         fi
7333                   done
7334                 fi
7335
7336                 if test "$cf_have_incdir" = no ; then
7337                   if test "$cf_add_incdir" = /usr/local/include ; then
7338                         if test "$GCC" = yes
7339                         then
7340                           cf_save_CPPFLAGS=$CPPFLAGS
7341
7342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7343         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7344
7345                           cat >conftest.$ac_ext <<_ACEOF
7346 #line 7346 "configure"
7347 #include "confdefs.h"
7348 #include <stdio.h>
7349 int
7350 main (void)
7351 {
7352 printf("Hello")
7353   ;
7354   return 0;
7355 }
7356 _ACEOF
7357 rm -f conftest.$ac_objext
7358 if { (eval echo "$as_me:7358: \"$ac_compile\"") >&5
7359   (eval $ac_compile) 2>&5
7360   ac_status=$?
7361   echo "$as_me:7361: \$? = $ac_status" >&5
7362   (exit $ac_status); } &&
7363          { ac_try='test -s conftest.$ac_objext'
7364   { (eval echo "$as_me:7364: \"$ac_try\"") >&5
7365   (eval $ac_try) 2>&5
7366   ac_status=$?
7367   echo "$as_me:7367: \$? = $ac_status" >&5
7368   (exit $ac_status); }; }; then
7369   :
7370 else
7371   echo "$as_me: failed program was:" >&5
7372 cat conftest.$ac_ext >&5
7373 cf_have_incdir=yes
7374 fi
7375 rm -f conftest.$ac_objext conftest.$ac_ext
7376                           CPPFLAGS=$cf_save_CPPFLAGS
7377                         fi
7378                   fi
7379                 fi
7380
7381                 if test "$cf_have_incdir" = no ; then
7382                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7383
7384 echo "${as_me:-configure}:7384: testing adding $cf_add_incdir to include-path ..." 1>&5
7385
7386                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7387
7388                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7389                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7390                   cf_add_incdir="$cf_top_incdir"
7391                 else
7392                   break
7393                 fi
7394           else
7395                 break
7396           fi
7397         done
7398   done
7399 fi
7400
7401                 for cf_header in \
7402                         ncurses.h \
7403                         curses.h
7404                 do
7405
7406         cat >conftest.$ac_ext <<_ACEOF
7407 #line 7407 "configure"
7408 #include "confdefs.h"
7409
7410 #include <$cf_header>
7411 int
7412 main (void)
7413 {
7414
7415 #ifdef NCURSES_VERSION
7416
7417 printf("%s\n", NCURSES_VERSION);
7418 #else
7419 #ifdef __NCURSES_H
7420 printf("old\n");
7421 #else
7422         make an error
7423 #endif
7424 #endif
7425
7426   ;
7427   return 0;
7428 }
7429 _ACEOF
7430 rm -f conftest.$ac_objext
7431 if { (eval echo "$as_me:7431: \"$ac_compile\"") >&5
7432   (eval $ac_compile) 2>&5
7433   ac_status=$?
7434   echo "$as_me:7434: \$? = $ac_status" >&5
7435   (exit $ac_status); } &&
7436          { ac_try='test -s conftest.$ac_objext'
7437   { (eval echo "$as_me:7437: \"$ac_try\"") >&5
7438   (eval $ac_try) 2>&5
7439   ac_status=$?
7440   echo "$as_me:7440: \$? = $ac_status" >&5
7441   (exit $ac_status); }; }; then
7442   cf_cv_ncurses_h2=$cf_header
7443
7444 else
7445   echo "$as_me: failed program was:" >&5
7446 cat conftest.$ac_ext >&5
7447 cf_cv_ncurses_h2=no
7448 fi
7449 rm -f conftest.$ac_objext conftest.$ac_ext
7450
7451                         if test "$cf_cv_ncurses_h2" != no ; then
7452                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7453                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7454                                 break
7455                         fi
7456                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7457                 done
7458                 CPPFLAGS="$cf_save2_CPPFLAGS"
7459                 test "$cf_cv_ncurses_h2" != no && break
7460         done
7461         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7461: error: not found" >&5
7462 echo "$as_me: error: not found" >&2;}
7463    { (exit 1); exit 1; }; }
7464
7465 fi
7466 echo "$as_me:7466: result: $cf_cv_ncurses_h2" >&5
7467 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7468
7469         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7470         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7471         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7472                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7473         fi
7474
7475 if test -n "$cf_1st_incdir" ; then
7476   for cf_add_incdir in $cf_1st_incdir
7477   do
7478         while test $cf_add_incdir != /usr/include
7479         do
7480           if test -d $cf_add_incdir
7481           then
7482                 cf_have_incdir=no
7483                 if test -n "$CFLAGS$CPPFLAGS" ; then
7484                   # a loop is needed to ensure we can add subdirs of existing dirs
7485                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7486                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7487                           cf_have_incdir=yes; break
7488                         fi
7489                   done
7490                 fi
7491
7492                 if test "$cf_have_incdir" = no ; then
7493                   if test "$cf_add_incdir" = /usr/local/include ; then
7494                         if test "$GCC" = yes
7495                         then
7496                           cf_save_CPPFLAGS=$CPPFLAGS
7497
7498         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7499         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7500
7501                           cat >conftest.$ac_ext <<_ACEOF
7502 #line 7502 "configure"
7503 #include "confdefs.h"
7504 #include <stdio.h>
7505 int
7506 main (void)
7507 {
7508 printf("Hello")
7509   ;
7510   return 0;
7511 }
7512 _ACEOF
7513 rm -f conftest.$ac_objext
7514 if { (eval echo "$as_me:7514: \"$ac_compile\"") >&5
7515   (eval $ac_compile) 2>&5
7516   ac_status=$?
7517   echo "$as_me:7517: \$? = $ac_status" >&5
7518   (exit $ac_status); } &&
7519          { ac_try='test -s conftest.$ac_objext'
7520   { (eval echo "$as_me:7520: \"$ac_try\"") >&5
7521   (eval $ac_try) 2>&5
7522   ac_status=$?
7523   echo "$as_me:7523: \$? = $ac_status" >&5
7524   (exit $ac_status); }; }; then
7525   :
7526 else
7527   echo "$as_me: failed program was:" >&5
7528 cat conftest.$ac_ext >&5
7529 cf_have_incdir=yes
7530 fi
7531 rm -f conftest.$ac_objext conftest.$ac_ext
7532                           CPPFLAGS=$cf_save_CPPFLAGS
7533                         fi
7534                   fi
7535                 fi
7536
7537                 if test "$cf_have_incdir" = no ; then
7538                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7539
7540 echo "${as_me:-configure}:7540: testing adding $cf_add_incdir to include-path ..." 1>&5
7541
7542                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7543
7544                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7545                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7546                   cf_add_incdir="$cf_top_incdir"
7547                 else
7548                   break
7549                 fi
7550           else
7551                 break
7552           fi
7553         done
7554   done
7555 fi
7556
7557 fi
7558
7559 # Set definitions to allow ifdef'ing for ncurses.h
7560
7561 case $cf_cv_ncurses_header in
7562 (*ncurses.h)
7563
7564 cat >>confdefs.h <<\EOF
7565 #define HAVE_NCURSES_H 1
7566 EOF
7567
7568         ;;
7569 esac
7570
7571 case $cf_cv_ncurses_header in
7572 (ncurses/curses.h|ncurses/ncurses.h)
7573
7574 cat >>confdefs.h <<\EOF
7575 #define HAVE_NCURSES_NCURSES_H 1
7576 EOF
7577
7578         ;;
7579 (ncursesw/curses.h|ncursesw/ncurses.h)
7580
7581 cat >>confdefs.h <<\EOF
7582 #define HAVE_NCURSESW_NCURSES_H 1
7583 EOF
7584
7585         ;;
7586 esac
7587
7588 echo "$as_me:7588: checking for terminfo header" >&5
7589 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7590 if test "${cf_cv_term_header+set}" = set; then
7591   echo $ECHO_N "(cached) $ECHO_C" >&6
7592 else
7593
7594 case ${cf_cv_ncurses_header} in
7595 (*/ncurses.h|*/ncursesw.h)
7596         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7597         ;;
7598 (*)
7599         cf_term_header=term.h
7600         ;;
7601 esac
7602
7603 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7604 do
7605 cat >conftest.$ac_ext <<_ACEOF
7606 #line 7606 "configure"
7607 #include "confdefs.h"
7608 #include <stdio.h>
7609 #include <${cf_cv_ncurses_header:-curses.h}>
7610 #include <$cf_test>
7611
7612 int
7613 main (void)
7614 {
7615 int x = auto_left_margin
7616   ;
7617   return 0;
7618 }
7619 _ACEOF
7620 rm -f conftest.$ac_objext
7621 if { (eval echo "$as_me:7621: \"$ac_compile\"") >&5
7622   (eval $ac_compile) 2>&5
7623   ac_status=$?
7624   echo "$as_me:7624: \$? = $ac_status" >&5
7625   (exit $ac_status); } &&
7626          { ac_try='test -s conftest.$ac_objext'
7627   { (eval echo "$as_me:7627: \"$ac_try\"") >&5
7628   (eval $ac_try) 2>&5
7629   ac_status=$?
7630   echo "$as_me:7630: \$? = $ac_status" >&5
7631   (exit $ac_status); }; }; then
7632
7633         cf_cv_term_header="$cf_test"
7634 else
7635   echo "$as_me: failed program was:" >&5
7636 cat conftest.$ac_ext >&5
7637
7638         cf_cv_term_header=unknown
7639
7640 fi
7641 rm -f conftest.$ac_objext conftest.$ac_ext
7642         test "$cf_cv_term_header" != unknown && break
7643 done
7644
7645 fi
7646 echo "$as_me:7646: result: $cf_cv_term_header" >&5
7647 echo "${ECHO_T}$cf_cv_term_header" >&6
7648
7649 # Set definitions to allow ifdef'ing to accommodate subdirectories
7650
7651 case $cf_cv_term_header in
7652 (*term.h)
7653
7654 cat >>confdefs.h <<\EOF
7655 #define HAVE_TERM_H 1
7656 EOF
7657
7658         ;;
7659 esac
7660
7661 case $cf_cv_term_header in
7662 (ncurses/term.h)
7663
7664 cat >>confdefs.h <<\EOF
7665 #define HAVE_NCURSES_TERM_H 1
7666 EOF
7667
7668         ;;
7669 (ncursesw/term.h)
7670
7671 cat >>confdefs.h <<\EOF
7672 #define HAVE_NCURSESW_TERM_H 1
7673 EOF
7674
7675         ;;
7676 esac
7677
7678 # some applications need this, but should check for NCURSES_VERSION
7679
7680 cat >>confdefs.h <<\EOF
7681 #define NCURSES 1
7682 EOF
7683
7684 echo "$as_me:7684: checking for ncurses version" >&5
7685 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7686 if test "${cf_cv_ncurses_version+set}" = set; then
7687   echo $ECHO_N "(cached) $ECHO_C" >&6
7688 else
7689
7690         cf_cv_ncurses_version=no
7691         cf_tempfile=out$$
7692         rm -f $cf_tempfile
7693         if test "$cross_compiling" = yes; then
7694
7695         # This will not work if the preprocessor splits the line after the
7696         # Autoconf token.  The 'unproto' program does that.
7697         cat > conftest.$ac_ext <<EOF
7698 #include <${cf_cv_ncurses_header:-curses.h}>
7699 #undef Autoconf
7700 #ifdef NCURSES_VERSION
7701 Autoconf NCURSES_VERSION
7702 #else
7703 #ifdef __NCURSES_H
7704 Autoconf "old"
7705 #endif
7706 ;
7707 #endif
7708 EOF
7709         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7710         { (eval echo "$as_me:7710: \"$cf_try\"") >&5
7711   (eval $cf_try) 2>&5
7712   ac_status=$?
7713   echo "$as_me:7713: \$? = $ac_status" >&5
7714   (exit $ac_status); }
7715         if test -f conftest.out ; then
7716                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7717                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7718                 rm -f conftest.out
7719         fi
7720
7721 else
7722   cat >conftest.$ac_ext <<_ACEOF
7723 #line 7723 "configure"
7724 #include "confdefs.h"
7725
7726 #include <${cf_cv_ncurses_header:-curses.h}>
7727 #include <stdio.h>
7728 int main(void)
7729 {
7730         FILE *fp = fopen("$cf_tempfile", "w");
7731 #ifdef NCURSES_VERSION
7732 # ifdef NCURSES_VERSION_PATCH
7733         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7734 # else
7735         fprintf(fp, "%s\n", NCURSES_VERSION);
7736 # endif
7737 #else
7738 # ifdef __NCURSES_H
7739         fprintf(fp, "old\n");
7740 # else
7741         make an error
7742 # endif
7743 #endif
7744         ${cf_cv_main_return:-return}(0);
7745 }
7746 _ACEOF
7747 rm -f conftest$ac_exeext
7748 if { (eval echo "$as_me:7748: \"$ac_link\"") >&5
7749   (eval $ac_link) 2>&5
7750   ac_status=$?
7751   echo "$as_me:7751: \$? = $ac_status" >&5
7752   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7753   { (eval echo "$as_me:7753: \"$ac_try\"") >&5
7754   (eval $ac_try) 2>&5
7755   ac_status=$?
7756   echo "$as_me:7756: \$? = $ac_status" >&5
7757   (exit $ac_status); }; }; then
7758
7759         cf_cv_ncurses_version=`cat $cf_tempfile`
7760 else
7761   echo "$as_me: program exited with status $ac_status" >&5
7762 echo "$as_me: failed program was:" >&5
7763 cat conftest.$ac_ext >&5
7764 fi
7765 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7766 fi
7767         rm -f $cf_tempfile
7768
7769 fi
7770 echo "$as_me:7770: result: $cf_cv_ncurses_version" >&5
7771 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7772 test "$cf_cv_ncurses_version" = no ||
7773 cat >>confdefs.h <<\EOF
7774 #define NCURSES 1
7775 EOF
7776
7777 cf_nculib_root=ncursesw
7778         # This works, except for the special case where we find gpm, but
7779         # ncurses is in a nonstandard location via $LIBS, and we really want
7780         # to link gpm.
7781 cf_ncurses_LIBS=""
7782 cf_ncurses_SAVE="$LIBS"
7783 echo "$as_me:7783: checking for Gpm_Open in -lgpm" >&5
7784 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7785 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7786   echo $ECHO_N "(cached) $ECHO_C" >&6
7787 else
7788   ac_check_lib_save_LIBS=$LIBS
7789 LIBS="-lgpm  $LIBS"
7790 cat >conftest.$ac_ext <<_ACEOF
7791 #line 7791 "configure"
7792 #include "confdefs.h"
7793
7794 /* Override any gcc2 internal prototype to avoid an error.  */
7795 #ifdef __cplusplus
7796 extern "C"
7797 #endif
7798 /* We use char because int might match the return type of a gcc2
7799    builtin and then its argument prototype would still apply.  */
7800 char Gpm_Open ();
7801 int
7802 main (void)
7803 {
7804 Gpm_Open ();
7805   ;
7806   return 0;
7807 }
7808 _ACEOF
7809 rm -f conftest.$ac_objext conftest$ac_exeext
7810 if { (eval echo "$as_me:7810: \"$ac_link\"") >&5
7811   (eval $ac_link) 2>&5
7812   ac_status=$?
7813   echo "$as_me:7813: \$? = $ac_status" >&5
7814   (exit $ac_status); } &&
7815          { ac_try='test -s conftest$ac_exeext'
7816   { (eval echo "$as_me:7816: \"$ac_try\"") >&5
7817   (eval $ac_try) 2>&5
7818   ac_status=$?
7819   echo "$as_me:7819: \$? = $ac_status" >&5
7820   (exit $ac_status); }; }; then
7821   ac_cv_lib_gpm_Gpm_Open=yes
7822 else
7823   echo "$as_me: failed program was:" >&5
7824 cat conftest.$ac_ext >&5
7825 ac_cv_lib_gpm_Gpm_Open=no
7826 fi
7827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7828 LIBS=$ac_check_lib_save_LIBS
7829 fi
7830 echo "$as_me:7830: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7831 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7832 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7833   echo "$as_me:7833: checking for initscr in -lgpm" >&5
7834 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7835 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7836   echo $ECHO_N "(cached) $ECHO_C" >&6
7837 else
7838   ac_check_lib_save_LIBS=$LIBS
7839 LIBS="-lgpm  $LIBS"
7840 cat >conftest.$ac_ext <<_ACEOF
7841 #line 7841 "configure"
7842 #include "confdefs.h"
7843
7844 /* Override any gcc2 internal prototype to avoid an error.  */
7845 #ifdef __cplusplus
7846 extern "C"
7847 #endif
7848 /* We use char because int might match the return type of a gcc2
7849    builtin and then its argument prototype would still apply.  */
7850 char initscr ();
7851 int
7852 main (void)
7853 {
7854 initscr ();
7855   ;
7856   return 0;
7857 }
7858 _ACEOF
7859 rm -f conftest.$ac_objext conftest$ac_exeext
7860 if { (eval echo "$as_me:7860: \"$ac_link\"") >&5
7861   (eval $ac_link) 2>&5
7862   ac_status=$?
7863   echo "$as_me:7863: \$? = $ac_status" >&5
7864   (exit $ac_status); } &&
7865          { ac_try='test -s conftest$ac_exeext'
7866   { (eval echo "$as_me:7866: \"$ac_try\"") >&5
7867   (eval $ac_try) 2>&5
7868   ac_status=$?
7869   echo "$as_me:7869: \$? = $ac_status" >&5
7870   (exit $ac_status); }; }; then
7871   ac_cv_lib_gpm_initscr=yes
7872 else
7873   echo "$as_me: failed program was:" >&5
7874 cat conftest.$ac_ext >&5
7875 ac_cv_lib_gpm_initscr=no
7876 fi
7877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7878 LIBS=$ac_check_lib_save_LIBS
7879 fi
7880 echo "$as_me:7880: result: $ac_cv_lib_gpm_initscr" >&5
7881 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7882 if test $ac_cv_lib_gpm_initscr = yes; then
7883   LIBS="$cf_ncurses_SAVE"
7884 else
7885   cf_ncurses_LIBS="-lgpm"
7886 fi
7887
7888 fi
7889
7890 case $host_os in
7891 (freebsd*)
7892         # This is only necessary if you are linking against an obsolete
7893         # version of ncurses (but it should do no harm, since it's static).
7894         if test "$cf_nculib_root" = ncurses ; then
7895                 echo "$as_me:7895: checking for tgoto in -lmytinfo" >&5
7896 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7897 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7898   echo $ECHO_N "(cached) $ECHO_C" >&6
7899 else
7900   ac_check_lib_save_LIBS=$LIBS
7901 LIBS="-lmytinfo  $LIBS"
7902 cat >conftest.$ac_ext <<_ACEOF
7903 #line 7903 "configure"
7904 #include "confdefs.h"
7905
7906 /* Override any gcc2 internal prototype to avoid an error.  */
7907 #ifdef __cplusplus
7908 extern "C"
7909 #endif
7910 /* We use char because int might match the return type of a gcc2
7911    builtin and then its argument prototype would still apply.  */
7912 char tgoto ();
7913 int
7914 main (void)
7915 {
7916 tgoto ();
7917   ;
7918   return 0;
7919 }
7920 _ACEOF
7921 rm -f conftest.$ac_objext conftest$ac_exeext
7922 if { (eval echo "$as_me:7922: \"$ac_link\"") >&5
7923   (eval $ac_link) 2>&5
7924   ac_status=$?
7925   echo "$as_me:7925: \$? = $ac_status" >&5
7926   (exit $ac_status); } &&
7927          { ac_try='test -s conftest$ac_exeext'
7928   { (eval echo "$as_me:7928: \"$ac_try\"") >&5
7929   (eval $ac_try) 2>&5
7930   ac_status=$?
7931   echo "$as_me:7931: \$? = $ac_status" >&5
7932   (exit $ac_status); }; }; then
7933   ac_cv_lib_mytinfo_tgoto=yes
7934 else
7935   echo "$as_me: failed program was:" >&5
7936 cat conftest.$ac_ext >&5
7937 ac_cv_lib_mytinfo_tgoto=no
7938 fi
7939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7940 LIBS=$ac_check_lib_save_LIBS
7941 fi
7942 echo "$as_me:7942: result: $ac_cv_lib_mytinfo_tgoto" >&5
7943 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7944 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7945   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7946 fi
7947
7948         fi
7949         ;;
7950 esac
7951
7952 cf_add_libs="$cf_ncurses_LIBS"
7953 # Filter out duplicates - this happens with badly-designed ".pc" files...
7954 for cf_add_1lib in $LIBS
7955 do
7956         for cf_add_2lib in $cf_add_libs
7957         do
7958                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7959                 then
7960                         cf_add_1lib=
7961                         break
7962                 fi
7963         done
7964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7965 done
7966 LIBS="$cf_add_libs"
7967
7968 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7969 then
7970
7971 cf_add_libs="-l$cf_nculib_root"
7972 # Filter out duplicates - this happens with badly-designed ".pc" files...
7973 for cf_add_1lib in $LIBS
7974 do
7975         for cf_add_2lib in $cf_add_libs
7976         do
7977                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7978                 then
7979                         cf_add_1lib=
7980                         break
7981                 fi
7982         done
7983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7984 done
7985 LIBS="$cf_add_libs"
7986
7987 else
7988
7989         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7990         cf_libdir=""
7991         echo "$as_me:7991: checking for initscr" >&5
7992 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7993 if test "${ac_cv_func_initscr+set}" = set; then
7994   echo $ECHO_N "(cached) $ECHO_C" >&6
7995 else
7996   cat >conftest.$ac_ext <<_ACEOF
7997 #line 7997 "configure"
7998 #include "confdefs.h"
7999 #define initscr autoconf_temporary
8000 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8001 #undef initscr
8002
8003 #ifdef __cplusplus
8004 extern "C"
8005 #endif
8006
8007 /* We use char because int might match the return type of a gcc2
8008    builtin and then its argument prototype would still apply.  */
8009 char initscr (void);
8010
8011 int
8012 main (void)
8013 {
8014
8015 /* The GNU C library defines stubs for functions which it implements
8016     to always fail with ENOSYS.  Some functions are actually named
8017     something starting with __ and the normal name is an alias.  */
8018 #if defined (__stub_initscr) || defined (__stub___initscr)
8019 #error found stub for initscr
8020 #endif
8021
8022         return initscr ();
8023   ;
8024   return 0;
8025 }
8026 _ACEOF
8027 rm -f conftest.$ac_objext conftest$ac_exeext
8028 if { (eval echo "$as_me:8028: \"$ac_link\"") >&5
8029   (eval $ac_link) 2>&5
8030   ac_status=$?
8031   echo "$as_me:8031: \$? = $ac_status" >&5
8032   (exit $ac_status); } &&
8033          { ac_try='test -s conftest$ac_exeext'
8034   { (eval echo "$as_me:8034: \"$ac_try\"") >&5
8035   (eval $ac_try) 2>&5
8036   ac_status=$?
8037   echo "$as_me:8037: \$? = $ac_status" >&5
8038   (exit $ac_status); }; }; then
8039   ac_cv_func_initscr=yes
8040 else
8041   echo "$as_me: failed program was:" >&5
8042 cat conftest.$ac_ext >&5
8043 ac_cv_func_initscr=no
8044 fi
8045 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8046 fi
8047 echo "$as_me:8047: result: $ac_cv_func_initscr" >&5
8048 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8049 if test $ac_cv_func_initscr = yes; then
8050   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8051 else
8052
8053                 cf_save_LIBS="$LIBS"
8054                 echo "$as_me:8054: checking for initscr in -l$cf_nculib_root" >&5
8055 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8056                 LIBS="-l$cf_nculib_root $LIBS"
8057                 cat >conftest.$ac_ext <<_ACEOF
8058 #line 8058 "configure"
8059 #include "confdefs.h"
8060 #include <${cf_cv_ncurses_header:-curses.h}>
8061 int
8062 main (void)
8063 {
8064 initscr()
8065   ;
8066   return 0;
8067 }
8068 _ACEOF
8069 rm -f conftest.$ac_objext conftest$ac_exeext
8070 if { (eval echo "$as_me:8070: \"$ac_link\"") >&5
8071   (eval $ac_link) 2>&5
8072   ac_status=$?
8073   echo "$as_me:8073: \$? = $ac_status" >&5
8074   (exit $ac_status); } &&
8075          { ac_try='test -s conftest$ac_exeext'
8076   { (eval echo "$as_me:8076: \"$ac_try\"") >&5
8077   (eval $ac_try) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit $ac_status); }; }; then
8081   echo "$as_me:8081: result: yes" >&5
8082 echo "${ECHO_T}yes" >&6
8083                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8084
8085 else
8086   echo "$as_me: failed program was:" >&5
8087 cat conftest.$ac_ext >&5
8088 echo "$as_me:8088: result: no" >&5
8089 echo "${ECHO_T}no" >&6
8090
8091 cf_search=
8092 cf_library_path_list=""
8093 if test -n "${LDFLAGS}${LIBS}" ; then
8094         for cf_library_path in $LDFLAGS $LIBS
8095         do
8096                 case $cf_library_path in
8097                 (-L*)
8098                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8099
8100 test "x$cf_library_path" != "xNONE" && \
8101 test -d "$cf_library_path" && \
8102  {
8103         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8104         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8105         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8106         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8107         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8108         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"
8109 }
8110
8111                         cf_library_path_list="$cf_library_path_list $cf_search"
8112                         ;;
8113                 esac
8114         done
8115 fi
8116
8117 cf_search=
8118
8119 test "x$prefix" != "xNONE" && \
8120 test -d "$prefix" && \
8121  {
8122         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8123         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8124         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8125         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8126         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8127         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8128 }
8129
8130 for cf_subdir_prefix in \
8131         /usr \
8132         /usr/local \
8133         /usr/pkg \
8134         /opt \
8135         /opt/local \
8136         $HOME
8137 do
8138
8139 test "x$cf_subdir_prefix" != "x$prefix" && \
8140 test -d "$cf_subdir_prefix" && \
8141 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8142         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8143         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8144         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8145         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8146         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8147         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"
8148 }
8149
8150 done
8151
8152 cf_search="$cf_library_path_list $cf_search"
8153
8154                         for cf_libdir in $cf_search
8155                         do
8156                                 echo "$as_me:8156: checking for -l$cf_nculib_root in $cf_libdir" >&5
8157 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8158                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8159                                 cat >conftest.$ac_ext <<_ACEOF
8160 #line 8160 "configure"
8161 #include "confdefs.h"
8162 #include <${cf_cv_ncurses_header:-curses.h}>
8163 int
8164 main (void)
8165 {
8166 initscr()
8167   ;
8168   return 0;
8169 }
8170 _ACEOF
8171 rm -f conftest.$ac_objext conftest$ac_exeext
8172 if { (eval echo "$as_me:8172: \"$ac_link\"") >&5
8173   (eval $ac_link) 2>&5
8174   ac_status=$?
8175   echo "$as_me:8175: \$? = $ac_status" >&5
8176   (exit $ac_status); } &&
8177          { ac_try='test -s conftest$ac_exeext'
8178   { (eval echo "$as_me:8178: \"$ac_try\"") >&5
8179   (eval $ac_try) 2>&5
8180   ac_status=$?
8181   echo "$as_me:8181: \$? = $ac_status" >&5
8182   (exit $ac_status); }; }; then
8183   echo "$as_me:8183: result: yes" >&5
8184 echo "${ECHO_T}yes" >&6
8185                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8186                                          break
8187 else
8188   echo "$as_me: failed program was:" >&5
8189 cat conftest.$ac_ext >&5
8190 echo "$as_me:8190: result: no" >&5
8191 echo "${ECHO_T}no" >&6
8192                                          LIBS="$cf_save_LIBS"
8193 fi
8194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8195                         done
8196
8197 fi
8198 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8199
8200 fi
8201
8202 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8203
8204 if test $cf_found_library = no ; then
8205         { { echo "$as_me:8205: error: Cannot link $cf_nculib_root library" >&5
8206 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8207    { (exit 1); exit 1; }; }
8208 fi
8209
8210 fi
8211
8212 if test -n "$cf_ncurses_LIBS" ; then
8213         echo "$as_me:8213: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8214 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8215         cf_ncurses_SAVE="$LIBS"
8216         for p in $cf_ncurses_LIBS ; do
8217                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8218                 if test "$q" != "$LIBS" ; then
8219                         LIBS="$q"
8220                 fi
8221         done
8222         cat >conftest.$ac_ext <<_ACEOF
8223 #line 8223 "configure"
8224 #include "confdefs.h"
8225 #include <${cf_cv_ncurses_header:-curses.h}>
8226 int
8227 main (void)
8228 {
8229 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8230   ;
8231   return 0;
8232 }
8233 _ACEOF
8234 rm -f conftest.$ac_objext conftest$ac_exeext
8235 if { (eval echo "$as_me:8235: \"$ac_link\"") >&5
8236   (eval $ac_link) 2>&5
8237   ac_status=$?
8238   echo "$as_me:8238: \$? = $ac_status" >&5
8239   (exit $ac_status); } &&
8240          { ac_try='test -s conftest$ac_exeext'
8241   { (eval echo "$as_me:8241: \"$ac_try\"") >&5
8242   (eval $ac_try) 2>&5
8243   ac_status=$?
8244   echo "$as_me:8244: \$? = $ac_status" >&5
8245   (exit $ac_status); }; }; then
8246   echo "$as_me:8246: result: yes" >&5
8247 echo "${ECHO_T}yes" >&6
8248 else
8249   echo "$as_me: failed program was:" >&5
8250 cat conftest.$ac_ext >&5
8251 echo "$as_me:8251: result: no" >&5
8252 echo "${ECHO_T}no" >&6
8253                  LIBS="$cf_ncurses_SAVE"
8254 fi
8255 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8256 fi
8257
8258 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8259
8260 cat >>confdefs.h <<EOF
8261 #define $cf_nculib_ROOT 1
8262 EOF
8263
8264         fi
8265 else
8266         NCURSES_CONFIG=none
8267 fi
8268
8269 else
8270
8271 cf_ncuconfig_root=ncurses
8272 cf_have_ncuconfig=no
8273
8274 if test "x${PKG_CONFIG:=none}" != xnone; then
8275         echo "$as_me:8275: checking pkg-config for $cf_ncuconfig_root" >&5
8276 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8277         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8278                 echo "$as_me:8278: result: yes" >&5
8279 echo "${ECHO_T}yes" >&6
8280
8281                 echo "$as_me:8281: checking if the $cf_ncuconfig_root package files work" >&5
8282 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8283                 cf_have_ncuconfig=unknown
8284
8285                 cf_save_CPPFLAGS="$CPPFLAGS"
8286                 cf_save_LIBS="$LIBS"
8287
8288 cf_fix_cppflags=no
8289 cf_new_cflags=
8290 cf_new_cppflags=
8291 cf_new_extra_cppflags=
8292
8293 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
8294 do
8295 case $cf_fix_cppflags in
8296 (no)
8297         case $cf_add_cflags in
8298         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8299                 case $cf_add_cflags in
8300                 (-D*)
8301                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8302
8303                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8304                                 && test -z "${cf_tst_cflags}" \
8305                                 && cf_fix_cppflags=yes
8306
8307                         if test $cf_fix_cppflags = yes ; then
8308
8309         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8310         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8311
8312                                 continue
8313                         elif test "${cf_tst_cflags}" = "\"'" ; then
8314
8315         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8316         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8317
8318                                 continue
8319                         fi
8320                         ;;
8321                 esac
8322                 case "$CPPFLAGS" in
8323                 (*$cf_add_cflags)
8324                         ;;
8325                 (*)
8326                         case $cf_add_cflags in
8327                         (-D*)
8328                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8329
8330 CPPFLAGS=`echo "$CPPFLAGS" | \
8331         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8332                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8333
8334                                 ;;
8335                         esac
8336
8337         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8338         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8339
8340                         ;;
8341                 esac
8342                 ;;
8343         (*)
8344
8345         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8346         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8347
8348                 ;;
8349         esac
8350         ;;
8351 (yes)
8352
8353         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8354         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8355
8356         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8357
8358         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8359                 && test -z "${cf_tst_cflags}" \
8360                 && cf_fix_cppflags=no
8361         ;;
8362 esac
8363 done
8364
8365 if test -n "$cf_new_cflags" ; then
8366
8367         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8368         CFLAGS="${CFLAGS}$cf_new_cflags"
8369
8370 fi
8371
8372 if test -n "$cf_new_cppflags" ; then
8373
8374         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8375         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8376
8377 fi
8378
8379 if test -n "$cf_new_extra_cppflags" ; then
8380
8381         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8382         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8383
8384 fi
8385
8386 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8387 # Filter out duplicates - this happens with badly-designed ".pc" files...
8388 for cf_add_1lib in $LIBS
8389 do
8390         for cf_add_2lib in $cf_add_libs
8391         do
8392                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8393                 then
8394                         cf_add_1lib=
8395                         break
8396                 fi
8397         done
8398         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8399 done
8400 LIBS="$cf_add_libs"
8401
8402                 cat >conftest.$ac_ext <<_ACEOF
8403 #line 8403 "configure"
8404 #include "confdefs.h"
8405 #include <${cf_cv_ncurses_header:-curses.h}>
8406 int
8407 main (void)
8408 {
8409 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8410   ;
8411   return 0;
8412 }
8413 _ACEOF
8414 rm -f conftest.$ac_objext conftest$ac_exeext
8415 if { (eval echo "$as_me:8415: \"$ac_link\"") >&5
8416   (eval $ac_link) 2>&5
8417   ac_status=$?
8418   echo "$as_me:8418: \$? = $ac_status" >&5
8419   (exit $ac_status); } &&
8420          { ac_try='test -s conftest$ac_exeext'
8421   { (eval echo "$as_me:8421: \"$ac_try\"") >&5
8422   (eval $ac_try) 2>&5
8423   ac_status=$?
8424   echo "$as_me:8424: \$? = $ac_status" >&5
8425   (exit $ac_status); }; }; then
8426   if test "$cross_compiling" = yes; then
8427   cf_have_ncuconfig=maybe
8428 else
8429   cat >conftest.$ac_ext <<_ACEOF
8430 #line 8430 "configure"
8431 #include "confdefs.h"
8432 #include <${cf_cv_ncurses_header:-curses.h}>
8433                                 int main(void)
8434                                 { char *xx = curses_version(); return (xx == 0); }
8435 _ACEOF
8436 rm -f conftest$ac_exeext
8437 if { (eval echo "$as_me:8437: \"$ac_link\"") >&5
8438   (eval $ac_link) 2>&5
8439   ac_status=$?
8440   echo "$as_me:8440: \$? = $ac_status" >&5
8441   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8442   { (eval echo "$as_me:8442: \"$ac_try\"") >&5
8443   (eval $ac_try) 2>&5
8444   ac_status=$?
8445   echo "$as_me:8445: \$? = $ac_status" >&5
8446   (exit $ac_status); }; }; then
8447   cf_have_ncuconfig=yes
8448 else
8449   echo "$as_me: program exited with status $ac_status" >&5
8450 echo "$as_me: failed program was:" >&5
8451 cat conftest.$ac_ext >&5
8452 cf_have_ncuconfig=no
8453 fi
8454 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8455 fi
8456 else
8457   echo "$as_me: failed program was:" >&5
8458 cat conftest.$ac_ext >&5
8459 cf_have_ncuconfig=no
8460 fi
8461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8462                 echo "$as_me:8462: result: $cf_have_ncuconfig" >&5
8463 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8464                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8465                 if test "$cf_have_ncuconfig" != "yes"
8466                 then
8467                         CPPFLAGS="$cf_save_CPPFLAGS"
8468                         LIBS="$cf_save_LIBS"
8469                         NCURSES_CONFIG_PKG=none
8470                 else
8471
8472 cat >>confdefs.h <<\EOF
8473 #define NCURSES 1
8474 EOF
8475
8476                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8477
8478 echo "$as_me:8478: checking for terminfo header" >&5
8479 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8480 if test "${cf_cv_term_header+set}" = set; then
8481   echo $ECHO_N "(cached) $ECHO_C" >&6
8482 else
8483
8484 case ${cf_cv_ncurses_header} in
8485 (*/ncurses.h|*/ncursesw.h)
8486         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8487         ;;
8488 (*)
8489         cf_term_header=term.h
8490         ;;
8491 esac
8492
8493 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8494 do
8495 cat >conftest.$ac_ext <<_ACEOF
8496 #line 8496 "configure"
8497 #include "confdefs.h"
8498 #include <stdio.h>
8499 #include <${cf_cv_ncurses_header:-curses.h}>
8500 #include <$cf_test>
8501
8502 int
8503 main (void)
8504 {
8505 int x = auto_left_margin
8506   ;
8507   return 0;
8508 }
8509 _ACEOF
8510 rm -f conftest.$ac_objext
8511 if { (eval echo "$as_me:8511: \"$ac_compile\"") >&5
8512   (eval $ac_compile) 2>&5
8513   ac_status=$?
8514   echo "$as_me:8514: \$? = $ac_status" >&5
8515   (exit $ac_status); } &&
8516          { ac_try='test -s conftest.$ac_objext'
8517   { (eval echo "$as_me:8517: \"$ac_try\"") >&5
8518   (eval $ac_try) 2>&5
8519   ac_status=$?
8520   echo "$as_me:8520: \$? = $ac_status" >&5
8521   (exit $ac_status); }; }; then
8522
8523         cf_cv_term_header="$cf_test"
8524 else
8525   echo "$as_me: failed program was:" >&5
8526 cat conftest.$ac_ext >&5
8527
8528         cf_cv_term_header=unknown
8529
8530 fi
8531 rm -f conftest.$ac_objext conftest.$ac_ext
8532         test "$cf_cv_term_header" != unknown && break
8533 done
8534
8535 fi
8536 echo "$as_me:8536: result: $cf_cv_term_header" >&5
8537 echo "${ECHO_T}$cf_cv_term_header" >&6
8538
8539 # Set definitions to allow ifdef'ing to accommodate subdirectories
8540
8541 case $cf_cv_term_header in
8542 (*term.h)
8543
8544 cat >>confdefs.h <<\EOF
8545 #define HAVE_TERM_H 1
8546 EOF
8547
8548         ;;
8549 esac
8550
8551 case $cf_cv_term_header in
8552 (ncurses/term.h)
8553
8554 cat >>confdefs.h <<\EOF
8555 #define HAVE_NCURSES_TERM_H 1
8556 EOF
8557
8558         ;;
8559 (ncursesw/term.h)
8560
8561 cat >>confdefs.h <<\EOF
8562 #define HAVE_NCURSESW_TERM_H 1
8563 EOF
8564
8565         ;;
8566 esac
8567
8568                 fi
8569
8570         else
8571                 echo "$as_me:8571: result: no" >&5
8572 echo "${ECHO_T}no" >&6
8573                 NCURSES_CONFIG_PKG=none
8574         fi
8575 else
8576         NCURSES_CONFIG_PKG=none
8577 fi
8578
8579 if test "x$cf_have_ncuconfig" = "xno"; then
8580         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8581
8582 if test -n "$ac_tool_prefix"; then
8583   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8584   do
8585     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8586 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8587 echo "$as_me:8587: checking for $ac_word" >&5
8588 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8589 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8590   echo $ECHO_N "(cached) $ECHO_C" >&6
8591 else
8592   if test -n "$NCURSES_CONFIG"; then
8593   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8594 else
8595   ac_save_IFS=$IFS; IFS=$ac_path_separator
8596 ac_dummy="$PATH"
8597 for ac_dir in $ac_dummy; do
8598   IFS=$ac_save_IFS
8599   test -z "$ac_dir" && ac_dir=.
8600   $as_executable_p "$ac_dir/$ac_word" || continue
8601 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8602 echo "$as_me:8602: found $ac_dir/$ac_word" >&5
8603 break
8604 done
8605
8606 fi
8607 fi
8608 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8609 if test -n "$NCURSES_CONFIG"; then
8610   echo "$as_me:8610: result: $NCURSES_CONFIG" >&5
8611 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8612 else
8613   echo "$as_me:8613: result: no" >&5
8614 echo "${ECHO_T}no" >&6
8615 fi
8616
8617     test -n "$NCURSES_CONFIG" && break
8618   done
8619 fi
8620 if test -z "$NCURSES_CONFIG"; then
8621   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8622   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8623 do
8624   # Extract the first word of "$ac_prog", so it can be a program name with args.
8625 set dummy $ac_prog; ac_word=$2
8626 echo "$as_me:8626: checking for $ac_word" >&5
8627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8628 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8629   echo $ECHO_N "(cached) $ECHO_C" >&6
8630 else
8631   if test -n "$ac_ct_NCURSES_CONFIG"; then
8632   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8633 else
8634   ac_save_IFS=$IFS; IFS=$ac_path_separator
8635 ac_dummy="$PATH"
8636 for ac_dir in $ac_dummy; do
8637   IFS=$ac_save_IFS
8638   test -z "$ac_dir" && ac_dir=.
8639   $as_executable_p "$ac_dir/$ac_word" || continue
8640 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8641 echo "$as_me:8641: found $ac_dir/$ac_word" >&5
8642 break
8643 done
8644
8645 fi
8646 fi
8647 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8648 if test -n "$ac_ct_NCURSES_CONFIG"; then
8649   echo "$as_me:8649: result: $ac_ct_NCURSES_CONFIG" >&5
8650 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8651 else
8652   echo "$as_me:8652: result: no" >&5
8653 echo "${ECHO_T}no" >&6
8654 fi
8655
8656   test -n "$ac_ct_NCURSES_CONFIG" && break
8657 done
8658 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8659
8660   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8661 fi
8662
8663         if test "$NCURSES_CONFIG" != none ; then
8664
8665 cf_fix_cppflags=no
8666 cf_new_cflags=
8667 cf_new_cppflags=
8668 cf_new_extra_cppflags=
8669
8670 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8671 do
8672 case $cf_fix_cppflags in
8673 (no)
8674         case $cf_add_cflags in
8675         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8676                 case $cf_add_cflags in
8677                 (-D*)
8678                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8679
8680                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8681                                 && test -z "${cf_tst_cflags}" \
8682                                 && cf_fix_cppflags=yes
8683
8684                         if test $cf_fix_cppflags = yes ; then
8685
8686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8688
8689                                 continue
8690                         elif test "${cf_tst_cflags}" = "\"'" ; then
8691
8692         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8693         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8694
8695                                 continue
8696                         fi
8697                         ;;
8698                 esac
8699                 case "$CPPFLAGS" in
8700                 (*$cf_add_cflags)
8701                         ;;
8702                 (*)
8703                         case $cf_add_cflags in
8704                         (-D*)
8705                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8706
8707 CPPFLAGS=`echo "$CPPFLAGS" | \
8708         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8709                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8710
8711                                 ;;
8712                         esac
8713
8714         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8715         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8716
8717                         ;;
8718                 esac
8719                 ;;
8720         (*)
8721
8722         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8723         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8724
8725                 ;;
8726         esac
8727         ;;
8728 (yes)
8729
8730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8732
8733         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8734
8735         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8736                 && test -z "${cf_tst_cflags}" \
8737                 && cf_fix_cppflags=no
8738         ;;
8739 esac
8740 done
8741
8742 if test -n "$cf_new_cflags" ; then
8743
8744         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8745         CFLAGS="${CFLAGS}$cf_new_cflags"
8746
8747 fi
8748
8749 if test -n "$cf_new_cppflags" ; then
8750
8751         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8752         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8753
8754 fi
8755
8756 if test -n "$cf_new_extra_cppflags" ; then
8757
8758         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8759         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8760
8761 fi
8762
8763 cf_add_libs="`$NCURSES_CONFIG --libs`"
8764 # Filter out duplicates - this happens with badly-designed ".pc" files...
8765 for cf_add_1lib in $LIBS
8766 do
8767         for cf_add_2lib in $cf_add_libs
8768         do
8769                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8770                 then
8771                         cf_add_1lib=
8772                         break
8773                 fi
8774         done
8775         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8776 done
8777 LIBS="$cf_add_libs"
8778
8779                 # even with config script, some packages use no-override for curses.h
8780
8781 echo "$as_me:8781: checking if we have identified curses headers" >&5
8782 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8783 if test "${cf_cv_ncurses_header+set}" = set; then
8784   echo $ECHO_N "(cached) $ECHO_C" >&6
8785 else
8786
8787 cf_cv_ncurses_header=none
8788 for cf_header in \
8789         ncurses.h ncurses/ncurses.h \
8790         curses.h ncurses/curses.h
8791 do
8792 cat >conftest.$ac_ext <<_ACEOF
8793 #line 8793 "configure"
8794 #include "confdefs.h"
8795 #include <${cf_header}>
8796 int
8797 main (void)
8798 {
8799 initscr(); tgoto("?", 0,0)
8800   ;
8801   return 0;
8802 }
8803 _ACEOF
8804 rm -f conftest.$ac_objext
8805 if { (eval echo "$as_me:8805: \"$ac_compile\"") >&5
8806   (eval $ac_compile) 2>&5
8807   ac_status=$?
8808   echo "$as_me:8808: \$? = $ac_status" >&5
8809   (exit $ac_status); } &&
8810          { ac_try='test -s conftest.$ac_objext'
8811   { (eval echo "$as_me:8811: \"$ac_try\"") >&5
8812   (eval $ac_try) 2>&5
8813   ac_status=$?
8814   echo "$as_me:8814: \$? = $ac_status" >&5
8815   (exit $ac_status); }; }; then
8816   cf_cv_ncurses_header=$cf_header; break
8817 else
8818   echo "$as_me: failed program was:" >&5
8819 cat conftest.$ac_ext >&5
8820 fi
8821 rm -f conftest.$ac_objext conftest.$ac_ext
8822 done
8823
8824 fi
8825 echo "$as_me:8825: result: $cf_cv_ncurses_header" >&5
8826 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8827
8828 if test "$cf_cv_ncurses_header" = none ; then
8829         { { echo "$as_me:8829: error: No curses header-files found" >&5
8830 echo "$as_me: error: No curses header-files found" >&2;}
8831    { (exit 1); exit 1; }; }
8832 fi
8833
8834 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8835
8836 for ac_header in $cf_cv_ncurses_header
8837 do
8838 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8839 echo "$as_me:8839: checking for $ac_header" >&5
8840 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8841 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8842   echo $ECHO_N "(cached) $ECHO_C" >&6
8843 else
8844   cat >conftest.$ac_ext <<_ACEOF
8845 #line 8845 "configure"
8846 #include "confdefs.h"
8847 #include <$ac_header>
8848 _ACEOF
8849 if { (eval echo "$as_me:8849: \"$ac_cpp conftest.$ac_ext\"") >&5
8850   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8851   ac_status=$?
8852   egrep -v '^ *\+' conftest.er1 >conftest.err
8853   rm -f conftest.er1
8854   cat conftest.err >&5
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit $ac_status); } >/dev/null; then
8857   if test -s conftest.err; then
8858     ac_cpp_err=$ac_c_preproc_warn_flag
8859   else
8860     ac_cpp_err=
8861   fi
8862 else
8863   ac_cpp_err=yes
8864 fi
8865 if test -z "$ac_cpp_err"; then
8866   eval "$as_ac_Header=yes"
8867 else
8868   echo "$as_me: failed program was:" >&5
8869   cat conftest.$ac_ext >&5
8870   eval "$as_ac_Header=no"
8871 fi
8872 rm -f conftest.err conftest.$ac_ext
8873 fi
8874 echo "$as_me:8874: result: `eval echo '${'$as_ac_Header'}'`" >&5
8875 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8876 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8877   cat >>confdefs.h <<EOF
8878 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8879 EOF
8880
8881 fi
8882 done
8883
8884 cat >>confdefs.h <<\EOF
8885 #define NCURSES 1
8886 EOF
8887
8888 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8889
8890                 cat >>confdefs.h <<EOF
8891 #define $cf_nculib_ROOT 1
8892 EOF
8893
8894                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8895
8896         else
8897
8898 cf_ncuhdr_root=ncurses
8899
8900 test -n "$cf_cv_curses_dir" && \
8901 test "$cf_cv_curses_dir" != "no" && { \
8902
8903 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8904   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8905   do
8906         while test $cf_add_incdir != /usr/include
8907         do
8908           if test -d $cf_add_incdir
8909           then
8910                 cf_have_incdir=no
8911                 if test -n "$CFLAGS$CPPFLAGS" ; then
8912                   # a loop is needed to ensure we can add subdirs of existing dirs
8913                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8914                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8915                           cf_have_incdir=yes; break
8916                         fi
8917                   done
8918                 fi
8919
8920                 if test "$cf_have_incdir" = no ; then
8921                   if test "$cf_add_incdir" = /usr/local/include ; then
8922                         if test "$GCC" = yes
8923                         then
8924                           cf_save_CPPFLAGS=$CPPFLAGS
8925
8926         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8927         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8928
8929                           cat >conftest.$ac_ext <<_ACEOF
8930 #line 8930 "configure"
8931 #include "confdefs.h"
8932 #include <stdio.h>
8933 int
8934 main (void)
8935 {
8936 printf("Hello")
8937   ;
8938   return 0;
8939 }
8940 _ACEOF
8941 rm -f conftest.$ac_objext
8942 if { (eval echo "$as_me:8942: \"$ac_compile\"") >&5
8943   (eval $ac_compile) 2>&5
8944   ac_status=$?
8945   echo "$as_me:8945: \$? = $ac_status" >&5
8946   (exit $ac_status); } &&
8947          { ac_try='test -s conftest.$ac_objext'
8948   { (eval echo "$as_me:8948: \"$ac_try\"") >&5
8949   (eval $ac_try) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); }; }; then
8953   :
8954 else
8955   echo "$as_me: failed program was:" >&5
8956 cat conftest.$ac_ext >&5
8957 cf_have_incdir=yes
8958 fi
8959 rm -f conftest.$ac_objext conftest.$ac_ext
8960                           CPPFLAGS=$cf_save_CPPFLAGS
8961                         fi
8962                   fi
8963                 fi
8964
8965                 if test "$cf_have_incdir" = no ; then
8966                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8967
8968 echo "${as_me:-configure}:8968: testing adding $cf_add_incdir to include-path ..." 1>&5
8969
8970                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8971
8972                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8973                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8974                   cf_add_incdir="$cf_top_incdir"
8975                 else
8976                   break
8977                 fi
8978           else
8979                 break
8980           fi
8981         done
8982   done
8983 fi
8984
8985 }
8986
8987 echo "$as_me:8987: checking for $cf_ncuhdr_root header in include-path" >&5
8988 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8989 if test "${cf_cv_ncurses_h+set}" = set; then
8990   echo $ECHO_N "(cached) $ECHO_C" >&6
8991 else
8992
8993         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8994         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8995         for cf_header in $cf_header_list
8996         do
8997
8998         cat >conftest.$ac_ext <<_ACEOF
8999 #line 8999 "configure"
9000 #include "confdefs.h"
9001
9002 #include <$cf_header>
9003 int
9004 main (void)
9005 {
9006
9007 #ifdef NCURSES_VERSION
9008
9009 printf("%s\n", NCURSES_VERSION);
9010 #else
9011 #ifdef __NCURSES_H
9012 printf("old\n");
9013 #else
9014         make an error
9015 #endif
9016 #endif
9017
9018   ;
9019   return 0;
9020 }
9021 _ACEOF
9022 rm -f conftest.$ac_objext
9023 if { (eval echo "$as_me:9023: \"$ac_compile\"") >&5
9024   (eval $ac_compile) 2>&5
9025   ac_status=$?
9026   echo "$as_me:9026: \$? = $ac_status" >&5
9027   (exit $ac_status); } &&
9028          { ac_try='test -s conftest.$ac_objext'
9029   { (eval echo "$as_me:9029: \"$ac_try\"") >&5
9030   (eval $ac_try) 2>&5
9031   ac_status=$?
9032   echo "$as_me:9032: \$? = $ac_status" >&5
9033   (exit $ac_status); }; }; then
9034   cf_cv_ncurses_h=$cf_header
9035
9036 else
9037   echo "$as_me: failed program was:" >&5
9038 cat conftest.$ac_ext >&5
9039 cf_cv_ncurses_h=no
9040 fi
9041 rm -f conftest.$ac_objext conftest.$ac_ext
9042
9043                 test "$cf_cv_ncurses_h" != no && break
9044         done
9045
9046 fi
9047 echo "$as_me:9047: result: $cf_cv_ncurses_h" >&5
9048 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9049
9050 if test "$cf_cv_ncurses_h" != no ; then
9051         cf_cv_ncurses_header=$cf_cv_ncurses_h
9052 else
9053
9054 echo "$as_me:9054: checking for $cf_ncuhdr_root include-path" >&5
9055 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9056 if test "${cf_cv_ncurses_h2+set}" = set; then
9057   echo $ECHO_N "(cached) $ECHO_C" >&6
9058 else
9059
9060         test -n "$verbose" && echo
9061
9062 cf_search=
9063
9064 # collect the current set of include-directories from compiler flags
9065 cf_header_path_list=""
9066 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9067         for cf_header_path in $CPPFLAGS $CFLAGS
9068         do
9069                 case $cf_header_path in
9070                 (-I*)
9071                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9072
9073 test "x$cf_header_path" != "xNONE" && \
9074 test -d "$cf_header_path" && \
9075  {
9076         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9077         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9078         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9079         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9080         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9081         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"
9082 }
9083
9084                         cf_header_path_list="$cf_header_path_list $cf_search"
9085                         ;;
9086                 esac
9087         done
9088 fi
9089
9090 # add the variations for the package we are looking for
9091
9092 cf_search=
9093
9094 test "x$prefix" != "xNONE" && \
9095 test -d "$prefix" && \
9096  {
9097         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9098         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9099         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9100         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9101         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9102         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9103 }
9104
9105 for cf_subdir_prefix in \
9106         /usr \
9107         /usr/local \
9108         /usr/pkg \
9109         /opt \
9110         /opt/local \
9111         $HOME
9112 do
9113
9114 test "x$cf_subdir_prefix" != "x$prefix" && \
9115 test -d "$cf_subdir_prefix" && \
9116 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9117         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9118         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9119         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9120         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9121         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9122         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"
9123 }
9124
9125 done
9126
9127 test "$includedir" != NONE && \
9128 test "$includedir" != "/usr/include" && \
9129 test -d "$includedir" && {
9130         test -d $includedir &&    cf_search="$cf_search $includedir"
9131         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9132 }
9133
9134 test "$oldincludedir" != NONE && \
9135 test "$oldincludedir" != "/usr/include" && \
9136 test -d "$oldincludedir" && {
9137         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9138         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9139 }
9140
9141 cf_search="$cf_search $cf_header_path_list"
9142
9143         test -n "$verbose" && echo search path $cf_search
9144         cf_save2_CPPFLAGS="$CPPFLAGS"
9145         for cf_incdir in $cf_search
9146         do
9147
9148 if test -n "$cf_incdir" ; then
9149   for cf_add_incdir in $cf_incdir
9150   do
9151         while test $cf_add_incdir != /usr/include
9152         do
9153           if test -d $cf_add_incdir
9154           then
9155                 cf_have_incdir=no
9156                 if test -n "$CFLAGS$CPPFLAGS" ; then
9157                   # a loop is needed to ensure we can add subdirs of existing dirs
9158                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9159                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9160                           cf_have_incdir=yes; break
9161                         fi
9162                   done
9163                 fi
9164
9165                 if test "$cf_have_incdir" = no ; then
9166                   if test "$cf_add_incdir" = /usr/local/include ; then
9167                         if test "$GCC" = yes
9168                         then
9169                           cf_save_CPPFLAGS=$CPPFLAGS
9170
9171         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9172         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9173
9174                           cat >conftest.$ac_ext <<_ACEOF
9175 #line 9175 "configure"
9176 #include "confdefs.h"
9177 #include <stdio.h>
9178 int
9179 main (void)
9180 {
9181 printf("Hello")
9182   ;
9183   return 0;
9184 }
9185 _ACEOF
9186 rm -f conftest.$ac_objext
9187 if { (eval echo "$as_me:9187: \"$ac_compile\"") >&5
9188   (eval $ac_compile) 2>&5
9189   ac_status=$?
9190   echo "$as_me:9190: \$? = $ac_status" >&5
9191   (exit $ac_status); } &&
9192          { ac_try='test -s conftest.$ac_objext'
9193   { (eval echo "$as_me:9193: \"$ac_try\"") >&5
9194   (eval $ac_try) 2>&5
9195   ac_status=$?
9196   echo "$as_me:9196: \$? = $ac_status" >&5
9197   (exit $ac_status); }; }; then
9198   :
9199 else
9200   echo "$as_me: failed program was:" >&5
9201 cat conftest.$ac_ext >&5
9202 cf_have_incdir=yes
9203 fi
9204 rm -f conftest.$ac_objext conftest.$ac_ext
9205                           CPPFLAGS=$cf_save_CPPFLAGS
9206                         fi
9207                   fi
9208                 fi
9209
9210                 if test "$cf_have_incdir" = no ; then
9211                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9212
9213 echo "${as_me:-configure}:9213: testing adding $cf_add_incdir to include-path ..." 1>&5
9214
9215                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9216
9217                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9218                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9219                   cf_add_incdir="$cf_top_incdir"
9220                 else
9221                   break
9222                 fi
9223           else
9224                 break
9225           fi
9226         done
9227   done
9228 fi
9229
9230                 for cf_header in \
9231                         ncurses.h \
9232                         curses.h
9233                 do
9234
9235         cat >conftest.$ac_ext <<_ACEOF
9236 #line 9236 "configure"
9237 #include "confdefs.h"
9238
9239 #include <$cf_header>
9240 int
9241 main (void)
9242 {
9243
9244 #ifdef NCURSES_VERSION
9245
9246 printf("%s\n", NCURSES_VERSION);
9247 #else
9248 #ifdef __NCURSES_H
9249 printf("old\n");
9250 #else
9251         make an error
9252 #endif
9253 #endif
9254
9255   ;
9256   return 0;
9257 }
9258 _ACEOF
9259 rm -f conftest.$ac_objext
9260 if { (eval echo "$as_me:9260: \"$ac_compile\"") >&5
9261   (eval $ac_compile) 2>&5
9262   ac_status=$?
9263   echo "$as_me:9263: \$? = $ac_status" >&5
9264   (exit $ac_status); } &&
9265          { ac_try='test -s conftest.$ac_objext'
9266   { (eval echo "$as_me:9266: \"$ac_try\"") >&5
9267   (eval $ac_try) 2>&5
9268   ac_status=$?
9269   echo "$as_me:9269: \$? = $ac_status" >&5
9270   (exit $ac_status); }; }; then
9271   cf_cv_ncurses_h2=$cf_header
9272
9273 else
9274   echo "$as_me: failed program was:" >&5
9275 cat conftest.$ac_ext >&5
9276 cf_cv_ncurses_h2=no
9277 fi
9278 rm -f conftest.$ac_objext conftest.$ac_ext
9279
9280                         if test "$cf_cv_ncurses_h2" != no ; then
9281                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9282                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9283                                 break
9284                         fi
9285                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9286                 done
9287                 CPPFLAGS="$cf_save2_CPPFLAGS"
9288                 test "$cf_cv_ncurses_h2" != no && break
9289         done
9290         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9290: error: not found" >&5
9291 echo "$as_me: error: not found" >&2;}
9292    { (exit 1); exit 1; }; }
9293
9294 fi
9295 echo "$as_me:9295: result: $cf_cv_ncurses_h2" >&5
9296 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9297
9298         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9299         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9300         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9301                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9302         fi
9303
9304 if test -n "$cf_1st_incdir" ; then
9305   for cf_add_incdir in $cf_1st_incdir
9306   do
9307         while test $cf_add_incdir != /usr/include
9308         do
9309           if test -d $cf_add_incdir
9310           then
9311                 cf_have_incdir=no
9312                 if test -n "$CFLAGS$CPPFLAGS" ; then
9313                   # a loop is needed to ensure we can add subdirs of existing dirs
9314                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9315                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9316                           cf_have_incdir=yes; break
9317                         fi
9318                   done
9319                 fi
9320
9321                 if test "$cf_have_incdir" = no ; then
9322                   if test "$cf_add_incdir" = /usr/local/include ; then
9323                         if test "$GCC" = yes
9324                         then
9325                           cf_save_CPPFLAGS=$CPPFLAGS
9326
9327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9328         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9329
9330                           cat >conftest.$ac_ext <<_ACEOF
9331 #line 9331 "configure"
9332 #include "confdefs.h"
9333 #include <stdio.h>
9334 int
9335 main (void)
9336 {
9337 printf("Hello")
9338   ;
9339   return 0;
9340 }
9341 _ACEOF
9342 rm -f conftest.$ac_objext
9343 if { (eval echo "$as_me:9343: \"$ac_compile\"") >&5
9344   (eval $ac_compile) 2>&5
9345   ac_status=$?
9346   echo "$as_me:9346: \$? = $ac_status" >&5
9347   (exit $ac_status); } &&
9348          { ac_try='test -s conftest.$ac_objext'
9349   { (eval echo "$as_me:9349: \"$ac_try\"") >&5
9350   (eval $ac_try) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); }; }; then
9354   :
9355 else
9356   echo "$as_me: failed program was:" >&5
9357 cat conftest.$ac_ext >&5
9358 cf_have_incdir=yes
9359 fi
9360 rm -f conftest.$ac_objext conftest.$ac_ext
9361                           CPPFLAGS=$cf_save_CPPFLAGS
9362                         fi
9363                   fi
9364                 fi
9365
9366                 if test "$cf_have_incdir" = no ; then
9367                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9368
9369 echo "${as_me:-configure}:9369: testing adding $cf_add_incdir to include-path ..." 1>&5
9370
9371                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9372
9373                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9374                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9375                   cf_add_incdir="$cf_top_incdir"
9376                 else
9377                   break
9378                 fi
9379           else
9380                 break
9381           fi
9382         done
9383   done
9384 fi
9385
9386 fi
9387
9388 # Set definitions to allow ifdef'ing for ncurses.h
9389
9390 case $cf_cv_ncurses_header in
9391 (*ncurses.h)
9392
9393 cat >>confdefs.h <<\EOF
9394 #define HAVE_NCURSES_H 1
9395 EOF
9396
9397         ;;
9398 esac
9399
9400 case $cf_cv_ncurses_header in
9401 (ncurses/curses.h|ncurses/ncurses.h)
9402
9403 cat >>confdefs.h <<\EOF
9404 #define HAVE_NCURSES_NCURSES_H 1
9405 EOF
9406
9407         ;;
9408 (ncursesw/curses.h|ncursesw/ncurses.h)
9409
9410 cat >>confdefs.h <<\EOF
9411 #define HAVE_NCURSESW_NCURSES_H 1
9412 EOF
9413
9414         ;;
9415 esac
9416
9417 echo "$as_me:9417: checking for terminfo header" >&5
9418 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9419 if test "${cf_cv_term_header+set}" = set; then
9420   echo $ECHO_N "(cached) $ECHO_C" >&6
9421 else
9422
9423 case ${cf_cv_ncurses_header} in
9424 (*/ncurses.h|*/ncursesw.h)
9425         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9426         ;;
9427 (*)
9428         cf_term_header=term.h
9429         ;;
9430 esac
9431
9432 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9433 do
9434 cat >conftest.$ac_ext <<_ACEOF
9435 #line 9435 "configure"
9436 #include "confdefs.h"
9437 #include <stdio.h>
9438 #include <${cf_cv_ncurses_header:-curses.h}>
9439 #include <$cf_test>
9440
9441 int
9442 main (void)
9443 {
9444 int x = auto_left_margin
9445   ;
9446   return 0;
9447 }
9448 _ACEOF
9449 rm -f conftest.$ac_objext
9450 if { (eval echo "$as_me:9450: \"$ac_compile\"") >&5
9451   (eval $ac_compile) 2>&5
9452   ac_status=$?
9453   echo "$as_me:9453: \$? = $ac_status" >&5
9454   (exit $ac_status); } &&
9455          { ac_try='test -s conftest.$ac_objext'
9456   { (eval echo "$as_me:9456: \"$ac_try\"") >&5
9457   (eval $ac_try) 2>&5
9458   ac_status=$?
9459   echo "$as_me:9459: \$? = $ac_status" >&5
9460   (exit $ac_status); }; }; then
9461
9462         cf_cv_term_header="$cf_test"
9463 else
9464   echo "$as_me: failed program was:" >&5
9465 cat conftest.$ac_ext >&5
9466
9467         cf_cv_term_header=unknown
9468
9469 fi
9470 rm -f conftest.$ac_objext conftest.$ac_ext
9471         test "$cf_cv_term_header" != unknown && break
9472 done
9473
9474 fi
9475 echo "$as_me:9475: result: $cf_cv_term_header" >&5
9476 echo "${ECHO_T}$cf_cv_term_header" >&6
9477
9478 # Set definitions to allow ifdef'ing to accommodate subdirectories
9479
9480 case $cf_cv_term_header in
9481 (*term.h)
9482
9483 cat >>confdefs.h <<\EOF
9484 #define HAVE_TERM_H 1
9485 EOF
9486
9487         ;;
9488 esac
9489
9490 case $cf_cv_term_header in
9491 (ncurses/term.h)
9492
9493 cat >>confdefs.h <<\EOF
9494 #define HAVE_NCURSES_TERM_H 1
9495 EOF
9496
9497         ;;
9498 (ncursesw/term.h)
9499
9500 cat >>confdefs.h <<\EOF
9501 #define HAVE_NCURSESW_TERM_H 1
9502 EOF
9503
9504         ;;
9505 esac
9506
9507 # some applications need this, but should check for NCURSES_VERSION
9508
9509 cat >>confdefs.h <<\EOF
9510 #define NCURSES 1
9511 EOF
9512
9513 echo "$as_me:9513: checking for ncurses version" >&5
9514 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9515 if test "${cf_cv_ncurses_version+set}" = set; then
9516   echo $ECHO_N "(cached) $ECHO_C" >&6
9517 else
9518
9519         cf_cv_ncurses_version=no
9520         cf_tempfile=out$$
9521         rm -f $cf_tempfile
9522         if test "$cross_compiling" = yes; then
9523
9524         # This will not work if the preprocessor splits the line after the
9525         # Autoconf token.  The 'unproto' program does that.
9526         cat > conftest.$ac_ext <<EOF
9527 #include <${cf_cv_ncurses_header:-curses.h}>
9528 #undef Autoconf
9529 #ifdef NCURSES_VERSION
9530 Autoconf NCURSES_VERSION
9531 #else
9532 #ifdef __NCURSES_H
9533 Autoconf "old"
9534 #endif
9535 ;
9536 #endif
9537 EOF
9538         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9539         { (eval echo "$as_me:9539: \"$cf_try\"") >&5
9540   (eval $cf_try) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); }
9544         if test -f conftest.out ; then
9545                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9546                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9547                 rm -f conftest.out
9548         fi
9549
9550 else
9551   cat >conftest.$ac_ext <<_ACEOF
9552 #line 9552 "configure"
9553 #include "confdefs.h"
9554
9555 #include <${cf_cv_ncurses_header:-curses.h}>
9556 #include <stdio.h>
9557 int main(void)
9558 {
9559         FILE *fp = fopen("$cf_tempfile", "w");
9560 #ifdef NCURSES_VERSION
9561 # ifdef NCURSES_VERSION_PATCH
9562         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9563 # else
9564         fprintf(fp, "%s\n", NCURSES_VERSION);
9565 # endif
9566 #else
9567 # ifdef __NCURSES_H
9568         fprintf(fp, "old\n");
9569 # else
9570         make an error
9571 # endif
9572 #endif
9573         ${cf_cv_main_return:-return}(0);
9574 }
9575 _ACEOF
9576 rm -f conftest$ac_exeext
9577 if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
9578   (eval $ac_link) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9582   { (eval echo "$as_me:9582: \"$ac_try\"") >&5
9583   (eval $ac_try) 2>&5
9584   ac_status=$?
9585   echo "$as_me:9585: \$? = $ac_status" >&5
9586   (exit $ac_status); }; }; then
9587
9588         cf_cv_ncurses_version=`cat $cf_tempfile`
9589 else
9590   echo "$as_me: program exited with status $ac_status" >&5
9591 echo "$as_me: failed program was:" >&5
9592 cat conftest.$ac_ext >&5
9593 fi
9594 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9595 fi
9596         rm -f $cf_tempfile
9597
9598 fi
9599 echo "$as_me:9599: result: $cf_cv_ncurses_version" >&5
9600 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9601 test "$cf_cv_ncurses_version" = no ||
9602 cat >>confdefs.h <<\EOF
9603 #define NCURSES 1
9604 EOF
9605
9606 cf_nculib_root=ncurses
9607         # This works, except for the special case where we find gpm, but
9608         # ncurses is in a nonstandard location via $LIBS, and we really want
9609         # to link gpm.
9610 cf_ncurses_LIBS=""
9611 cf_ncurses_SAVE="$LIBS"
9612 echo "$as_me:9612: checking for Gpm_Open in -lgpm" >&5
9613 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9614 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9615   echo $ECHO_N "(cached) $ECHO_C" >&6
9616 else
9617   ac_check_lib_save_LIBS=$LIBS
9618 LIBS="-lgpm  $LIBS"
9619 cat >conftest.$ac_ext <<_ACEOF
9620 #line 9620 "configure"
9621 #include "confdefs.h"
9622
9623 /* Override any gcc2 internal prototype to avoid an error.  */
9624 #ifdef __cplusplus
9625 extern "C"
9626 #endif
9627 /* We use char because int might match the return type of a gcc2
9628    builtin and then its argument prototype would still apply.  */
9629 char Gpm_Open ();
9630 int
9631 main (void)
9632 {
9633 Gpm_Open ();
9634   ;
9635   return 0;
9636 }
9637 _ACEOF
9638 rm -f conftest.$ac_objext conftest$ac_exeext
9639 if { (eval echo "$as_me:9639: \"$ac_link\"") >&5
9640   (eval $ac_link) 2>&5
9641   ac_status=$?
9642   echo "$as_me:9642: \$? = $ac_status" >&5
9643   (exit $ac_status); } &&
9644          { ac_try='test -s conftest$ac_exeext'
9645   { (eval echo "$as_me:9645: \"$ac_try\"") >&5
9646   (eval $ac_try) 2>&5
9647   ac_status=$?
9648   echo "$as_me:9648: \$? = $ac_status" >&5
9649   (exit $ac_status); }; }; then
9650   ac_cv_lib_gpm_Gpm_Open=yes
9651 else
9652   echo "$as_me: failed program was:" >&5
9653 cat conftest.$ac_ext >&5
9654 ac_cv_lib_gpm_Gpm_Open=no
9655 fi
9656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9657 LIBS=$ac_check_lib_save_LIBS
9658 fi
9659 echo "$as_me:9659: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9660 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9661 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9662   echo "$as_me:9662: checking for initscr in -lgpm" >&5
9663 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9664 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9665   echo $ECHO_N "(cached) $ECHO_C" >&6
9666 else
9667   ac_check_lib_save_LIBS=$LIBS
9668 LIBS="-lgpm  $LIBS"
9669 cat >conftest.$ac_ext <<_ACEOF
9670 #line 9670 "configure"
9671 #include "confdefs.h"
9672
9673 /* Override any gcc2 internal prototype to avoid an error.  */
9674 #ifdef __cplusplus
9675 extern "C"
9676 #endif
9677 /* We use char because int might match the return type of a gcc2
9678    builtin and then its argument prototype would still apply.  */
9679 char initscr ();
9680 int
9681 main (void)
9682 {
9683 initscr ();
9684   ;
9685   return 0;
9686 }
9687 _ACEOF
9688 rm -f conftest.$ac_objext conftest$ac_exeext
9689 if { (eval echo "$as_me:9689: \"$ac_link\"") >&5
9690   (eval $ac_link) 2>&5
9691   ac_status=$?
9692   echo "$as_me:9692: \$? = $ac_status" >&5
9693   (exit $ac_status); } &&
9694          { ac_try='test -s conftest$ac_exeext'
9695   { (eval echo "$as_me:9695: \"$ac_try\"") >&5
9696   (eval $ac_try) 2>&5
9697   ac_status=$?
9698   echo "$as_me:9698: \$? = $ac_status" >&5
9699   (exit $ac_status); }; }; then
9700   ac_cv_lib_gpm_initscr=yes
9701 else
9702   echo "$as_me: failed program was:" >&5
9703 cat conftest.$ac_ext >&5
9704 ac_cv_lib_gpm_initscr=no
9705 fi
9706 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9707 LIBS=$ac_check_lib_save_LIBS
9708 fi
9709 echo "$as_me:9709: result: $ac_cv_lib_gpm_initscr" >&5
9710 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9711 if test $ac_cv_lib_gpm_initscr = yes; then
9712   LIBS="$cf_ncurses_SAVE"
9713 else
9714   cf_ncurses_LIBS="-lgpm"
9715 fi
9716
9717 fi
9718
9719 case $host_os in
9720 (freebsd*)
9721         # This is only necessary if you are linking against an obsolete
9722         # version of ncurses (but it should do no harm, since it's static).
9723         if test "$cf_nculib_root" = ncurses ; then
9724                 echo "$as_me:9724: checking for tgoto in -lmytinfo" >&5
9725 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9726 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9727   echo $ECHO_N "(cached) $ECHO_C" >&6
9728 else
9729   ac_check_lib_save_LIBS=$LIBS
9730 LIBS="-lmytinfo  $LIBS"
9731 cat >conftest.$ac_ext <<_ACEOF
9732 #line 9732 "configure"
9733 #include "confdefs.h"
9734
9735 /* Override any gcc2 internal prototype to avoid an error.  */
9736 #ifdef __cplusplus
9737 extern "C"
9738 #endif
9739 /* We use char because int might match the return type of a gcc2
9740    builtin and then its argument prototype would still apply.  */
9741 char tgoto ();
9742 int
9743 main (void)
9744 {
9745 tgoto ();
9746   ;
9747   return 0;
9748 }
9749 _ACEOF
9750 rm -f conftest.$ac_objext conftest$ac_exeext
9751 if { (eval echo "$as_me:9751: \"$ac_link\"") >&5
9752   (eval $ac_link) 2>&5
9753   ac_status=$?
9754   echo "$as_me:9754: \$? = $ac_status" >&5
9755   (exit $ac_status); } &&
9756          { ac_try='test -s conftest$ac_exeext'
9757   { (eval echo "$as_me:9757: \"$ac_try\"") >&5
9758   (eval $ac_try) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); }; }; then
9762   ac_cv_lib_mytinfo_tgoto=yes
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat conftest.$ac_ext >&5
9766 ac_cv_lib_mytinfo_tgoto=no
9767 fi
9768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9769 LIBS=$ac_check_lib_save_LIBS
9770 fi
9771 echo "$as_me:9771: result: $ac_cv_lib_mytinfo_tgoto" >&5
9772 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9773 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9774   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9775 fi
9776
9777         fi
9778         ;;
9779 esac
9780
9781 cf_add_libs="$cf_ncurses_LIBS"
9782 # Filter out duplicates - this happens with badly-designed ".pc" files...
9783 for cf_add_1lib in $LIBS
9784 do
9785         for cf_add_2lib in $cf_add_libs
9786         do
9787                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9788                 then
9789                         cf_add_1lib=
9790                         break
9791                 fi
9792         done
9793         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9794 done
9795 LIBS="$cf_add_libs"
9796
9797 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9798 then
9799
9800 cf_add_libs="-l$cf_nculib_root"
9801 # Filter out duplicates - this happens with badly-designed ".pc" files...
9802 for cf_add_1lib in $LIBS
9803 do
9804         for cf_add_2lib in $cf_add_libs
9805         do
9806                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9807                 then
9808                         cf_add_1lib=
9809                         break
9810                 fi
9811         done
9812         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9813 done
9814 LIBS="$cf_add_libs"
9815
9816 else
9817
9818         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9819         cf_libdir=""
9820         echo "$as_me:9820: checking for initscr" >&5
9821 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9822 if test "${ac_cv_func_initscr+set}" = set; then
9823   echo $ECHO_N "(cached) $ECHO_C" >&6
9824 else
9825   cat >conftest.$ac_ext <<_ACEOF
9826 #line 9826 "configure"
9827 #include "confdefs.h"
9828 #define initscr autoconf_temporary
9829 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9830 #undef initscr
9831
9832 #ifdef __cplusplus
9833 extern "C"
9834 #endif
9835
9836 /* We use char because int might match the return type of a gcc2
9837    builtin and then its argument prototype would still apply.  */
9838 char initscr (void);
9839
9840 int
9841 main (void)
9842 {
9843
9844 /* The GNU C library defines stubs for functions which it implements
9845     to always fail with ENOSYS.  Some functions are actually named
9846     something starting with __ and the normal name is an alias.  */
9847 #if defined (__stub_initscr) || defined (__stub___initscr)
9848 #error found stub for initscr
9849 #endif
9850
9851         return initscr ();
9852   ;
9853   return 0;
9854 }
9855 _ACEOF
9856 rm -f conftest.$ac_objext conftest$ac_exeext
9857 if { (eval echo "$as_me:9857: \"$ac_link\"") >&5
9858   (eval $ac_link) 2>&5
9859   ac_status=$?
9860   echo "$as_me:9860: \$? = $ac_status" >&5
9861   (exit $ac_status); } &&
9862          { ac_try='test -s conftest$ac_exeext'
9863   { (eval echo "$as_me:9863: \"$ac_try\"") >&5
9864   (eval $ac_try) 2>&5
9865   ac_status=$?
9866   echo "$as_me:9866: \$? = $ac_status" >&5
9867   (exit $ac_status); }; }; then
9868   ac_cv_func_initscr=yes
9869 else
9870   echo "$as_me: failed program was:" >&5
9871 cat conftest.$ac_ext >&5
9872 ac_cv_func_initscr=no
9873 fi
9874 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9875 fi
9876 echo "$as_me:9876: result: $ac_cv_func_initscr" >&5
9877 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9878 if test $ac_cv_func_initscr = yes; then
9879   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9880 else
9881
9882                 cf_save_LIBS="$LIBS"
9883                 echo "$as_me:9883: checking for initscr in -l$cf_nculib_root" >&5
9884 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9885                 LIBS="-l$cf_nculib_root $LIBS"
9886                 cat >conftest.$ac_ext <<_ACEOF
9887 #line 9887 "configure"
9888 #include "confdefs.h"
9889 #include <${cf_cv_ncurses_header:-curses.h}>
9890 int
9891 main (void)
9892 {
9893 initscr()
9894   ;
9895   return 0;
9896 }
9897 _ACEOF
9898 rm -f conftest.$ac_objext conftest$ac_exeext
9899 if { (eval echo "$as_me:9899: \"$ac_link\"") >&5
9900   (eval $ac_link) 2>&5
9901   ac_status=$?
9902   echo "$as_me:9902: \$? = $ac_status" >&5
9903   (exit $ac_status); } &&
9904          { ac_try='test -s conftest$ac_exeext'
9905   { (eval echo "$as_me:9905: \"$ac_try\"") >&5
9906   (eval $ac_try) 2>&5
9907   ac_status=$?
9908   echo "$as_me:9908: \$? = $ac_status" >&5
9909   (exit $ac_status); }; }; then
9910   echo "$as_me:9910: result: yes" >&5
9911 echo "${ECHO_T}yes" >&6
9912                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9913
9914 else
9915   echo "$as_me: failed program was:" >&5
9916 cat conftest.$ac_ext >&5
9917 echo "$as_me:9917: result: no" >&5
9918 echo "${ECHO_T}no" >&6
9919
9920 cf_search=
9921 cf_library_path_list=""
9922 if test -n "${LDFLAGS}${LIBS}" ; then
9923         for cf_library_path in $LDFLAGS $LIBS
9924         do
9925                 case $cf_library_path in
9926                 (-L*)
9927                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9928
9929 test "x$cf_library_path" != "xNONE" && \
9930 test -d "$cf_library_path" && \
9931  {
9932         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9933         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9934         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9935         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9936         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9937         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"
9938 }
9939
9940                         cf_library_path_list="$cf_library_path_list $cf_search"
9941                         ;;
9942                 esac
9943         done
9944 fi
9945
9946 cf_search=
9947
9948 test "x$prefix" != "xNONE" && \
9949 test -d "$prefix" && \
9950  {
9951         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9952         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9953         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9954         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9955         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9956         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9957 }
9958
9959 for cf_subdir_prefix in \
9960         /usr \
9961         /usr/local \
9962         /usr/pkg \
9963         /opt \
9964         /opt/local \
9965         $HOME
9966 do
9967
9968 test "x$cf_subdir_prefix" != "x$prefix" && \
9969 test -d "$cf_subdir_prefix" && \
9970 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9971         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9972         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9973         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9974         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9975         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9976         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"
9977 }
9978
9979 done
9980
9981 cf_search="$cf_library_path_list $cf_search"
9982
9983                         for cf_libdir in $cf_search
9984                         do
9985                                 echo "$as_me:9985: checking for -l$cf_nculib_root in $cf_libdir" >&5
9986 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9987                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9988                                 cat >conftest.$ac_ext <<_ACEOF
9989 #line 9989 "configure"
9990 #include "confdefs.h"
9991 #include <${cf_cv_ncurses_header:-curses.h}>
9992 int
9993 main (void)
9994 {
9995 initscr()
9996   ;
9997   return 0;
9998 }
9999 _ACEOF
10000 rm -f conftest.$ac_objext conftest$ac_exeext
10001 if { (eval echo "$as_me:10001: \"$ac_link\"") >&5
10002   (eval $ac_link) 2>&5
10003   ac_status=$?
10004   echo "$as_me:10004: \$? = $ac_status" >&5
10005   (exit $ac_status); } &&
10006          { ac_try='test -s conftest$ac_exeext'
10007   { (eval echo "$as_me:10007: \"$ac_try\"") >&5
10008   (eval $ac_try) 2>&5
10009   ac_status=$?
10010   echo "$as_me:10010: \$? = $ac_status" >&5
10011   (exit $ac_status); }; }; then
10012   echo "$as_me:10012: result: yes" >&5
10013 echo "${ECHO_T}yes" >&6
10014                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10015                                          break
10016 else
10017   echo "$as_me: failed program was:" >&5
10018 cat conftest.$ac_ext >&5
10019 echo "$as_me:10019: result: no" >&5
10020 echo "${ECHO_T}no" >&6
10021                                          LIBS="$cf_save_LIBS"
10022 fi
10023 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10024                         done
10025
10026 fi
10027 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10028
10029 fi
10030
10031 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10032
10033 if test $cf_found_library = no ; then
10034         { { echo "$as_me:10034: error: Cannot link $cf_nculib_root library" >&5
10035 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10036    { (exit 1); exit 1; }; }
10037 fi
10038
10039 fi
10040
10041 if test -n "$cf_ncurses_LIBS" ; then
10042         echo "$as_me:10042: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10043 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10044         cf_ncurses_SAVE="$LIBS"
10045         for p in $cf_ncurses_LIBS ; do
10046                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10047                 if test "$q" != "$LIBS" ; then
10048                         LIBS="$q"
10049                 fi
10050         done
10051         cat >conftest.$ac_ext <<_ACEOF
10052 #line 10052 "configure"
10053 #include "confdefs.h"
10054 #include <${cf_cv_ncurses_header:-curses.h}>
10055 int
10056 main (void)
10057 {
10058 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10059   ;
10060   return 0;
10061 }
10062 _ACEOF
10063 rm -f conftest.$ac_objext conftest$ac_exeext
10064 if { (eval echo "$as_me:10064: \"$ac_link\"") >&5
10065   (eval $ac_link) 2>&5
10066   ac_status=$?
10067   echo "$as_me:10067: \$? = $ac_status" >&5
10068   (exit $ac_status); } &&
10069          { ac_try='test -s conftest$ac_exeext'
10070   { (eval echo "$as_me:10070: \"$ac_try\"") >&5
10071   (eval $ac_try) 2>&5
10072   ac_status=$?
10073   echo "$as_me:10073: \$? = $ac_status" >&5
10074   (exit $ac_status); }; }; then
10075   echo "$as_me:10075: result: yes" >&5
10076 echo "${ECHO_T}yes" >&6
10077 else
10078   echo "$as_me: failed program was:" >&5
10079 cat conftest.$ac_ext >&5
10080 echo "$as_me:10080: result: no" >&5
10081 echo "${ECHO_T}no" >&6
10082                  LIBS="$cf_ncurses_SAVE"
10083 fi
10084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10085 fi
10086
10087 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10088
10089 cat >>confdefs.h <<EOF
10090 #define $cf_nculib_ROOT 1
10091 EOF
10092
10093         fi
10094 else
10095         NCURSES_CONFIG=none
10096 fi
10097
10098 fi
10099
10100 if test "$NCURSES_CONFIG_PKG" != none ; then
10101         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10102
10103         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10104         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10105         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10106
10107         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10108         if test -z "$cf_cv_abi_version"
10109         then
10110                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10111         fi
10112
10113 elif test "$NCURSES_CONFIG" != none ; then
10114
10115         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10116
10117         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10118         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10119         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10120
10121         # ABI version is not available from headers
10122         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10123
10124 else
10125
10126         for cf_name in MAJOR MINOR PATCH
10127         do
10128         cat >conftest.$ac_ext <<CF_EOF
10129         #include <${cf_cv_ncurses_header:-curses.h}>
10130         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10131 CF_EOF
10132                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10133                 { (eval echo "$as_me:10133: \"$cf_try\"") >&5
10134   (eval $cf_try) 2>&5
10135   ac_status=$?
10136   echo "$as_me:10136: \$? = $ac_status" >&5
10137   (exit $ac_status); }
10138                 if test -f conftest.out ; then
10139                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10140                         eval NCURSES_$cf_name=\"$cf_result\"
10141                         # cat conftest.$ac_ext
10142                         # cat conftest.out
10143                 fi
10144         done
10145
10146         cf_cv_abi_version=${NCURSES_MAJOR}
10147
10148 fi
10149
10150 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10151
10152 cf_cv_timestamp=`date`
10153
10154 echo "$as_me:10154: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10155 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10156
10157 echo "$as_me:10157: checking if you want to have a library-prefix" >&5
10158 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10159
10160 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10161 if test "${with_lib_prefix+set}" = set; then
10162   withval="$with_lib_prefix"
10163   with_lib_prefix=$withval
10164 else
10165   with_lib_prefix=auto
10166 fi;
10167 echo "$as_me:10167: result: $with_lib_prefix" >&5
10168 echo "${ECHO_T}$with_lib_prefix" >&6
10169
10170 if test $with_lib_prefix = auto
10171 then
10172
10173         case $cf_cv_system_name in
10174         (OS/2*|os2*)
10175                 if test "$DFT_LWR_MODEL" = libtool; then
10176                         LIB_PREFIX='lib'
10177                 else
10178                         LIB_PREFIX=''
10179                 fi
10180                 ;;
10181         (*)     LIB_PREFIX='lib'
10182                 ;;
10183         esac
10184 cf_prefix=$LIB_PREFIX
10185
10186 elif test $with_lib_prefix = no
10187 then
10188         LIB_PREFIX=
10189 else
10190         LIB_PREFIX=$with_lib_prefix
10191 fi
10192
10193 LIB_SUFFIX=
10194
10195 ###############################################################################
10196
10197 if test X"$CC_G_OPT" = X"" ; then
10198         CC_G_OPT='-g'
10199         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10200 fi
10201
10202 echo "$as_me:10202: checking for default loader flags" >&5
10203 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10204 case $DFT_LWR_MODEL in
10205 (normal)  LD_MODEL=''   ;;
10206 (debug)   LD_MODEL=$CC_G_OPT ;;
10207 (profile) LD_MODEL='-pg';;
10208 (shared)  LD_MODEL=''   ;;
10209 esac
10210 echo "$as_me:10210: result: $LD_MODEL" >&5
10211 echo "${ECHO_T}$LD_MODEL" >&6
10212
10213 LD_RPATH_OPT=
10214 if test "x$cf_cv_enable_rpath" != xno
10215 then
10216         echo "$as_me:10216: checking for an rpath option" >&5
10217 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10218         case $cf_cv_system_name in
10219         (irix*)
10220                 if test "$GCC" = yes; then
10221                         LD_RPATH_OPT="-Wl,-rpath,"
10222                 else
10223                         LD_RPATH_OPT="-rpath "
10224                 fi
10225                 ;;
10226         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10227                 LD_RPATH_OPT="-Wl,-rpath,"
10228                 ;;
10229         (openbsd[2-9].*|mirbsd*)
10230                 LD_RPATH_OPT="-Wl,-rpath,"
10231                 ;;
10232         (dragonfly*)
10233                 LD_RPATH_OPT="-rpath "
10234                 ;;
10235         (netbsd*)
10236                 LD_RPATH_OPT="-Wl,-rpath,"
10237                 ;;
10238         (osf*|mls+*)
10239                 LD_RPATH_OPT="-rpath "
10240                 ;;
10241         (solaris2*)
10242                 LD_RPATH_OPT="-R"
10243                 ;;
10244         (*)
10245                 ;;
10246         esac
10247         echo "$as_me:10247: result: $LD_RPATH_OPT" >&5
10248 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10249
10250         case "x$LD_RPATH_OPT" in
10251         (x-R*)
10252                 echo "$as_me:10252: checking if we need a space after rpath option" >&5
10253 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10254                 cf_save_LIBS="$LIBS"
10255
10256 cf_add_libs="${LD_RPATH_OPT}$libdir"
10257 # Filter out duplicates - this happens with badly-designed ".pc" files...
10258 for cf_add_1lib in $LIBS
10259 do
10260         for cf_add_2lib in $cf_add_libs
10261         do
10262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10263                 then
10264                         cf_add_1lib=
10265                         break
10266                 fi
10267         done
10268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10269 done
10270 LIBS="$cf_add_libs"
10271
10272                 cat >conftest.$ac_ext <<_ACEOF
10273 #line 10273 "configure"
10274 #include "confdefs.h"
10275
10276 int
10277 main (void)
10278 {
10279
10280   ;
10281   return 0;
10282 }
10283 _ACEOF
10284 rm -f conftest.$ac_objext conftest$ac_exeext
10285 if { (eval echo "$as_me:10285: \"$ac_link\"") >&5
10286   (eval $ac_link) 2>&5
10287   ac_status=$?
10288   echo "$as_me:10288: \$? = $ac_status" >&5
10289   (exit $ac_status); } &&
10290          { ac_try='test -s conftest$ac_exeext'
10291   { (eval echo "$as_me:10291: \"$ac_try\"") >&5
10292   (eval $ac_try) 2>&5
10293   ac_status=$?
10294   echo "$as_me:10294: \$? = $ac_status" >&5
10295   (exit $ac_status); }; }; then
10296   cf_rpath_space=no
10297 else
10298   echo "$as_me: failed program was:" >&5
10299 cat conftest.$ac_ext >&5
10300 cf_rpath_space=yes
10301 fi
10302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10303                 LIBS="$cf_save_LIBS"
10304                 echo "$as_me:10304: result: $cf_rpath_space" >&5
10305 echo "${ECHO_T}$cf_rpath_space" >&6
10306                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
10307                 ;;
10308         esac
10309 fi
10310
10311         RM_SHARED_OPTS=
10312         LOCAL_LDFLAGS=
10313         LOCAL_LDFLAGS2=
10314         LD_SHARED_OPTS=
10315         INSTALL_LIB="-m 644"
10316         : ${rel_builddir:=.}
10317
10318         shlibdir=$libdir
10319
10320         MAKE_DLLS="#"
10321
10322         cf_cv_do_symlinks=no
10323         cf_ld_rpath_opt=
10324         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
10325
10326         echo "$as_me:10326: checking if release/abi version should be used for shared libs" >&5
10327 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
10328
10329 # Check whether --with-shlib-version or --without-shlib-version was given.
10330 if test "${with_shlib_version+set}" = set; then
10331   withval="$with_shlib_version"
10332   test -z "$withval" && withval=auto
10333         case $withval in
10334         (yes)
10335                 cf_cv_shlib_version=auto
10336                 ;;
10337         (rel|abi|auto)
10338                 cf_cv_shlib_version=$withval
10339                 ;;
10340         (*)
10341                 echo "$as_me:10341: result: $withval" >&5
10342 echo "${ECHO_T}$withval" >&6
10343                 { { echo "$as_me:10343: error: option value must be one of: rel, abi, or auto" >&5
10344 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
10345    { (exit 1); exit 1; }; }
10346                 ;;
10347         esac
10348
10349 else
10350   cf_cv_shlib_version=auto
10351 fi;
10352         echo "$as_me:10352: result: $cf_cv_shlib_version" >&5
10353 echo "${ECHO_T}$cf_cv_shlib_version" >&6
10354
10355         cf_cv_rm_so_locs=no
10356         cf_try_cflags=
10357
10358         # Some less-capable ports of gcc support only -fpic
10359         CC_SHARED_OPTS=
10360
10361         cf_try_fPIC=no
10362         if test "$GCC" = yes
10363         then
10364                 cf_try_fPIC=yes
10365         else
10366                 case $cf_cv_system_name in
10367                 (*linux*)       # e.g., PGI compiler
10368                         cf_try_fPIC=yes
10369                         ;;
10370                 esac
10371         fi
10372
10373         if test "$cf_try_fPIC" = yes
10374         then
10375                 echo "$as_me:10375: checking which $CC option to use" >&5
10376 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
10377                 cf_save_CFLAGS="$CFLAGS"
10378                 for CC_SHARED_OPTS in -fPIC -fpic ''
10379                 do
10380                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
10381                         cat >conftest.$ac_ext <<_ACEOF
10382 #line 10382 "configure"
10383 #include "confdefs.h"
10384 #include <stdio.h>
10385 int
10386 main (void)
10387 {
10388 int x = 1
10389   ;
10390   return 0;
10391 }
10392 _ACEOF
10393 rm -f conftest.$ac_objext
10394 if { (eval echo "$as_me:10394: \"$ac_compile\"") >&5
10395   (eval $ac_compile) 2>&5
10396   ac_status=$?
10397   echo "$as_me:10397: \$? = $ac_status" >&5
10398   (exit $ac_status); } &&
10399          { ac_try='test -s conftest.$ac_objext'
10400   { (eval echo "$as_me:10400: \"$ac_try\"") >&5
10401   (eval $ac_try) 2>&5
10402   ac_status=$?
10403   echo "$as_me:10403: \$? = $ac_status" >&5
10404   (exit $ac_status); }; }; then
10405   break
10406 else
10407   echo "$as_me: failed program was:" >&5
10408 cat conftest.$ac_ext >&5
10409 fi
10410 rm -f conftest.$ac_objext conftest.$ac_ext
10411                 done
10412                 echo "$as_me:10412: result: $CC_SHARED_OPTS" >&5
10413 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
10414                 CFLAGS="$cf_save_CFLAGS"
10415         fi
10416
10417         cf_cv_shlib_version_infix=no
10418
10419         case $cf_cv_system_name in
10420         (aix4.3-9*|aix[5-7]*)
10421                 if test "$GCC" = yes; then
10422                         CC_SHARED_OPTS='-Wl,-brtl'
10423                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10424                 else
10425                         CC_SHARED_OPTS='-brtl'
10426                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
10427                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10428                 fi
10429                 ;;
10430         (beos*)
10431                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
10432                 ;;
10433         (cygwin*)
10434                 CC_SHARED_OPTS=
10435                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10436                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10437                 cf_cv_shlib_version=cygdll
10438                 cf_cv_shlib_version_infix=cygdll
10439                 shlibdir=$bindir
10440                 MAKE_DLLS=
10441                 cat >mk_shared_lib.sh <<-CF_EOF
10442                 #!$SHELL
10443                 SHARED_LIB=\$1
10444                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10445                 shift
10446                 cat <<-EOF
10447                 Linking shared library
10448                 ** SHARED_LIB \$SHARED_LIB
10449                 ** IMPORT_LIB \$IMPORT_LIB
10450 EOF
10451                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10452 CF_EOF
10453                 chmod +x mk_shared_lib.sh
10454                 ;;
10455         (msys*)
10456                 CC_SHARED_OPTS=
10457                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10458                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10459                 cf_cv_shlib_version=msysdll
10460                 cf_cv_shlib_version_infix=msysdll
10461                 shlibdir=$bindir
10462                 MAKE_DLLS=
10463                 cat >mk_shared_lib.sh <<-CF_EOF
10464                 #!$SHELL
10465                 SHARED_LIB=\$1
10466                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10467                 shift
10468                 cat <<-EOF
10469                 Linking shared library
10470                 ** SHARED_LIB \$SHARED_LIB
10471                 ** IMPORT_LIB \$IMPORT_LIB
10472 EOF
10473                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10474 CF_EOF
10475                 chmod +x mk_shared_lib.sh
10476                 ;;
10477         (darwin*)
10478                 cf_try_cflags="no-cpp-precomp"
10479                 CC_SHARED_OPTS="-dynamic"
10480                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
10481                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
10482                 cf_cv_shlib_version_infix=yes
10483                 echo "$as_me:10483: checking if ld -search_paths_first works" >&5
10484 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
10485 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
10486   echo $ECHO_N "(cached) $ECHO_C" >&6
10487 else
10488
10489                         cf_save_LDFLAGS=$LDFLAGS
10490                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10491                         cat >conftest.$ac_ext <<_ACEOF
10492 #line 10492 "configure"
10493 #include "confdefs.h"
10494
10495 int
10496 main (void)
10497 {
10498 int i;
10499   ;
10500   return 0;
10501 }
10502 _ACEOF
10503 rm -f conftest.$ac_objext conftest$ac_exeext
10504 if { (eval echo "$as_me:10504: \"$ac_link\"") >&5
10505   (eval $ac_link) 2>&5
10506   ac_status=$?
10507   echo "$as_me:10507: \$? = $ac_status" >&5
10508   (exit $ac_status); } &&
10509          { ac_try='test -s conftest$ac_exeext'
10510   { (eval echo "$as_me:10510: \"$ac_try\"") >&5
10511   (eval $ac_try) 2>&5
10512   ac_status=$?
10513   echo "$as_me:10513: \$? = $ac_status" >&5
10514   (exit $ac_status); }; }; then
10515   cf_cv_ldflags_search_paths_first=yes
10516 else
10517   echo "$as_me: failed program was:" >&5
10518 cat conftest.$ac_ext >&5
10519 cf_cv_ldflags_search_paths_first=no
10520 fi
10521 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10522                                 LDFLAGS=$cf_save_LDFLAGS
10523 fi
10524 echo "$as_me:10524: result: $cf_cv_ldflags_search_paths_first" >&5
10525 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
10526                 if test $cf_cv_ldflags_search_paths_first = yes; then
10527                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10528                 fi
10529                 ;;
10530         (hpux[7-8]*)
10531                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
10532                 if test "$GCC" != yes; then
10533                         CC_SHARED_OPTS='+Z'
10534                 fi
10535                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
10536                 INSTALL_LIB="-m 555"
10537                 ;;
10538         (hpux*)
10539                 # (tested with gcc 2.7.2 -- I don't have c89)
10540                 if test "$GCC" = yes; then
10541                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
10542                 else
10543                         CC_SHARED_OPTS='+Z'
10544                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
10545                 fi
10546                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
10547                 # HP-UX shared libraries must be executable, and should be
10548                 # readonly to exploit a quirk in the memory manager.
10549                 INSTALL_LIB="-m 555"
10550                 ;;
10551         (interix*)
10552                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10553                 if test "$cf_cv_shlib_version" = rel; then
10554                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10555                 else
10556                         cf_shared_soname='`basename $@`'
10557                 fi
10558                 CC_SHARED_OPTS=
10559                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
10560                 ;;
10561         (irix*)
10562                 if test "$cf_cv_enable_rpath" = yes ; then
10563                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10564                 fi
10565                 # tested with IRIX 5.2 and 'cc'.
10566                 if test "$GCC" != yes; then
10567                         CC_SHARED_OPTS='-KPIC'
10568                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
10569                 else
10570                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
10571                 fi
10572                 cf_cv_rm_so_locs=yes
10573                 ;;
10574         (linux*|gnu*|k*bsd*-gnu)
10575                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10576                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10577                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10578                 fi
10579                 if test "$cf_cv_enable_rpath" = yes ; then
10580                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10581                 fi
10582
10583         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10584         if test "$cf_cv_shlib_version" = rel; then
10585                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10586         else
10587                 cf_cv_shared_soname='`basename $@`'
10588         fi
10589
10590                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10591                 ;;
10592         (mingw*)
10593                 cf_cv_shlib_version=mingw
10594                 cf_cv_shlib_version_infix=mingw
10595                 shlibdir=$bindir
10596                 MAKE_DLLS=
10597                 if test "$DFT_LWR_MODEL" = "shared" ; then
10598                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
10599                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10600                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
10601                 fi
10602                 CC_SHARED_OPTS=
10603                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10604                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10605                 cat >mk_shared_lib.sh <<-CF_EOF
10606                 #!$SHELL
10607                 SHARED_LIB=\$1
10608                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
10609                 shift
10610                 cat <<-EOF
10611                 Linking shared library
10612                 ** SHARED_LIB \$SHARED_LIB
10613                 ** IMPORT_LIB \$IMPORT_LIB
10614 EOF
10615                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10616 CF_EOF
10617                 chmod +x mk_shared_lib.sh
10618                 ;;
10619         (openbsd[2-9].*|mirbsd*)
10620                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10621                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10622                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10623                 fi
10624                 if test "$cf_cv_enable_rpath" = yes ; then
10625                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10626                 fi
10627                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10628
10629         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10630         if test "$cf_cv_shlib_version" = rel; then
10631                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10632         else
10633                 cf_cv_shared_soname='`basename $@`'
10634         fi
10635
10636                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10637                 ;;
10638         (nto-qnx*|openbsd*|freebsd[12].*)
10639                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10640                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
10641                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10642                 ;;
10643         (dragonfly*|freebsd*)
10644                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10645                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10646                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10647                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
10648                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10649                 fi
10650
10651         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10652         if test "$cf_cv_shlib_version" = rel; then
10653                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10654         else
10655                 cf_cv_shared_soname='`basename $@`'
10656         fi
10657
10658                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10659                 ;;
10660         (netbsd*)
10661                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10662                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10663                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10664                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10665                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10666                         if test "$cf_cv_shlib_version" = auto; then
10667                         if test -f /usr/libexec/ld.elf_so; then
10668                                 cf_cv_shlib_version=abi
10669                         else
10670                                 cf_cv_shlib_version=rel
10671                         fi
10672                         fi
10673
10674         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10675         if test "$cf_cv_shlib_version" = rel; then
10676                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10677         else
10678                 cf_cv_shared_soname='`basename $@`'
10679         fi
10680
10681                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
10682                 else
10683                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
10684                 fi
10685                 ;;
10686         (osf*|mls+*)
10687                 # tested with OSF/1 V3.2 and 'cc'
10688                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
10689                 # link with shared libs).
10690                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
10691                 case $host_os in
10692                 (osf4*)
10693                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
10694                         ;;
10695                 esac
10696                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
10697                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10698                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10699                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10700                 fi
10701                 cf_cv_rm_so_locs=yes
10702                 ;;
10703         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
10704                 # tested with osr5.0.5
10705                 if test "$GCC" != yes; then
10706                         CC_SHARED_OPTS='-belf -KPIC'
10707                 fi
10708                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
10709                 if test "$cf_cv_enable_rpath" = yes ; then
10710                         # only way is to set LD_RUN_PATH but no switch for it
10711                         RUN_PATH=$libdir
10712                 fi
10713                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10714                 LINK_PROGS='LD_RUN_PATH=${libdir}'
10715                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
10716                 ;;
10717         (sunos4*)
10718                 # tested with SunOS 4.1.1 and gcc 2.7.0
10719                 if test "$GCC" != yes; then
10720                         CC_SHARED_OPTS='-KPIC'
10721                 fi
10722                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
10723                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10724                 ;;
10725         (solaris2*)
10726                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
10727                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
10728                 if test "$DFT_LWR_MODEL" = "shared" ; then
10729                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
10730                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10731                 fi
10732                 if test "$cf_cv_enable_rpath" = yes ; then
10733                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
10734                 fi
10735
10736         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10737         if test "$cf_cv_shlib_version" = rel; then
10738                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10739         else
10740                 cf_cv_shared_soname='`basename $@`'
10741         fi
10742
10743                 if test "$GCC" != yes; then
10744                         cf_save_CFLAGS="$CFLAGS"
10745                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
10746                         do
10747                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
10748                                 cat >conftest.$ac_ext <<_ACEOF
10749 #line 10749 "configure"
10750 #include "confdefs.h"
10751 #include <stdio.h>
10752 int
10753 main (void)
10754 {
10755 printf("Hello\n");
10756   ;
10757   return 0;
10758 }
10759 _ACEOF
10760 rm -f conftest.$ac_objext
10761 if { (eval echo "$as_me:10761: \"$ac_compile\"") >&5
10762   (eval $ac_compile) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit $ac_status); } &&
10766          { ac_try='test -s conftest.$ac_objext'
10767   { (eval echo "$as_me:10767: \"$ac_try\"") >&5
10768   (eval $ac_try) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit $ac_status); }; }; then
10772   break
10773 else
10774   echo "$as_me: failed program was:" >&5
10775 cat conftest.$ac_ext >&5
10776 fi
10777 rm -f conftest.$ac_objext conftest.$ac_ext
10778                         done
10779                         CFLAGS="$cf_save_CFLAGS"
10780                         CC_SHARED_OPTS=$cf_shared_opts
10781                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10782                 else
10783                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10784                 fi
10785                 ;;
10786         (sysv5uw7*|unix_sv*)
10787                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10788                 if test "$GCC" != yes; then
10789                         CC_SHARED_OPTS='-KPIC'
10790                 fi
10791                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10792                 ;;
10793         (*)
10794                 CC_SHARED_OPTS='unknown'
10795                 MK_SHARED_LIB='echo unknown'
10796                 ;;
10797         esac
10798
10799         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10800         case "$cf_cv_shlib_version" in
10801         (rel|abi)
10802                 case "$MK_SHARED_LIB" in
10803                 (*'-o $@')
10804                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10805                         ;;
10806                 (*)
10807                         { echo "$as_me:10807: WARNING: ignored --with-shlib-version" >&5
10808 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10809                         ;;
10810                 esac
10811                 ;;
10812         esac
10813
10814         if test -n "$cf_try_cflags"
10815         then
10816 cat > conftest.$ac_ext <<EOF
10817 #line 10817 "${as_me:-configure}"
10818 #include <stdio.h>
10819 int main(int argc, char *argv[])
10820 {
10821         printf("hello\n");
10822         return (argv[argc-1] == 0) ;
10823 }
10824 EOF
10825                 cf_save_CFLAGS="$CFLAGS"
10826                 for cf_opt in $cf_try_cflags
10827                 do
10828                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10829                         echo "$as_me:10829: checking if CFLAGS option -$cf_opt works" >&5
10830 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10831                         if { (eval echo "$as_me:10831: \"$ac_compile\"") >&5
10832   (eval $ac_compile) 2>&5
10833   ac_status=$?
10834   echo "$as_me:10834: \$? = $ac_status" >&5
10835   (exit $ac_status); }; then
10836                                 echo "$as_me:10836: result: yes" >&5
10837 echo "${ECHO_T}yes" >&6
10838                                 cf_save_CFLAGS="$CFLAGS"
10839                         else
10840                                 echo "$as_me:10840: result: no" >&5
10841 echo "${ECHO_T}no" >&6
10842                         fi
10843                 done
10844                 CFLAGS="$cf_save_CFLAGS"
10845         fi
10846
10847         # RPATH_LIST is a colon-separated list of directories
10848         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10849         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10850
10851         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10852
10853         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10854
10855 echo "${as_me:-configure}:10855: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10856
10857         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10858
10859 echo "${as_me:-configure}:10859: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10860
10861 # The test/sample programs in the original tree link using rpath option.
10862 # Make it optional for packagers.
10863 if test -n "$LOCAL_LDFLAGS"
10864 then
10865         echo "$as_me:10865: checking if you want to link sample programs with rpath option" >&5
10866 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10867
10868 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10869 if test "${enable_rpath_link+set}" = set; then
10870   enableval="$enable_rpath_link"
10871   with_rpath_link=$enableval
10872 else
10873   with_rpath_link=yes
10874 fi;
10875         echo "$as_me:10875: result: $with_rpath_link" >&5
10876 echo "${ECHO_T}$with_rpath_link" >&6
10877         if test "$with_rpath_link" = no
10878         then
10879                 LOCAL_LDFLAGS=
10880                 LOCAL_LDFLAGS2=
10881         fi
10882 fi
10883
10884 ###############################################################################
10885
10886 ###   use option --enable-broken-linker to force on use of broken-linker support
10887 echo "$as_me:10887: checking if you want broken-linker support code" >&5
10888 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10889
10890 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10891 if test "${enable_broken_linker+set}" = set; then
10892   enableval="$enable_broken_linker"
10893   with_broken_linker=$enableval
10894 else
10895   with_broken_linker=${BROKEN_LINKER:-no}
10896 fi;
10897 echo "$as_me:10897: result: $with_broken_linker" >&5
10898 echo "${ECHO_T}$with_broken_linker" >&6
10899
10900 BROKEN_LINKER=0
10901 if test "$with_broken_linker" = yes ; then
10902         cat >>confdefs.h <<\EOF
10903 #define BROKEN_LINKER 1
10904 EOF
10905
10906         BROKEN_LINKER=1
10907 elif test "$DFT_LWR_MODEL" = shared ; then
10908         case $cf_cv_system_name in
10909         (cygwin*)
10910                 cat >>confdefs.h <<\EOF
10911 #define BROKEN_LINKER 1
10912 EOF
10913
10914                 BROKEN_LINKER=1
10915                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
10916
10917 echo "${as_me:-configure}:10917: testing cygwin linker is broken anyway ..." 1>&5
10918
10919                 ;;
10920         esac
10921 fi
10922
10923 # Check to define _XOPEN_SOURCE "automatically"
10924
10925 cf_XOPEN_SOURCE=600
10926 cf_POSIX_C_SOURCE=199506L
10927 cf_xopen_source=
10928
10929 case $host_os in
10930 (aix[4-7]*)
10931         cf_xopen_source="-D_ALL_SOURCE"
10932         ;;
10933 (msys)
10934         cf_XOPEN_SOURCE=600
10935         ;;
10936 (darwin[0-8].*)
10937         cf_xopen_source="-D_APPLE_C_SOURCE"
10938         ;;
10939 (darwin*)
10940         cf_xopen_source="-D_DARWIN_C_SOURCE"
10941         cf_XOPEN_SOURCE=
10942         ;;
10943 (freebsd*|dragonfly*)
10944         # 5.x headers associate
10945         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10946         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10947         cf_POSIX_C_SOURCE=200112L
10948         cf_XOPEN_SOURCE=600
10949         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10950         ;;
10951 (hpux11*)
10952         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10953         ;;
10954 (hpux*)
10955         cf_xopen_source="-D_HPUX_SOURCE"
10956         ;;
10957 (irix[56].*)
10958         cf_xopen_source="-D_SGI_SOURCE"
10959         cf_XOPEN_SOURCE=
10960         ;;
10961 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10962
10963 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
10964
10965 echo "$as_me:10965: checking if this is the GNU C library" >&5
10966 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
10967 if test "${cf_cv_gnu_library+set}" = set; then
10968   echo $ECHO_N "(cached) $ECHO_C" >&6
10969 else
10970
10971 cat >conftest.$ac_ext <<_ACEOF
10972 #line 10972 "configure"
10973 #include "confdefs.h"
10974 #include <sys/types.h>
10975 int
10976 main (void)
10977 {
10978
10979         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
10980                 return 0;
10981         #else
10982         #       error not GNU C library
10983         #endif
10984   ;
10985   return 0;
10986 }
10987 _ACEOF
10988 rm -f conftest.$ac_objext
10989 if { (eval echo "$as_me:10989: \"$ac_compile\"") >&5
10990   (eval $ac_compile) 2>&5
10991   ac_status=$?
10992   echo "$as_me:10992: \$? = $ac_status" >&5
10993   (exit $ac_status); } &&
10994          { ac_try='test -s conftest.$ac_objext'
10995   { (eval echo "$as_me:10995: \"$ac_try\"") >&5
10996   (eval $ac_try) 2>&5
10997   ac_status=$?
10998   echo "$as_me:10998: \$? = $ac_status" >&5
10999   (exit $ac_status); }; }; then
11000   cf_cv_gnu_library=yes
11001 else
11002   echo "$as_me: failed program was:" >&5
11003 cat conftest.$ac_ext >&5
11004 cf_cv_gnu_library=no
11005 fi
11006 rm -f conftest.$ac_objext conftest.$ac_ext
11007
11008 fi
11009 echo "$as_me:11009: result: $cf_cv_gnu_library" >&5
11010 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11011
11012 if test x$cf_cv_gnu_library = xyes; then
11013
11014         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11015         # was changed to help a little...
11016         echo "$as_me:11016: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11017 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11018 if test "${cf_cv_gnu_library_219+set}" = set; then
11019   echo $ECHO_N "(cached) $ECHO_C" >&6
11020 else
11021
11022                 cf_save="$CPPFLAGS"
11023
11024         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11025         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11026
11027                 cat >conftest.$ac_ext <<_ACEOF
11028 #line 11028 "configure"
11029 #include "confdefs.h"
11030 #include <sys/types.h>
11031 int
11032 main (void)
11033 {
11034
11035                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11036                                 return 0;
11037                         #else
11038                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11039                         #endif
11040   ;
11041   return 0;
11042 }
11043 _ACEOF
11044 rm -f conftest.$ac_objext
11045 if { (eval echo "$as_me:11045: \"$ac_compile\"") >&5
11046   (eval $ac_compile) 2>&5
11047   ac_status=$?
11048   echo "$as_me:11048: \$? = $ac_status" >&5
11049   (exit $ac_status); } &&
11050          { ac_try='test -s conftest.$ac_objext'
11051   { (eval echo "$as_me:11051: \"$ac_try\"") >&5
11052   (eval $ac_try) 2>&5
11053   ac_status=$?
11054   echo "$as_me:11054: \$? = $ac_status" >&5
11055   (exit $ac_status); }; }; then
11056   cf_cv_gnu_library_219=yes
11057 else
11058   echo "$as_me: failed program was:" >&5
11059 cat conftest.$ac_ext >&5
11060 cf_cv_gnu_library_219=no
11061 fi
11062 rm -f conftest.$ac_objext conftest.$ac_ext
11063                 CPPFLAGS="$cf_save"
11064
11065 fi
11066 echo "$as_me:11066: result: $cf_cv_gnu_library_219" >&5
11067 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11068
11069         if test "x$cf_cv_gnu_library_219" = xyes; then
11070                 cf_save="$CPPFLAGS"
11071                 echo "$as_me:11071: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11072 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11073 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11074   echo $ECHO_N "(cached) $ECHO_C" >&6
11075 else
11076
11077 cf_fix_cppflags=no
11078 cf_new_cflags=
11079 cf_new_cppflags=
11080 cf_new_extra_cppflags=
11081
11082 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11083 do
11084 case $cf_fix_cppflags in
11085 (no)
11086         case $cf_add_cflags in
11087         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11088                 case $cf_add_cflags in
11089                 (-D*)
11090                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11091
11092                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11093                                 && test -z "${cf_tst_cflags}" \
11094                                 && cf_fix_cppflags=yes
11095
11096                         if test $cf_fix_cppflags = yes ; then
11097
11098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11100
11101                                 continue
11102                         elif test "${cf_tst_cflags}" = "\"'" ; then
11103
11104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11106
11107                                 continue
11108                         fi
11109                         ;;
11110                 esac
11111                 case "$CPPFLAGS" in
11112                 (*$cf_add_cflags)
11113                         ;;
11114                 (*)
11115                         case $cf_add_cflags in
11116                         (-D*)
11117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11118
11119 CPPFLAGS=`echo "$CPPFLAGS" | \
11120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11122
11123                                 ;;
11124                         esac
11125
11126         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11127         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11128
11129                         ;;
11130                 esac
11131                 ;;
11132         (*)
11133
11134         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11135         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11136
11137                 ;;
11138         esac
11139         ;;
11140 (yes)
11141
11142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11144
11145         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11146
11147         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11148                 && test -z "${cf_tst_cflags}" \
11149                 && cf_fix_cppflags=no
11150         ;;
11151 esac
11152 done
11153
11154 if test -n "$cf_new_cflags" ; then
11155
11156         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11157         CFLAGS="${CFLAGS}$cf_new_cflags"
11158
11159 fi
11160
11161 if test -n "$cf_new_cppflags" ; then
11162
11163         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11164         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11165
11166 fi
11167
11168 if test -n "$cf_new_extra_cppflags" ; then
11169
11170         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11171         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11172
11173 fi
11174
11175                         cat >conftest.$ac_ext <<_ACEOF
11176 #line 11176 "configure"
11177 #include "confdefs.h"
11178
11179                                 #include <limits.h>
11180                                 #include <sys/types.h>
11181
11182 int
11183 main (void)
11184 {
11185
11186                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11187                                         return 0;
11188                                 #else
11189                                 #       error GNU C library is too old
11190                                 #endif
11191   ;
11192   return 0;
11193 }
11194 _ACEOF
11195 rm -f conftest.$ac_objext
11196 if { (eval echo "$as_me:11196: \"$ac_compile\"") >&5
11197   (eval $ac_compile) 2>&5
11198   ac_status=$?
11199   echo "$as_me:11199: \$? = $ac_status" >&5
11200   (exit $ac_status); } &&
11201          { ac_try='test -s conftest.$ac_objext'
11202   { (eval echo "$as_me:11202: \"$ac_try\"") >&5
11203   (eval $ac_try) 2>&5
11204   ac_status=$?
11205   echo "$as_me:11205: \$? = $ac_status" >&5
11206   (exit $ac_status); }; }; then
11207   cf_cv_gnu_dftsrc_219=yes
11208 else
11209   echo "$as_me: failed program was:" >&5
11210 cat conftest.$ac_ext >&5
11211 cf_cv_gnu_dftsrc_219=no
11212 fi
11213 rm -f conftest.$ac_objext conftest.$ac_ext
11214
11215 fi
11216 echo "$as_me:11216: result: $cf_cv_gnu_dftsrc_219" >&5
11217 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11218                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11219         else
11220                 cf_cv_gnu_dftsrc_219=maybe
11221         fi
11222
11223         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11224
11225                 echo "$as_me:11225: checking if we must define _GNU_SOURCE" >&5
11226 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11227 if test "${cf_cv_gnu_source+set}" = set; then
11228   echo $ECHO_N "(cached) $ECHO_C" >&6
11229 else
11230
11231                 cat >conftest.$ac_ext <<_ACEOF
11232 #line 11232 "configure"
11233 #include "confdefs.h"
11234 #include <sys/types.h>
11235 int
11236 main (void)
11237 {
11238
11239                         #ifndef _XOPEN_SOURCE
11240                         #error  expected _XOPEN_SOURCE to be defined
11241                         #endif
11242   ;
11243   return 0;
11244 }
11245 _ACEOF
11246 rm -f conftest.$ac_objext
11247 if { (eval echo "$as_me:11247: \"$ac_compile\"") >&5
11248   (eval $ac_compile) 2>&5
11249   ac_status=$?
11250   echo "$as_me:11250: \$? = $ac_status" >&5
11251   (exit $ac_status); } &&
11252          { ac_try='test -s conftest.$ac_objext'
11253   { (eval echo "$as_me:11253: \"$ac_try\"") >&5
11254   (eval $ac_try) 2>&5
11255   ac_status=$?
11256   echo "$as_me:11256: \$? = $ac_status" >&5
11257   (exit $ac_status); }; }; then
11258   cf_cv_gnu_source=no
11259 else
11260   echo "$as_me: failed program was:" >&5
11261 cat conftest.$ac_ext >&5
11262 cf_save="$CPPFLAGS"
11263
11264 cf_fix_cppflags=no
11265 cf_new_cflags=
11266 cf_new_cppflags=
11267 cf_new_extra_cppflags=
11268
11269 for cf_add_cflags in -D_GNU_SOURCE
11270 do
11271 case $cf_fix_cppflags in
11272 (no)
11273         case $cf_add_cflags in
11274         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11275                 case $cf_add_cflags in
11276                 (-D*)
11277                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11278
11279                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11280                                 && test -z "${cf_tst_cflags}" \
11281                                 && cf_fix_cppflags=yes
11282
11283                         if test $cf_fix_cppflags = yes ; then
11284
11285         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11286         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11287
11288                                 continue
11289                         elif test "${cf_tst_cflags}" = "\"'" ; then
11290
11291         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11292         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11293
11294                                 continue
11295                         fi
11296                         ;;
11297                 esac
11298                 case "$CPPFLAGS" in
11299                 (*$cf_add_cflags)
11300                         ;;
11301                 (*)
11302                         case $cf_add_cflags in
11303                         (-D*)
11304                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11305
11306 CPPFLAGS=`echo "$CPPFLAGS" | \
11307         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11308                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11309
11310                                 ;;
11311                         esac
11312
11313         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11314         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11315
11316                         ;;
11317                 esac
11318                 ;;
11319         (*)
11320
11321         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11322         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11323
11324                 ;;
11325         esac
11326         ;;
11327 (yes)
11328
11329         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11330         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11331
11332         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11333
11334         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11335                 && test -z "${cf_tst_cflags}" \
11336                 && cf_fix_cppflags=no
11337         ;;
11338 esac
11339 done
11340
11341 if test -n "$cf_new_cflags" ; then
11342
11343         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11344         CFLAGS="${CFLAGS}$cf_new_cflags"
11345
11346 fi
11347
11348 if test -n "$cf_new_cppflags" ; then
11349
11350         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11351         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11352
11353 fi
11354
11355 if test -n "$cf_new_extra_cppflags" ; then
11356
11357         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11358         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11359
11360 fi
11361
11362                          cat >conftest.$ac_ext <<_ACEOF
11363 #line 11363 "configure"
11364 #include "confdefs.h"
11365 #include <sys/types.h>
11366 int
11367 main (void)
11368 {
11369
11370                                 #ifdef _XOPEN_SOURCE
11371                                 #error  expected _XOPEN_SOURCE to be undefined
11372                                 #endif
11373   ;
11374   return 0;
11375 }
11376 _ACEOF
11377 rm -f conftest.$ac_objext
11378 if { (eval echo "$as_me:11378: \"$ac_compile\"") >&5
11379   (eval $ac_compile) 2>&5
11380   ac_status=$?
11381   echo "$as_me:11381: \$? = $ac_status" >&5
11382   (exit $ac_status); } &&
11383          { ac_try='test -s conftest.$ac_objext'
11384   { (eval echo "$as_me:11384: \"$ac_try\"") >&5
11385   (eval $ac_try) 2>&5
11386   ac_status=$?
11387   echo "$as_me:11387: \$? = $ac_status" >&5
11388   (exit $ac_status); }; }; then
11389   cf_cv_gnu_source=no
11390 else
11391   echo "$as_me: failed program was:" >&5
11392 cat conftest.$ac_ext >&5
11393 cf_cv_gnu_source=yes
11394 fi
11395 rm -f conftest.$ac_objext conftest.$ac_ext
11396                         CPPFLAGS="$cf_save"
11397
11398 fi
11399 rm -f conftest.$ac_objext conftest.$ac_ext
11400
11401 fi
11402 echo "$as_me:11402: result: $cf_cv_gnu_source" >&5
11403 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11404
11405                 if test "$cf_cv_gnu_source" = yes
11406                 then
11407                 echo "$as_me:11407: checking if we should also define _DEFAULT_SOURCE" >&5
11408 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11409 if test "${cf_cv_default_source+set}" = set; then
11410   echo $ECHO_N "(cached) $ECHO_C" >&6
11411 else
11412
11413         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11414         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11415
11416                         cat >conftest.$ac_ext <<_ACEOF
11417 #line 11417 "configure"
11418 #include "confdefs.h"
11419 #include <sys/types.h>
11420 int
11421 main (void)
11422 {
11423
11424                                 #ifdef _DEFAULT_SOURCE
11425                                 #error  expected _DEFAULT_SOURCE to be undefined
11426                                 #endif
11427   ;
11428   return 0;
11429 }
11430 _ACEOF
11431 rm -f conftest.$ac_objext
11432 if { (eval echo "$as_me:11432: \"$ac_compile\"") >&5
11433   (eval $ac_compile) 2>&5
11434   ac_status=$?
11435   echo "$as_me:11435: \$? = $ac_status" >&5
11436   (exit $ac_status); } &&
11437          { ac_try='test -s conftest.$ac_objext'
11438   { (eval echo "$as_me:11438: \"$ac_try\"") >&5
11439   (eval $ac_try) 2>&5
11440   ac_status=$?
11441   echo "$as_me:11441: \$? = $ac_status" >&5
11442   (exit $ac_status); }; }; then
11443   cf_cv_default_source=no
11444 else
11445   echo "$as_me: failed program was:" >&5
11446 cat conftest.$ac_ext >&5
11447 cf_cv_default_source=yes
11448 fi
11449 rm -f conftest.$ac_objext conftest.$ac_ext
11450
11451 fi
11452 echo "$as_me:11452: result: $cf_cv_default_source" >&5
11453 echo "${ECHO_T}$cf_cv_default_source" >&6
11454                         if test "$cf_cv_default_source" = yes
11455                         then
11456
11457         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11458         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11459
11460                         fi
11461                 fi
11462         fi
11463
11464 fi
11465
11466         ;;
11467 (minix*)
11468         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11469         ;;
11470 (mirbsd*)
11471         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11472         cf_XOPEN_SOURCE=
11473
11474 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11475
11476 cf_save_CFLAGS="$CFLAGS"
11477 cf_save_CPPFLAGS="$CPPFLAGS"
11478
11479 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11480         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11481                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11482
11483 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11484         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11485                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11486
11487 echo "$as_me:11487: checking if we should define _POSIX_C_SOURCE" >&5
11488 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11489 if test "${cf_cv_posix_c_source+set}" = set; then
11490   echo $ECHO_N "(cached) $ECHO_C" >&6
11491 else
11492
11493 echo "${as_me:-configure}:11493: testing if the symbol is already defined go no further ..." 1>&5
11494
11495         cat >conftest.$ac_ext <<_ACEOF
11496 #line 11496 "configure"
11497 #include "confdefs.h"
11498 #include <sys/types.h>
11499 int
11500 main (void)
11501 {
11502
11503 #ifndef _POSIX_C_SOURCE
11504 make an error
11505 #endif
11506   ;
11507   return 0;
11508 }
11509 _ACEOF
11510 rm -f conftest.$ac_objext
11511 if { (eval echo "$as_me:11511: \"$ac_compile\"") >&5
11512   (eval $ac_compile) 2>&5
11513   ac_status=$?
11514   echo "$as_me:11514: \$? = $ac_status" >&5
11515   (exit $ac_status); } &&
11516          { ac_try='test -s conftest.$ac_objext'
11517   { (eval echo "$as_me:11517: \"$ac_try\"") >&5
11518   (eval $ac_try) 2>&5
11519   ac_status=$?
11520   echo "$as_me:11520: \$? = $ac_status" >&5
11521   (exit $ac_status); }; }; then
11522   cf_cv_posix_c_source=no
11523 else
11524   echo "$as_me: failed program was:" >&5
11525 cat conftest.$ac_ext >&5
11526 cf_want_posix_source=no
11527          case .$cf_POSIX_C_SOURCE in
11528          (.[12]??*)
11529                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11530                 ;;
11531          (.2)
11532                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11533                 cf_want_posix_source=yes
11534                 ;;
11535          (.*)
11536                 cf_want_posix_source=yes
11537                 ;;
11538          esac
11539          if test "$cf_want_posix_source" = yes ; then
11540                 cat >conftest.$ac_ext <<_ACEOF
11541 #line 11541 "configure"
11542 #include "confdefs.h"
11543 #include <sys/types.h>
11544 int
11545 main (void)
11546 {
11547
11548 #ifdef _POSIX_SOURCE
11549 make an error
11550 #endif
11551   ;
11552   return 0;
11553 }
11554 _ACEOF
11555 rm -f conftest.$ac_objext
11556 if { (eval echo "$as_me:11556: \"$ac_compile\"") >&5
11557   (eval $ac_compile) 2>&5
11558   ac_status=$?
11559   echo "$as_me:11559: \$? = $ac_status" >&5
11560   (exit $ac_status); } &&
11561          { ac_try='test -s conftest.$ac_objext'
11562   { (eval echo "$as_me:11562: \"$ac_try\"") >&5
11563   (eval $ac_try) 2>&5
11564   ac_status=$?
11565   echo "$as_me:11565: \$? = $ac_status" >&5
11566   (exit $ac_status); }; }; then
11567   :
11568 else
11569   echo "$as_me: failed program was:" >&5
11570 cat conftest.$ac_ext >&5
11571 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11572 fi
11573 rm -f conftest.$ac_objext conftest.$ac_ext
11574          fi
11575
11576 echo "${as_me:-configure}:11576: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11577
11578          CFLAGS="$cf_trim_CFLAGS"
11579          CPPFLAGS="$cf_trim_CPPFLAGS"
11580
11581         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11582         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11583
11584 echo "${as_me:-configure}:11584: testing if the second compile does not leave our definition intact error ..." 1>&5
11585
11586          cat >conftest.$ac_ext <<_ACEOF
11587 #line 11587 "configure"
11588 #include "confdefs.h"
11589 #include <sys/types.h>
11590 int
11591 main (void)
11592 {
11593
11594 #ifndef _POSIX_C_SOURCE
11595 make an error
11596 #endif
11597   ;
11598   return 0;
11599 }
11600 _ACEOF
11601 rm -f conftest.$ac_objext
11602 if { (eval echo "$as_me:11602: \"$ac_compile\"") >&5
11603   (eval $ac_compile) 2>&5
11604   ac_status=$?
11605   echo "$as_me:11605: \$? = $ac_status" >&5
11606   (exit $ac_status); } &&
11607          { ac_try='test -s conftest.$ac_objext'
11608   { (eval echo "$as_me:11608: \"$ac_try\"") >&5
11609   (eval $ac_try) 2>&5
11610   ac_status=$?
11611   echo "$as_me:11611: \$? = $ac_status" >&5
11612   (exit $ac_status); }; }; then
11613   :
11614 else
11615   echo "$as_me: failed program was:" >&5
11616 cat conftest.$ac_ext >&5
11617 cf_cv_posix_c_source=no
11618 fi
11619 rm -f conftest.$ac_objext conftest.$ac_ext
11620          CFLAGS="$cf_save_CFLAGS"
11621          CPPFLAGS="$cf_save_CPPFLAGS"
11622
11623 fi
11624 rm -f conftest.$ac_objext conftest.$ac_ext
11625
11626 fi
11627 echo "$as_me:11627: result: $cf_cv_posix_c_source" >&5
11628 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11629
11630 if test "$cf_cv_posix_c_source" != no ; then
11631         CFLAGS="$cf_trim_CFLAGS"
11632         CPPFLAGS="$cf_trim_CPPFLAGS"
11633
11634 cf_fix_cppflags=no
11635 cf_new_cflags=
11636 cf_new_cppflags=
11637 cf_new_extra_cppflags=
11638
11639 for cf_add_cflags in $cf_cv_posix_c_source
11640 do
11641 case $cf_fix_cppflags in
11642 (no)
11643         case $cf_add_cflags in
11644         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11645                 case $cf_add_cflags in
11646                 (-D*)
11647                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11648
11649                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11650                                 && test -z "${cf_tst_cflags}" \
11651                                 && cf_fix_cppflags=yes
11652
11653                         if test $cf_fix_cppflags = yes ; then
11654
11655         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11656         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11657
11658                                 continue
11659                         elif test "${cf_tst_cflags}" = "\"'" ; then
11660
11661         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11662         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11663
11664                                 continue
11665                         fi
11666                         ;;
11667                 esac
11668                 case "$CPPFLAGS" in
11669                 (*$cf_add_cflags)
11670                         ;;
11671                 (*)
11672                         case $cf_add_cflags in
11673                         (-D*)
11674                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11675
11676 CPPFLAGS=`echo "$CPPFLAGS" | \
11677         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11678                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11679
11680                                 ;;
11681                         esac
11682
11683         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11684         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11685
11686                         ;;
11687                 esac
11688                 ;;
11689         (*)
11690
11691         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11692         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11693
11694                 ;;
11695         esac
11696         ;;
11697 (yes)
11698
11699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11701
11702         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11703
11704         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11705                 && test -z "${cf_tst_cflags}" \
11706                 && cf_fix_cppflags=no
11707         ;;
11708 esac
11709 done
11710
11711 if test -n "$cf_new_cflags" ; then
11712
11713         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11714         CFLAGS="${CFLAGS}$cf_new_cflags"
11715
11716 fi
11717
11718 if test -n "$cf_new_cppflags" ; then
11719
11720         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11721         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11722
11723 fi
11724
11725 if test -n "$cf_new_extra_cppflags" ; then
11726
11727         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11728         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11729
11730 fi
11731
11732 fi
11733
11734         ;;
11735 (netbsd*)
11736         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11737         ;;
11738 (openbsd[4-9]*)
11739         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11740         cf_xopen_source="-D_BSD_SOURCE"
11741         cf_XOPEN_SOURCE=600
11742         ;;
11743 (openbsd*)
11744         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11745         ;;
11746 (osf[45]*)
11747         cf_xopen_source="-D_OSF_SOURCE"
11748         ;;
11749 (nto-qnx*)
11750         cf_xopen_source="-D_QNX_SOURCE"
11751         ;;
11752 (sco*)
11753         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11754         ;;
11755 (solaris2.*)
11756         cf_xopen_source="-D__EXTENSIONS__"
11757         cf_cv_xopen_source=broken
11758         ;;
11759 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11760         cf_XOPEN_SOURCE=
11761         cf_POSIX_C_SOURCE=
11762         ;;
11763 (*)
11764
11765 echo "$as_me:11765: checking if we should define _XOPEN_SOURCE" >&5
11766 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11767 if test "${cf_cv_xopen_source+set}" = set; then
11768   echo $ECHO_N "(cached) $ECHO_C" >&6
11769 else
11770
11771         cat >conftest.$ac_ext <<_ACEOF
11772 #line 11772 "configure"
11773 #include "confdefs.h"
11774
11775 #include <stdlib.h>
11776 #include <string.h>
11777 #include <sys/types.h>
11778
11779 int
11780 main (void)
11781 {
11782
11783 #ifndef _XOPEN_SOURCE
11784 make an error
11785 #endif
11786   ;
11787   return 0;
11788 }
11789 _ACEOF
11790 rm -f conftest.$ac_objext
11791 if { (eval echo "$as_me:11791: \"$ac_compile\"") >&5
11792   (eval $ac_compile) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit $ac_status); } &&
11796          { ac_try='test -s conftest.$ac_objext'
11797   { (eval echo "$as_me:11797: \"$ac_try\"") >&5
11798   (eval $ac_try) 2>&5
11799   ac_status=$?
11800   echo "$as_me:11800: \$? = $ac_status" >&5
11801   (exit $ac_status); }; }; then
11802   cf_cv_xopen_source=no
11803 else
11804   echo "$as_me: failed program was:" >&5
11805 cat conftest.$ac_ext >&5
11806 cf_save="$CPPFLAGS"
11807
11808         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11809         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11810
11811          cat >conftest.$ac_ext <<_ACEOF
11812 #line 11812 "configure"
11813 #include "confdefs.h"
11814
11815 #include <stdlib.h>
11816 #include <string.h>
11817 #include <sys/types.h>
11818
11819 int
11820 main (void)
11821 {
11822
11823 #ifdef _XOPEN_SOURCE
11824 make an error
11825 #endif
11826   ;
11827   return 0;
11828 }
11829 _ACEOF
11830 rm -f conftest.$ac_objext
11831 if { (eval echo "$as_me:11831: \"$ac_compile\"") >&5
11832   (eval $ac_compile) 2>&5
11833   ac_status=$?
11834   echo "$as_me:11834: \$? = $ac_status" >&5
11835   (exit $ac_status); } &&
11836          { ac_try='test -s conftest.$ac_objext'
11837   { (eval echo "$as_me:11837: \"$ac_try\"") >&5
11838   (eval $ac_try) 2>&5
11839   ac_status=$?
11840   echo "$as_me:11840: \$? = $ac_status" >&5
11841   (exit $ac_status); }; }; then
11842   cf_cv_xopen_source=no
11843 else
11844   echo "$as_me: failed program was:" >&5
11845 cat conftest.$ac_ext >&5
11846 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11847 fi
11848 rm -f conftest.$ac_objext conftest.$ac_ext
11849         CPPFLAGS="$cf_save"
11850
11851 fi
11852 rm -f conftest.$ac_objext conftest.$ac_ext
11853
11854 fi
11855 echo "$as_me:11855: result: $cf_cv_xopen_source" >&5
11856 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11857
11858 if test "$cf_cv_xopen_source" != no ; then
11859
11860 CFLAGS=`echo "$CFLAGS" | \
11861         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11862                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11863
11864 CPPFLAGS=`echo "$CPPFLAGS" | \
11865         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11866                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11867
11868         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11869
11870 cf_fix_cppflags=no
11871 cf_new_cflags=
11872 cf_new_cppflags=
11873 cf_new_extra_cppflags=
11874
11875 for cf_add_cflags in $cf_temp_xopen_source
11876 do
11877 case $cf_fix_cppflags in
11878 (no)
11879         case $cf_add_cflags in
11880         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11881                 case $cf_add_cflags in
11882                 (-D*)
11883                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11884
11885                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11886                                 && test -z "${cf_tst_cflags}" \
11887                                 && cf_fix_cppflags=yes
11888
11889                         if test $cf_fix_cppflags = yes ; then
11890
11891         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11892         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11893
11894                                 continue
11895                         elif test "${cf_tst_cflags}" = "\"'" ; then
11896
11897         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11898         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11899
11900                                 continue
11901                         fi
11902                         ;;
11903                 esac
11904                 case "$CPPFLAGS" in
11905                 (*$cf_add_cflags)
11906                         ;;
11907                 (*)
11908                         case $cf_add_cflags in
11909                         (-D*)
11910                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11911
11912 CPPFLAGS=`echo "$CPPFLAGS" | \
11913         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11914                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11915
11916                                 ;;
11917                         esac
11918
11919         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11920         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11921
11922                         ;;
11923                 esac
11924                 ;;
11925         (*)
11926
11927         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11928         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11929
11930                 ;;
11931         esac
11932         ;;
11933 (yes)
11934
11935         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11936         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11937
11938         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11939
11940         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11941                 && test -z "${cf_tst_cflags}" \
11942                 && cf_fix_cppflags=no
11943         ;;
11944 esac
11945 done
11946
11947 if test -n "$cf_new_cflags" ; then
11948
11949         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11950         CFLAGS="${CFLAGS}$cf_new_cflags"
11951
11952 fi
11953
11954 if test -n "$cf_new_cppflags" ; then
11955
11956         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11957         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11958
11959 fi
11960
11961 if test -n "$cf_new_extra_cppflags" ; then
11962
11963         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11964         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11965
11966 fi
11967
11968 fi
11969
11970 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11971
11972 cf_save_CFLAGS="$CFLAGS"
11973 cf_save_CPPFLAGS="$CPPFLAGS"
11974
11975 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11976         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11977                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11978
11979 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11980         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11981                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11982
11983 echo "$as_me:11983: checking if we should define _POSIX_C_SOURCE" >&5
11984 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11985 if test "${cf_cv_posix_c_source+set}" = set; then
11986   echo $ECHO_N "(cached) $ECHO_C" >&6
11987 else
11988
11989 echo "${as_me:-configure}:11989: testing if the symbol is already defined go no further ..." 1>&5
11990
11991         cat >conftest.$ac_ext <<_ACEOF
11992 #line 11992 "configure"
11993 #include "confdefs.h"
11994 #include <sys/types.h>
11995 int
11996 main (void)
11997 {
11998
11999 #ifndef _POSIX_C_SOURCE
12000 make an error
12001 #endif
12002   ;
12003   return 0;
12004 }
12005 _ACEOF
12006 rm -f conftest.$ac_objext
12007 if { (eval echo "$as_me:12007: \"$ac_compile\"") >&5
12008   (eval $ac_compile) 2>&5
12009   ac_status=$?
12010   echo "$as_me:12010: \$? = $ac_status" >&5
12011   (exit $ac_status); } &&
12012          { ac_try='test -s conftest.$ac_objext'
12013   { (eval echo "$as_me:12013: \"$ac_try\"") >&5
12014   (eval $ac_try) 2>&5
12015   ac_status=$?
12016   echo "$as_me:12016: \$? = $ac_status" >&5
12017   (exit $ac_status); }; }; then
12018   cf_cv_posix_c_source=no
12019 else
12020   echo "$as_me: failed program was:" >&5
12021 cat conftest.$ac_ext >&5
12022 cf_want_posix_source=no
12023          case .$cf_POSIX_C_SOURCE in
12024          (.[12]??*)
12025                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12026                 ;;
12027          (.2)
12028                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12029                 cf_want_posix_source=yes
12030                 ;;
12031          (.*)
12032                 cf_want_posix_source=yes
12033                 ;;
12034          esac
12035          if test "$cf_want_posix_source" = yes ; then
12036                 cat >conftest.$ac_ext <<_ACEOF
12037 #line 12037 "configure"
12038 #include "confdefs.h"
12039 #include <sys/types.h>
12040 int
12041 main (void)
12042 {
12043
12044 #ifdef _POSIX_SOURCE
12045 make an error
12046 #endif
12047   ;
12048   return 0;
12049 }
12050 _ACEOF
12051 rm -f conftest.$ac_objext
12052 if { (eval echo "$as_me:12052: \"$ac_compile\"") >&5
12053   (eval $ac_compile) 2>&5
12054   ac_status=$?
12055   echo "$as_me:12055: \$? = $ac_status" >&5
12056   (exit $ac_status); } &&
12057          { ac_try='test -s conftest.$ac_objext'
12058   { (eval echo "$as_me:12058: \"$ac_try\"") >&5
12059   (eval $ac_try) 2>&5
12060   ac_status=$?
12061   echo "$as_me:12061: \$? = $ac_status" >&5
12062   (exit $ac_status); }; }; then
12063   :
12064 else
12065   echo "$as_me: failed program was:" >&5
12066 cat conftest.$ac_ext >&5
12067 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12068 fi
12069 rm -f conftest.$ac_objext conftest.$ac_ext
12070          fi
12071
12072 echo "${as_me:-configure}:12072: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12073
12074          CFLAGS="$cf_trim_CFLAGS"
12075          CPPFLAGS="$cf_trim_CPPFLAGS"
12076
12077         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12078         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12079
12080 echo "${as_me:-configure}:12080: testing if the second compile does not leave our definition intact error ..." 1>&5
12081
12082          cat >conftest.$ac_ext <<_ACEOF
12083 #line 12083 "configure"
12084 #include "confdefs.h"
12085 #include <sys/types.h>
12086 int
12087 main (void)
12088 {
12089
12090 #ifndef _POSIX_C_SOURCE
12091 make an error
12092 #endif
12093   ;
12094   return 0;
12095 }
12096 _ACEOF
12097 rm -f conftest.$ac_objext
12098 if { (eval echo "$as_me:12098: \"$ac_compile\"") >&5
12099   (eval $ac_compile) 2>&5
12100   ac_status=$?
12101   echo "$as_me:12101: \$? = $ac_status" >&5
12102   (exit $ac_status); } &&
12103          { ac_try='test -s conftest.$ac_objext'
12104   { (eval echo "$as_me:12104: \"$ac_try\"") >&5
12105   (eval $ac_try) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit $ac_status); }; }; then
12109   :
12110 else
12111   echo "$as_me: failed program was:" >&5
12112 cat conftest.$ac_ext >&5
12113 cf_cv_posix_c_source=no
12114 fi
12115 rm -f conftest.$ac_objext conftest.$ac_ext
12116          CFLAGS="$cf_save_CFLAGS"
12117          CPPFLAGS="$cf_save_CPPFLAGS"
12118
12119 fi
12120 rm -f conftest.$ac_objext conftest.$ac_ext
12121
12122 fi
12123 echo "$as_me:12123: result: $cf_cv_posix_c_source" >&5
12124 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12125
12126 if test "$cf_cv_posix_c_source" != no ; then
12127         CFLAGS="$cf_trim_CFLAGS"
12128         CPPFLAGS="$cf_trim_CPPFLAGS"
12129
12130 cf_fix_cppflags=no
12131 cf_new_cflags=
12132 cf_new_cppflags=
12133 cf_new_extra_cppflags=
12134
12135 for cf_add_cflags in $cf_cv_posix_c_source
12136 do
12137 case $cf_fix_cppflags in
12138 (no)
12139         case $cf_add_cflags in
12140         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12141                 case $cf_add_cflags in
12142                 (-D*)
12143                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12144
12145                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12146                                 && test -z "${cf_tst_cflags}" \
12147                                 && cf_fix_cppflags=yes
12148
12149                         if test $cf_fix_cppflags = yes ; then
12150
12151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12153
12154                                 continue
12155                         elif test "${cf_tst_cflags}" = "\"'" ; then
12156
12157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12159
12160                                 continue
12161                         fi
12162                         ;;
12163                 esac
12164                 case "$CPPFLAGS" in
12165                 (*$cf_add_cflags)
12166                         ;;
12167                 (*)
12168                         case $cf_add_cflags in
12169                         (-D*)
12170                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12171
12172 CPPFLAGS=`echo "$CPPFLAGS" | \
12173         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12174                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12175
12176                                 ;;
12177                         esac
12178
12179         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12180         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12181
12182                         ;;
12183                 esac
12184                 ;;
12185         (*)
12186
12187         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12188         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12189
12190                 ;;
12191         esac
12192         ;;
12193 (yes)
12194
12195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12197
12198         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12199
12200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12201                 && test -z "${cf_tst_cflags}" \
12202                 && cf_fix_cppflags=no
12203         ;;
12204 esac
12205 done
12206
12207 if test -n "$cf_new_cflags" ; then
12208
12209         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12210         CFLAGS="${CFLAGS}$cf_new_cflags"
12211
12212 fi
12213
12214 if test -n "$cf_new_cppflags" ; then
12215
12216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12217         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12218
12219 fi
12220
12221 if test -n "$cf_new_extra_cppflags" ; then
12222
12223         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12224         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12225
12226 fi
12227
12228 fi
12229
12230         ;;
12231 esac
12232
12233 if test -n "$cf_xopen_source" ; then
12234
12235 cf_fix_cppflags=no
12236 cf_new_cflags=
12237 cf_new_cppflags=
12238 cf_new_extra_cppflags=
12239
12240 for cf_add_cflags in $cf_xopen_source
12241 do
12242 case $cf_fix_cppflags in
12243 (no)
12244         case $cf_add_cflags in
12245         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12246                 case $cf_add_cflags in
12247                 (-D*)
12248                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12249
12250                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12251                                 && test -z "${cf_tst_cflags}" \
12252                                 && cf_fix_cppflags=yes
12253
12254                         if test $cf_fix_cppflags = yes ; then
12255
12256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12258
12259                                 continue
12260                         elif test "${cf_tst_cflags}" = "\"'" ; then
12261
12262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12264
12265                                 continue
12266                         fi
12267                         ;;
12268                 esac
12269                 case "$CPPFLAGS" in
12270                 (*$cf_add_cflags)
12271                         ;;
12272                 (*)
12273                         case $cf_add_cflags in
12274                         (-D*)
12275                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12276
12277 CPPFLAGS=`echo "$CPPFLAGS" | \
12278         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12279                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12280
12281                                 ;;
12282                         esac
12283
12284         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12285         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12286
12287                         ;;
12288                 esac
12289                 ;;
12290         (*)
12291
12292         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12293         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12294
12295                 ;;
12296         esac
12297         ;;
12298 (yes)
12299
12300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12302
12303         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12304
12305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12306                 && test -z "${cf_tst_cflags}" \
12307                 && cf_fix_cppflags=no
12308         ;;
12309 esac
12310 done
12311
12312 if test -n "$cf_new_cflags" ; then
12313         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12314
12315 echo "${as_me:-configure}:12315: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12316
12317         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12318         CFLAGS="${CFLAGS}$cf_new_cflags"
12319
12320 fi
12321
12322 if test -n "$cf_new_cppflags" ; then
12323         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12324
12325 echo "${as_me:-configure}:12325: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12326
12327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12328         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12329
12330 fi
12331
12332 if test -n "$cf_new_extra_cppflags" ; then
12333         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12334
12335 echo "${as_me:-configure}:12335: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12336
12337         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12338         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12339
12340 fi
12341
12342 fi
12343
12344 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12345         echo "$as_me:12345: checking if _XOPEN_SOURCE really is set" >&5
12346 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12347         cat >conftest.$ac_ext <<_ACEOF
12348 #line 12348 "configure"
12349 #include "confdefs.h"
12350 #include <stdlib.h>
12351 int
12352 main (void)
12353 {
12354
12355 #ifndef _XOPEN_SOURCE
12356 make an error
12357 #endif
12358   ;
12359   return 0;
12360 }
12361 _ACEOF
12362 rm -f conftest.$ac_objext
12363 if { (eval echo "$as_me:12363: \"$ac_compile\"") >&5
12364   (eval $ac_compile) 2>&5
12365   ac_status=$?
12366   echo "$as_me:12366: \$? = $ac_status" >&5
12367   (exit $ac_status); } &&
12368          { ac_try='test -s conftest.$ac_objext'
12369   { (eval echo "$as_me:12369: \"$ac_try\"") >&5
12370   (eval $ac_try) 2>&5
12371   ac_status=$?
12372   echo "$as_me:12372: \$? = $ac_status" >&5
12373   (exit $ac_status); }; }; then
12374   cf_XOPEN_SOURCE_set=yes
12375 else
12376   echo "$as_me: failed program was:" >&5
12377 cat conftest.$ac_ext >&5
12378 cf_XOPEN_SOURCE_set=no
12379 fi
12380 rm -f conftest.$ac_objext conftest.$ac_ext
12381         echo "$as_me:12381: result: $cf_XOPEN_SOURCE_set" >&5
12382 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12383         if test $cf_XOPEN_SOURCE_set = yes
12384         then
12385                 cat >conftest.$ac_ext <<_ACEOF
12386 #line 12386 "configure"
12387 #include "confdefs.h"
12388 #include <stdlib.h>
12389 int
12390 main (void)
12391 {
12392
12393 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12394 make an error
12395 #endif
12396   ;
12397   return 0;
12398 }
12399 _ACEOF
12400 rm -f conftest.$ac_objext
12401 if { (eval echo "$as_me:12401: \"$ac_compile\"") >&5
12402   (eval $ac_compile) 2>&5
12403   ac_status=$?
12404   echo "$as_me:12404: \$? = $ac_status" >&5
12405   (exit $ac_status); } &&
12406          { ac_try='test -s conftest.$ac_objext'
12407   { (eval echo "$as_me:12407: \"$ac_try\"") >&5
12408   (eval $ac_try) 2>&5
12409   ac_status=$?
12410   echo "$as_me:12410: \$? = $ac_status" >&5
12411   (exit $ac_status); }; }; then
12412   cf_XOPEN_SOURCE_set_ok=yes
12413 else
12414   echo "$as_me: failed program was:" >&5
12415 cat conftest.$ac_ext >&5
12416 cf_XOPEN_SOURCE_set_ok=no
12417 fi
12418 rm -f conftest.$ac_objext conftest.$ac_ext
12419                 if test $cf_XOPEN_SOURCE_set_ok = no
12420                 then
12421                         { echo "$as_me:12421: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12422 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12423                 fi
12424         else
12425
12426 echo "$as_me:12426: checking if we should define _XOPEN_SOURCE" >&5
12427 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12428 if test "${cf_cv_xopen_source+set}" = set; then
12429   echo $ECHO_N "(cached) $ECHO_C" >&6
12430 else
12431
12432         cat >conftest.$ac_ext <<_ACEOF
12433 #line 12433 "configure"
12434 #include "confdefs.h"
12435
12436 #include <stdlib.h>
12437 #include <string.h>
12438 #include <sys/types.h>
12439
12440 int
12441 main (void)
12442 {
12443
12444 #ifndef _XOPEN_SOURCE
12445 make an error
12446 #endif
12447   ;
12448   return 0;
12449 }
12450 _ACEOF
12451 rm -f conftest.$ac_objext
12452 if { (eval echo "$as_me:12452: \"$ac_compile\"") >&5
12453   (eval $ac_compile) 2>&5
12454   ac_status=$?
12455   echo "$as_me:12455: \$? = $ac_status" >&5
12456   (exit $ac_status); } &&
12457          { ac_try='test -s conftest.$ac_objext'
12458   { (eval echo "$as_me:12458: \"$ac_try\"") >&5
12459   (eval $ac_try) 2>&5
12460   ac_status=$?
12461   echo "$as_me:12461: \$? = $ac_status" >&5
12462   (exit $ac_status); }; }; then
12463   cf_cv_xopen_source=no
12464 else
12465   echo "$as_me: failed program was:" >&5
12466 cat conftest.$ac_ext >&5
12467 cf_save="$CPPFLAGS"
12468
12469         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12470         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12471
12472          cat >conftest.$ac_ext <<_ACEOF
12473 #line 12473 "configure"
12474 #include "confdefs.h"
12475
12476 #include <stdlib.h>
12477 #include <string.h>
12478 #include <sys/types.h>
12479
12480 int
12481 main (void)
12482 {
12483
12484 #ifdef _XOPEN_SOURCE
12485 make an error
12486 #endif
12487   ;
12488   return 0;
12489 }
12490 _ACEOF
12491 rm -f conftest.$ac_objext
12492 if { (eval echo "$as_me:12492: \"$ac_compile\"") >&5
12493   (eval $ac_compile) 2>&5
12494   ac_status=$?
12495   echo "$as_me:12495: \$? = $ac_status" >&5
12496   (exit $ac_status); } &&
12497          { ac_try='test -s conftest.$ac_objext'
12498   { (eval echo "$as_me:12498: \"$ac_try\"") >&5
12499   (eval $ac_try) 2>&5
12500   ac_status=$?
12501   echo "$as_me:12501: \$? = $ac_status" >&5
12502   (exit $ac_status); }; }; then
12503   cf_cv_xopen_source=no
12504 else
12505   echo "$as_me: failed program was:" >&5
12506 cat conftest.$ac_ext >&5
12507 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12508 fi
12509 rm -f conftest.$ac_objext conftest.$ac_ext
12510         CPPFLAGS="$cf_save"
12511
12512 fi
12513 rm -f conftest.$ac_objext conftest.$ac_ext
12514
12515 fi
12516 echo "$as_me:12516: result: $cf_cv_xopen_source" >&5
12517 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12518
12519 if test "$cf_cv_xopen_source" != no ; then
12520
12521 CFLAGS=`echo "$CFLAGS" | \
12522         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12523                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12524
12525 CPPFLAGS=`echo "$CPPFLAGS" | \
12526         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12527                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12528
12529         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12530
12531 cf_fix_cppflags=no
12532 cf_new_cflags=
12533 cf_new_cppflags=
12534 cf_new_extra_cppflags=
12535
12536 for cf_add_cflags in $cf_temp_xopen_source
12537 do
12538 case $cf_fix_cppflags in
12539 (no)
12540         case $cf_add_cflags in
12541         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12542                 case $cf_add_cflags in
12543                 (-D*)
12544                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12545
12546                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12547                                 && test -z "${cf_tst_cflags}" \
12548                                 && cf_fix_cppflags=yes
12549
12550                         if test $cf_fix_cppflags = yes ; then
12551
12552         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12553         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12554
12555                                 continue
12556                         elif test "${cf_tst_cflags}" = "\"'" ; then
12557
12558         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12559         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12560
12561                                 continue
12562                         fi
12563                         ;;
12564                 esac
12565                 case "$CPPFLAGS" in
12566                 (*$cf_add_cflags)
12567                         ;;
12568                 (*)
12569                         case $cf_add_cflags in
12570                         (-D*)
12571                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12572
12573 CPPFLAGS=`echo "$CPPFLAGS" | \
12574         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12575                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12576
12577                                 ;;
12578                         esac
12579
12580         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12581         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12582
12583                         ;;
12584                 esac
12585                 ;;
12586         (*)
12587
12588         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12589         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12590
12591                 ;;
12592         esac
12593         ;;
12594 (yes)
12595
12596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12598
12599         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12600
12601         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12602                 && test -z "${cf_tst_cflags}" \
12603                 && cf_fix_cppflags=no
12604         ;;
12605 esac
12606 done
12607
12608 if test -n "$cf_new_cflags" ; then
12609
12610         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12611         CFLAGS="${CFLAGS}$cf_new_cflags"
12612
12613 fi
12614
12615 if test -n "$cf_new_cppflags" ; then
12616
12617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12618         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12619
12620 fi
12621
12622 if test -n "$cf_new_extra_cppflags" ; then
12623
12624         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12625         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12626
12627 fi
12628
12629 fi
12630
12631         fi
12632 fi
12633
12634 # Check whether --enable-largefile or --disable-largefile was given.
12635 if test "${enable_largefile+set}" = set; then
12636   enableval="$enable_largefile"
12637
12638 fi;
12639 if test "$enable_largefile" != no; then
12640
12641   echo "$as_me:12641: checking for special C compiler options needed for large files" >&5
12642 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12643 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12644   echo $ECHO_N "(cached) $ECHO_C" >&6
12645 else
12646   ac_cv_sys_largefile_CC=no
12647      if test "$GCC" != yes; then
12648        ac_save_CC=$CC
12649        while :; do
12650          # IRIX 6.2 and later do not support large files by default,
12651          # so use the C compiler's -n32 option if that helps.
12652          cat >conftest.$ac_ext <<_ACEOF
12653 #line 12653 "configure"
12654 #include "confdefs.h"
12655 #include <sys/types.h>
12656  /* Check that off_t can represent 2**63 - 1 correctly.
12657     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12658     since some C++ compilers masquerading as C compilers
12659     incorrectly reject 9223372036854775807.  */
12660 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12661   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12662                        && LARGE_OFF_T % 2147483647 == 1)
12663                       ? 1 : -1];
12664 int
12665 main (void)
12666 {
12667
12668   ;
12669   return 0;
12670 }
12671 _ACEOF
12672          rm -f conftest.$ac_objext
12673 if { (eval echo "$as_me:12673: \"$ac_compile\"") >&5
12674   (eval $ac_compile) 2>&5
12675   ac_status=$?
12676   echo "$as_me:12676: \$? = $ac_status" >&5
12677   (exit $ac_status); } &&
12678          { ac_try='test -s conftest.$ac_objext'
12679   { (eval echo "$as_me:12679: \"$ac_try\"") >&5
12680   (eval $ac_try) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit $ac_status); }; }; then
12684   break
12685 else
12686   echo "$as_me: failed program was:" >&5
12687 cat conftest.$ac_ext >&5
12688 fi
12689 rm -f conftest.$ac_objext
12690          CC="$CC -n32"
12691          rm -f conftest.$ac_objext
12692 if { (eval echo "$as_me:12692: \"$ac_compile\"") >&5
12693   (eval $ac_compile) 2>&5
12694   ac_status=$?
12695   echo "$as_me:12695: \$? = $ac_status" >&5
12696   (exit $ac_status); } &&
12697          { ac_try='test -s conftest.$ac_objext'
12698   { (eval echo "$as_me:12698: \"$ac_try\"") >&5
12699   (eval $ac_try) 2>&5
12700   ac_status=$?
12701   echo "$as_me:12701: \$? = $ac_status" >&5
12702   (exit $ac_status); }; }; then
12703   ac_cv_sys_largefile_CC=' -n32'; break
12704 else
12705   echo "$as_me: failed program was:" >&5
12706 cat conftest.$ac_ext >&5
12707 fi
12708 rm -f conftest.$ac_objext
12709          break
12710        done
12711        CC=$ac_save_CC
12712        rm -f conftest.$ac_ext
12713     fi
12714 fi
12715 echo "$as_me:12715: result: $ac_cv_sys_largefile_CC" >&5
12716 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12717   if test "$ac_cv_sys_largefile_CC" != no; then
12718     CC=$CC$ac_cv_sys_largefile_CC
12719   fi
12720
12721   echo "$as_me:12721: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12722 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12723 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12724   echo $ECHO_N "(cached) $ECHO_C" >&6
12725 else
12726   while :; do
12727   ac_cv_sys_file_offset_bits=no
12728   cat >conftest.$ac_ext <<_ACEOF
12729 #line 12729 "configure"
12730 #include "confdefs.h"
12731 #include <sys/types.h>
12732  /* Check that off_t can represent 2**63 - 1 correctly.
12733     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12734     since some C++ compilers masquerading as C compilers
12735     incorrectly reject 9223372036854775807.  */
12736 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12737   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12738                        && LARGE_OFF_T % 2147483647 == 1)
12739                       ? 1 : -1];
12740 int
12741 main (void)
12742 {
12743
12744   ;
12745   return 0;
12746 }
12747 _ACEOF
12748 rm -f conftest.$ac_objext
12749 if { (eval echo "$as_me:12749: \"$ac_compile\"") >&5
12750   (eval $ac_compile) 2>&5
12751   ac_status=$?
12752   echo "$as_me:12752: \$? = $ac_status" >&5
12753   (exit $ac_status); } &&
12754          { ac_try='test -s conftest.$ac_objext'
12755   { (eval echo "$as_me:12755: \"$ac_try\"") >&5
12756   (eval $ac_try) 2>&5
12757   ac_status=$?
12758   echo "$as_me:12758: \$? = $ac_status" >&5
12759   (exit $ac_status); }; }; then
12760   break
12761 else
12762   echo "$as_me: failed program was:" >&5
12763 cat conftest.$ac_ext >&5
12764 fi
12765 rm -f conftest.$ac_objext conftest.$ac_ext
12766   cat >conftest.$ac_ext <<_ACEOF
12767 #line 12767 "configure"
12768 #include "confdefs.h"
12769 #define _FILE_OFFSET_BITS 64
12770 #include <sys/types.h>
12771  /* Check that off_t can represent 2**63 - 1 correctly.
12772     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12773     since some C++ compilers masquerading as C compilers
12774     incorrectly reject 9223372036854775807.  */
12775 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12776   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12777                        && LARGE_OFF_T % 2147483647 == 1)
12778                       ? 1 : -1];
12779 int
12780 main (void)
12781 {
12782
12783   ;
12784   return 0;
12785 }
12786 _ACEOF
12787 rm -f conftest.$ac_objext
12788 if { (eval echo "$as_me:12788: \"$ac_compile\"") >&5
12789   (eval $ac_compile) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit $ac_status); } &&
12793          { ac_try='test -s conftest.$ac_objext'
12794   { (eval echo "$as_me:12794: \"$ac_try\"") >&5
12795   (eval $ac_try) 2>&5
12796   ac_status=$?
12797   echo "$as_me:12797: \$? = $ac_status" >&5
12798   (exit $ac_status); }; }; then
12799   ac_cv_sys_file_offset_bits=64; break
12800 else
12801   echo "$as_me: failed program was:" >&5
12802 cat conftest.$ac_ext >&5
12803 fi
12804 rm -f conftest.$ac_objext conftest.$ac_ext
12805   break
12806 done
12807 fi
12808 echo "$as_me:12808: result: $ac_cv_sys_file_offset_bits" >&5
12809 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12810 if test "$ac_cv_sys_file_offset_bits" != no; then
12811
12812 cat >>confdefs.h <<EOF
12813 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12814 EOF
12815
12816 fi
12817 rm -rf conftest*
12818   echo "$as_me:12818: checking for _LARGE_FILES value needed for large files" >&5
12819 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12820 if test "${ac_cv_sys_large_files+set}" = set; then
12821   echo $ECHO_N "(cached) $ECHO_C" >&6
12822 else
12823   while :; do
12824   ac_cv_sys_large_files=no
12825   cat >conftest.$ac_ext <<_ACEOF
12826 #line 12826 "configure"
12827 #include "confdefs.h"
12828 #include <sys/types.h>
12829  /* Check that off_t can represent 2**63 - 1 correctly.
12830     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12831     since some C++ compilers masquerading as C compilers
12832     incorrectly reject 9223372036854775807.  */
12833 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12834   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12835                        && LARGE_OFF_T % 2147483647 == 1)
12836                       ? 1 : -1];
12837 int
12838 main (void)
12839 {
12840
12841   ;
12842   return 0;
12843 }
12844 _ACEOF
12845 rm -f conftest.$ac_objext
12846 if { (eval echo "$as_me:12846: \"$ac_compile\"") >&5
12847   (eval $ac_compile) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit $ac_status); } &&
12851          { ac_try='test -s conftest.$ac_objext'
12852   { (eval echo "$as_me:12852: \"$ac_try\"") >&5
12853   (eval $ac_try) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit $ac_status); }; }; then
12857   break
12858 else
12859   echo "$as_me: failed program was:" >&5
12860 cat conftest.$ac_ext >&5
12861 fi
12862 rm -f conftest.$ac_objext conftest.$ac_ext
12863   cat >conftest.$ac_ext <<_ACEOF
12864 #line 12864 "configure"
12865 #include "confdefs.h"
12866 #define _LARGE_FILES 1
12867 #include <sys/types.h>
12868  /* Check that off_t can represent 2**63 - 1 correctly.
12869     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12870     since some C++ compilers masquerading as C compilers
12871     incorrectly reject 9223372036854775807.  */
12872 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12873   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12874                        && LARGE_OFF_T % 2147483647 == 1)
12875                       ? 1 : -1];
12876 int
12877 main (void)
12878 {
12879
12880   ;
12881   return 0;
12882 }
12883 _ACEOF
12884 rm -f conftest.$ac_objext
12885 if { (eval echo "$as_me:12885: \"$ac_compile\"") >&5
12886   (eval $ac_compile) 2>&5
12887   ac_status=$?
12888   echo "$as_me:12888: \$? = $ac_status" >&5
12889   (exit $ac_status); } &&
12890          { ac_try='test -s conftest.$ac_objext'
12891   { (eval echo "$as_me:12891: \"$ac_try\"") >&5
12892   (eval $ac_try) 2>&5
12893   ac_status=$?
12894   echo "$as_me:12894: \$? = $ac_status" >&5
12895   (exit $ac_status); }; }; then
12896   ac_cv_sys_large_files=1; break
12897 else
12898   echo "$as_me: failed program was:" >&5
12899 cat conftest.$ac_ext >&5
12900 fi
12901 rm -f conftest.$ac_objext conftest.$ac_ext
12902   break
12903 done
12904 fi
12905 echo "$as_me:12905: result: $ac_cv_sys_large_files" >&5
12906 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
12907 if test "$ac_cv_sys_large_files" != no; then
12908
12909 cat >>confdefs.h <<EOF
12910 #define _LARGE_FILES $ac_cv_sys_large_files
12911 EOF
12912
12913 fi
12914 rm -rf conftest*
12915 fi
12916
12917         if test "$enable_largefile" != no ; then
12918         echo "$as_me:12918: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12919 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
12920 if test "${ac_cv_sys_largefile_source+set}" = set; then
12921   echo $ECHO_N "(cached) $ECHO_C" >&6
12922 else
12923   while :; do
12924   ac_cv_sys_largefile_source=no
12925   cat >conftest.$ac_ext <<_ACEOF
12926 #line 12926 "configure"
12927 #include "confdefs.h"
12928 #include <stdio.h>
12929 int
12930 main (void)
12931 {
12932 return !fseeko;
12933   ;
12934   return 0;
12935 }
12936 _ACEOF
12937 rm -f conftest.$ac_objext
12938 if { (eval echo "$as_me:12938: \"$ac_compile\"") >&5
12939   (eval $ac_compile) 2>&5
12940   ac_status=$?
12941   echo "$as_me:12941: \$? = $ac_status" >&5
12942   (exit $ac_status); } &&
12943          { ac_try='test -s conftest.$ac_objext'
12944   { (eval echo "$as_me:12944: \"$ac_try\"") >&5
12945   (eval $ac_try) 2>&5
12946   ac_status=$?
12947   echo "$as_me:12947: \$? = $ac_status" >&5
12948   (exit $ac_status); }; }; then
12949   break
12950 else
12951   echo "$as_me: failed program was:" >&5
12952 cat conftest.$ac_ext >&5
12953 fi
12954 rm -f conftest.$ac_objext conftest.$ac_ext
12955   cat >conftest.$ac_ext <<_ACEOF
12956 #line 12956 "configure"
12957 #include "confdefs.h"
12958 #define _LARGEFILE_SOURCE 1
12959 #include <stdio.h>
12960 int
12961 main (void)
12962 {
12963 return !fseeko;
12964   ;
12965   return 0;
12966 }
12967 _ACEOF
12968 rm -f conftest.$ac_objext
12969 if { (eval echo "$as_me:12969: \"$ac_compile\"") >&5
12970   (eval $ac_compile) 2>&5
12971   ac_status=$?
12972   echo "$as_me:12972: \$? = $ac_status" >&5
12973   (exit $ac_status); } &&
12974          { ac_try='test -s conftest.$ac_objext'
12975   { (eval echo "$as_me:12975: \"$ac_try\"") >&5
12976   (eval $ac_try) 2>&5
12977   ac_status=$?
12978   echo "$as_me:12978: \$? = $ac_status" >&5
12979   (exit $ac_status); }; }; then
12980   ac_cv_sys_largefile_source=1; break
12981 else
12982   echo "$as_me: failed program was:" >&5
12983 cat conftest.$ac_ext >&5
12984 fi
12985 rm -f conftest.$ac_objext conftest.$ac_ext
12986   break
12987 done
12988 fi
12989 echo "$as_me:12989: result: $ac_cv_sys_largefile_source" >&5
12990 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
12991 if test "$ac_cv_sys_largefile_source" != no; then
12992
12993 cat >>confdefs.h <<EOF
12994 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12995 EOF
12996
12997 fi
12998 rm -rf conftest*
12999
13000 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13001 # in glibc 2.1.3, but that breaks too many other things.
13002 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13003 echo "$as_me:13003: checking for fseeko" >&5
13004 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13005 if test "${ac_cv_func_fseeko+set}" = set; then
13006   echo $ECHO_N "(cached) $ECHO_C" >&6
13007 else
13008   cat >conftest.$ac_ext <<_ACEOF
13009 #line 13009 "configure"
13010 #include "confdefs.h"
13011 #include <stdio.h>
13012 int
13013 main (void)
13014 {
13015 return fseeko && fseeko (stdin, 0, 0);
13016   ;
13017   return 0;
13018 }
13019 _ACEOF
13020 rm -f conftest.$ac_objext conftest$ac_exeext
13021 if { (eval echo "$as_me:13021: \"$ac_link\"") >&5
13022   (eval $ac_link) 2>&5
13023   ac_status=$?
13024   echo "$as_me:13024: \$? = $ac_status" >&5
13025   (exit $ac_status); } &&
13026          { ac_try='test -s conftest$ac_exeext'
13027   { (eval echo "$as_me:13027: \"$ac_try\"") >&5
13028   (eval $ac_try) 2>&5
13029   ac_status=$?
13030   echo "$as_me:13030: \$? = $ac_status" >&5
13031   (exit $ac_status); }; }; then
13032   ac_cv_func_fseeko=yes
13033 else
13034   echo "$as_me: failed program was:" >&5
13035 cat conftest.$ac_ext >&5
13036 ac_cv_func_fseeko=no
13037 fi
13038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13039 fi
13040 echo "$as_me:13040: result: $ac_cv_func_fseeko" >&5
13041 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13042 if test $ac_cv_func_fseeko = yes; then
13043
13044 cat >>confdefs.h <<\EOF
13045 #define HAVE_FSEEKO 1
13046 EOF
13047
13048 fi
13049
13050         # Normally we would collect these definitions in the config.h,
13051         # but (like _XOPEN_SOURCE), some environments rely on having these
13052         # defined before any of the system headers are included.  Another
13053         # case comes up with C++, e.g., on AIX the compiler compiles the
13054         # header files by themselves before looking at the body files it is
13055         # told to compile.  For ncurses, those header files do not include
13056         # the config.h
13057         if test "$ac_cv_sys_large_files" != no
13058         then
13059
13060         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13061         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13062
13063         fi
13064         if test "$ac_cv_sys_largefile_source" != no
13065         then
13066
13067         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13068         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13069
13070         fi
13071         if test "$ac_cv_sys_file_offset_bits" != no
13072         then
13073
13074         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13075         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13076
13077         fi
13078
13079         echo "$as_me:13079: checking whether to use struct dirent64" >&5
13080 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13081 if test "${cf_cv_struct_dirent64+set}" = set; then
13082   echo $ECHO_N "(cached) $ECHO_C" >&6
13083 else
13084
13085                 cat >conftest.$ac_ext <<_ACEOF
13086 #line 13086 "configure"
13087 #include "confdefs.h"
13088
13089 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13090 #include <sys/types.h>
13091 #include <dirent.h>
13092
13093 int
13094 main (void)
13095 {
13096
13097                 /* if transitional largefile support is setup, this is true */
13098                 extern struct dirent64 * readdir(DIR *);
13099                 struct dirent64 *x = readdir((DIR *)0);
13100                 struct dirent *y = readdir((DIR *)0);
13101                 int z = x - y;
13102
13103   ;
13104   return 0;
13105 }
13106 _ACEOF
13107 rm -f conftest.$ac_objext
13108 if { (eval echo "$as_me:13108: \"$ac_compile\"") >&5
13109   (eval $ac_compile) 2>&5
13110   ac_status=$?
13111   echo "$as_me:13111: \$? = $ac_status" >&5
13112   (exit $ac_status); } &&
13113          { ac_try='test -s conftest.$ac_objext'
13114   { (eval echo "$as_me:13114: \"$ac_try\"") >&5
13115   (eval $ac_try) 2>&5
13116   ac_status=$?
13117   echo "$as_me:13117: \$? = $ac_status" >&5
13118   (exit $ac_status); }; }; then
13119   cf_cv_struct_dirent64=yes
13120 else
13121   echo "$as_me: failed program was:" >&5
13122 cat conftest.$ac_ext >&5
13123 cf_cv_struct_dirent64=no
13124 fi
13125 rm -f conftest.$ac_objext conftest.$ac_ext
13126
13127 fi
13128 echo "$as_me:13128: result: $cf_cv_struct_dirent64" >&5
13129 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13130         test "$cf_cv_struct_dirent64" = yes &&
13131 cat >>confdefs.h <<\EOF
13132 #define HAVE_STRUCT_DIRENT64 1
13133 EOF
13134
13135         fi
13136
13137 ### Enable compiling-in rcs id's
13138 echo "$as_me:13138: checking if RCS identifiers should be compiled-in" >&5
13139 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13140
13141 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13142 if test "${with_rcs_ids+set}" = set; then
13143   withval="$with_rcs_ids"
13144   with_rcs_ids=$withval
13145 else
13146   with_rcs_ids=no
13147 fi;
13148 echo "$as_me:13148: result: $with_rcs_ids" >&5
13149 echo "${ECHO_T}$with_rcs_ids" >&6
13150 test "$with_rcs_ids" = yes &&
13151 cat >>confdefs.h <<\EOF
13152 #define USE_RCS_IDS 1
13153 EOF
13154
13155 ###############################################################################
13156
13157 ### Note that some functions (such as const) are normally disabled anyway.
13158 echo "$as_me:13158: checking if you want to build with function extensions" >&5
13159 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13160
13161 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13162 if test "${enable_ext_funcs+set}" = set; then
13163   enableval="$enable_ext_funcs"
13164   with_ext_funcs=$enableval
13165 else
13166   with_ext_funcs=yes
13167 fi;
13168 echo "$as_me:13168: result: $with_ext_funcs" >&5
13169 echo "${ECHO_T}$with_ext_funcs" >&6
13170 if test "$with_ext_funcs" = yes ; then
13171         NCURSES_EXT_FUNCS=1
13172
13173 cat >>confdefs.h <<\EOF
13174 #define HAVE_USE_DEFAULT_COLORS 1
13175 EOF
13176
13177 cat >>confdefs.h <<\EOF
13178 #define NCURSES_EXT_FUNCS 1
13179 EOF
13180
13181 else
13182         NCURSES_EXT_FUNCS=0
13183 fi
13184
13185 ###   use option --enable-const to turn on use of const beyond that in XSI.
13186 echo "$as_me:13186: checking for extended use of const keyword" >&5
13187 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13188
13189 # Check whether --enable-const or --disable-const was given.
13190 if test "${enable_const+set}" = set; then
13191   enableval="$enable_const"
13192   with_ext_const=$enableval
13193 else
13194   with_ext_const=no
13195 fi;
13196 echo "$as_me:13196: result: $with_ext_const" >&5
13197 echo "${ECHO_T}$with_ext_const" >&6
13198 NCURSES_CONST='/*nothing*/'
13199 if test "$with_ext_const" = yes ; then
13200         NCURSES_CONST=const
13201 fi
13202
13203 ###############################################################################
13204 # These options are relatively safe to experiment with.
13205
13206 echo "$as_me:13206: checking if you want all development code" >&5
13207 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13208
13209 # Check whether --with-develop or --without-develop was given.
13210 if test "${with_develop+set}" = set; then
13211   withval="$with_develop"
13212   with_develop=$withval
13213 else
13214   with_develop=no
13215 fi;
13216 echo "$as_me:13216: result: $with_develop" >&5
13217 echo "${ECHO_T}$with_develop" >&6
13218
13219 ###############################################################################
13220 # These are just experimental, probably should not be in a package:
13221
13222 # This is still experimental (20080329), but should ultimately be moved to
13223 # the script-block --with-normal, etc.
13224
13225 echo "$as_me:13225: checking if you want to link with the pthread library" >&5
13226 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13227
13228 # Check whether --with-pthread or --without-pthread was given.
13229 if test "${with_pthread+set}" = set; then
13230   withval="$with_pthread"
13231   with_pthread=$withval
13232 else
13233   with_pthread=no
13234 fi;
13235 echo "$as_me:13235: result: $with_pthread" >&5
13236 echo "${ECHO_T}$with_pthread" >&6
13237
13238 if test "$with_pthread" != no ; then
13239         echo "$as_me:13239: checking for pthread.h" >&5
13240 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13241 if test "${ac_cv_header_pthread_h+set}" = set; then
13242   echo $ECHO_N "(cached) $ECHO_C" >&6
13243 else
13244   cat >conftest.$ac_ext <<_ACEOF
13245 #line 13245 "configure"
13246 #include "confdefs.h"
13247 #include <pthread.h>
13248 _ACEOF
13249 if { (eval echo "$as_me:13249: \"$ac_cpp conftest.$ac_ext\"") >&5
13250   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13251   ac_status=$?
13252   egrep -v '^ *\+' conftest.er1 >conftest.err
13253   rm -f conftest.er1
13254   cat conftest.err >&5
13255   echo "$as_me:13255: \$? = $ac_status" >&5
13256   (exit $ac_status); } >/dev/null; then
13257   if test -s conftest.err; then
13258     ac_cpp_err=$ac_c_preproc_warn_flag
13259   else
13260     ac_cpp_err=
13261   fi
13262 else
13263   ac_cpp_err=yes
13264 fi
13265 if test -z "$ac_cpp_err"; then
13266   ac_cv_header_pthread_h=yes
13267 else
13268   echo "$as_me: failed program was:" >&5
13269   cat conftest.$ac_ext >&5
13270   ac_cv_header_pthread_h=no
13271 fi
13272 rm -f conftest.err conftest.$ac_ext
13273 fi
13274 echo "$as_me:13274: result: $ac_cv_header_pthread_h" >&5
13275 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13276 if test $ac_cv_header_pthread_h = yes; then
13277
13278 cat >>confdefs.h <<\EOF
13279 #define HAVE_PTHREADS_H 1
13280 EOF
13281
13282         for cf_lib_pthread in pthread c_r
13283         do
13284             echo "$as_me:13284: checking if we can link with the $cf_lib_pthread library" >&5
13285 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13286             cf_save_LIBS="$LIBS"
13287
13288 cf_add_libs="-l$cf_lib_pthread"
13289 # Filter out duplicates - this happens with badly-designed ".pc" files...
13290 for cf_add_1lib in $LIBS
13291 do
13292         for cf_add_2lib in $cf_add_libs
13293         do
13294                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13295                 then
13296                         cf_add_1lib=
13297                         break
13298                 fi
13299         done
13300         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13301 done
13302 LIBS="$cf_add_libs"
13303
13304             cat >conftest.$ac_ext <<_ACEOF
13305 #line 13305 "configure"
13306 #include "confdefs.h"
13307
13308 #include <pthread.h>
13309
13310 int
13311 main (void)
13312 {
13313
13314                 int rc = pthread_create(0,0,0,0);
13315                 int r2 = pthread_mutexattr_settype(0, 0);
13316
13317   ;
13318   return 0;
13319 }
13320 _ACEOF
13321 rm -f conftest.$ac_objext conftest$ac_exeext
13322 if { (eval echo "$as_me:13322: \"$ac_link\"") >&5
13323   (eval $ac_link) 2>&5
13324   ac_status=$?
13325   echo "$as_me:13325: \$? = $ac_status" >&5
13326   (exit $ac_status); } &&
13327          { ac_try='test -s conftest$ac_exeext'
13328   { (eval echo "$as_me:13328: \"$ac_try\"") >&5
13329   (eval $ac_try) 2>&5
13330   ac_status=$?
13331   echo "$as_me:13331: \$? = $ac_status" >&5
13332   (exit $ac_status); }; }; then
13333   with_pthread=yes
13334 else
13335   echo "$as_me: failed program was:" >&5
13336 cat conftest.$ac_ext >&5
13337 with_pthread=no
13338 fi
13339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13340             LIBS="$cf_save_LIBS"
13341             echo "$as_me:13341: result: $with_pthread" >&5
13342 echo "${ECHO_T}$with_pthread" >&6
13343             test "$with_pthread" = yes && break
13344         done
13345
13346         if test "$with_pthread" = yes ; then
13347
13348 cf_add_libs="-l$cf_lib_pthread"
13349 # Filter out duplicates - this happens with badly-designed ".pc" files...
13350 for cf_add_1lib in $LIBS
13351 do
13352         for cf_add_2lib in $cf_add_libs
13353         do
13354                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13355                 then
13356                         cf_add_1lib=
13357                         break
13358                 fi
13359         done
13360         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13361 done
13362 LIBS="$cf_add_libs"
13363
13364 cat >>confdefs.h <<\EOF
13365 #define HAVE_LIBPTHREADS 1
13366 EOF
13367
13368         else
13369             { { echo "$as_me:13369: error: Cannot link with pthread library" >&5
13370 echo "$as_me: error: Cannot link with pthread library" >&2;}
13371    { (exit 1); exit 1; }; }
13372         fi
13373
13374 fi
13375
13376 fi
13377
13378 echo "$as_me:13378: checking if you want to use weak-symbols for pthreads" >&5
13379 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13380
13381 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13382 if test "${enable_weak_symbols+set}" = set; then
13383   enableval="$enable_weak_symbols"
13384   use_weak_symbols=$withval
13385 else
13386   use_weak_symbols=no
13387 fi;
13388 echo "$as_me:13388: result: $use_weak_symbols" >&5
13389 echo "${ECHO_T}$use_weak_symbols" >&6
13390 if test "$use_weak_symbols" = yes ; then
13391
13392 echo "$as_me:13392: checking if $CC supports weak symbols" >&5
13393 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13394 if test "${cf_cv_weak_symbols+set}" = set; then
13395   echo $ECHO_N "(cached) $ECHO_C" >&6
13396 else
13397
13398 cat >conftest.$ac_ext <<_ACEOF
13399 #line 13399 "configure"
13400 #include "confdefs.h"
13401
13402 #include <stdio.h>
13403 int
13404 main (void)
13405 {
13406
13407 #if defined(__GNUC__)
13408 #  if defined __USE_ISOC99
13409 #    define _cat_pragma(exp)    _Pragma(#exp)
13410 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13411 #  else
13412 #    define _weak_pragma(exp)
13413 #  endif
13414 #  define _declare(name)        __extension__ extern __typeof__(name) name
13415 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13416 #endif
13417
13418 weak_symbol(fopen);
13419
13420   ;
13421   return 0;
13422 }
13423 _ACEOF
13424 rm -f conftest.$ac_objext
13425 if { (eval echo "$as_me:13425: \"$ac_compile\"") >&5
13426   (eval $ac_compile) 2>&5
13427   ac_status=$?
13428   echo "$as_me:13428: \$? = $ac_status" >&5
13429   (exit $ac_status); } &&
13430          { ac_try='test -s conftest.$ac_objext'
13431   { (eval echo "$as_me:13431: \"$ac_try\"") >&5
13432   (eval $ac_try) 2>&5
13433   ac_status=$?
13434   echo "$as_me:13434: \$? = $ac_status" >&5
13435   (exit $ac_status); }; }; then
13436   cf_cv_weak_symbols=yes
13437 else
13438   echo "$as_me: failed program was:" >&5
13439 cat conftest.$ac_ext >&5
13440 cf_cv_weak_symbols=no
13441 fi
13442 rm -f conftest.$ac_objext conftest.$ac_ext
13443
13444 fi
13445 echo "$as_me:13445: result: $cf_cv_weak_symbols" >&5
13446 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13447
13448 else
13449         cf_cv_weak_symbols=no
13450 fi
13451
13452 if test $cf_cv_weak_symbols = yes ; then
13453
13454 cat >>confdefs.h <<\EOF
13455 #define USE_WEAK_SYMBOLS 1
13456 EOF
13457
13458 fi
13459
13460 PTHREAD=
13461 if test "$with_pthread" = "yes" ; then
13462
13463 cat >>confdefs.h <<\EOF
13464 #define USE_PTHREADS 1
13465 EOF
13466
13467         enable_reentrant=yes
13468         if test $cf_cv_weak_symbols = yes ; then
13469                 PTHREAD=-lpthread
13470         fi
13471 fi
13472
13473 # OpenSUSE is installing ncurses6, using reentrant option.
13474 echo "$as_me:13474: checking for _nc_TABSIZE" >&5
13475 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13476 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13477   echo $ECHO_N "(cached) $ECHO_C" >&6
13478 else
13479   cat >conftest.$ac_ext <<_ACEOF
13480 #line 13480 "configure"
13481 #include "confdefs.h"
13482 #define _nc_TABSIZE autoconf_temporary
13483 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13484 #undef _nc_TABSIZE
13485
13486 #ifdef __cplusplus
13487 extern "C"
13488 #endif
13489
13490 /* We use char because int might match the return type of a gcc2
13491    builtin and then its argument prototype would still apply.  */
13492 char _nc_TABSIZE (void);
13493
13494 int
13495 main (void)
13496 {
13497
13498 /* The GNU C library defines stubs for functions which it implements
13499     to always fail with ENOSYS.  Some functions are actually named
13500     something starting with __ and the normal name is an alias.  */
13501 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13502 #error found stub for _nc_TABSIZE
13503 #endif
13504
13505         return _nc_TABSIZE ();
13506   ;
13507   return 0;
13508 }
13509 _ACEOF
13510 rm -f conftest.$ac_objext conftest$ac_exeext
13511 if { (eval echo "$as_me:13511: \"$ac_link\"") >&5
13512   (eval $ac_link) 2>&5
13513   ac_status=$?
13514   echo "$as_me:13514: \$? = $ac_status" >&5
13515   (exit $ac_status); } &&
13516          { ac_try='test -s conftest$ac_exeext'
13517   { (eval echo "$as_me:13517: \"$ac_try\"") >&5
13518   (eval $ac_try) 2>&5
13519   ac_status=$?
13520   echo "$as_me:13520: \$? = $ac_status" >&5
13521   (exit $ac_status); }; }; then
13522   ac_cv_func__nc_TABSIZE=yes
13523 else
13524   echo "$as_me: failed program was:" >&5
13525 cat conftest.$ac_ext >&5
13526 ac_cv_func__nc_TABSIZE=no
13527 fi
13528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13529 fi
13530 echo "$as_me:13530: result: $ac_cv_func__nc_TABSIZE" >&5
13531 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13532 if test $ac_cv_func__nc_TABSIZE = yes; then
13533   assume_reentrant=yes
13534 else
13535   assume_reentrant=no
13536 fi
13537
13538 # Reentrant code has to be opaque; there's little advantage to making ncurses
13539 # opaque outside of that, so there is no --enable-opaque option.  We can use
13540 # this option without --with-pthreads, but this will be always set for
13541 # pthreads.
13542 echo "$as_me:13542: checking if you want experimental reentrant code" >&5
13543 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13544
13545 # Check whether --enable-reentrant or --disable-reentrant was given.
13546 if test "${enable_reentrant+set}" = set; then
13547   enableval="$enable_reentrant"
13548   with_reentrant=$enableval
13549 else
13550   with_reentrant=$assume_reentrant
13551 fi;
13552 echo "$as_me:13552: result: $with_reentrant" >&5
13553 echo "${ECHO_T}$with_reentrant" >&6
13554 if test "$with_reentrant" = yes ; then
13555         cf_cv_enable_reentrant=1
13556         if test $cf_cv_weak_symbols = yes ; then
13557
13558 # remove pthread library from $LIBS
13559 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13560
13561         elif test "$assume_reentrant" = no ; then
13562                 LIB_SUFFIX="t${LIB_SUFFIX}"
13563         fi
13564
13565 cat >>confdefs.h <<\EOF
13566 #define USE_REENTRANT 1
13567 EOF
13568
13569 else
13570         cf_cv_enable_reentrant=0
13571 fi
13572
13573 ### Allow using a different wrap-prefix
13574 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13575         echo "$as_me:13575: checking for prefix used to wrap public variables" >&5
13576 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13577
13578 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13579 if test "${with_wrap_prefix+set}" = set; then
13580   withval="$with_wrap_prefix"
13581   NCURSES_WRAP_PREFIX=$withval
13582 else
13583   NCURSES_WRAP_PREFIX=_nc_
13584 fi;
13585         echo "$as_me:13585: result: $NCURSES_WRAP_PREFIX" >&5
13586 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13587 else
13588         NCURSES_WRAP_PREFIX=_nc_
13589 fi
13590
13591 cat >>confdefs.h <<EOF
13592 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13593 EOF
13594
13595 ###############################################################################
13596
13597 ###     use option --disable-echo to suppress full display compiling commands
13598
13599 echo "$as_me:13599: checking if you want to see long compiling messages" >&5
13600 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13601
13602 # Check whether --enable-echo or --disable-echo was given.
13603 if test "${enable_echo+set}" = set; then
13604   enableval="$enable_echo"
13605   test "$enableval" != no && enableval=yes
13606         if test "$enableval" != "yes" ; then
13607
13608         ECHO_LT='--silent'
13609         ECHO_LD='@echo linking $@;'
13610         RULE_CC='@echo compiling $<'
13611         SHOW_CC='@echo compiling $@'
13612         ECHO_CC='@'
13613
13614         else
13615
13616         ECHO_LT=''
13617         ECHO_LD=''
13618         RULE_CC=''
13619         SHOW_CC=''
13620         ECHO_CC=''
13621
13622         fi
13623 else
13624   enableval=yes
13625
13626         ECHO_LT=''
13627         ECHO_LD=''
13628         RULE_CC=''
13629         SHOW_CC=''
13630         ECHO_CC=''
13631
13632 fi;
13633 echo "$as_me:13633: result: $enableval" >&5
13634 echo "${ECHO_T}$enableval" >&6
13635
13636 ###     use option --enable-warnings to turn on all gcc warnings
13637 echo "$as_me:13637: checking if you want to see compiler warnings" >&5
13638 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13639
13640 # Check whether --enable-warnings or --disable-warnings was given.
13641 if test "${enable_warnings+set}" = set; then
13642   enableval="$enable_warnings"
13643   with_warnings=$enableval
13644 fi;
13645 echo "$as_me:13645: result: $with_warnings" >&5
13646 echo "${ECHO_T}$with_warnings" >&6
13647
13648 if test "x$with_warnings" = "xyes"; then
13649
13650         ADAFLAGS="$ADAFLAGS -gnatg"
13651
13652 INTEL_COMPILER=no
13653
13654 if test "$GCC" = yes ; then
13655         case $host_os in
13656         (linux*|gnu*)
13657                 echo "$as_me:13657: checking if this is really Intel C compiler" >&5
13658 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
13659                 cf_save_CFLAGS="$CFLAGS"
13660                 CFLAGS="$CFLAGS -no-gcc"
13661                 cat >conftest.$ac_ext <<_ACEOF
13662 #line 13662 "configure"
13663 #include "confdefs.h"
13664
13665 int
13666 main (void)
13667 {
13668
13669 #ifdef __INTEL_COMPILER
13670 #else
13671 make an error
13672 #endif
13673
13674   ;
13675   return 0;
13676 }
13677 _ACEOF
13678 rm -f conftest.$ac_objext
13679 if { (eval echo "$as_me:13679: \"$ac_compile\"") >&5
13680   (eval $ac_compile) 2>&5
13681   ac_status=$?
13682   echo "$as_me:13682: \$? = $ac_status" >&5
13683   (exit $ac_status); } &&
13684          { ac_try='test -s conftest.$ac_objext'
13685   { (eval echo "$as_me:13685: \"$ac_try\"") >&5
13686   (eval $ac_try) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); }; }; then
13690   INTEL_COMPILER=yes
13691 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
13692
13693 else
13694   echo "$as_me: failed program was:" >&5
13695 cat conftest.$ac_ext >&5
13696 fi
13697 rm -f conftest.$ac_objext conftest.$ac_ext
13698                 CFLAGS="$cf_save_CFLAGS"
13699                 echo "$as_me:13699: result: $INTEL_COMPILER" >&5
13700 echo "${ECHO_T}$INTEL_COMPILER" >&6
13701                 ;;
13702         esac
13703 fi
13704
13705 CLANG_COMPILER=no
13706
13707 if test "$GCC" = yes ; then
13708         echo "$as_me:13708: checking if this is really Clang C compiler" >&5
13709 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
13710         cf_save_CFLAGS="$CFLAGS"
13711         CFLAGS="$CFLAGS -Qunused-arguments"
13712         cat >conftest.$ac_ext <<_ACEOF
13713 #line 13713 "configure"
13714 #include "confdefs.h"
13715
13716 int
13717 main (void)
13718 {
13719
13720 #ifdef __clang__
13721 #else
13722 make an error
13723 #endif
13724
13725   ;
13726   return 0;
13727 }
13728 _ACEOF
13729 rm -f conftest.$ac_objext
13730 if { (eval echo "$as_me:13730: \"$ac_compile\"") >&5
13731   (eval $ac_compile) 2>&5
13732   ac_status=$?
13733   echo "$as_me:13733: \$? = $ac_status" >&5
13734   (exit $ac_status); } &&
13735          { ac_try='test -s conftest.$ac_objext'
13736   { (eval echo "$as_me:13736: \"$ac_try\"") >&5
13737   (eval $ac_try) 2>&5
13738   ac_status=$?
13739   echo "$as_me:13739: \$? = $ac_status" >&5
13740   (exit $ac_status); }; }; then
13741   CLANG_COMPILER=yes
13742 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
13743
13744 else
13745   echo "$as_me: failed program was:" >&5
13746 cat conftest.$ac_ext >&5
13747 fi
13748 rm -f conftest.$ac_objext conftest.$ac_ext
13749         CFLAGS="$cf_save_CFLAGS"
13750         echo "$as_me:13750: result: $CLANG_COMPILER" >&5
13751 echo "${ECHO_T}$CLANG_COMPILER" >&6
13752 fi
13753
13754 cat > conftest.$ac_ext <<EOF
13755 #line 13755 "${as_me:-configure}"
13756 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13757 EOF
13758
13759 if test "$INTEL_COMPILER" = yes
13760 then
13761 # The "-wdXXX" options suppress warnings:
13762 # remark #1419: external declaration in primary source file
13763 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13764 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13765 # remark #193: zero used for undefined preprocessing identifier
13766 # remark #593: variable "curs_sb_left_arrow" was set but never used
13767 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13768 # remark #869: parameter "tw" was never referenced
13769 # remark #981: operands are evaluated in unspecified order
13770 # warning #279: controlling expression is constant
13771
13772         { echo "$as_me:13772: checking for $CC warning options..." >&5
13773 echo "$as_me: checking for $CC warning options..." >&6;}
13774         cf_save_CFLAGS="$CFLAGS"
13775         EXTRA_CFLAGS="-Wall"
13776         for cf_opt in \
13777                 wd1419 \
13778                 wd1683 \
13779                 wd1684 \
13780                 wd193 \
13781                 wd593 \
13782                 wd279 \
13783                 wd810 \
13784                 wd869 \
13785                 wd981
13786         do
13787                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13788                 if { (eval echo "$as_me:13788: \"$ac_compile\"") >&5
13789   (eval $ac_compile) 2>&5
13790   ac_status=$?
13791   echo "$as_me:13791: \$? = $ac_status" >&5
13792   (exit $ac_status); }; then
13793                         test -n "$verbose" && echo "$as_me:13793: result: ... -$cf_opt" >&5
13794 echo "${ECHO_T}... -$cf_opt" >&6
13795                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13796                 fi
13797         done
13798         CFLAGS="$cf_save_CFLAGS"
13799
13800 elif test "$GCC" = yes
13801 then
13802         { echo "$as_me:13802: checking for $CC warning options..." >&5
13803 echo "$as_me: checking for $CC warning options..." >&6;}
13804         cf_save_CFLAGS="$CFLAGS"
13805         EXTRA_CFLAGS=
13806         cf_warn_CONST=""
13807         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13808         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13809         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13810         for cf_opt in W Wall \
13811                 Wbad-function-cast \
13812                 Wcast-align \
13813                 Wcast-qual \
13814                 Wdeclaration-after-statement \
13815                 Wextra \
13816                 Winline \
13817                 Wmissing-declarations \
13818                 Wmissing-prototypes \
13819                 Wnested-externs \
13820                 Wpointer-arith \
13821                 Wshadow \
13822                 Wstrict-prototypes \
13823                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
13824         do
13825                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13826                 if { (eval echo "$as_me:13826: \"$ac_compile\"") >&5
13827   (eval $ac_compile) 2>&5
13828   ac_status=$?
13829   echo "$as_me:13829: \$? = $ac_status" >&5
13830   (exit $ac_status); }; then
13831                         test -n "$verbose" && echo "$as_me:13831: result: ... -$cf_opt" >&5
13832 echo "${ECHO_T}... -$cf_opt" >&6
13833                         case $cf_opt in
13834                         (Wcast-qual)
13835
13836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13837         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13838
13839                                 ;;
13840                         (Winline)
13841                                 case $GCC_VERSION in
13842                                 ([34].*)
13843                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13844
13845 echo "${as_me:-configure}:13845: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13846
13847                                         continue;;
13848                                 esac
13849                                 ;;
13850                         (Wpointer-arith)
13851                                 case $GCC_VERSION in
13852                                 ([12].*)
13853                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13854
13855 echo "${as_me:-configure}:13855: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13856
13857                                         continue;;
13858                                 esac
13859                                 ;;
13860                         esac
13861                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13862                 fi
13863         done
13864         CFLAGS="$cf_save_CFLAGS"
13865 fi
13866 rm -rf conftest*
13867
13868 fi
13869
13870 if test "$GCC" = yes
13871 then
13872 cat > conftest.i <<EOF
13873 #ifndef GCC_PRINTF
13874 #define GCC_PRINTF 0
13875 #endif
13876 #ifndef GCC_SCANF
13877 #define GCC_SCANF 0
13878 #endif
13879 #ifndef GCC_NORETURN
13880 #define GCC_NORETURN /* nothing */
13881 #endif
13882 #ifndef GCC_UNUSED
13883 #define GCC_UNUSED /* nothing */
13884 #endif
13885 EOF
13886 if test "$GCC" = yes
13887 then
13888         { echo "$as_me:13888: checking for $CC __attribute__ directives..." >&5
13889 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
13890 cat > conftest.$ac_ext <<EOF
13891 #line 13891 "${as_me:-configure}"
13892 #include "confdefs.h"
13893 #include "conftest.h"
13894 #include "conftest.i"
13895 #if     GCC_PRINTF
13896 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
13897 #else
13898 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
13899 #endif
13900 #if     GCC_SCANF
13901 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
13902 #else
13903 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
13904 #endif
13905 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
13906 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
13907 extern void foo(void) GCC_NORETURN;
13908 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
13909 EOF
13910         cf_printf_attribute=no
13911         cf_scanf_attribute=no
13912         for cf_attribute in scanf printf unused noreturn
13913         do
13914
13915 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13916
13917                 cf_directive="__attribute__(($cf_attribute))"
13918                 echo "checking for $CC $cf_directive" 1>&5
13919
13920                 case $cf_attribute in
13921                 (printf)
13922                         cf_printf_attribute=yes
13923                         cat >conftest.h <<EOF
13924 #define GCC_$cf_ATTRIBUTE 1
13925 EOF
13926                         ;;
13927                 (scanf)
13928                         cf_scanf_attribute=yes
13929                         cat >conftest.h <<EOF
13930 #define GCC_$cf_ATTRIBUTE 1
13931 EOF
13932                         ;;
13933                 (*)
13934                         cat >conftest.h <<EOF
13935 #define GCC_$cf_ATTRIBUTE $cf_directive
13936 EOF
13937                         ;;
13938                 esac
13939
13940                 if { (eval echo "$as_me:13940: \"$ac_compile\"") >&5
13941   (eval $ac_compile) 2>&5
13942   ac_status=$?
13943   echo "$as_me:13943: \$? = $ac_status" >&5
13944   (exit $ac_status); }; then
13945                         test -n "$verbose" && echo "$as_me:13945: result: ... $cf_attribute" >&5
13946 echo "${ECHO_T}... $cf_attribute" >&6
13947                         cat conftest.h >>confdefs.h
13948                         case $cf_attribute in
13949                         (noreturn)
13950
13951 cat >>confdefs.h <<EOF
13952 #define GCC_NORETURN $cf_directive
13953 EOF
13954
13955                                 ;;
13956                         (printf)
13957                                 cf_value='/* nothing */'
13958                                 if test "$cf_printf_attribute" != no ; then
13959                                         cf_value='__attribute__((format(printf,fmt,var)))'
13960
13961 cat >>confdefs.h <<\EOF
13962 #define GCC_PRINTF 1
13963 EOF
13964
13965                                 fi
13966
13967 cat >>confdefs.h <<EOF
13968 #define GCC_PRINTFLIKE(fmt,var) $cf_value
13969 EOF
13970
13971                                 ;;
13972                         (scanf)
13973                                 cf_value='/* nothing */'
13974                                 if test "$cf_scanf_attribute" != no ; then
13975                                         cf_value='__attribute__((format(scanf,fmt,var)))'
13976
13977 cat >>confdefs.h <<\EOF
13978 #define GCC_SCANF 1
13979 EOF
13980
13981                                 fi
13982
13983 cat >>confdefs.h <<EOF
13984 #define GCC_SCANFLIKE(fmt,var) $cf_value
13985 EOF
13986
13987                                 ;;
13988                         (unused)
13989
13990 cat >>confdefs.h <<EOF
13991 #define GCC_UNUSED $cf_directive
13992 EOF
13993
13994                                 ;;
13995                         esac
13996                 fi
13997         done
13998 else
13999         fgrep define conftest.i >>confdefs.h
14000 fi
14001 rm -rf conftest*
14002 fi
14003
14004 ###     use option --enable-assertions to turn on generation of assertion code
14005 echo "$as_me:14005: checking if you want to enable runtime assertions" >&5
14006 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14007
14008 # Check whether --enable-assertions or --disable-assertions was given.
14009 if test "${enable_assertions+set}" = set; then
14010   enableval="$enable_assertions"
14011   with_assertions=$enableval
14012 else
14013   with_assertions=no
14014 fi;
14015 echo "$as_me:14015: result: $with_assertions" >&5
14016 echo "${ECHO_T}$with_assertions" >&6
14017 if test -n "$GCC"
14018 then
14019         if test "$with_assertions" = no
14020         then
14021                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14022         else
14023
14024         ADAFLAGS="$ADAFLAGS -gnata"
14025
14026         fi
14027 fi
14028
14029 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14030
14031 cat >>confdefs.h <<\EOF
14032 #define HAVE_NC_ALLOC_H 1
14033 EOF
14034
14035 ###     use option --enable-expanded to generate certain macros as functions
14036
14037 # Check whether --enable-expanded or --disable-expanded was given.
14038 if test "${enable_expanded+set}" = set; then
14039   enableval="$enable_expanded"
14040   test "$enableval" = yes &&
14041 cat >>confdefs.h <<\EOF
14042 #define NCURSES_EXPANDED 1
14043 EOF
14044
14045 fi;
14046
14047 ###     use option --disable-macros to suppress macros in favor of functions
14048
14049 # Check whether --enable-macros or --disable-macros was given.
14050 if test "${enable_macros+set}" = set; then
14051   enableval="$enable_macros"
14052   test "$enableval" = no &&
14053 cat >>confdefs.h <<\EOF
14054 #define NCURSES_NOMACROS 1
14055 EOF
14056
14057 fi;
14058
14059 # Normally we only add trace() to the debug-library.  Allow this to be
14060 # extended to all models of the ncurses library:
14061 cf_all_traces=no
14062 case "$CFLAGS $CPPFLAGS" in
14063 (*-DTRACE*)
14064         cf_all_traces=yes
14065         ;;
14066 esac
14067
14068 echo "$as_me:14068: checking whether to add trace feature to all models" >&5
14069 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14070
14071 # Check whether --with-trace or --without-trace was given.
14072 if test "${with_trace+set}" = set; then
14073   withval="$with_trace"
14074   cf_with_trace=$withval
14075 else
14076   cf_with_trace=$cf_all_traces
14077 fi;
14078 echo "$as_me:14078: result: $cf_with_trace" >&5
14079 echo "${ECHO_T}$cf_with_trace" >&6
14080
14081 if test "$cf_with_trace" = yes ; then
14082         ADA_TRACE=TRUE
14083
14084 cf_fix_cppflags=no
14085 cf_new_cflags=
14086 cf_new_cppflags=
14087 cf_new_extra_cppflags=
14088
14089 for cf_add_cflags in -DTRACE
14090 do
14091 case $cf_fix_cppflags in
14092 (no)
14093         case $cf_add_cflags in
14094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14095                 case $cf_add_cflags in
14096                 (-D*)
14097                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14098
14099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14100                                 && test -z "${cf_tst_cflags}" \
14101                                 && cf_fix_cppflags=yes
14102
14103                         if test $cf_fix_cppflags = yes ; then
14104
14105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14107
14108                                 continue
14109                         elif test "${cf_tst_cflags}" = "\"'" ; then
14110
14111         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14112         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14113
14114                                 continue
14115                         fi
14116                         ;;
14117                 esac
14118                 case "$CPPFLAGS" in
14119                 (*$cf_add_cflags)
14120                         ;;
14121                 (*)
14122                         case $cf_add_cflags in
14123                         (-D*)
14124                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14125
14126 CPPFLAGS=`echo "$CPPFLAGS" | \
14127         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14128                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14129
14130                                 ;;
14131                         esac
14132
14133         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14134         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14135
14136                         ;;
14137                 esac
14138                 ;;
14139         (*)
14140
14141         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14142         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14143
14144                 ;;
14145         esac
14146         ;;
14147 (yes)
14148
14149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14151
14152         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14153
14154         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14155                 && test -z "${cf_tst_cflags}" \
14156                 && cf_fix_cppflags=no
14157         ;;
14158 esac
14159 done
14160
14161 if test -n "$cf_new_cflags" ; then
14162
14163         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14164         CFLAGS="${CFLAGS}$cf_new_cflags"
14165
14166 fi
14167
14168 if test -n "$cf_new_cppflags" ; then
14169
14170         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14171         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14172
14173 fi
14174
14175 if test -n "$cf_new_extra_cppflags" ; then
14176
14177         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14178         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14179
14180 fi
14181
14182 else
14183         ADA_TRACE=FALSE
14184 fi
14185
14186 echo "$as_me:14186: checking if we want to use GNAT projects" >&5
14187 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14188
14189 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14190 if test "${enable_gnat_projects+set}" = set; then
14191   enableval="$enable_gnat_projects"
14192   test "$enableval" != no && enableval=yes
14193         if test "$enableval" != "yes" ; then
14194     enable_gnat_projects=no
14195         else
14196                 enable_gnat_projects=yes
14197         fi
14198 else
14199   enableval=yes
14200         enable_gnat_projects=yes
14201
14202 fi;
14203 echo "$as_me:14203: result: $enable_gnat_projects" >&5
14204 echo "${ECHO_T}$enable_gnat_projects" >&6
14205
14206 ###     Checks for libraries.
14207 case $cf_cv_system_name in
14208 (*mingw32*)
14209         ;;
14210 (*)
14211 echo "$as_me:14211: checking for gettimeofday" >&5
14212 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14213 if test "${ac_cv_func_gettimeofday+set}" = set; then
14214   echo $ECHO_N "(cached) $ECHO_C" >&6
14215 else
14216   cat >conftest.$ac_ext <<_ACEOF
14217 #line 14217 "configure"
14218 #include "confdefs.h"
14219 #define gettimeofday autoconf_temporary
14220 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14221 #undef gettimeofday
14222
14223 #ifdef __cplusplus
14224 extern "C"
14225 #endif
14226
14227 /* We use char because int might match the return type of a gcc2
14228    builtin and then its argument prototype would still apply.  */
14229 char gettimeofday (void);
14230
14231 int
14232 main (void)
14233 {
14234
14235 /* The GNU C library defines stubs for functions which it implements
14236     to always fail with ENOSYS.  Some functions are actually named
14237     something starting with __ and the normal name is an alias.  */
14238 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14239 #error found stub for gettimeofday
14240 #endif
14241
14242         return gettimeofday ();
14243   ;
14244   return 0;
14245 }
14246 _ACEOF
14247 rm -f conftest.$ac_objext conftest$ac_exeext
14248 if { (eval echo "$as_me:14248: \"$ac_link\"") >&5
14249   (eval $ac_link) 2>&5
14250   ac_status=$?
14251   echo "$as_me:14251: \$? = $ac_status" >&5
14252   (exit $ac_status); } &&
14253          { ac_try='test -s conftest$ac_exeext'
14254   { (eval echo "$as_me:14254: \"$ac_try\"") >&5
14255   (eval $ac_try) 2>&5
14256   ac_status=$?
14257   echo "$as_me:14257: \$? = $ac_status" >&5
14258   (exit $ac_status); }; }; then
14259   ac_cv_func_gettimeofday=yes
14260 else
14261   echo "$as_me: failed program was:" >&5
14262 cat conftest.$ac_ext >&5
14263 ac_cv_func_gettimeofday=no
14264 fi
14265 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14266 fi
14267 echo "$as_me:14267: result: $ac_cv_func_gettimeofday" >&5
14268 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14269 if test $ac_cv_func_gettimeofday = yes; then
14270   cat >>confdefs.h <<\EOF
14271 #define HAVE_GETTIMEOFDAY 1
14272 EOF
14273
14274 else
14275
14276 echo "$as_me:14276: checking for gettimeofday in -lbsd" >&5
14277 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14278 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14279   echo $ECHO_N "(cached) $ECHO_C" >&6
14280 else
14281   ac_check_lib_save_LIBS=$LIBS
14282 LIBS="-lbsd  $LIBS"
14283 cat >conftest.$ac_ext <<_ACEOF
14284 #line 14284 "configure"
14285 #include "confdefs.h"
14286
14287 /* Override any gcc2 internal prototype to avoid an error.  */
14288 #ifdef __cplusplus
14289 extern "C"
14290 #endif
14291 /* We use char because int might match the return type of a gcc2
14292    builtin and then its argument prototype would still apply.  */
14293 char gettimeofday ();
14294 int
14295 main (void)
14296 {
14297 gettimeofday ();
14298   ;
14299   return 0;
14300 }
14301 _ACEOF
14302 rm -f conftest.$ac_objext conftest$ac_exeext
14303 if { (eval echo "$as_me:14303: \"$ac_link\"") >&5
14304   (eval $ac_link) 2>&5
14305   ac_status=$?
14306   echo "$as_me:14306: \$? = $ac_status" >&5
14307   (exit $ac_status); } &&
14308          { ac_try='test -s conftest$ac_exeext'
14309   { (eval echo "$as_me:14309: \"$ac_try\"") >&5
14310   (eval $ac_try) 2>&5
14311   ac_status=$?
14312   echo "$as_me:14312: \$? = $ac_status" >&5
14313   (exit $ac_status); }; }; then
14314   ac_cv_lib_bsd_gettimeofday=yes
14315 else
14316   echo "$as_me: failed program was:" >&5
14317 cat conftest.$ac_ext >&5
14318 ac_cv_lib_bsd_gettimeofday=no
14319 fi
14320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14321 LIBS=$ac_check_lib_save_LIBS
14322 fi
14323 echo "$as_me:14323: result: $ac_cv_lib_bsd_gettimeofday" >&5
14324 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14325 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14326
14327 cat >>confdefs.h <<\EOF
14328 #define HAVE_GETTIMEOFDAY 1
14329 EOF
14330
14331         LIBS="$LIBS -lbsd"
14332 fi
14333
14334 fi
14335         ;;
14336 esac
14337
14338 ###     Checks for header files.
14339 echo "$as_me:14339: checking for ANSI C header files" >&5
14340 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14341 if test "${ac_cv_header_stdc+set}" = set; then
14342   echo $ECHO_N "(cached) $ECHO_C" >&6
14343 else
14344   cat >conftest.$ac_ext <<_ACEOF
14345 #line 14345 "configure"
14346 #include "confdefs.h"
14347 #include <stdlib.h>
14348 #include <stdarg.h>
14349 #include <string.h>
14350 #include <float.h>
14351
14352 _ACEOF
14353 if { (eval echo "$as_me:14353: \"$ac_cpp conftest.$ac_ext\"") >&5
14354   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14355   ac_status=$?
14356   egrep -v '^ *\+' conftest.er1 >conftest.err
14357   rm -f conftest.er1
14358   cat conftest.err >&5
14359   echo "$as_me:14359: \$? = $ac_status" >&5
14360   (exit $ac_status); } >/dev/null; then
14361   if test -s conftest.err; then
14362     ac_cpp_err=$ac_c_preproc_warn_flag
14363   else
14364     ac_cpp_err=
14365   fi
14366 else
14367   ac_cpp_err=yes
14368 fi
14369 if test -z "$ac_cpp_err"; then
14370   ac_cv_header_stdc=yes
14371 else
14372   echo "$as_me: failed program was:" >&5
14373   cat conftest.$ac_ext >&5
14374   ac_cv_header_stdc=no
14375 fi
14376 rm -f conftest.err conftest.$ac_ext
14377
14378 if test $ac_cv_header_stdc = yes; then
14379   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14380   cat >conftest.$ac_ext <<_ACEOF
14381 #line 14381 "configure"
14382 #include "confdefs.h"
14383 #include <string.h>
14384
14385 _ACEOF
14386 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14387   egrep "memchr" >/dev/null 2>&1; then
14388   :
14389 else
14390   ac_cv_header_stdc=no
14391 fi
14392 rm -rf conftest*
14393
14394 fi
14395
14396 if test $ac_cv_header_stdc = yes; then
14397   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14398   cat >conftest.$ac_ext <<_ACEOF
14399 #line 14399 "configure"
14400 #include "confdefs.h"
14401 #include <stdlib.h>
14402
14403 _ACEOF
14404 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14405   egrep "free" >/dev/null 2>&1; then
14406   :
14407 else
14408   ac_cv_header_stdc=no
14409 fi
14410 rm -rf conftest*
14411
14412 fi
14413
14414 if test $ac_cv_header_stdc = yes; then
14415   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14416   if test "$cross_compiling" = yes; then
14417   :
14418 else
14419   cat >conftest.$ac_ext <<_ACEOF
14420 #line 14420 "configure"
14421 #include "confdefs.h"
14422 #include <ctype.h>
14423 #if ((' ' & 0x0FF) == 0x020)
14424 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14425 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14426 #else
14427 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14428                      || ('j' <= (c) && (c) <= 'r') \
14429                      || ('s' <= (c) && (c) <= 'z'))
14430 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14431 #endif
14432
14433 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14434 int
14435 main (void)
14436 {
14437   int i;
14438   for (i = 0; i < 256; i++)
14439     if (XOR (islower (i), ISLOWER (i))
14440         || toupper (i) != TOUPPER (i))
14441       $ac_main_return(2);
14442   $ac_main_return (0);
14443 }
14444 _ACEOF
14445 rm -f conftest$ac_exeext
14446 if { (eval echo "$as_me:14446: \"$ac_link\"") >&5
14447   (eval $ac_link) 2>&5
14448   ac_status=$?
14449   echo "$as_me:14449: \$? = $ac_status" >&5
14450   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14451   { (eval echo "$as_me:14451: \"$ac_try\"") >&5
14452   (eval $ac_try) 2>&5
14453   ac_status=$?
14454   echo "$as_me:14454: \$? = $ac_status" >&5
14455   (exit $ac_status); }; }; then
14456   :
14457 else
14458   echo "$as_me: program exited with status $ac_status" >&5
14459 echo "$as_me: failed program was:" >&5
14460 cat conftest.$ac_ext >&5
14461 ac_cv_header_stdc=no
14462 fi
14463 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14464 fi
14465 fi
14466 fi
14467 echo "$as_me:14467: result: $ac_cv_header_stdc" >&5
14468 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14469 if test $ac_cv_header_stdc = yes; then
14470
14471 cat >>confdefs.h <<\EOF
14472 #define STDC_HEADERS 1
14473 EOF
14474
14475 fi
14476
14477 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14478
14479 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14480                   inttypes.h stdint.h unistd.h
14481 do
14482 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14483 echo "$as_me:14483: checking for $ac_header" >&5
14484 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14485 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14486   echo $ECHO_N "(cached) $ECHO_C" >&6
14487 else
14488   cat >conftest.$ac_ext <<_ACEOF
14489 #line 14489 "configure"
14490 #include "confdefs.h"
14491 $ac_includes_default
14492 #include <$ac_header>
14493 _ACEOF
14494 rm -f conftest.$ac_objext
14495 if { (eval echo "$as_me:14495: \"$ac_compile\"") >&5
14496   (eval $ac_compile) 2>&5
14497   ac_status=$?
14498   echo "$as_me:14498: \$? = $ac_status" >&5
14499   (exit $ac_status); } &&
14500          { ac_try='test -s conftest.$ac_objext'
14501   { (eval echo "$as_me:14501: \"$ac_try\"") >&5
14502   (eval $ac_try) 2>&5
14503   ac_status=$?
14504   echo "$as_me:14504: \$? = $ac_status" >&5
14505   (exit $ac_status); }; }; then
14506   eval "$as_ac_Header=yes"
14507 else
14508   echo "$as_me: failed program was:" >&5
14509 cat conftest.$ac_ext >&5
14510 eval "$as_ac_Header=no"
14511 fi
14512 rm -f conftest.$ac_objext conftest.$ac_ext
14513 fi
14514 echo "$as_me:14514: result: `eval echo '${'$as_ac_Header'}'`" >&5
14515 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14516 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14517   cat >>confdefs.h <<EOF
14518 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14519 EOF
14520
14521 fi
14522 done
14523
14524 echo "$as_me:14524: checking for signed char" >&5
14525 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14526 if test "${ac_cv_type_signed_char+set}" = set; then
14527   echo $ECHO_N "(cached) $ECHO_C" >&6
14528 else
14529   cat >conftest.$ac_ext <<_ACEOF
14530 #line 14530 "configure"
14531 #include "confdefs.h"
14532 $ac_includes_default
14533 int
14534 main (void)
14535 {
14536 if ((signed char *) 0)
14537   return 0;
14538 if (sizeof (signed char))
14539   return 0;
14540   ;
14541   return 0;
14542 }
14543 _ACEOF
14544 rm -f conftest.$ac_objext
14545 if { (eval echo "$as_me:14545: \"$ac_compile\"") >&5
14546   (eval $ac_compile) 2>&5
14547   ac_status=$?
14548   echo "$as_me:14548: \$? = $ac_status" >&5
14549   (exit $ac_status); } &&
14550          { ac_try='test -s conftest.$ac_objext'
14551   { (eval echo "$as_me:14551: \"$ac_try\"") >&5
14552   (eval $ac_try) 2>&5
14553   ac_status=$?
14554   echo "$as_me:14554: \$? = $ac_status" >&5
14555   (exit $ac_status); }; }; then
14556   ac_cv_type_signed_char=yes
14557 else
14558   echo "$as_me: failed program was:" >&5
14559 cat conftest.$ac_ext >&5
14560 ac_cv_type_signed_char=no
14561 fi
14562 rm -f conftest.$ac_objext conftest.$ac_ext
14563 fi
14564 echo "$as_me:14564: result: $ac_cv_type_signed_char" >&5
14565 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14566
14567 echo "$as_me:14567: checking size of signed char" >&5
14568 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14569 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14570   echo $ECHO_N "(cached) $ECHO_C" >&6
14571 else
14572   if test "$ac_cv_type_signed_char" = yes; then
14573   if test "$cross_compiling" = yes; then
14574   # Depending upon the size, compute the lo and hi bounds.
14575 cat >conftest.$ac_ext <<_ACEOF
14576 #line 14576 "configure"
14577 #include "confdefs.h"
14578 $ac_includes_default
14579 int
14580 main (void)
14581 {
14582 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14583   ;
14584   return 0;
14585 }
14586 _ACEOF
14587 rm -f conftest.$ac_objext
14588 if { (eval echo "$as_me:14588: \"$ac_compile\"") >&5
14589   (eval $ac_compile) 2>&5
14590   ac_status=$?
14591   echo "$as_me:14591: \$? = $ac_status" >&5
14592   (exit $ac_status); } &&
14593          { ac_try='test -s conftest.$ac_objext'
14594   { (eval echo "$as_me:14594: \"$ac_try\"") >&5
14595   (eval $ac_try) 2>&5
14596   ac_status=$?
14597   echo "$as_me:14597: \$? = $ac_status" >&5
14598   (exit $ac_status); }; }; then
14599   ac_lo=0 ac_mid=0
14600   while :; do
14601     cat >conftest.$ac_ext <<_ACEOF
14602 #line 14602 "configure"
14603 #include "confdefs.h"
14604 $ac_includes_default
14605 int
14606 main (void)
14607 {
14608 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14609   ;
14610   return 0;
14611 }
14612 _ACEOF
14613 rm -f conftest.$ac_objext
14614 if { (eval echo "$as_me:14614: \"$ac_compile\"") >&5
14615   (eval $ac_compile) 2>&5
14616   ac_status=$?
14617   echo "$as_me:14617: \$? = $ac_status" >&5
14618   (exit $ac_status); } &&
14619          { ac_try='test -s conftest.$ac_objext'
14620   { (eval echo "$as_me:14620: \"$ac_try\"") >&5
14621   (eval $ac_try) 2>&5
14622   ac_status=$?
14623   echo "$as_me:14623: \$? = $ac_status" >&5
14624   (exit $ac_status); }; }; then
14625   ac_hi=$ac_mid; break
14626 else
14627   echo "$as_me: failed program was:" >&5
14628 cat conftest.$ac_ext >&5
14629 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14630 fi
14631 rm -f conftest.$ac_objext conftest.$ac_ext
14632   done
14633 else
14634   echo "$as_me: failed program was:" >&5
14635 cat conftest.$ac_ext >&5
14636 ac_hi=-1 ac_mid=-1
14637   while :; do
14638     cat >conftest.$ac_ext <<_ACEOF
14639 #line 14639 "configure"
14640 #include "confdefs.h"
14641 $ac_includes_default
14642 int
14643 main (void)
14644 {
14645 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14646   ;
14647   return 0;
14648 }
14649 _ACEOF
14650 rm -f conftest.$ac_objext
14651 if { (eval echo "$as_me:14651: \"$ac_compile\"") >&5
14652   (eval $ac_compile) 2>&5
14653   ac_status=$?
14654   echo "$as_me:14654: \$? = $ac_status" >&5
14655   (exit $ac_status); } &&
14656          { ac_try='test -s conftest.$ac_objext'
14657   { (eval echo "$as_me:14657: \"$ac_try\"") >&5
14658   (eval $ac_try) 2>&5
14659   ac_status=$?
14660   echo "$as_me:14660: \$? = $ac_status" >&5
14661   (exit $ac_status); }; }; then
14662   ac_lo=$ac_mid; break
14663 else
14664   echo "$as_me: failed program was:" >&5
14665 cat conftest.$ac_ext >&5
14666 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14667 fi
14668 rm -f conftest.$ac_objext conftest.$ac_ext
14669   done
14670 fi
14671 rm -f conftest.$ac_objext conftest.$ac_ext
14672 # Binary search between lo and hi bounds.
14673 while test "x$ac_lo" != "x$ac_hi"; do
14674   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14675   cat >conftest.$ac_ext <<_ACEOF
14676 #line 14676 "configure"
14677 #include "confdefs.h"
14678 $ac_includes_default
14679 int
14680 main (void)
14681 {
14682 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14683   ;
14684   return 0;
14685 }
14686 _ACEOF
14687 rm -f conftest.$ac_objext
14688 if { (eval echo "$as_me:14688: \"$ac_compile\"") >&5
14689   (eval $ac_compile) 2>&5
14690   ac_status=$?
14691   echo "$as_me:14691: \$? = $ac_status" >&5
14692   (exit $ac_status); } &&
14693          { ac_try='test -s conftest.$ac_objext'
14694   { (eval echo "$as_me:14694: \"$ac_try\"") >&5
14695   (eval $ac_try) 2>&5
14696   ac_status=$?
14697   echo "$as_me:14697: \$? = $ac_status" >&5
14698   (exit $ac_status); }; }; then
14699   ac_hi=$ac_mid
14700 else
14701   echo "$as_me: failed program was:" >&5
14702 cat conftest.$ac_ext >&5
14703 ac_lo=`expr $ac_mid + 1`
14704 fi
14705 rm -f conftest.$ac_objext conftest.$ac_ext
14706 done
14707 ac_cv_sizeof_signed_char=$ac_lo
14708 else
14709   if test "$cross_compiling" = yes; then
14710   { { echo "$as_me:14710: error: cannot run test program while cross compiling" >&5
14711 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14712    { (exit 1); exit 1; }; }
14713 else
14714   cat >conftest.$ac_ext <<_ACEOF
14715 #line 14715 "configure"
14716 #include "confdefs.h"
14717 $ac_includes_default
14718 int
14719 main (void)
14720 {
14721 FILE *f = fopen ("conftest.val", "w");
14722 if (!f)
14723   $ac_main_return (1);
14724 fprintf (f, "%d", (sizeof (signed char)));
14725 fclose (f);
14726   ;
14727   return 0;
14728 }
14729 _ACEOF
14730 rm -f conftest$ac_exeext
14731 if { (eval echo "$as_me:14731: \"$ac_link\"") >&5
14732   (eval $ac_link) 2>&5
14733   ac_status=$?
14734   echo "$as_me:14734: \$? = $ac_status" >&5
14735   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14736   { (eval echo "$as_me:14736: \"$ac_try\"") >&5
14737   (eval $ac_try) 2>&5
14738   ac_status=$?
14739   echo "$as_me:14739: \$? = $ac_status" >&5
14740   (exit $ac_status); }; }; then
14741   ac_cv_sizeof_signed_char=`cat conftest.val`
14742 else
14743   echo "$as_me: program exited with status $ac_status" >&5
14744 echo "$as_me: failed program was:" >&5
14745 cat conftest.$ac_ext >&5
14746 fi
14747 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14748 fi
14749 fi
14750 rm -f conftest.val
14751 else
14752   ac_cv_sizeof_signed_char=0
14753 fi
14754 fi
14755 echo "$as_me:14755: result: $ac_cv_sizeof_signed_char" >&5
14756 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14757 cat >>confdefs.h <<EOF
14758 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14759 EOF
14760
14761 echo "$as_me:14761: checking for ANSI C header files" >&5
14762 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14763 if test "${ac_cv_header_stdc+set}" = set; then
14764   echo $ECHO_N "(cached) $ECHO_C" >&6
14765 else
14766   cat >conftest.$ac_ext <<_ACEOF
14767 #line 14767 "configure"
14768 #include "confdefs.h"
14769 #include <stdlib.h>
14770 #include <stdarg.h>
14771 #include <string.h>
14772 #include <float.h>
14773
14774 _ACEOF
14775 if { (eval echo "$as_me:14775: \"$ac_cpp conftest.$ac_ext\"") >&5
14776   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14777   ac_status=$?
14778   egrep -v '^ *\+' conftest.er1 >conftest.err
14779   rm -f conftest.er1
14780   cat conftest.err >&5
14781   echo "$as_me:14781: \$? = $ac_status" >&5
14782   (exit $ac_status); } >/dev/null; then
14783   if test -s conftest.err; then
14784     ac_cpp_err=$ac_c_preproc_warn_flag
14785   else
14786     ac_cpp_err=
14787   fi
14788 else
14789   ac_cpp_err=yes
14790 fi
14791 if test -z "$ac_cpp_err"; then
14792   ac_cv_header_stdc=yes
14793 else
14794   echo "$as_me: failed program was:" >&5
14795   cat conftest.$ac_ext >&5
14796   ac_cv_header_stdc=no
14797 fi
14798 rm -f conftest.err conftest.$ac_ext
14799
14800 if test $ac_cv_header_stdc = yes; then
14801   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14802   cat >conftest.$ac_ext <<_ACEOF
14803 #line 14803 "configure"
14804 #include "confdefs.h"
14805 #include <string.h>
14806
14807 _ACEOF
14808 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14809   egrep "memchr" >/dev/null 2>&1; then
14810   :
14811 else
14812   ac_cv_header_stdc=no
14813 fi
14814 rm -rf conftest*
14815
14816 fi
14817
14818 if test $ac_cv_header_stdc = yes; then
14819   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14820   cat >conftest.$ac_ext <<_ACEOF
14821 #line 14821 "configure"
14822 #include "confdefs.h"
14823 #include <stdlib.h>
14824
14825 _ACEOF
14826 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14827   egrep "free" >/dev/null 2>&1; then
14828   :
14829 else
14830   ac_cv_header_stdc=no
14831 fi
14832 rm -rf conftest*
14833
14834 fi
14835
14836 if test $ac_cv_header_stdc = yes; then
14837   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14838   if test "$cross_compiling" = yes; then
14839   :
14840 else
14841   cat >conftest.$ac_ext <<_ACEOF
14842 #line 14842 "configure"
14843 #include "confdefs.h"
14844 #include <ctype.h>
14845 #if ((' ' & 0x0FF) == 0x020)
14846 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14847 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14848 #else
14849 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14850                      || ('j' <= (c) && (c) <= 'r') \
14851                      || ('s' <= (c) && (c) <= 'z'))
14852 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14853 #endif
14854
14855 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14856 int
14857 main (void)
14858 {
14859   int i;
14860   for (i = 0; i < 256; i++)
14861     if (XOR (islower (i), ISLOWER (i))
14862         || toupper (i) != TOUPPER (i))
14863       $ac_main_return(2);
14864   $ac_main_return (0);
14865 }
14866 _ACEOF
14867 rm -f conftest$ac_exeext
14868 if { (eval echo "$as_me:14868: \"$ac_link\"") >&5
14869   (eval $ac_link) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14873   { (eval echo "$as_me:14873: \"$ac_try\"") >&5
14874   (eval $ac_try) 2>&5
14875   ac_status=$?
14876   echo "$as_me:14876: \$? = $ac_status" >&5
14877   (exit $ac_status); }; }; then
14878   :
14879 else
14880   echo "$as_me: program exited with status $ac_status" >&5
14881 echo "$as_me: failed program was:" >&5
14882 cat conftest.$ac_ext >&5
14883 ac_cv_header_stdc=no
14884 fi
14885 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14886 fi
14887 fi
14888 fi
14889 echo "$as_me:14889: result: $ac_cv_header_stdc" >&5
14890 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14891 if test $ac_cv_header_stdc = yes; then
14892
14893 cat >>confdefs.h <<\EOF
14894 #define STDC_HEADERS 1
14895 EOF
14896
14897 fi
14898
14899 ac_header_dirent=no
14900 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
14901   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
14902 echo "$as_me:14902: checking for $ac_hdr that defines DIR" >&5
14903 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
14904 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14905   echo $ECHO_N "(cached) $ECHO_C" >&6
14906 else
14907   cat >conftest.$ac_ext <<_ACEOF
14908 #line 14908 "configure"
14909 #include "confdefs.h"
14910 #include <sys/types.h>
14911 #include <$ac_hdr>
14912
14913 int
14914 main (void)
14915 {
14916 if ((DIR *) 0)
14917 return 0;
14918   ;
14919   return 0;
14920 }
14921 _ACEOF
14922 rm -f conftest.$ac_objext
14923 if { (eval echo "$as_me:14923: \"$ac_compile\"") >&5
14924   (eval $ac_compile) 2>&5
14925   ac_status=$?
14926   echo "$as_me:14926: \$? = $ac_status" >&5
14927   (exit $ac_status); } &&
14928          { ac_try='test -s conftest.$ac_objext'
14929   { (eval echo "$as_me:14929: \"$ac_try\"") >&5
14930   (eval $ac_try) 2>&5
14931   ac_status=$?
14932   echo "$as_me:14932: \$? = $ac_status" >&5
14933   (exit $ac_status); }; }; then
14934   eval "$as_ac_Header=yes"
14935 else
14936   echo "$as_me: failed program was:" >&5
14937 cat conftest.$ac_ext >&5
14938 eval "$as_ac_Header=no"
14939 fi
14940 rm -f conftest.$ac_objext conftest.$ac_ext
14941 fi
14942 echo "$as_me:14942: result: `eval echo '${'$as_ac_Header'}'`" >&5
14943 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14944 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14945   cat >>confdefs.h <<EOF
14946 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
14947 EOF
14948
14949 ac_header_dirent=$ac_hdr; break
14950 fi
14951
14952 done
14953 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
14954 if test $ac_header_dirent = dirent.h; then
14955   echo "$as_me:14955: checking for opendir in -ldir" >&5
14956 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
14957 if test "${ac_cv_lib_dir_opendir+set}" = set; then
14958   echo $ECHO_N "(cached) $ECHO_C" >&6
14959 else
14960   ac_check_lib_save_LIBS=$LIBS
14961 LIBS="-ldir  $LIBS"
14962 cat >conftest.$ac_ext <<_ACEOF
14963 #line 14963 "configure"
14964 #include "confdefs.h"
14965
14966 /* Override any gcc2 internal prototype to avoid an error.  */
14967 #ifdef __cplusplus
14968 extern "C"
14969 #endif
14970 /* We use char because int might match the return type of a gcc2
14971    builtin and then its argument prototype would still apply.  */
14972 char opendir ();
14973 int
14974 main (void)
14975 {
14976 opendir ();
14977   ;
14978   return 0;
14979 }
14980 _ACEOF
14981 rm -f conftest.$ac_objext conftest$ac_exeext
14982 if { (eval echo "$as_me:14982: \"$ac_link\"") >&5
14983   (eval $ac_link) 2>&5
14984   ac_status=$?
14985   echo "$as_me:14985: \$? = $ac_status" >&5
14986   (exit $ac_status); } &&
14987          { ac_try='test -s conftest$ac_exeext'
14988   { (eval echo "$as_me:14988: \"$ac_try\"") >&5
14989   (eval $ac_try) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); }; }; then
14993   ac_cv_lib_dir_opendir=yes
14994 else
14995   echo "$as_me: failed program was:" >&5
14996 cat conftest.$ac_ext >&5
14997 ac_cv_lib_dir_opendir=no
14998 fi
14999 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15000 LIBS=$ac_check_lib_save_LIBS
15001 fi
15002 echo "$as_me:15002: result: $ac_cv_lib_dir_opendir" >&5
15003 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15004 if test $ac_cv_lib_dir_opendir = yes; then
15005   LIBS="$LIBS -ldir"
15006 fi
15007
15008 else
15009   echo "$as_me:15009: checking for opendir in -lx" >&5
15010 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15011 if test "${ac_cv_lib_x_opendir+set}" = set; then
15012   echo $ECHO_N "(cached) $ECHO_C" >&6
15013 else
15014   ac_check_lib_save_LIBS=$LIBS
15015 LIBS="-lx  $LIBS"
15016 cat >conftest.$ac_ext <<_ACEOF
15017 #line 15017 "configure"
15018 #include "confdefs.h"
15019
15020 /* Override any gcc2 internal prototype to avoid an error.  */
15021 #ifdef __cplusplus
15022 extern "C"
15023 #endif
15024 /* We use char because int might match the return type of a gcc2
15025    builtin and then its argument prototype would still apply.  */
15026 char opendir ();
15027 int
15028 main (void)
15029 {
15030 opendir ();
15031   ;
15032   return 0;
15033 }
15034 _ACEOF
15035 rm -f conftest.$ac_objext 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); } &&
15041          { ac_try='test -s conftest$ac_exeext'
15042   { (eval echo "$as_me:15042: \"$ac_try\"") >&5
15043   (eval $ac_try) 2>&5
15044   ac_status=$?
15045   echo "$as_me:15045: \$? = $ac_status" >&5
15046   (exit $ac_status); }; }; then
15047   ac_cv_lib_x_opendir=yes
15048 else
15049   echo "$as_me: failed program was:" >&5
15050 cat conftest.$ac_ext >&5
15051 ac_cv_lib_x_opendir=no
15052 fi
15053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15054 LIBS=$ac_check_lib_save_LIBS
15055 fi
15056 echo "$as_me:15056: result: $ac_cv_lib_x_opendir" >&5
15057 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15058 if test $ac_cv_lib_x_opendir = yes; then
15059   LIBS="$LIBS -lx"
15060 fi
15061
15062 fi
15063
15064 echo "$as_me:15064: checking whether time.h and sys/time.h may both be included" >&5
15065 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15066 if test "${ac_cv_header_time+set}" = set; then
15067   echo $ECHO_N "(cached) $ECHO_C" >&6
15068 else
15069   cat >conftest.$ac_ext <<_ACEOF
15070 #line 15070 "configure"
15071 #include "confdefs.h"
15072 #include <sys/types.h>
15073 #include <sys/time.h>
15074 #include <time.h>
15075
15076 int
15077 main (void)
15078 {
15079 if ((struct tm *) 0)
15080 return 0;
15081   ;
15082   return 0;
15083 }
15084 _ACEOF
15085 rm -f conftest.$ac_objext
15086 if { (eval echo "$as_me:15086: \"$ac_compile\"") >&5
15087   (eval $ac_compile) 2>&5
15088   ac_status=$?
15089   echo "$as_me:15089: \$? = $ac_status" >&5
15090   (exit $ac_status); } &&
15091          { ac_try='test -s conftest.$ac_objext'
15092   { (eval echo "$as_me:15092: \"$ac_try\"") >&5
15093   (eval $ac_try) 2>&5
15094   ac_status=$?
15095   echo "$as_me:15095: \$? = $ac_status" >&5
15096   (exit $ac_status); }; }; then
15097   ac_cv_header_time=yes
15098 else
15099   echo "$as_me: failed program was:" >&5
15100 cat conftest.$ac_ext >&5
15101 ac_cv_header_time=no
15102 fi
15103 rm -f conftest.$ac_objext conftest.$ac_ext
15104 fi
15105 echo "$as_me:15105: result: $ac_cv_header_time" >&5
15106 echo "${ECHO_T}$ac_cv_header_time" >&6
15107 if test $ac_cv_header_time = yes; then
15108
15109 cat >>confdefs.h <<\EOF
15110 #define TIME_WITH_SYS_TIME 1
15111 EOF
15112
15113 fi
15114
15115 ###     checks for compiler characteristics
15116 ac_ext=c
15117 ac_cpp='$CPP $CPPFLAGS'
15118 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15119 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15120 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15121 ac_main_return=return
15122
15123 echo "$as_me:15123: checking for an ANSI C-conforming const" >&5
15124 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15125 if test "${ac_cv_c_const+set}" = set; then
15126   echo $ECHO_N "(cached) $ECHO_C" >&6
15127 else
15128   cat >conftest.$ac_ext <<_ACEOF
15129 #line 15129 "configure"
15130 #include "confdefs.h"
15131
15132 int
15133 main (void)
15134 {
15135 /* FIXME: Include the comments suggested by Paul. */
15136 #ifndef __cplusplus
15137   /* Ultrix mips cc rejects this.  */
15138   typedef int charset[2];
15139   const charset x;
15140   /* SunOS 4.1.1 cc rejects this.  */
15141   char const *const *ccp;
15142   char **p;
15143   /* NEC SVR4.0.2 mips cc rejects this.  */
15144   struct point {int x, y;};
15145   static struct point const zero = {0,0};
15146   /* AIX XL C 1.02.0.0 rejects this.
15147      It does not let you subtract one const X* pointer from another in
15148      an arm of an if-expression whose if-part is not a constant
15149      expression */
15150   const char *g = "string";
15151   ccp = &g + (g ? g-g : 0);
15152   /* HPUX 7.0 cc rejects these. */
15153   ++ccp;
15154   p = (char**) ccp;
15155   ccp = (char const *const *) p;
15156   { /* SCO 3.2v4 cc rejects this.  */
15157     char *t;
15158     char const *s = 0 ? (char *) 0 : (char const *) 0;
15159
15160     *t++ = 0;
15161   }
15162   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15163     int x[] = {25, 17};
15164     const int *foo = &x[0];
15165     ++foo;
15166   }
15167   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15168     typedef const int *iptr;
15169     iptr p = 0;
15170     ++p;
15171   }
15172   { /* AIX XL C 1.02.0.0 rejects this saying
15173        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15174     struct s { int j; const int *ap[3]; };
15175     struct s *b; b->j = 5;
15176   }
15177   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15178     const int foo = 10;
15179   }
15180 #endif
15181
15182   ;
15183   return 0;
15184 }
15185 _ACEOF
15186 rm -f conftest.$ac_objext
15187 if { (eval echo "$as_me:15187: \"$ac_compile\"") >&5
15188   (eval $ac_compile) 2>&5
15189   ac_status=$?
15190   echo "$as_me:15190: \$? = $ac_status" >&5
15191   (exit $ac_status); } &&
15192          { ac_try='test -s conftest.$ac_objext'
15193   { (eval echo "$as_me:15193: \"$ac_try\"") >&5
15194   (eval $ac_try) 2>&5
15195   ac_status=$?
15196   echo "$as_me:15196: \$? = $ac_status" >&5
15197   (exit $ac_status); }; }; then
15198   ac_cv_c_const=yes
15199 else
15200   echo "$as_me: failed program was:" >&5
15201 cat conftest.$ac_ext >&5
15202 ac_cv_c_const=no
15203 fi
15204 rm -f conftest.$ac_objext conftest.$ac_ext
15205 fi
15206 echo "$as_me:15206: result: $ac_cv_c_const" >&5
15207 echo "${ECHO_T}$ac_cv_c_const" >&6
15208 if test $ac_cv_c_const = no; then
15209
15210 cat >>confdefs.h <<\EOF
15211 #define const
15212 EOF
15213
15214 fi
15215
15216 ###     Checks for external-data
15217
15218 echo "$as_me:15218: checking if data-only library module links" >&5
15219 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15220 if test "${cf_cv_link_dataonly+set}" = set; then
15221   echo $ECHO_N "(cached) $ECHO_C" >&6
15222 else
15223
15224         rm -f conftest.a
15225         cat >conftest.$ac_ext <<EOF
15226 #line 15226 "configure"
15227 int     testdata[3] = { 123, 456, 789 };
15228 EOF
15229         if { (eval echo "$as_me:15229: \"$ac_compile\"") >&5
15230   (eval $ac_compile) 2>&5
15231   ac_status=$?
15232   echo "$as_me:15232: \$? = $ac_status" >&5
15233   (exit $ac_status); } ; then
15234                 mv conftest.o data.o && \
15235                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15236         fi
15237         rm -f conftest.$ac_ext data.o
15238         cat >conftest.$ac_ext <<EOF
15239 #line 15239 "configure"
15240 int     testfunc(void)
15241 {
15242 #if defined(NeXT)
15243         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15244 #else
15245         extern int testdata[3];
15246         return testdata[0] == 123
15247            &&  testdata[1] == 456
15248            &&  testdata[2] == 789;
15249 #endif
15250 }
15251 EOF
15252         if { (eval echo "$as_me:15252: \"$ac_compile\"") >&5
15253   (eval $ac_compile) 2>&5
15254   ac_status=$?
15255   echo "$as_me:15255: \$? = $ac_status" >&5
15256   (exit $ac_status); }; then
15257                 mv conftest.o func.o && \
15258                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15259         fi
15260         rm -f conftest.$ac_ext func.o
15261         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15262         cf_saveLIBS="$LIBS"
15263         LIBS="conftest.a $LIBS"
15264         if test "$cross_compiling" = yes; then
15265   cf_cv_link_dataonly=unknown
15266 else
15267   cat >conftest.$ac_ext <<_ACEOF
15268 #line 15268 "configure"
15269 #include "confdefs.h"
15270
15271         int main(void)
15272         {
15273                 extern int testfunc();
15274                 ${cf_cv_main_return:-return} (!testfunc());
15275         }
15276
15277 _ACEOF
15278 rm -f conftest$ac_exeext
15279 if { (eval echo "$as_me:15279: \"$ac_link\"") >&5
15280   (eval $ac_link) 2>&5
15281   ac_status=$?
15282   echo "$as_me:15282: \$? = $ac_status" >&5
15283   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15284   { (eval echo "$as_me:15284: \"$ac_try\"") >&5
15285   (eval $ac_try) 2>&5
15286   ac_status=$?
15287   echo "$as_me:15287: \$? = $ac_status" >&5
15288   (exit $ac_status); }; }; then
15289   cf_cv_link_dataonly=yes
15290 else
15291   echo "$as_me: program exited with status $ac_status" >&5
15292 echo "$as_me: failed program was:" >&5
15293 cat conftest.$ac_ext >&5
15294 cf_cv_link_dataonly=no
15295 fi
15296 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15297 fi
15298         LIBS="$cf_saveLIBS"
15299
15300 fi
15301
15302 echo "$as_me:15302: result: $cf_cv_link_dataonly" >&5
15303 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15304
15305 if test "$cf_cv_link_dataonly" = no ; then
15306
15307 cat >>confdefs.h <<\EOF
15308 #define BROKEN_LINKER 1
15309 EOF
15310
15311         BROKEN_LINKER=1
15312 fi
15313
15314 ###     Checks for library functions.
15315
15316 for ac_header in \
15317 unistd.h \
15318
15319 do
15320 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15321 echo "$as_me:15321: checking for $ac_header" >&5
15322 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15323 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15324   echo $ECHO_N "(cached) $ECHO_C" >&6
15325 else
15326   cat >conftest.$ac_ext <<_ACEOF
15327 #line 15327 "configure"
15328 #include "confdefs.h"
15329 #include <$ac_header>
15330 _ACEOF
15331 if { (eval echo "$as_me:15331: \"$ac_cpp conftest.$ac_ext\"") >&5
15332   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15333   ac_status=$?
15334   egrep -v '^ *\+' conftest.er1 >conftest.err
15335   rm -f conftest.er1
15336   cat conftest.err >&5
15337   echo "$as_me:15337: \$? = $ac_status" >&5
15338   (exit $ac_status); } >/dev/null; then
15339   if test -s conftest.err; then
15340     ac_cpp_err=$ac_c_preproc_warn_flag
15341   else
15342     ac_cpp_err=
15343   fi
15344 else
15345   ac_cpp_err=yes
15346 fi
15347 if test -z "$ac_cpp_err"; then
15348   eval "$as_ac_Header=yes"
15349 else
15350   echo "$as_me: failed program was:" >&5
15351   cat conftest.$ac_ext >&5
15352   eval "$as_ac_Header=no"
15353 fi
15354 rm -f conftest.err conftest.$ac_ext
15355 fi
15356 echo "$as_me:15356: result: `eval echo '${'$as_ac_Header'}'`" >&5
15357 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15358 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15359   cat >>confdefs.h <<EOF
15360 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15361 EOF
15362
15363 fi
15364 done
15365
15366 echo "$as_me:15366: checking for working mkstemp" >&5
15367 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15368 if test "${cf_cv_func_mkstemp+set}" = set; then
15369   echo $ECHO_N "(cached) $ECHO_C" >&6
15370 else
15371
15372 rm -rf conftest*
15373 if test "$cross_compiling" = yes; then
15374   cf_cv_func_mkstemp=maybe
15375 else
15376   cat >conftest.$ac_ext <<_ACEOF
15377 #line 15377 "configure"
15378 #include "confdefs.h"
15379
15380 #include <sys/types.h>
15381 #ifdef HAVE_UNISTD_H
15382 #include <unistd.h>
15383 #endif
15384 #include <stdlib.h>
15385 #include <stdio.h>
15386 #include <string.h>
15387 #include <sys/stat.h>
15388 int main(void)
15389 {
15390         char *tmpl = "conftestXXXXXX";
15391         char name[2][80];
15392         int n;
15393         int result = 0;
15394         int fd;
15395         struct stat sb;
15396
15397         umask(077);
15398         for (n = 0; n < 2; ++n) {
15399                 strcpy(name[n], tmpl);
15400                 if ((fd = mkstemp(name[n])) >= 0) {
15401                         if (!strcmp(name[n], tmpl)
15402                          || stat(name[n], &sb) != 0
15403                          || (sb.st_mode & S_IFMT) != S_IFREG
15404                          || (sb.st_mode & 077) != 0) {
15405                                 result = 1;
15406                         }
15407                         close(fd);
15408                 }
15409         }
15410         if (result == 0
15411          && !strcmp(name[0], name[1]))
15412                 result = 1;
15413         ${cf_cv_main_return:-return}(result);
15414 }
15415
15416 _ACEOF
15417 rm -f conftest$ac_exeext
15418 if { (eval echo "$as_me:15418: \"$ac_link\"") >&5
15419   (eval $ac_link) 2>&5
15420   ac_status=$?
15421   echo "$as_me:15421: \$? = $ac_status" >&5
15422   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15423   { (eval echo "$as_me:15423: \"$ac_try\"") >&5
15424   (eval $ac_try) 2>&5
15425   ac_status=$?
15426   echo "$as_me:15426: \$? = $ac_status" >&5
15427   (exit $ac_status); }; }; then
15428   cf_cv_func_mkstemp=yes
15429
15430 else
15431   echo "$as_me: program exited with status $ac_status" >&5
15432 echo "$as_me: failed program was:" >&5
15433 cat conftest.$ac_ext >&5
15434 cf_cv_func_mkstemp=no
15435
15436 fi
15437 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15438 fi
15439
15440 fi
15441 echo "$as_me:15441: result: $cf_cv_func_mkstemp" >&5
15442 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15443 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15444         echo "$as_me:15444: checking for mkstemp" >&5
15445 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15446 if test "${ac_cv_func_mkstemp+set}" = set; then
15447   echo $ECHO_N "(cached) $ECHO_C" >&6
15448 else
15449   cat >conftest.$ac_ext <<_ACEOF
15450 #line 15450 "configure"
15451 #include "confdefs.h"
15452 #define mkstemp autoconf_temporary
15453 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15454 #undef mkstemp
15455
15456 #ifdef __cplusplus
15457 extern "C"
15458 #endif
15459
15460 /* We use char because int might match the return type of a gcc2
15461    builtin and then its argument prototype would still apply.  */
15462 char mkstemp (void);
15463
15464 int
15465 main (void)
15466 {
15467
15468 /* The GNU C library defines stubs for functions which it implements
15469     to always fail with ENOSYS.  Some functions are actually named
15470     something starting with __ and the normal name is an alias.  */
15471 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15472 #error found stub for mkstemp
15473 #endif
15474
15475         return mkstemp ();
15476   ;
15477   return 0;
15478 }
15479 _ACEOF
15480 rm -f conftest.$ac_objext conftest$ac_exeext
15481 if { (eval echo "$as_me:15481: \"$ac_link\"") >&5
15482   (eval $ac_link) 2>&5
15483   ac_status=$?
15484   echo "$as_me:15484: \$? = $ac_status" >&5
15485   (exit $ac_status); } &&
15486          { ac_try='test -s conftest$ac_exeext'
15487   { (eval echo "$as_me:15487: \"$ac_try\"") >&5
15488   (eval $ac_try) 2>&5
15489   ac_status=$?
15490   echo "$as_me:15490: \$? = $ac_status" >&5
15491   (exit $ac_status); }; }; then
15492   ac_cv_func_mkstemp=yes
15493 else
15494   echo "$as_me: failed program was:" >&5
15495 cat conftest.$ac_ext >&5
15496 ac_cv_func_mkstemp=no
15497 fi
15498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15499 fi
15500 echo "$as_me:15500: result: $ac_cv_func_mkstemp" >&5
15501 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15502
15503 fi
15504 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15505
15506 cat >>confdefs.h <<\EOF
15507 #define HAVE_MKSTEMP 1
15508 EOF
15509
15510 fi
15511
15512 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15513         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15514         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15515 fi
15516
15517 cf_with_ada=yes
15518 if test "$cf_with_ada" != "no" ; then
15519
15520 cf_ada_make=gnatmake
15521 cf_ada_config="#"
15522 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
15523 set dummy $cf_ada_make; ac_word=$2
15524 echo "$as_me:15524: checking for $ac_word" >&5
15525 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15526 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
15527   echo $ECHO_N "(cached) $ECHO_C" >&6
15528 else
15529   if test -n "$gnatmake_exists"; then
15530   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
15531 else
15532   ac_save_IFS=$IFS; IFS=$ac_path_separator
15533 ac_dummy="$PATH"
15534 for ac_dir in $ac_dummy; do
15535   IFS=$ac_save_IFS
15536   test -z "$ac_dir" && ac_dir=.
15537   $as_executable_p "$ac_dir/$ac_word" || continue
15538 ac_cv_prog_gnatmake_exists="yes"
15539 echo "$as_me:15539: found $ac_dir/$ac_word" >&5
15540 break
15541 done
15542
15543   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
15544 fi
15545 fi
15546 gnatmake_exists=$ac_cv_prog_gnatmake_exists
15547 if test -n "$gnatmake_exists"; then
15548   echo "$as_me:15548: result: $gnatmake_exists" >&5
15549 echo "${ECHO_T}$gnatmake_exists" >&6
15550 else
15551   echo "$as_me:15551: result: no" >&5
15552 echo "${ECHO_T}no" >&6
15553 fi
15554
15555 if test "$ac_cv_prog_gnatmake_exists" = no; then
15556         cf_ada_make=
15557         cf_cv_prog_gnat_correct=no
15558 else
15559         # Extract the first word of "gprconfig", so it can be a program name with args.
15560 set dummy gprconfig; ac_word=$2
15561 echo "$as_me:15561: checking for $ac_word" >&5
15562 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15563 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
15564   echo $ECHO_N "(cached) $ECHO_C" >&6
15565 else
15566   if test -n "$gprconfig_exists"; then
15567   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
15568 else
15569   ac_save_IFS=$IFS; IFS=$ac_path_separator
15570 ac_dummy="$PATH"
15571 for ac_dir in $ac_dummy; do
15572   IFS=$ac_save_IFS
15573   test -z "$ac_dir" && ac_dir=.
15574   $as_executable_p "$ac_dir/$ac_word" || continue
15575 ac_cv_prog_gprconfig_exists="yes"
15576 echo "$as_me:15576: found $ac_dir/$ac_word" >&5
15577 break
15578 done
15579
15580   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
15581 fi
15582 fi
15583 gprconfig_exists=$ac_cv_prog_gprconfig_exists
15584 if test -n "$gprconfig_exists"; then
15585   echo "$as_me:15585: result: $gprconfig_exists" >&5
15586 echo "${ECHO_T}$gprconfig_exists" >&6
15587 else
15588   echo "$as_me:15588: result: no" >&5
15589 echo "${ECHO_T}no" >&6
15590 fi
15591
15592         if test "$ac_cv_prog_gprconfig_exists" = yes
15593         then
15594                 rm -rf conftest* *~conftest*
15595                 if mkdir conftest.src
15596                 then
15597                         cf_ada_config=""
15598                         cd conftest.src
15599                         for cf_gprconfig in Ada C
15600                         do
15601                                 echo "$as_me:15601: checking for gprconfig name for $cf_gprconfig" >&5
15602 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15603                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15604                                 if test -n "$cf_gprconfig_value"
15605                                 then
15606                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15607                                         echo "$as_me:15607: result: $cf_gprconfig_value" >&5
15608 echo "${ECHO_T}$cf_gprconfig_value" >&6
15609                                 else
15610                                         echo "$as_me:15610: result: missing" >&5
15611 echo "${ECHO_T}missing" >&6
15612                                         cf_ada_config="#"
15613                                         break
15614                                 fi
15615                         done
15616                         cd ..
15617                         rm -rf conftest* *~conftest*
15618                 fi
15619         else
15620                 # gprconfig is newer than gnatmake; we can continue...
15621                 cf_ada_config="##"
15622         fi
15623         if test "x$cf_ada_config" != "x#"
15624         then
15625
15626 echo "$as_me:15626: checking for gnat version" >&5
15627 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15628 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
15629         grep '[0-9].[0-9][0-9]*' |\
15630         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15631 echo "$as_me:15631: result: $cf_gnat_version" >&5
15632 echo "${ECHO_T}$cf_gnat_version" >&6
15633
15634 case $cf_gnat_version in
15635 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15636         cf_cv_prog_gnat_correct=yes
15637         ;;
15638 (*)
15639         { echo "$as_me:15639: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15640 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15641         cf_cv_prog_gnat_correct=no
15642         ;;
15643 esac
15644
15645                 # Extract the first word of "m4", so it can be a program name with args.
15646 set dummy m4; ac_word=$2
15647 echo "$as_me:15647: checking for $ac_word" >&5
15648 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15649 if test "${ac_cv_prog_M4_exists+set}" = set; then
15650   echo $ECHO_N "(cached) $ECHO_C" >&6
15651 else
15652   if test -n "$M4_exists"; then
15653   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15654 else
15655   ac_save_IFS=$IFS; IFS=$ac_path_separator
15656 ac_dummy="$PATH"
15657 for ac_dir in $ac_dummy; do
15658   IFS=$ac_save_IFS
15659   test -z "$ac_dir" && ac_dir=.
15660   $as_executable_p "$ac_dir/$ac_word" || continue
15661 ac_cv_prog_M4_exists="yes"
15662 echo "$as_me:15662: found $ac_dir/$ac_word" >&5
15663 break
15664 done
15665
15666   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15667 fi
15668 fi
15669 M4_exists=$ac_cv_prog_M4_exists
15670 if test -n "$M4_exists"; then
15671   echo "$as_me:15671: result: $M4_exists" >&5
15672 echo "${ECHO_T}$M4_exists" >&6
15673 else
15674   echo "$as_me:15674: result: no" >&5
15675 echo "${ECHO_T}no" >&6
15676 fi
15677
15678                 if test "$ac_cv_prog_M4_exists" = no; then
15679                         cf_cv_prog_gnat_correct=no
15680                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
15681                 fi
15682                 if test "$cf_cv_prog_gnat_correct" = yes; then
15683                         echo "$as_me:15683: checking if GNAT works" >&5
15684 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15685
15686 rm -rf conftest* *~conftest*
15687 cat >>conftest.ads <<CF_EOF
15688 procedure conftest;
15689 CF_EOF
15690 cat >>conftest.adb <<CF_EOF
15691 with Text_IO;
15692 with GNAT.OS_Lib;
15693 procedure conftest is
15694 begin
15695    Text_IO.Put ("Hello World");
15696    Text_IO.New_Line;
15697    GNAT.OS_Lib.OS_Exit (0);
15698 end conftest;
15699 CF_EOF
15700 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15701    if ( ./conftest 1>&5 2>&1 ) ; then
15702       cf_cv_prog_gnat_correct=yes
15703    else
15704       cf_cv_prog_gnat_correct=no
15705    fi
15706 else
15707    cf_cv_prog_gnat_correct=no
15708 fi
15709 rm -rf conftest* *~conftest*
15710
15711                         echo "$as_me:15711: result: $cf_cv_prog_gnat_correct" >&5
15712 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15713                 fi
15714         else
15715                 cf_cv_prog_gnat_correct=no
15716         fi
15717 fi
15718
15719         if test "$cf_cv_prog_gnat_correct" = yes; then
15720
15721         echo "$as_me:15721: checking optimization options for ADAFLAGS" >&5
15722 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15723         case "$CFLAGS" in
15724         (*-g*)
15725
15726         ADAFLAGS="$ADAFLAGS -g"
15727
15728                 ;;
15729         esac
15730         case "$CFLAGS" in
15731         (*-O*)
15732                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15733
15734         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15735
15736                 ;;
15737         esac
15738         echo "$as_me:15738: result: $ADAFLAGS" >&5
15739 echo "${ECHO_T}$ADAFLAGS" >&6
15740
15741 echo "$as_me:15741: checking if GNATPREP supports -T option" >&5
15742 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15743 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15744   echo $ECHO_N "(cached) $ECHO_C" >&6
15745 else
15746
15747 cf_cv_gnatprep_opt_t=no
15748 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15749
15750 fi
15751 echo "$as_me:15751: result: $cf_cv_gnatprep_opt_t" >&5
15752 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15753 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15754
15755 echo "$as_me:15755: checking if GNAT supports generics" >&5
15756 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15757 case $cf_gnat_version in
15758 (3.[1-9]*|[4-9].*)
15759         cf_gnat_generics=yes
15760         ;;
15761 (*)
15762         cf_gnat_generics=no
15763         ;;
15764 esac
15765 echo "$as_me:15765: result: $cf_gnat_generics" >&5
15766 echo "${ECHO_T}$cf_gnat_generics" >&6
15767
15768 if test "$cf_gnat_generics" = yes
15769 then
15770         cf_compile_generics=generics
15771         cf_generic_objects="\${GENOBJS}"
15772 else
15773         cf_compile_generics=
15774         cf_generic_objects=
15775 fi
15776
15777 echo "$as_me:15777: checking if GNAT supports SIGINT" >&5
15778 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15779 if test "${cf_cv_gnat_sigint+set}" = set; then
15780   echo $ECHO_N "(cached) $ECHO_C" >&6
15781 else
15782
15783 rm -rf conftest* *~conftest*
15784 cat >>conftest.ads <<CF_EOF
15785 with Ada.Interrupts.Names;
15786
15787 package ConfTest is
15788
15789    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15790    pragma Unreserve_All_Interrupts;
15791    pragma Warnings (On);
15792
15793    protected Process is
15794       procedure Stop;
15795       function Continue return Boolean;
15796       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
15797    private
15798       Done : Boolean := False;
15799    end Process;
15800
15801 end ConfTest;
15802 CF_EOF
15803 cat >>conftest.adb <<CF_EOF
15804 package body ConfTest is
15805    protected body Process is
15806       procedure Stop is
15807       begin
15808          Done := True;
15809       end Stop;
15810       function Continue return Boolean is
15811       begin
15812          return not Done;
15813       end Continue;
15814    end Process;
15815 end ConfTest;
15816 CF_EOF
15817 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15818       cf_cv_gnat_sigint=yes
15819 else
15820    cf_cv_gnat_sigint=no
15821 fi
15822 rm -rf conftest* *~conftest*
15823
15824 fi
15825 echo "$as_me:15825: result: $cf_cv_gnat_sigint" >&5
15826 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
15827
15828 if test $cf_cv_gnat_sigint = yes ; then
15829         USE_GNAT_SIGINT=""
15830 else
15831         USE_GNAT_SIGINT="#"
15832 fi
15833
15834 cf_gnat_libraries=no
15835 cf_gnat_projects=no
15836
15837 if test "$enable_gnat_projects" != no ; then
15838 echo "$as_me:15838: checking if GNAT supports project files" >&5
15839 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
15840 case $cf_gnat_version in
15841 (3.[0-9]*)
15842         ;;
15843 (*)
15844         case $cf_cv_system_name in
15845         (cygwin*|msys*)
15846                 ;;
15847         (*)
15848                 rm -rf conftest* *~conftest*
15849                 if mkdir conftest.src conftest.bin conftest.lib
15850                 then
15851                         cd conftest.src
15852                         rm -rf conftest* *~conftest*
15853                         cat >>library.gpr <<CF_EOF
15854 project Library is
15855   Kind := External ("LIB_KIND");
15856   for Library_Name use "ConfTest";
15857   for Object_Dir use ".";
15858   for Library_ALI_Dir use External("LIBRARY_DIR");
15859   for Library_Version use External ("SONAME");
15860   for Library_Kind use Kind;
15861   for Library_Dir use External("BUILD_DIR");
15862   Source_Dir := External ("SOURCE_DIR");
15863   for Source_Dirs use (Source_Dir);
15864 end Library;
15865 CF_EOF
15866                         cat >>confpackage.ads <<CF_EOF
15867 package ConfPackage is
15868    procedure conftest;
15869 end ConfPackage;
15870 CF_EOF
15871                         cat >>confpackage.adb <<CF_EOF
15872 with Text_IO;
15873 package body ConfPackage is
15874    procedure conftest is
15875    begin
15876       Text_IO.Put ("Hello World");
15877       Text_IO.New_Line;
15878    end conftest;
15879 end ConfPackage;
15880 CF_EOF
15881                         if ( $cf_ada_make $ADAFLAGS \
15882                                         -Plibrary.gpr \
15883                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
15884                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
15885                                         -XSOURCE_DIR=`pwd` \
15886                                         -XSONAME=libConfTest.so.1 \
15887                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
15888                                 cf_gnat_projects=yes
15889                         fi
15890                         cd ..
15891                 fi
15892                 if test -f conftest.lib/confpackage.ali
15893                 then
15894                         cf_gnat_libraries=yes
15895                 fi
15896                 rm -rf conftest* *~conftest*
15897                 ;;
15898         esac
15899         ;;
15900 esac
15901 echo "$as_me:15901: result: $cf_gnat_projects" >&5
15902 echo "${ECHO_T}$cf_gnat_projects" >&6
15903 fi # enable_gnat_projects
15904
15905 if test $cf_gnat_projects = yes
15906 then
15907         echo "$as_me:15907: checking if GNAT supports libraries" >&5
15908 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
15909         echo "$as_me:15909: result: $cf_gnat_libraries" >&5
15910 echo "${ECHO_T}$cf_gnat_libraries" >&6
15911 fi
15912
15913 if test "$cf_gnat_projects" = yes
15914 then
15915         USE_OLD_MAKERULES="#"
15916         USE_GNAT_PROJECTS=""
15917 else
15918         USE_OLD_MAKERULES=""
15919         USE_GNAT_PROJECTS="#"
15920 fi
15921
15922 if test "$cf_gnat_libraries" = yes
15923 then
15924         USE_GNAT_LIBRARIES=""
15925 else
15926         USE_GNAT_LIBRARIES="#"
15927 fi
15928
15929 echo "$as_me:15929: checking for ada-compiler" >&5
15930 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
15931
15932 # Check whether --with-ada-compiler or --without-ada-compiler was given.
15933 if test "${with_ada_compiler+set}" = set; then
15934   withval="$with_ada_compiler"
15935   cf_ada_compiler=$withval
15936 else
15937   cf_ada_compiler=gnatmake
15938 fi;
15939
15940 echo "$as_me:15940: result: $cf_ada_compiler" >&5
15941 echo "${ECHO_T}$cf_ada_compiler" >&6
15942
15943                 cf_ada_package=terminal_interface
15944
15945 echo "$as_me:15945: checking for ada-include" >&5
15946 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
15947
15948 # Check whether --with-ada-include or --without-ada-include was given.
15949 if test "${with_ada_include+set}" = set; then
15950   withval="$with_ada_include"
15951
15952 else
15953   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
15954 fi; if test -n "$prefix/share/ada/adainclude" ; then
15955
15956 if test "x$prefix" != xNONE; then
15957         cf_path_syntax="$prefix"
15958 else
15959         cf_path_syntax="$ac_default_prefix"
15960 fi
15961
15962 case ".$withval" in
15963 (.\$\(*\)*|.\'*\'*)
15964         ;;
15965 (..|./*|.\\*)
15966         ;;
15967 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15968         ;;
15969 (.\${*prefix}*|.\${*dir}*)
15970         eval withval="$withval"
15971         case ".$withval" in
15972         (.NONE/*)
15973                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15974                 ;;
15975         esac
15976         ;;
15977 (.no|.NONE/*)
15978         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15979         ;;
15980 (*)
15981         { { echo "$as_me:15981: error: expected a pathname, not \"$withval\"" >&5
15982 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
15983    { (exit 1); exit 1; }; }
15984         ;;
15985 esac
15986
15987 fi
15988 eval ADA_INCLUDE="$withval"
15989
15990 echo "$as_me:15990: result: $ADA_INCLUDE" >&5
15991 echo "${ECHO_T}$ADA_INCLUDE" >&6
15992
15993 echo "$as_me:15993: checking for ada-objects" >&5
15994 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
15995
15996 # Check whether --with-ada-objects or --without-ada-objects was given.
15997 if test "${with_ada_objects+set}" = set; then
15998   withval="$with_ada_objects"
15999
16000 else
16001   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16002 fi; if test -n "$prefix/lib/ada/adalib" ; then
16003
16004 if test "x$prefix" != xNONE; then
16005         cf_path_syntax="$prefix"
16006 else
16007         cf_path_syntax="$ac_default_prefix"
16008 fi
16009
16010 case ".$withval" in
16011 (.\$\(*\)*|.\'*\'*)
16012         ;;
16013 (..|./*|.\\*)
16014         ;;
16015 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16016         ;;
16017 (.\${*prefix}*|.\${*dir}*)
16018         eval withval="$withval"
16019         case ".$withval" in
16020         (.NONE/*)
16021                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16022                 ;;
16023         esac
16024         ;;
16025 (.no|.NONE/*)
16026         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16027         ;;
16028 (*)
16029         { { echo "$as_me:16029: error: expected a pathname, not \"$withval\"" >&5
16030 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16031    { (exit 1); exit 1; }; }
16032         ;;
16033 esac
16034
16035 fi
16036 eval ADA_OBJECTS="$withval"
16037
16038 echo "$as_me:16038: result: $ADA_OBJECTS" >&5
16039 echo "${ECHO_T}$ADA_OBJECTS" >&6
16040
16041 echo "$as_me:16041: checking if an Ada95 shared-library should be built" >&5
16042 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16043
16044 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16045 if test "${with_ada_sharedlib+set}" = set; then
16046   withval="$with_ada_sharedlib"
16047   with_ada_sharedlib=$withval
16048 else
16049   with_ada_sharedlib=no
16050 fi;
16051 echo "$as_me:16051: result: $with_ada_sharedlib" >&5
16052 echo "${ECHO_T}$with_ada_sharedlib" >&6
16053
16054 if test "x$with_ada_sharedlib" != xno
16055 then
16056         if test "x$cf_gnat_projects" != xyes
16057         then
16058                 { echo "$as_me:16058: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16059 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16060                 with_ada_sharedlib=no
16061         fi
16062 fi
16063
16064 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16065 MAKE_ADA_SHAREDLIB="#"
16066
16067 if test "x$with_ada_sharedlib" != xno
16068 then
16069         MAKE_ADA_SHAREDLIB=
16070         if test "x$with_ada_sharedlib" != xyes
16071         then
16072                 ADA_SHAREDLIB="$with_ada_sharedlib"
16073         fi
16074 fi
16075
16076         else
16077                 { { echo "$as_me:16077: error: No usable Ada compiler found" >&5
16078 echo "$as_me: error: No usable Ada compiler found" >&2;}
16079    { (exit 1); exit 1; }; }
16080         fi
16081 else
16082         { { echo "$as_me:16082: error: The Ada compiler is needed for this package" >&5
16083 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16084    { (exit 1); exit 1; }; }
16085 fi
16086
16087 ################################################################################
16088
16089 # not needed
16090 TINFO_LDFLAGS2=
16091
16092 TINFO_LIBS=
16093
16094 ### Construct the list of include-directories to be generated
16095
16096 if test "$srcdir" != "."; then
16097         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16098 fi
16099 CPPFLAGS="-I../include $CPPFLAGS"
16100 if test "$srcdir" != "."; then
16101         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16102 fi
16103 CPPFLAGS="-I. $CPPFLAGS"
16104
16105 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16106 if test "$srcdir" != "."; then
16107         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16108 fi
16109 if test "$GCC" != yes; then
16110         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16111 elif test "$includedir" != "/usr/include"; then
16112         if test "$includedir" = '${prefix}/include' ; then
16113                 if test x$prefix != x/usr ; then
16114                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16115                 fi
16116         else
16117                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16118         fi
16119 fi
16120
16121 ### Build up pieces for makefile rules
16122 echo "$as_me:16122: checking default library suffix" >&5
16123 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16124
16125         case $DFT_LWR_MODEL in
16126         (libtool) DFT_ARG_SUFFIX=''   ;;
16127         (normal)  DFT_ARG_SUFFIX=''   ;;
16128         (debug)   DFT_ARG_SUFFIX='_g' ;;
16129         (profile) DFT_ARG_SUFFIX='_p' ;;
16130         (shared)  DFT_ARG_SUFFIX=''   ;;
16131         esac
16132         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16133 echo "$as_me:16133: result: $DFT_ARG_SUFFIX" >&5
16134 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16135
16136 echo "$as_me:16136: checking default library-dependency suffix" >&5
16137 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16138
16139         case X$DFT_LWR_MODEL in
16140         (Xlibtool)
16141                 DFT_LIB_SUFFIX='.la'
16142                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16143                 ;;
16144         (Xdebug)
16145                 DFT_LIB_SUFFIX='_g.a'
16146                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16147                 ;;
16148         (Xprofile)
16149                 DFT_LIB_SUFFIX='_p.a'
16150                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16151                 ;;
16152         (Xshared)
16153                 case $cf_cv_system_name in
16154                 (aix[5-7]*)
16155                         DFT_LIB_SUFFIX='.so'
16156                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16157                         ;;
16158                 (cygwin*|msys*|mingw*)
16159                         DFT_LIB_SUFFIX='.dll'
16160                         DFT_DEP_SUFFIX='.dll.a'
16161                         ;;
16162                 (darwin*)
16163                         DFT_LIB_SUFFIX='.dylib'
16164                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16165                         ;;
16166                 (hpux*)
16167                         case $target in
16168                         (ia64*)
16169                                 DFT_LIB_SUFFIX='.so'
16170                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16171                                 ;;
16172                         (*)
16173                                 DFT_LIB_SUFFIX='.sl'
16174                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16175                                 ;;
16176                         esac
16177                         ;;
16178                 (*)
16179                         DFT_LIB_SUFFIX='.so'
16180                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16181                         ;;
16182                 esac
16183                 ;;
16184         (*)
16185                 DFT_LIB_SUFFIX='.a'
16186                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16187                 ;;
16188         esac
16189         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16190         then
16191                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16192                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16193         fi
16194 echo "$as_me:16194: result: $DFT_DEP_SUFFIX" >&5
16195 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16196
16197 echo "$as_me:16197: checking default object directory" >&5
16198 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16199
16200         case $DFT_LWR_MODEL in
16201         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16202         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16203         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16204         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16205         (shared)
16206                 case $cf_cv_system_name in
16207                 (cygwin|msys)
16208                         DFT_OBJ_SUBDIR='objects' ;;
16209                 (*)
16210                         DFT_OBJ_SUBDIR='obj_s' ;;
16211                 esac
16212         esac
16213 echo "$as_me:16213: result: $DFT_OBJ_SUBDIR" >&5
16214 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16215
16216 ### Set up low-level terminfo dependencies for makefiles.
16217
16218 if test "$DFT_LWR_MODEL" = shared ; then
16219         case $cf_cv_system_name in
16220         (cygwin*)
16221                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16222                 ;;
16223         (msys*)
16224                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16225                 ;;
16226         esac
16227 fi
16228
16229 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16230
16231 ### Construct the list of subdirectories for which we'll customize makefiles
16232 ### with the appropriate compile-rules.
16233
16234 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16235
16236 cat >>confdefs.h <<EOF
16237 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16238 EOF
16239
16240 ### Now that we're done running tests, add the compiler-warnings, if any
16241
16242 cf_fix_cppflags=no
16243 cf_new_cflags=
16244 cf_new_cppflags=
16245 cf_new_extra_cppflags=
16246
16247 for cf_add_cflags in $EXTRA_CFLAGS
16248 do
16249 case $cf_fix_cppflags in
16250 (no)
16251         case $cf_add_cflags in
16252         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16253                 case $cf_add_cflags in
16254                 (-D*)
16255                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16256
16257                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16258                                 && test -z "${cf_tst_cflags}" \
16259                                 && cf_fix_cppflags=yes
16260
16261                         if test $cf_fix_cppflags = yes ; then
16262
16263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16265
16266                                 continue
16267                         elif test "${cf_tst_cflags}" = "\"'" ; then
16268
16269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16271
16272                                 continue
16273                         fi
16274                         ;;
16275                 esac
16276                 case "$CPPFLAGS" in
16277                 (*$cf_add_cflags)
16278                         ;;
16279                 (*)
16280                         case $cf_add_cflags in
16281                         (-D*)
16282                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16283
16284 CPPFLAGS=`echo "$CPPFLAGS" | \
16285         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16286                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16287
16288                                 ;;
16289                         esac
16290
16291         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16292         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16293
16294                         ;;
16295                 esac
16296                 ;;
16297         (*)
16298
16299         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16300         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16301
16302                 ;;
16303         esac
16304         ;;
16305 (yes)
16306
16307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16309
16310         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16311
16312         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16313                 && test -z "${cf_tst_cflags}" \
16314                 && cf_fix_cppflags=no
16315         ;;
16316 esac
16317 done
16318
16319 if test -n "$cf_new_cflags" ; then
16320
16321         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16322         CFLAGS="${CFLAGS}$cf_new_cflags"
16323
16324 fi
16325
16326 if test -n "$cf_new_cppflags" ; then
16327
16328         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16329         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16330
16331 fi
16332
16333 if test -n "$cf_new_extra_cppflags" ; then
16334
16335         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16336         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16337
16338 fi
16339
16340 ################################################################################
16341
16342 TEST_ARG2=
16343
16344 TEST_LIBS2=
16345
16346 NCURSES_SHLIB2="sh -c"
16347
16348 ADA_SUBDIRS="include gen src doc"
16349 if test "x$cf_with_tests" != "xno" ; then
16350         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16351 fi
16352 for cf_dir in $ADA_SUBDIRS
16353 do
16354         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16355 done
16356
16357 NCURSES_TREE="#"
16358
16359 EXTERNAL_TREE=
16360
16361 # match layout used by make-tar.sh
16362 ADAHTML_DIR=../doc/ada
16363
16364 if test "x$cross_compiling" = xyes ; then
16365         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16366 else
16367         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16368 fi
16369
16370 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
16371 ac_config_commands="$ac_config_commands default"
16372 cat >confcache <<\_ACEOF
16373 # This file is a shell script that caches the results of configure
16374 # tests run on this system so they can be shared between configure
16375 # scripts and configure runs, see configure's option --config-cache.
16376 # It is not useful on other systems.  If it contains results you don't
16377 # want to keep, you may remove or edit it.
16378 #
16379 # config.status only pays attention to the cache file if you give it
16380 # the --recheck option to rerun configure.
16381 #
16382 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16383 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16384 # following values.
16385
16386 _ACEOF
16387
16388 # The following way of writing the cache mishandles newlines in values,
16389 # but we know of no workaround that is simple, portable, and efficient.
16390 # So, don't put newlines in cache variables' values.
16391 # Ultrix sh set writes to stderr and can't be redirected directly,
16392 # and sets the high bit in the cache file unless we assign to the vars.
16393 {
16394   (set) 2>&1 |
16395     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16396     *ac_space=\ *)
16397       # `set' does not quote correctly, so add quotes (double-quote
16398       # substitution turns \\\\ into \\, and sed turns \\ into \).
16399       sed -n \
16400         "s/'/'\\\\''/g;
16401           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16402       ;;
16403     *)
16404       # `set' quotes correctly as required by POSIX, so do not add quotes.
16405       sed -n \
16406         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16407       ;;
16408     esac;
16409 } |
16410   sed '
16411      t clear
16412      : clear
16413      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16414      t end
16415      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16416      : end' >>confcache
16417 if cmp -s $cache_file confcache; then :; else
16418   if test -w $cache_file; then
16419     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16420     cat confcache >$cache_file
16421   else
16422     echo "not updating unwritable cache $cache_file"
16423   fi
16424 fi
16425 rm -f confcache
16426
16427 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16428 # Let make expand exec_prefix.
16429 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16430
16431 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16432 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16433 # trailing colons and then remove the whole line if VPATH becomes empty
16434 # (actually we leave an empty line to preserve line numbers).
16435 if test "x$srcdir" = x.; then
16436   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16437 s/:*\$(srcdir):*/:/;
16438 s/:*\${srcdir}:*/:/;
16439 s/:*@srcdir@:*/:/;
16440 s/^\([^=]*=[    ]*\):*/\1/;
16441 s/:*$//;
16442 s/^[^=]*=[      ]*$//;
16443 }'
16444 fi
16445
16446 DEFS=-DHAVE_CONFIG_H
16447
16448 : ${CONFIG_STATUS=./config.status}
16449 ac_clean_files_save=$ac_clean_files
16450 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16451 { echo "$as_me:16451: creating $CONFIG_STATUS" >&5
16452 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16453 cat >$CONFIG_STATUS <<_ACEOF
16454 #! $SHELL
16455 # Generated automatically by configure.
16456 # Run this file to recreate the current configuration.
16457 # Compiler output produced by configure, useful for debugging
16458 # configure, is in config.log if it exists.
16459
16460 debug=false
16461 SHELL=\${CONFIG_SHELL-$SHELL}
16462 ac_cs_invocation="\$0 \$@"
16463
16464 _ACEOF
16465
16466 cat >>$CONFIG_STATUS <<\_ACEOF
16467 # Be Bourne compatible
16468 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16469   emulate sh
16470   NULLCMD=:
16471 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16472   set -o posix
16473 fi
16474
16475 # Name of the executable.
16476 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16477
16478 if expr a : '\(a\)' >/dev/null 2>&1; then
16479   as_expr=expr
16480 else
16481   as_expr=false
16482 fi
16483
16484 rm -f conf$$ conf$$.exe conf$$.file
16485 echo >conf$$.file
16486 if ln -s conf$$.file conf$$ 2>/dev/null; then
16487   # We could just check for DJGPP; but this test a) works b) is more generic
16488   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16489   if test -f conf$$.exe; then
16490     # Don't use ln at all; we don't have any links
16491     as_ln_s='cp -p'
16492   else
16493     as_ln_s='ln -s'
16494   fi
16495 elif ln conf$$.file conf$$ 2>/dev/null; then
16496   as_ln_s=ln
16497 else
16498   as_ln_s='cp -p'
16499 fi
16500 rm -f conf$$ conf$$.exe conf$$.file
16501
16502 as_executable_p="test -f"
16503
16504 # Support unset when possible.
16505 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16506   as_unset=unset
16507 else
16508   as_unset=false
16509 fi
16510
16511 # NLS nuisances.
16512 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16513 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16514 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16515 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16516 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16517 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16518 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16519 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16520
16521 # IFS
16522 # We need space, tab and new line, in precisely that order.
16523 as_nl='
16524 '
16525 IFS="   $as_nl"
16526
16527 # CDPATH.
16528 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16529
16530 exec 6>&1
16531
16532 _ACEOF
16533
16534 # Files that config.status was made for.
16535 if test -n "$ac_config_files"; then
16536   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16537 fi
16538
16539 if test -n "$ac_config_headers"; then
16540   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16541 fi
16542
16543 if test -n "$ac_config_links"; then
16544   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16545 fi
16546
16547 if test -n "$ac_config_commands"; then
16548   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16549 fi
16550
16551 cat >>$CONFIG_STATUS <<\EOF
16552
16553 ac_cs_usage="\
16554 \`$as_me' instantiates files from templates according to the
16555 current configuration.
16556
16557 Usage: $0 [OPTIONS] [FILE]...
16558
16559   -h, --help       print this help, then exit
16560   -V, --version    print version number, then exit
16561   -d, --debug      don't remove temporary files
16562       --recheck    update $as_me by reconfiguring in the same conditions
16563   --file=FILE[:TEMPLATE]
16564                    instantiate the configuration file FILE
16565   --header=FILE[:TEMPLATE]
16566                    instantiate the configuration header FILE
16567
16568 Configuration files:
16569 $config_files
16570
16571 Configuration headers:
16572 $config_headers
16573
16574 Configuration commands:
16575 $config_commands
16576
16577 Report bugs to <dickey@invisible-island.net>."
16578 EOF
16579
16580 cat >>$CONFIG_STATUS <<EOF
16581 ac_cs_version="\\
16582 config.status
16583 configured by $0, generated by GNU Autoconf 2.52.20181006,
16584   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16585
16586 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16587 Free Software Foundation, Inc.
16588 This config.status script is free software; the Free Software Foundation
16589 gives unlimited permission to copy, distribute and modify it."
16590 srcdir=$srcdir
16591 INSTALL="$INSTALL"
16592 EOF
16593
16594 cat >>$CONFIG_STATUS <<\EOF
16595 # If no file are specified by the user, then we need to provide default
16596 # value.  By we need to know if files were specified by the user.
16597 ac_need_defaults=:
16598 while test $# != 0
16599 do
16600   case $1 in
16601   --*=*)
16602     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16603     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16604     shift
16605     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16606     shift
16607     ;;
16608   -*);;
16609   *) # This is not an option, so the user has probably given explicit
16610      # arguments.
16611      ac_need_defaults=false;;
16612   esac
16613
16614   case $1 in
16615   # Handling of the options.
16616 EOF
16617 cat >>$CONFIG_STATUS <<EOF
16618   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16619     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16620     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16621 EOF
16622 cat >>$CONFIG_STATUS <<\EOF
16623   --version | --vers* | -V )
16624     echo "$ac_cs_version"; exit 0 ;;
16625   --he | --h)
16626     # Conflict between --help and --header
16627     { { echo "$as_me:16627: error: ambiguous option: $1
16628 Try \`$0 --help' for more information." >&5
16629 echo "$as_me: error: ambiguous option: $1
16630 Try \`$0 --help' for more information." >&2;}
16631    { (exit 1); exit 1; }; };;
16632   --help | --hel | -h )
16633     echo "$ac_cs_usage"; exit 0 ;;
16634   --debug | --d* | -d )
16635     debug=: ;;
16636   --file | --fil | --fi | --f )
16637     shift
16638     CONFIG_FILES="$CONFIG_FILES $1"
16639     ac_need_defaults=false;;
16640   --header | --heade | --head | --hea )
16641     shift
16642     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16643     ac_need_defaults=false;;
16644
16645   # This is an error.
16646   -*) { { echo "$as_me:16646: error: unrecognized option: $1
16647 Try \`$0 --help' for more information." >&5
16648 echo "$as_me: error: unrecognized option: $1
16649 Try \`$0 --help' for more information." >&2;}
16650    { (exit 1); exit 1; }; } ;;
16651
16652   *) ac_config_targets="$ac_config_targets $1" ;;
16653
16654   esac
16655   shift
16656 done
16657
16658 exec 5>>config.log
16659 cat >&5 << _ACEOF
16660
16661 ## ----------------------- ##
16662 ## Running config.status.  ##
16663 ## ----------------------- ##
16664
16665 This file was extended by $as_me 2.52.20181006, executed with
16666   CONFIG_FILES    = $CONFIG_FILES
16667   CONFIG_HEADERS  = $CONFIG_HEADERS
16668   CONFIG_LINKS    = $CONFIG_LINKS
16669   CONFIG_COMMANDS = $CONFIG_COMMANDS
16670   > $ac_cs_invocation
16671 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16672
16673 _ACEOF
16674 EOF
16675
16676 cat >>$CONFIG_STATUS <<EOF
16677 #
16678 # INIT-COMMANDS section.
16679 #
16680
16681 ### Special initialization commands, used to pass information from the
16682 ### configuration-run into config.status
16683
16684 AWK="$AWK"
16685 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16686 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16687 LIB_NAME="$LIB_NAME"
16688 LIB_PREFIX="$LIB_PREFIX"
16689 LIB_SUFFIX="$LIB_SUFFIX"
16690 LN_S="$LN_S"
16691 NCURSES_MAJOR="$NCURSES_MAJOR"
16692 NCURSES_MINOR="$NCURSES_MINOR"
16693 NCURSES_PATCH="$NCURSES_PATCH"
16694 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16695 cf_cv_abi_version="$cf_cv_abi_version"
16696 cf_cv_rel_version="$cf_cv_rel_version"
16697 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16698 cf_cv_shared_soname='$cf_cv_shared_soname'
16699 cf_cv_shlib_version="$cf_cv_shlib_version"
16700 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16701 cf_cv_system_name="$cf_cv_system_name"
16702 host="$host"
16703 target="$target"
16704
16705 EOF
16706
16707 cat >>$CONFIG_STATUS <<\EOF
16708 for ac_config_target in $ac_config_targets
16709 do
16710   case "$ac_config_target" in
16711   # Handling of arguments.
16712   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16713   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16714   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16715   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16716   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16717   *) { { echo "$as_me:16717: error: invalid argument: $ac_config_target" >&5
16718 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16719    { (exit 1); exit 1; }; };;
16720   esac
16721 done
16722
16723 # If the user did not use the arguments to specify the items to instantiate,
16724 # then the envvar interface is used.  Set only those that are not.
16725 # We use the long form for the default assignment because of an extremely
16726 # bizarre bug on SunOS 4.1.3.
16727 if $ac_need_defaults; then
16728   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16729   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16730   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16731 fi
16732
16733 # Create a temporary directory, and hook for its removal unless debugging.
16734 $debug ||
16735 {
16736   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16737   trap '{ (exit 1); exit 1; }' 1 2 13 15
16738 }
16739
16740 # Create a (secure) tmp directory for tmp files.
16741 : ${TMPDIR=/tmp}
16742 {
16743   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16744   test -n "$tmp" && test -d "$tmp"
16745 }  ||
16746 {
16747   tmp=$TMPDIR/cs$$-$RANDOM
16748   (umask 077 && mkdir $tmp)
16749 } ||
16750 {
16751    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16752    { (exit 1); exit 1; }
16753 }
16754
16755 EOF
16756
16757 cat >>$CONFIG_STATUS <<EOF
16758
16759 #
16760 # CONFIG_FILES section.
16761 #
16762
16763 # No need to generate the scripts if there are no CONFIG_FILES.
16764 # This happens for instance when ./config.status config.h
16765 if test -n "\$CONFIG_FILES"; then
16766   # Protect against being on the right side of a sed subst in config.status.
16767   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16768    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16769 s,@SHELL@,$SHELL,;t t
16770 s,@exec_prefix@,$exec_prefix,;t t
16771 s,@prefix@,$prefix,;t t
16772 s,@program_transform_name@,$program_transform_name,;t t
16773 s,@bindir@,$bindir,;t t
16774 s,@sbindir@,$sbindir,;t t
16775 s,@libexecdir@,$libexecdir,;t t
16776 s,@datarootdir@,$datarootdir,;t t
16777 s,@datadir@,$datadir,;t t
16778 s,@sysconfdir@,$sysconfdir,;t t
16779 s,@sharedstatedir@,$sharedstatedir,;t t
16780 s,@localstatedir@,$localstatedir,;t t
16781 s,@runstatedir@,$runstatedir,;t t
16782 s,@libdir@,$libdir,;t t
16783 s,@includedir@,$includedir,;t t
16784 s,@oldincludedir@,$oldincludedir,;t t
16785 s,@infodir@,$infodir,;t t
16786 s,@mandir@,$mandir,;t t
16787 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16788 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16789 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16790 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16791 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16792 s,@build_alias@,$build_alias,;t t
16793 s,@host_alias@,$host_alias,;t t
16794 s,@target_alias@,$target_alias,;t t
16795 s,@ECHO_C@,$ECHO_C,;t t
16796 s,@ECHO_N@,$ECHO_N,;t t
16797 s,@ECHO_T@,$ECHO_T,;t t
16798 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16799 s,@DEFS@,$DEFS,;t t
16800 s,@LIBS@,$LIBS,;t t
16801 s,@top_builddir@,$top_builddir,;t t
16802 s,@build@,$build,;t t
16803 s,@build_cpu@,$build_cpu,;t t
16804 s,@build_vendor@,$build_vendor,;t t
16805 s,@build_os@,$build_os,;t t
16806 s,@host@,$host,;t t
16807 s,@host_cpu@,$host_cpu,;t t
16808 s,@host_vendor@,$host_vendor,;t t
16809 s,@host_os@,$host_os,;t t
16810 s,@target@,$target,;t t
16811 s,@target_cpu@,$target_cpu,;t t
16812 s,@target_vendor@,$target_vendor,;t t
16813 s,@target_os@,$target_os,;t t
16814 s,@CC@,$CC,;t t
16815 s,@CFLAGS@,$CFLAGS,;t t
16816 s,@LDFLAGS@,$LDFLAGS,;t t
16817 s,@CPPFLAGS@,$CPPFLAGS,;t t
16818 s,@ac_ct_CC@,$ac_ct_CC,;t t
16819 s,@EXEEXT@,$EXEEXT,;t t
16820 s,@OBJEXT@,$OBJEXT,;t t
16821 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16822 s,@CPP@,$CPP,;t t
16823 s,@AWK@,$AWK,;t t
16824 s,@EGREP@,$EGREP,;t t
16825 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16826 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16827 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16828 s,@LN_S@,$LN_S,;t t
16829 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
16830 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
16831 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16832 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16833 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
16834 s,@SET_MAKE@,$SET_MAKE,;t t
16835 s,@CTAGS@,$CTAGS,;t t
16836 s,@ETAGS@,$ETAGS,;t t
16837 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16838 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16839 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
16840 s,@RANLIB@,$RANLIB,;t t
16841 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
16842 s,@LD@,$LD,;t t
16843 s,@ac_ct_LD@,$ac_ct_LD,;t t
16844 s,@AR@,$AR,;t t
16845 s,@ac_ct_AR@,$ac_ct_AR,;t t
16846 s,@ARFLAGS@,$ARFLAGS,;t t
16847 s,@DESTDIR@,$DESTDIR,;t t
16848 s,@BUILD_CC@,$BUILD_CC,;t t
16849 s,@BUILD_CPP@,$BUILD_CPP,;t t
16850 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
16851 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
16852 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
16853 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
16854 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
16855 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
16856 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
16857 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16858 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16859 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16860 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
16861 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
16862 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
16863 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16864 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16865 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
16866 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
16867 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
16868 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
16869 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
16870 s,@CC_G_OPT@,$CC_G_OPT,;t t
16871 s,@LD_MODEL@,$LD_MODEL,;t t
16872 s,@shlibdir@,$shlibdir,;t t
16873 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
16874 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16875 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
16876 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16877 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
16878 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
16879 s,@LINK_PROGS@,$LINK_PROGS,;t t
16880 s,@LINK_TESTS@,$LINK_TESTS,;t t
16881 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16882 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16883 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
16884 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
16885 s,@RPATH_LIST@,$RPATH_LIST,;t t
16886 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
16887 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
16888 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
16889 s,@PTHREAD@,$PTHREAD,;t t
16890 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
16891 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16892 s,@ECHO_LT@,$ECHO_LT,;t t
16893 s,@ECHO_LD@,$ECHO_LD,;t t
16894 s,@RULE_CC@,$RULE_CC,;t t
16895 s,@SHOW_CC@,$SHOW_CC,;t t
16896 s,@ECHO_CC@,$ECHO_CC,;t t
16897 s,@ADAFLAGS@,$ADAFLAGS,;t t
16898 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16899 s,@ADA_TRACE@,$ADA_TRACE,;t t
16900 s,@gnatmake_exists@,$gnatmake_exists,;t t
16901 s,@gprconfig_exists@,$gprconfig_exists,;t t
16902 s,@M4_exists@,$M4_exists,;t t
16903 s,@cf_ada_make@,$cf_ada_make,;t t
16904 s,@cf_ada_config@,$cf_ada_config,;t t
16905 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
16906 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
16907 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
16908 s,@cf_compile_generics@,$cf_compile_generics,;t t
16909 s,@cf_generic_objects@,$cf_generic_objects,;t t
16910 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
16911 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
16912 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
16913 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
16914 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
16915 s,@cf_ada_package@,$cf_ada_package,;t t
16916 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
16917 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
16918 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
16919 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
16920 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
16921 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16922 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
16923 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
16924 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16925 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16926 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
16927 s,@TEST_ARG2@,$TEST_ARG2,;t t
16928 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
16929 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
16930 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
16931 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
16932 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
16933 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
16934 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
16935 CEOF
16936
16937 EOF
16938
16939   cat >>$CONFIG_STATUS <<\EOF
16940   # Split the substitutions into bite-sized pieces for seds with
16941   # small command number limits, like on Digital OSF/1 and HP-UX.
16942   ac_max_sed_lines=48
16943   ac_sed_frag=1 # Number of current file.
16944   ac_beg=1 # First line for current file.
16945   ac_end=$ac_max_sed_lines # Line after last line for current file.
16946   ac_more_lines=:
16947   ac_sed_cmds=
16948   while $ac_more_lines; do
16949     if test $ac_beg -gt 1; then
16950       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16951     else
16952       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16953     fi
16954     if test ! -s $tmp/subs.frag; then
16955       ac_more_lines=false
16956     else
16957       # The purpose of the label and of the branching condition is to
16958       # speed up the sed processing (if there are no `@' at all, there
16959       # is no need to browse any of the substitutions).
16960       # These are the two extra sed commands mentioned above.
16961       (echo ':t
16962   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16963       # It is possible to make a multiline substitution using escaped newlines.
16964       # Ensure that we do not split the substitution between script fragments.
16965       ac_BEG=$ac_end
16966       ac_END=`expr $ac_end + $ac_max_sed_lines`
16967       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
16968       if test -s $tmp/subs.next; then
16969         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
16970         if test ! -s $tmp/subs.edit; then
16971           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
16972           if test ! -s $tmp/subs.edit; then
16973             if test $ac_beg -gt 1; then
16974               ac_end=`expr $ac_end - 1`
16975               continue
16976             fi
16977           fi
16978         fi
16979       fi
16980
16981       if test -z "$ac_sed_cmds"; then
16982         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16983       else
16984         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16985       fi
16986       ac_sed_frag=`expr $ac_sed_frag + 1`
16987       ac_beg=$ac_end
16988       ac_end=`expr $ac_end + $ac_max_sed_lines`
16989     fi
16990   done
16991   if test -z "$ac_sed_cmds"; then
16992     ac_sed_cmds=cat
16993   fi
16994 fi # test -n "$CONFIG_FILES"
16995
16996 EOF
16997 cat >>$CONFIG_STATUS <<\EOF
16998 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16999   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17000   case $ac_file in
17001   - | *:- | *:-:* ) # input from stdin
17002         cat >$tmp/stdin
17003         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17004         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17005   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17006         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17007   * )   ac_file_in=$ac_file.in ;;
17008   esac
17009
17010   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17011   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17012          X"$ac_file" : 'X\(//\)[^/]' \| \
17013          X"$ac_file" : 'X\(//\)$' \| \
17014          X"$ac_file" : 'X\(/\)' \| \
17015          .     : '\(.\)' 2>/dev/null ||
17016 echo X"$ac_file" |
17017     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17018           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17019           /^X\(\/\/\)$/{ s//\1/; q; }
17020           /^X\(\/\).*/{ s//\1/; q; }
17021           s/.*/./; q'`
17022   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17023     { case "$ac_dir" in
17024   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17025   *)                      as_incr_dir=.;;
17026 esac
17027 as_dummy="$ac_dir"
17028 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17029   case $as_mkdir_dir in
17030     # Skip DOS drivespec
17031     ?:) as_incr_dir=$as_mkdir_dir ;;
17032     *)
17033       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17034       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17035     ;;
17036   esac
17037 done; }
17038
17039     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17040     # A "../" for each directory in $ac_dir_suffix.
17041     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17042   else
17043     ac_dir_suffix= ac_dots=
17044   fi
17045
17046   case $srcdir in
17047   .)  ac_srcdir=.
17048       if test -z "$ac_dots"; then
17049          ac_top_srcdir=.
17050       else
17051          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17052       fi ;;
17053   [\\/]* | ?:[\\/]* )
17054       ac_srcdir=$srcdir$ac_dir_suffix;
17055       ac_top_srcdir=$srcdir ;;
17056   *) # Relative path.
17057     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17058     ac_top_srcdir=$ac_dots$srcdir ;;
17059   esac
17060
17061   case $INSTALL in
17062   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17063   *) ac_INSTALL=$ac_dots$INSTALL ;;
17064   esac
17065
17066   if test x"$ac_file" != x-; then
17067     { echo "$as_me:17067: creating $ac_file" >&5
17068 echo "$as_me: creating $ac_file" >&6;}
17069     rm -f "$ac_file"
17070   fi
17071   # Let's still pretend it is `configure' which instantiates (i.e., don't
17072   # use $as_me), people would be surprised to read:
17073   #    /* config.h.  Generated automatically by config.status.  */
17074   configure_input="Generated automatically from `echo $ac_file_in |
17075                                                  sed 's,.*/,,'` by configure."
17076
17077   # First look for the input files in the build tree, otherwise in the
17078   # src tree.
17079   ac_file_inputs=`IFS=:
17080     for f in $ac_file_in; do
17081       case $f in
17082       -) echo $tmp/stdin ;;
17083       [\\/$]*)
17084          # Absolute (can't be DOS-style, as IFS=:)
17085          test -f "$f" || { { echo "$as_me:17085: error: cannot find input file: $f" >&5
17086 echo "$as_me: error: cannot find input file: $f" >&2;}
17087    { (exit 1); exit 1; }; }
17088          echo $f;;
17089       *) # Relative
17090          if test -f "$f"; then
17091            # Build tree
17092            echo $f
17093          elif test -f "$srcdir/$f"; then
17094            # Source tree
17095            echo $srcdir/$f
17096          else
17097            # /dev/null tree
17098            { { echo "$as_me:17098: error: cannot find input file: $f" >&5
17099 echo "$as_me: error: cannot find input file: $f" >&2;}
17100    { (exit 1); exit 1; }; }
17101          fi;;
17102       esac
17103     done` || { (exit 1); exit 1; }
17104 EOF
17105 cat >>$CONFIG_STATUS <<\EOF
17106   ac_warn_datarootdir=no
17107   if test x"$ac_file" != x-; then
17108     for ac_item in $ac_file_inputs
17109     do
17110       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17111       if test -n "$ac_seen"; then
17112         ac_used=`grep '@datarootdir@' $ac_item`
17113         if test -z "$ac_used"; then
17114           { echo "$as_me:17114: WARNING: datarootdir was used implicitly but not set:
17115 $ac_seen" >&5
17116 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17117 $ac_seen" >&2;}
17118           ac_warn_datarootdir=yes
17119         fi
17120       fi
17121       ac_seen=`grep '${datarootdir}' $ac_item`
17122       if test -n "$ac_seen"; then
17123         { echo "$as_me:17123: WARNING: datarootdir was used explicitly but not set:
17124 $ac_seen" >&5
17125 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17126 $ac_seen" >&2;}
17127         ac_warn_datarootdir=yes
17128       fi
17129     done
17130   fi
17131
17132 if test "x$ac_warn_datarootdir" = xyes; then
17133   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17134 fi
17135
17136 EOF
17137 cat >>$CONFIG_STATUS <<EOF
17138   sed "$ac_vpsub
17139 $extrasub
17140 EOF
17141 cat >>$CONFIG_STATUS <<\EOF
17142 :t
17143 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17144 s,@configure_input@,$configure_input,;t t
17145 s,@srcdir@,$ac_srcdir,;t t
17146 s,@top_srcdir@,$ac_top_srcdir,;t t
17147 s,@INSTALL@,$ac_INSTALL,;t t
17148 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17149   rm -f $tmp/stdin
17150   if test x"$ac_file" != x-; then
17151     cp $tmp/out $ac_file
17152
17153     for ac_name in prefix exec_prefix datarootdir
17154     do
17155         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17156         if test -n "$ac_seen"; then
17157             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17158             if test -z "$ac_init"; then
17159               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17160               { echo "$as_me:17160: WARNING: Variable $ac_name is used but was not set:
17161 $ac_seen" >&5
17162 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17163 $ac_seen" >&2;}
17164             fi
17165         fi
17166     done
17167     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17168     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17169     if test -s $tmp/out; then
17170       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17171       { echo "$as_me:17171: WARNING: Some variables may not be substituted:
17172 $ac_seen" >&5
17173 echo "$as_me: WARNING: Some variables may not be substituted:
17174 $ac_seen" >&2;}
17175     fi
17176   else
17177     cat $tmp/out
17178   fi
17179   rm -f $tmp/out
17180
17181 done
17182 EOF
17183 cat >>$CONFIG_STATUS <<\EOF
17184
17185 #
17186 # CONFIG_HEADER section.
17187 #
17188
17189 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17190 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17191 #
17192 # ac_d sets the value in "#define NAME VALUE" lines.
17193 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17194 ac_dB='[        ].*$,\1#\2'
17195 ac_dC=' '
17196 ac_dD=',;t'
17197 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17198 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17199 ac_iB='\([      ]\),\1#\2define\3'
17200 ac_iC=' '
17201 ac_iD='\4,;t'
17202 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17203 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17204 ac_uB='$,\1#\2define\3'
17205 ac_uC=' '
17206 ac_uD=',;t'
17207
17208 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17209   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17210   case $ac_file in
17211   - | *:- | *:-:* ) # input from stdin
17212         cat >$tmp/stdin
17213         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17214         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17215   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17216         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17217   * )   ac_file_in=$ac_file.in ;;
17218   esac
17219
17220   test x"$ac_file" != x- && { echo "$as_me:17220: creating $ac_file" >&5
17221 echo "$as_me: creating $ac_file" >&6;}
17222
17223   # First look for the input files in the build tree, otherwise in the
17224   # src tree.
17225   ac_file_inputs=`IFS=:
17226     for f in $ac_file_in; do
17227       case $f in
17228       -) echo $tmp/stdin ;;
17229       [\\/$]*)
17230          # Absolute (can't be DOS-style, as IFS=:)
17231          test -f "$f" || { { echo "$as_me:17231: error: cannot find input file: $f" >&5
17232 echo "$as_me: error: cannot find input file: $f" >&2;}
17233    { (exit 1); exit 1; }; }
17234          echo $f;;
17235       *) # Relative
17236          if test -f "$f"; then
17237            # Build tree
17238            echo $f
17239          elif test -f "$srcdir/$f"; then
17240            # Source tree
17241            echo $srcdir/$f
17242          else
17243            # /dev/null tree
17244            { { echo "$as_me:17244: error: cannot find input file: $f" >&5
17245 echo "$as_me: error: cannot find input file: $f" >&2;}
17246    { (exit 1); exit 1; }; }
17247          fi;;
17248       esac
17249     done` || { (exit 1); exit 1; }
17250   # Remove the trailing spaces.
17251   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17252
17253 EOF
17254
17255 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17256 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17257 # be either 'cat' or 'sort'.
17258 cat confdefs.h | uniq >conftest.vals
17259
17260 # Break up conftest.vals because some shells have a limit on
17261 # the size of here documents, and old seds have small limits too.
17262
17263 rm -f conftest.tail
17264 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17265 while grep . conftest.vals >/dev/null
17266 do
17267   # Write chunks of a limited-size here document to conftest.frag.
17268   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17269   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17270   echo 'CEOF' >> $CONFIG_STATUS
17271   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17272   rm -f conftest.vals
17273   mv conftest.tail conftest.vals
17274 done
17275 rm -f conftest.vals
17276
17277 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17278 # marker @DEFS@.
17279 echo '  cat >> conftest.edit <<CEOF
17280 /@DEFS@/r conftest.frag
17281 /@DEFS@/d
17282 CEOF
17283 sed -f conftest.edit $tmp/in > $tmp/out
17284 rm -f $tmp/in
17285 mv $tmp/out $tmp/in
17286 rm -f conftest.edit conftest.frag
17287 ' >> $CONFIG_STATUS
17288
17289 cat >>$CONFIG_STATUS <<\EOF
17290   # Let's still pretend it is `configure' which instantiates (i.e., don't
17291   # use $as_me), people would be surprised to read:
17292   #    /* config.h.  Generated automatically by config.status.  */
17293   if test x"$ac_file" = x-; then
17294     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17295   else
17296     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17297   fi
17298   cat $tmp/in >>$tmp/config.h
17299   rm -f $tmp/in
17300   if test x"$ac_file" != x-; then
17301     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17302       { echo "$as_me:17302: $ac_file is unchanged" >&5
17303 echo "$as_me: $ac_file is unchanged" >&6;}
17304     else
17305       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17306          X"$ac_file" : 'X\(//\)[^/]' \| \
17307          X"$ac_file" : 'X\(//\)$' \| \
17308          X"$ac_file" : 'X\(/\)' \| \
17309          .     : '\(.\)' 2>/dev/null ||
17310 echo X"$ac_file" |
17311     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17312           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17313           /^X\(\/\/\)$/{ s//\1/; q; }
17314           /^X\(\/\).*/{ s//\1/; q; }
17315           s/.*/./; q'`
17316       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17317         { case "$ac_dir" in
17318   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17319   *)                      as_incr_dir=.;;
17320 esac
17321 as_dummy="$ac_dir"
17322 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17323   case $as_mkdir_dir in
17324     # Skip DOS drivespec
17325     ?:) as_incr_dir=$as_mkdir_dir ;;
17326     *)
17327       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17328       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17329     ;;
17330   esac
17331 done; }
17332
17333       fi
17334       rm -f $ac_file
17335       mv $tmp/config.h $ac_file
17336     fi
17337   else
17338     cat $tmp/config.h
17339     rm -f $tmp/config.h
17340   fi
17341 done
17342 EOF
17343 cat >>$CONFIG_STATUS <<\EOF
17344 #
17345 # CONFIG_COMMANDS section.
17346 #
17347 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17348   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17349   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17350
17351   case $ac_dest in
17352     default )
17353 if test -z "$USE_OLD_MAKERULES" ; then
17354         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17355 fi
17356  ;;
17357   esac
17358 done
17359 EOF
17360
17361 cat >>$CONFIG_STATUS <<\EOF
17362
17363 { (exit 0); exit 0; }
17364 EOF
17365 chmod +x $CONFIG_STATUS
17366 ac_clean_files=$ac_clean_files_save
17367
17368 # configure is writing to config.log, and then calls config.status.
17369 # config.status does its own redirection, appending to config.log.
17370 # Unfortunately, on DOS this fails, as config.log is still kept open
17371 # by configure, so config.status won't be able to write to it; its
17372 # output is simply discarded.  So we exec the FD to /dev/null,
17373 # effectively closing config.log, so it can be properly (re)opened and
17374 # appended to by config.status.  When coming back to configure, we
17375 # need to make the FD available again.
17376 if test "$no_create" != yes; then
17377   ac_cs_success=:
17378   exec 5>/dev/null
17379   $SHELL $CONFIG_STATUS || ac_cs_success=false
17380   exec 5>>config.log
17381   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17382   # would make configure fail if this is the last instruction.
17383   $ac_cs_success || { (exit 1); exit 1; }
17384 fi
17385 ${MAKE:-make} preinstall