]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
5b45539e195c41a7e113eaf3301bff9501e6e1c1
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.71 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20190828.
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.20190828.  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 echo "$as_me:10925: checking if the POSIX test-macros are already defined" >&5
10926 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
10927 if test "${cf_cv_posix_visible+set}" = set; then
10928   echo $ECHO_N "(cached) $ECHO_C" >&6
10929 else
10930
10931 cat >conftest.$ac_ext <<_ACEOF
10932 #line 10932 "configure"
10933 #include "confdefs.h"
10934 #include <stdio.h>
10935 int
10936 main (void)
10937 {
10938
10939 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
10940         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
10941         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
10942         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
10943 #error conflicting symbols found
10944 #endif
10945
10946   ;
10947   return 0;
10948 }
10949 _ACEOF
10950 rm -f conftest.$ac_objext
10951 if { (eval echo "$as_me:10951: \"$ac_compile\"") >&5
10952   (eval $ac_compile) 2>&5
10953   ac_status=$?
10954   echo "$as_me:10954: \$? = $ac_status" >&5
10955   (exit $ac_status); } &&
10956          { ac_try='test -s conftest.$ac_objext'
10957   { (eval echo "$as_me:10957: \"$ac_try\"") >&5
10958   (eval $ac_try) 2>&5
10959   ac_status=$?
10960   echo "$as_me:10960: \$? = $ac_status" >&5
10961   (exit $ac_status); }; }; then
10962   cf_cv_posix_visible=no
10963 else
10964   echo "$as_me: failed program was:" >&5
10965 cat conftest.$ac_ext >&5
10966 cf_cv_posix_visible=yes
10967 fi
10968 rm -f conftest.$ac_objext conftest.$ac_ext
10969
10970 fi
10971 echo "$as_me:10971: result: $cf_cv_posix_visible" >&5
10972 echo "${ECHO_T}$cf_cv_posix_visible" >&6
10973
10974 if test "$cf_cv_posix_visible" = no; then
10975
10976 cf_XOPEN_SOURCE=600
10977 cf_POSIX_C_SOURCE=199506L
10978 cf_xopen_source=
10979
10980 case $host_os in
10981 (aix[4-7]*)
10982         cf_xopen_source="-D_ALL_SOURCE"
10983         ;;
10984 (msys)
10985         cf_XOPEN_SOURCE=600
10986         ;;
10987 (darwin[0-8].*)
10988         cf_xopen_source="-D_APPLE_C_SOURCE"
10989         ;;
10990 (darwin*)
10991         cf_xopen_source="-D_DARWIN_C_SOURCE"
10992         cf_XOPEN_SOURCE=
10993         ;;
10994 (freebsd*|dragonfly*|midnightbsd*)
10995         # 5.x headers associate
10996         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10997         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10998         cf_POSIX_C_SOURCE=200112L
10999         cf_XOPEN_SOURCE=600
11000         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11001         ;;
11002 (hpux11*)
11003         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11004         ;;
11005 (hpux*)
11006         cf_xopen_source="-D_HPUX_SOURCE"
11007         ;;
11008 (irix[56].*)
11009         cf_xopen_source="-D_SGI_SOURCE"
11010         cf_XOPEN_SOURCE=
11011         ;;
11012 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11013
11014 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11015
11016 echo "$as_me:11016: checking if this is the GNU C library" >&5
11017 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11018 if test "${cf_cv_gnu_library+set}" = set; then
11019   echo $ECHO_N "(cached) $ECHO_C" >&6
11020 else
11021
11022 cat >conftest.$ac_ext <<_ACEOF
11023 #line 11023 "configure"
11024 #include "confdefs.h"
11025 #include <sys/types.h>
11026 int
11027 main (void)
11028 {
11029
11030         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11031                 return 0;
11032         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11033                 return 0;
11034         #else
11035         #       error not GNU C library
11036         #endif
11037   ;
11038   return 0;
11039 }
11040 _ACEOF
11041 rm -f conftest.$ac_objext
11042 if { (eval echo "$as_me:11042: \"$ac_compile\"") >&5
11043   (eval $ac_compile) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit $ac_status); } &&
11047          { ac_try='test -s conftest.$ac_objext'
11048   { (eval echo "$as_me:11048: \"$ac_try\"") >&5
11049   (eval $ac_try) 2>&5
11050   ac_status=$?
11051   echo "$as_me:11051: \$? = $ac_status" >&5
11052   (exit $ac_status); }; }; then
11053   cf_cv_gnu_library=yes
11054 else
11055   echo "$as_me: failed program was:" >&5
11056 cat conftest.$ac_ext >&5
11057 cf_cv_gnu_library=no
11058 fi
11059 rm -f conftest.$ac_objext conftest.$ac_ext
11060
11061 fi
11062 echo "$as_me:11062: result: $cf_cv_gnu_library" >&5
11063 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11064
11065 if test x$cf_cv_gnu_library = xyes; then
11066
11067         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11068         # was changed to help a little.  newlib incorporated the change about 4
11069         # years later.
11070         echo "$as_me:11070: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11071 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11072 if test "${cf_cv_gnu_library_219+set}" = set; then
11073   echo $ECHO_N "(cached) $ECHO_C" >&6
11074 else
11075
11076                 cf_save="$CPPFLAGS"
11077
11078         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11079         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11080
11081                 cat >conftest.$ac_ext <<_ACEOF
11082 #line 11082 "configure"
11083 #include "confdefs.h"
11084 #include <sys/types.h>
11085 int
11086 main (void)
11087 {
11088
11089                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11090                                 return 0;
11091                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11092                                 return 0;
11093                         #else
11094                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11095                         #endif
11096   ;
11097   return 0;
11098 }
11099 _ACEOF
11100 rm -f conftest.$ac_objext
11101 if { (eval echo "$as_me:11101: \"$ac_compile\"") >&5
11102   (eval $ac_compile) 2>&5
11103   ac_status=$?
11104   echo "$as_me:11104: \$? = $ac_status" >&5
11105   (exit $ac_status); } &&
11106          { ac_try='test -s conftest.$ac_objext'
11107   { (eval echo "$as_me:11107: \"$ac_try\"") >&5
11108   (eval $ac_try) 2>&5
11109   ac_status=$?
11110   echo "$as_me:11110: \$? = $ac_status" >&5
11111   (exit $ac_status); }; }; then
11112   cf_cv_gnu_library_219=yes
11113 else
11114   echo "$as_me: failed program was:" >&5
11115 cat conftest.$ac_ext >&5
11116 cf_cv_gnu_library_219=no
11117 fi
11118 rm -f conftest.$ac_objext conftest.$ac_ext
11119                 CPPFLAGS="$cf_save"
11120
11121 fi
11122 echo "$as_me:11122: result: $cf_cv_gnu_library_219" >&5
11123 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11124
11125         if test "x$cf_cv_gnu_library_219" = xyes; then
11126                 cf_save="$CPPFLAGS"
11127                 echo "$as_me:11127: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11128 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11129 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11130   echo $ECHO_N "(cached) $ECHO_C" >&6
11131 else
11132
11133 cf_fix_cppflags=no
11134 cf_new_cflags=
11135 cf_new_cppflags=
11136 cf_new_extra_cppflags=
11137
11138 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11139 do
11140 case $cf_fix_cppflags in
11141 (no)
11142         case $cf_add_cflags in
11143         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11144                 case $cf_add_cflags in
11145                 (-D*)
11146                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11147
11148                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11149                                 && test -z "${cf_tst_cflags}" \
11150                                 && cf_fix_cppflags=yes
11151
11152                         if test $cf_fix_cppflags = yes ; then
11153
11154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11156
11157                                 continue
11158                         elif test "${cf_tst_cflags}" = "\"'" ; then
11159
11160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11162
11163                                 continue
11164                         fi
11165                         ;;
11166                 esac
11167                 case "$CPPFLAGS" in
11168                 (*$cf_add_cflags)
11169                         ;;
11170                 (*)
11171                         case $cf_add_cflags in
11172                         (-D*)
11173                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11174
11175 CPPFLAGS=`echo "$CPPFLAGS" | \
11176         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11177                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11178
11179                                 ;;
11180                         esac
11181
11182         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11183         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11184
11185                         ;;
11186                 esac
11187                 ;;
11188         (*)
11189
11190         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11191         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11192
11193                 ;;
11194         esac
11195         ;;
11196 (yes)
11197
11198         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11199         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11200
11201         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11202
11203         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11204                 && test -z "${cf_tst_cflags}" \
11205                 && cf_fix_cppflags=no
11206         ;;
11207 esac
11208 done
11209
11210 if test -n "$cf_new_cflags" ; then
11211
11212         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11213         CFLAGS="${CFLAGS}$cf_new_cflags"
11214
11215 fi
11216
11217 if test -n "$cf_new_cppflags" ; then
11218
11219         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11220         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11221
11222 fi
11223
11224 if test -n "$cf_new_extra_cppflags" ; then
11225
11226         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11227         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11228
11229 fi
11230
11231                         cat >conftest.$ac_ext <<_ACEOF
11232 #line 11232 "configure"
11233 #include "confdefs.h"
11234
11235                                 #include <limits.h>
11236                                 #include <sys/types.h>
11237
11238 int
11239 main (void)
11240 {
11241
11242                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11243                                         return 0;
11244                                 #else
11245                                 #       error GNU C library is too old
11246                                 #endif
11247   ;
11248   return 0;
11249 }
11250 _ACEOF
11251 rm -f conftest.$ac_objext
11252 if { (eval echo "$as_me:11252: \"$ac_compile\"") >&5
11253   (eval $ac_compile) 2>&5
11254   ac_status=$?
11255   echo "$as_me:11255: \$? = $ac_status" >&5
11256   (exit $ac_status); } &&
11257          { ac_try='test -s conftest.$ac_objext'
11258   { (eval echo "$as_me:11258: \"$ac_try\"") >&5
11259   (eval $ac_try) 2>&5
11260   ac_status=$?
11261   echo "$as_me:11261: \$? = $ac_status" >&5
11262   (exit $ac_status); }; }; then
11263   cf_cv_gnu_dftsrc_219=yes
11264 else
11265   echo "$as_me: failed program was:" >&5
11266 cat conftest.$ac_ext >&5
11267 cf_cv_gnu_dftsrc_219=no
11268 fi
11269 rm -f conftest.$ac_objext conftest.$ac_ext
11270
11271 fi
11272 echo "$as_me:11272: result: $cf_cv_gnu_dftsrc_219" >&5
11273 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11274                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11275         else
11276                 cf_cv_gnu_dftsrc_219=maybe
11277         fi
11278
11279         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11280
11281                 echo "$as_me:11281: checking if we must define _GNU_SOURCE" >&5
11282 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11283 if test "${cf_cv_gnu_source+set}" = set; then
11284   echo $ECHO_N "(cached) $ECHO_C" >&6
11285 else
11286
11287                 cat >conftest.$ac_ext <<_ACEOF
11288 #line 11288 "configure"
11289 #include "confdefs.h"
11290 #include <sys/types.h>
11291 int
11292 main (void)
11293 {
11294
11295                         #ifndef _XOPEN_SOURCE
11296                         #error  expected _XOPEN_SOURCE to be defined
11297                         #endif
11298   ;
11299   return 0;
11300 }
11301 _ACEOF
11302 rm -f conftest.$ac_objext
11303 if { (eval echo "$as_me:11303: \"$ac_compile\"") >&5
11304   (eval $ac_compile) 2>&5
11305   ac_status=$?
11306   echo "$as_me:11306: \$? = $ac_status" >&5
11307   (exit $ac_status); } &&
11308          { ac_try='test -s conftest.$ac_objext'
11309   { (eval echo "$as_me:11309: \"$ac_try\"") >&5
11310   (eval $ac_try) 2>&5
11311   ac_status=$?
11312   echo "$as_me:11312: \$? = $ac_status" >&5
11313   (exit $ac_status); }; }; then
11314   cf_cv_gnu_source=no
11315 else
11316   echo "$as_me: failed program was:" >&5
11317 cat conftest.$ac_ext >&5
11318 cf_save="$CPPFLAGS"
11319
11320 cf_fix_cppflags=no
11321 cf_new_cflags=
11322 cf_new_cppflags=
11323 cf_new_extra_cppflags=
11324
11325 for cf_add_cflags in -D_GNU_SOURCE
11326 do
11327 case $cf_fix_cppflags in
11328 (no)
11329         case $cf_add_cflags in
11330         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11331                 case $cf_add_cflags in
11332                 (-D*)
11333                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11334
11335                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11336                                 && test -z "${cf_tst_cflags}" \
11337                                 && cf_fix_cppflags=yes
11338
11339                         if test $cf_fix_cppflags = yes ; then
11340
11341         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11342         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11343
11344                                 continue
11345                         elif test "${cf_tst_cflags}" = "\"'" ; then
11346
11347         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11348         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11349
11350                                 continue
11351                         fi
11352                         ;;
11353                 esac
11354                 case "$CPPFLAGS" in
11355                 (*$cf_add_cflags)
11356                         ;;
11357                 (*)
11358                         case $cf_add_cflags in
11359                         (-D*)
11360                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11361
11362 CPPFLAGS=`echo "$CPPFLAGS" | \
11363         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11364                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11365
11366                                 ;;
11367                         esac
11368
11369         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11370         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11371
11372                         ;;
11373                 esac
11374                 ;;
11375         (*)
11376
11377         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11378         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11379
11380                 ;;
11381         esac
11382         ;;
11383 (yes)
11384
11385         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11386         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11387
11388         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11389
11390         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11391                 && test -z "${cf_tst_cflags}" \
11392                 && cf_fix_cppflags=no
11393         ;;
11394 esac
11395 done
11396
11397 if test -n "$cf_new_cflags" ; then
11398
11399         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11400         CFLAGS="${CFLAGS}$cf_new_cflags"
11401
11402 fi
11403
11404 if test -n "$cf_new_cppflags" ; then
11405
11406         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11407         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11408
11409 fi
11410
11411 if test -n "$cf_new_extra_cppflags" ; then
11412
11413         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11414         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11415
11416 fi
11417
11418                          cat >conftest.$ac_ext <<_ACEOF
11419 #line 11419 "configure"
11420 #include "confdefs.h"
11421 #include <sys/types.h>
11422 int
11423 main (void)
11424 {
11425
11426                                 #ifdef _XOPEN_SOURCE
11427                                 #error  expected _XOPEN_SOURCE to be undefined
11428                                 #endif
11429   ;
11430   return 0;
11431 }
11432 _ACEOF
11433 rm -f conftest.$ac_objext
11434 if { (eval echo "$as_me:11434: \"$ac_compile\"") >&5
11435   (eval $ac_compile) 2>&5
11436   ac_status=$?
11437   echo "$as_me:11437: \$? = $ac_status" >&5
11438   (exit $ac_status); } &&
11439          { ac_try='test -s conftest.$ac_objext'
11440   { (eval echo "$as_me:11440: \"$ac_try\"") >&5
11441   (eval $ac_try) 2>&5
11442   ac_status=$?
11443   echo "$as_me:11443: \$? = $ac_status" >&5
11444   (exit $ac_status); }; }; then
11445   cf_cv_gnu_source=no
11446 else
11447   echo "$as_me: failed program was:" >&5
11448 cat conftest.$ac_ext >&5
11449 cf_cv_gnu_source=yes
11450 fi
11451 rm -f conftest.$ac_objext conftest.$ac_ext
11452                         CPPFLAGS="$cf_save"
11453
11454 fi
11455 rm -f conftest.$ac_objext conftest.$ac_ext
11456
11457 fi
11458 echo "$as_me:11458: result: $cf_cv_gnu_source" >&5
11459 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11460
11461                 if test "$cf_cv_gnu_source" = yes
11462                 then
11463                 echo "$as_me:11463: checking if we should also define _DEFAULT_SOURCE" >&5
11464 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11465 if test "${cf_cv_default_source+set}" = set; then
11466   echo $ECHO_N "(cached) $ECHO_C" >&6
11467 else
11468
11469         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11470         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11471
11472                         cat >conftest.$ac_ext <<_ACEOF
11473 #line 11473 "configure"
11474 #include "confdefs.h"
11475 #include <sys/types.h>
11476 int
11477 main (void)
11478 {
11479
11480                                 #ifdef _DEFAULT_SOURCE
11481                                 #error  expected _DEFAULT_SOURCE to be undefined
11482                                 #endif
11483   ;
11484   return 0;
11485 }
11486 _ACEOF
11487 rm -f conftest.$ac_objext
11488 if { (eval echo "$as_me:11488: \"$ac_compile\"") >&5
11489   (eval $ac_compile) 2>&5
11490   ac_status=$?
11491   echo "$as_me:11491: \$? = $ac_status" >&5
11492   (exit $ac_status); } &&
11493          { ac_try='test -s conftest.$ac_objext'
11494   { (eval echo "$as_me:11494: \"$ac_try\"") >&5
11495   (eval $ac_try) 2>&5
11496   ac_status=$?
11497   echo "$as_me:11497: \$? = $ac_status" >&5
11498   (exit $ac_status); }; }; then
11499   cf_cv_default_source=no
11500 else
11501   echo "$as_me: failed program was:" >&5
11502 cat conftest.$ac_ext >&5
11503 cf_cv_default_source=yes
11504 fi
11505 rm -f conftest.$ac_objext conftest.$ac_ext
11506
11507 fi
11508 echo "$as_me:11508: result: $cf_cv_default_source" >&5
11509 echo "${ECHO_T}$cf_cv_default_source" >&6
11510                         if test "$cf_cv_default_source" = yes
11511                         then
11512
11513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11514         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11515
11516                         fi
11517                 fi
11518         fi
11519
11520 fi
11521
11522         ;;
11523 (minix*)
11524         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11525         ;;
11526 (mirbsd*)
11527         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11528         cf_XOPEN_SOURCE=
11529
11530 if test "$cf_cv_posix_visible" = no; then
11531
11532 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11533
11534 cf_save_CFLAGS="$CFLAGS"
11535 cf_save_CPPFLAGS="$CPPFLAGS"
11536
11537 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11538         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11539                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11540
11541 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11542         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11543                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11544
11545 echo "$as_me:11545: checking if we should define _POSIX_C_SOURCE" >&5
11546 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11547 if test "${cf_cv_posix_c_source+set}" = set; then
11548   echo $ECHO_N "(cached) $ECHO_C" >&6
11549 else
11550
11551 echo "${as_me:-configure}:11551: testing if the symbol is already defined go no further ..." 1>&5
11552
11553         cat >conftest.$ac_ext <<_ACEOF
11554 #line 11554 "configure"
11555 #include "confdefs.h"
11556 #include <sys/types.h>
11557 int
11558 main (void)
11559 {
11560
11561 #ifndef _POSIX_C_SOURCE
11562 make an error
11563 #endif
11564   ;
11565   return 0;
11566 }
11567 _ACEOF
11568 rm -f conftest.$ac_objext
11569 if { (eval echo "$as_me:11569: \"$ac_compile\"") >&5
11570   (eval $ac_compile) 2>&5
11571   ac_status=$?
11572   echo "$as_me:11572: \$? = $ac_status" >&5
11573   (exit $ac_status); } &&
11574          { ac_try='test -s conftest.$ac_objext'
11575   { (eval echo "$as_me:11575: \"$ac_try\"") >&5
11576   (eval $ac_try) 2>&5
11577   ac_status=$?
11578   echo "$as_me:11578: \$? = $ac_status" >&5
11579   (exit $ac_status); }; }; then
11580   cf_cv_posix_c_source=no
11581 else
11582   echo "$as_me: failed program was:" >&5
11583 cat conftest.$ac_ext >&5
11584 cf_want_posix_source=no
11585          case .$cf_POSIX_C_SOURCE in
11586          (.[12]??*)
11587                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11588                 ;;
11589          (.2)
11590                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11591                 cf_want_posix_source=yes
11592                 ;;
11593          (.*)
11594                 cf_want_posix_source=yes
11595                 ;;
11596          esac
11597          if test "$cf_want_posix_source" = yes ; then
11598                 cat >conftest.$ac_ext <<_ACEOF
11599 #line 11599 "configure"
11600 #include "confdefs.h"
11601 #include <sys/types.h>
11602 int
11603 main (void)
11604 {
11605
11606 #ifdef _POSIX_SOURCE
11607 make an error
11608 #endif
11609   ;
11610   return 0;
11611 }
11612 _ACEOF
11613 rm -f conftest.$ac_objext
11614 if { (eval echo "$as_me:11614: \"$ac_compile\"") >&5
11615   (eval $ac_compile) 2>&5
11616   ac_status=$?
11617   echo "$as_me:11617: \$? = $ac_status" >&5
11618   (exit $ac_status); } &&
11619          { ac_try='test -s conftest.$ac_objext'
11620   { (eval echo "$as_me:11620: \"$ac_try\"") >&5
11621   (eval $ac_try) 2>&5
11622   ac_status=$?
11623   echo "$as_me:11623: \$? = $ac_status" >&5
11624   (exit $ac_status); }; }; then
11625   :
11626 else
11627   echo "$as_me: failed program was:" >&5
11628 cat conftest.$ac_ext >&5
11629 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11630 fi
11631 rm -f conftest.$ac_objext conftest.$ac_ext
11632          fi
11633
11634 echo "${as_me:-configure}:11634: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11635
11636          CFLAGS="$cf_trim_CFLAGS"
11637          CPPFLAGS="$cf_trim_CPPFLAGS"
11638
11639         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11640         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11641
11642 echo "${as_me:-configure}:11642: testing if the second compile does not leave our definition intact error ..." 1>&5
11643
11644          cat >conftest.$ac_ext <<_ACEOF
11645 #line 11645 "configure"
11646 #include "confdefs.h"
11647 #include <sys/types.h>
11648 int
11649 main (void)
11650 {
11651
11652 #ifndef _POSIX_C_SOURCE
11653 make an error
11654 #endif
11655   ;
11656   return 0;
11657 }
11658 _ACEOF
11659 rm -f conftest.$ac_objext
11660 if { (eval echo "$as_me:11660: \"$ac_compile\"") >&5
11661   (eval $ac_compile) 2>&5
11662   ac_status=$?
11663   echo "$as_me:11663: \$? = $ac_status" >&5
11664   (exit $ac_status); } &&
11665          { ac_try='test -s conftest.$ac_objext'
11666   { (eval echo "$as_me:11666: \"$ac_try\"") >&5
11667   (eval $ac_try) 2>&5
11668   ac_status=$?
11669   echo "$as_me:11669: \$? = $ac_status" >&5
11670   (exit $ac_status); }; }; then
11671   :
11672 else
11673   echo "$as_me: failed program was:" >&5
11674 cat conftest.$ac_ext >&5
11675 cf_cv_posix_c_source=no
11676 fi
11677 rm -f conftest.$ac_objext conftest.$ac_ext
11678          CFLAGS="$cf_save_CFLAGS"
11679          CPPFLAGS="$cf_save_CPPFLAGS"
11680
11681 fi
11682 rm -f conftest.$ac_objext conftest.$ac_ext
11683
11684 fi
11685 echo "$as_me:11685: result: $cf_cv_posix_c_source" >&5
11686 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11687
11688 if test "$cf_cv_posix_c_source" != no ; then
11689         CFLAGS="$cf_trim_CFLAGS"
11690         CPPFLAGS="$cf_trim_CPPFLAGS"
11691
11692 cf_fix_cppflags=no
11693 cf_new_cflags=
11694 cf_new_cppflags=
11695 cf_new_extra_cppflags=
11696
11697 for cf_add_cflags in $cf_cv_posix_c_source
11698 do
11699 case $cf_fix_cppflags in
11700 (no)
11701         case $cf_add_cflags in
11702         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11703                 case $cf_add_cflags in
11704                 (-D*)
11705                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11706
11707                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11708                                 && test -z "${cf_tst_cflags}" \
11709                                 && cf_fix_cppflags=yes
11710
11711                         if test $cf_fix_cppflags = yes ; then
11712
11713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11715
11716                                 continue
11717                         elif test "${cf_tst_cflags}" = "\"'" ; then
11718
11719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11721
11722                                 continue
11723                         fi
11724                         ;;
11725                 esac
11726                 case "$CPPFLAGS" in
11727                 (*$cf_add_cflags)
11728                         ;;
11729                 (*)
11730                         case $cf_add_cflags in
11731                         (-D*)
11732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11733
11734 CPPFLAGS=`echo "$CPPFLAGS" | \
11735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11737
11738                                 ;;
11739                         esac
11740
11741         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11742         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11743
11744                         ;;
11745                 esac
11746                 ;;
11747         (*)
11748
11749         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11750         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11751
11752                 ;;
11753         esac
11754         ;;
11755 (yes)
11756
11757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11759
11760         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11761
11762         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11763                 && test -z "${cf_tst_cflags}" \
11764                 && cf_fix_cppflags=no
11765         ;;
11766 esac
11767 done
11768
11769 if test -n "$cf_new_cflags" ; then
11770
11771         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11772         CFLAGS="${CFLAGS}$cf_new_cflags"
11773
11774 fi
11775
11776 if test -n "$cf_new_cppflags" ; then
11777
11778         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11779         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11780
11781 fi
11782
11783 if test -n "$cf_new_extra_cppflags" ; then
11784
11785         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11786         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11787
11788 fi
11789
11790 fi
11791
11792 fi # cf_cv_posix_visible
11793
11794         ;;
11795 (netbsd*)
11796         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11797         ;;
11798 (openbsd[4-9]*)
11799         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11800         cf_xopen_source="-D_BSD_SOURCE"
11801         cf_XOPEN_SOURCE=600
11802         ;;
11803 (openbsd*)
11804         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11805         ;;
11806 (osf[45]*)
11807         cf_xopen_source="-D_OSF_SOURCE"
11808         ;;
11809 (nto-qnx*)
11810         cf_xopen_source="-D_QNX_SOURCE"
11811         ;;
11812 (sco*)
11813         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11814         ;;
11815 (solaris2.*)
11816         cf_xopen_source="-D__EXTENSIONS__"
11817         cf_cv_xopen_source=broken
11818         ;;
11819 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11820         cf_XOPEN_SOURCE=
11821         cf_POSIX_C_SOURCE=
11822         ;;
11823 (*)
11824
11825 echo "$as_me:11825: checking if we should define _XOPEN_SOURCE" >&5
11826 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11827 if test "${cf_cv_xopen_source+set}" = set; then
11828   echo $ECHO_N "(cached) $ECHO_C" >&6
11829 else
11830
11831         cat >conftest.$ac_ext <<_ACEOF
11832 #line 11832 "configure"
11833 #include "confdefs.h"
11834
11835 #include <stdlib.h>
11836 #include <string.h>
11837 #include <sys/types.h>
11838
11839 int
11840 main (void)
11841 {
11842
11843 #ifndef _XOPEN_SOURCE
11844 make an error
11845 #endif
11846   ;
11847   return 0;
11848 }
11849 _ACEOF
11850 rm -f conftest.$ac_objext
11851 if { (eval echo "$as_me:11851: \"$ac_compile\"") >&5
11852   (eval $ac_compile) 2>&5
11853   ac_status=$?
11854   echo "$as_me:11854: \$? = $ac_status" >&5
11855   (exit $ac_status); } &&
11856          { ac_try='test -s conftest.$ac_objext'
11857   { (eval echo "$as_me:11857: \"$ac_try\"") >&5
11858   (eval $ac_try) 2>&5
11859   ac_status=$?
11860   echo "$as_me:11860: \$? = $ac_status" >&5
11861   (exit $ac_status); }; }; then
11862   cf_cv_xopen_source=no
11863 else
11864   echo "$as_me: failed program was:" >&5
11865 cat conftest.$ac_ext >&5
11866 cf_save="$CPPFLAGS"
11867
11868         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11869         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11870
11871          cat >conftest.$ac_ext <<_ACEOF
11872 #line 11872 "configure"
11873 #include "confdefs.h"
11874
11875 #include <stdlib.h>
11876 #include <string.h>
11877 #include <sys/types.h>
11878
11879 int
11880 main (void)
11881 {
11882
11883 #ifdef _XOPEN_SOURCE
11884 make an error
11885 #endif
11886   ;
11887   return 0;
11888 }
11889 _ACEOF
11890 rm -f conftest.$ac_objext
11891 if { (eval echo "$as_me:11891: \"$ac_compile\"") >&5
11892   (eval $ac_compile) 2>&5
11893   ac_status=$?
11894   echo "$as_me:11894: \$? = $ac_status" >&5
11895   (exit $ac_status); } &&
11896          { ac_try='test -s conftest.$ac_objext'
11897   { (eval echo "$as_me:11897: \"$ac_try\"") >&5
11898   (eval $ac_try) 2>&5
11899   ac_status=$?
11900   echo "$as_me:11900: \$? = $ac_status" >&5
11901   (exit $ac_status); }; }; then
11902   cf_cv_xopen_source=no
11903 else
11904   echo "$as_me: failed program was:" >&5
11905 cat conftest.$ac_ext >&5
11906 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11907 fi
11908 rm -f conftest.$ac_objext conftest.$ac_ext
11909         CPPFLAGS="$cf_save"
11910
11911 fi
11912 rm -f conftest.$ac_objext conftest.$ac_ext
11913
11914 fi
11915 echo "$as_me:11915: result: $cf_cv_xopen_source" >&5
11916 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11917
11918 if test "$cf_cv_xopen_source" != no ; then
11919
11920 CFLAGS=`echo "$CFLAGS" | \
11921         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11922                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11923
11924 CPPFLAGS=`echo "$CPPFLAGS" | \
11925         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11926                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11927
11928         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11929
11930 cf_fix_cppflags=no
11931 cf_new_cflags=
11932 cf_new_cppflags=
11933 cf_new_extra_cppflags=
11934
11935 for cf_add_cflags in $cf_temp_xopen_source
11936 do
11937 case $cf_fix_cppflags in
11938 (no)
11939         case $cf_add_cflags in
11940         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11941                 case $cf_add_cflags in
11942                 (-D*)
11943                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11944
11945                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11946                                 && test -z "${cf_tst_cflags}" \
11947                                 && cf_fix_cppflags=yes
11948
11949                         if test $cf_fix_cppflags = yes ; then
11950
11951         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11952         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11953
11954                                 continue
11955                         elif test "${cf_tst_cflags}" = "\"'" ; then
11956
11957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11959
11960                                 continue
11961                         fi
11962                         ;;
11963                 esac
11964                 case "$CPPFLAGS" in
11965                 (*$cf_add_cflags)
11966                         ;;
11967                 (*)
11968                         case $cf_add_cflags in
11969                         (-D*)
11970                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11971
11972 CPPFLAGS=`echo "$CPPFLAGS" | \
11973         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11974                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11975
11976                                 ;;
11977                         esac
11978
11979         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11980         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11981
11982                         ;;
11983                 esac
11984                 ;;
11985         (*)
11986
11987         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11988         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11989
11990                 ;;
11991         esac
11992         ;;
11993 (yes)
11994
11995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11997
11998         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11999
12000         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12001                 && test -z "${cf_tst_cflags}" \
12002                 && cf_fix_cppflags=no
12003         ;;
12004 esac
12005 done
12006
12007 if test -n "$cf_new_cflags" ; then
12008
12009         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12010         CFLAGS="${CFLAGS}$cf_new_cflags"
12011
12012 fi
12013
12014 if test -n "$cf_new_cppflags" ; then
12015
12016         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12017         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12018
12019 fi
12020
12021 if test -n "$cf_new_extra_cppflags" ; then
12022
12023         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12024         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12025
12026 fi
12027
12028 fi
12029
12030 if test "$cf_cv_posix_visible" = no; then
12031
12032 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12033
12034 cf_save_CFLAGS="$CFLAGS"
12035 cf_save_CPPFLAGS="$CPPFLAGS"
12036
12037 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12038         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12039                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12040
12041 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12042         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12043                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12044
12045 echo "$as_me:12045: checking if we should define _POSIX_C_SOURCE" >&5
12046 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12047 if test "${cf_cv_posix_c_source+set}" = set; then
12048   echo $ECHO_N "(cached) $ECHO_C" >&6
12049 else
12050
12051 echo "${as_me:-configure}:12051: testing if the symbol is already defined go no further ..." 1>&5
12052
12053         cat >conftest.$ac_ext <<_ACEOF
12054 #line 12054 "configure"
12055 #include "confdefs.h"
12056 #include <sys/types.h>
12057 int
12058 main (void)
12059 {
12060
12061 #ifndef _POSIX_C_SOURCE
12062 make an error
12063 #endif
12064   ;
12065   return 0;
12066 }
12067 _ACEOF
12068 rm -f conftest.$ac_objext
12069 if { (eval echo "$as_me:12069: \"$ac_compile\"") >&5
12070   (eval $ac_compile) 2>&5
12071   ac_status=$?
12072   echo "$as_me:12072: \$? = $ac_status" >&5
12073   (exit $ac_status); } &&
12074          { ac_try='test -s conftest.$ac_objext'
12075   { (eval echo "$as_me:12075: \"$ac_try\"") >&5
12076   (eval $ac_try) 2>&5
12077   ac_status=$?
12078   echo "$as_me:12078: \$? = $ac_status" >&5
12079   (exit $ac_status); }; }; then
12080   cf_cv_posix_c_source=no
12081 else
12082   echo "$as_me: failed program was:" >&5
12083 cat conftest.$ac_ext >&5
12084 cf_want_posix_source=no
12085          case .$cf_POSIX_C_SOURCE in
12086          (.[12]??*)
12087                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12088                 ;;
12089          (.2)
12090                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12091                 cf_want_posix_source=yes
12092                 ;;
12093          (.*)
12094                 cf_want_posix_source=yes
12095                 ;;
12096          esac
12097          if test "$cf_want_posix_source" = yes ; then
12098                 cat >conftest.$ac_ext <<_ACEOF
12099 #line 12099 "configure"
12100 #include "confdefs.h"
12101 #include <sys/types.h>
12102 int
12103 main (void)
12104 {
12105
12106 #ifdef _POSIX_SOURCE
12107 make an error
12108 #endif
12109   ;
12110   return 0;
12111 }
12112 _ACEOF
12113 rm -f conftest.$ac_objext
12114 if { (eval echo "$as_me:12114: \"$ac_compile\"") >&5
12115   (eval $ac_compile) 2>&5
12116   ac_status=$?
12117   echo "$as_me:12117: \$? = $ac_status" >&5
12118   (exit $ac_status); } &&
12119          { ac_try='test -s conftest.$ac_objext'
12120   { (eval echo "$as_me:12120: \"$ac_try\"") >&5
12121   (eval $ac_try) 2>&5
12122   ac_status=$?
12123   echo "$as_me:12123: \$? = $ac_status" >&5
12124   (exit $ac_status); }; }; then
12125   :
12126 else
12127   echo "$as_me: failed program was:" >&5
12128 cat conftest.$ac_ext >&5
12129 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12130 fi
12131 rm -f conftest.$ac_objext conftest.$ac_ext
12132          fi
12133
12134 echo "${as_me:-configure}:12134: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12135
12136          CFLAGS="$cf_trim_CFLAGS"
12137          CPPFLAGS="$cf_trim_CPPFLAGS"
12138
12139         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12140         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12141
12142 echo "${as_me:-configure}:12142: testing if the second compile does not leave our definition intact error ..." 1>&5
12143
12144          cat >conftest.$ac_ext <<_ACEOF
12145 #line 12145 "configure"
12146 #include "confdefs.h"
12147 #include <sys/types.h>
12148 int
12149 main (void)
12150 {
12151
12152 #ifndef _POSIX_C_SOURCE
12153 make an error
12154 #endif
12155   ;
12156   return 0;
12157 }
12158 _ACEOF
12159 rm -f conftest.$ac_objext
12160 if { (eval echo "$as_me:12160: \"$ac_compile\"") >&5
12161   (eval $ac_compile) 2>&5
12162   ac_status=$?
12163   echo "$as_me:12163: \$? = $ac_status" >&5
12164   (exit $ac_status); } &&
12165          { ac_try='test -s conftest.$ac_objext'
12166   { (eval echo "$as_me:12166: \"$ac_try\"") >&5
12167   (eval $ac_try) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit $ac_status); }; }; then
12171   :
12172 else
12173   echo "$as_me: failed program was:" >&5
12174 cat conftest.$ac_ext >&5
12175 cf_cv_posix_c_source=no
12176 fi
12177 rm -f conftest.$ac_objext conftest.$ac_ext
12178          CFLAGS="$cf_save_CFLAGS"
12179          CPPFLAGS="$cf_save_CPPFLAGS"
12180
12181 fi
12182 rm -f conftest.$ac_objext conftest.$ac_ext
12183
12184 fi
12185 echo "$as_me:12185: result: $cf_cv_posix_c_source" >&5
12186 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12187
12188 if test "$cf_cv_posix_c_source" != no ; then
12189         CFLAGS="$cf_trim_CFLAGS"
12190         CPPFLAGS="$cf_trim_CPPFLAGS"
12191
12192 cf_fix_cppflags=no
12193 cf_new_cflags=
12194 cf_new_cppflags=
12195 cf_new_extra_cppflags=
12196
12197 for cf_add_cflags in $cf_cv_posix_c_source
12198 do
12199 case $cf_fix_cppflags in
12200 (no)
12201         case $cf_add_cflags in
12202         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12203                 case $cf_add_cflags in
12204                 (-D*)
12205                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12206
12207                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12208                                 && test -z "${cf_tst_cflags}" \
12209                                 && cf_fix_cppflags=yes
12210
12211                         if test $cf_fix_cppflags = yes ; then
12212
12213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12215
12216                                 continue
12217                         elif test "${cf_tst_cflags}" = "\"'" ; then
12218
12219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12221
12222                                 continue
12223                         fi
12224                         ;;
12225                 esac
12226                 case "$CPPFLAGS" in
12227                 (*$cf_add_cflags)
12228                         ;;
12229                 (*)
12230                         case $cf_add_cflags in
12231                         (-D*)
12232                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12233
12234 CPPFLAGS=`echo "$CPPFLAGS" | \
12235         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12236                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12237
12238                                 ;;
12239                         esac
12240
12241         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12242         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12243
12244                         ;;
12245                 esac
12246                 ;;
12247         (*)
12248
12249         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12250         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12251
12252                 ;;
12253         esac
12254         ;;
12255 (yes)
12256
12257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12259
12260         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12261
12262         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12263                 && test -z "${cf_tst_cflags}" \
12264                 && cf_fix_cppflags=no
12265         ;;
12266 esac
12267 done
12268
12269 if test -n "$cf_new_cflags" ; then
12270
12271         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12272         CFLAGS="${CFLAGS}$cf_new_cflags"
12273
12274 fi
12275
12276 if test -n "$cf_new_cppflags" ; then
12277
12278         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12279         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12280
12281 fi
12282
12283 if test -n "$cf_new_extra_cppflags" ; then
12284
12285         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12286         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12287
12288 fi
12289
12290 fi
12291
12292 fi # cf_cv_posix_visible
12293
12294         ;;
12295 esac
12296
12297 if test -n "$cf_xopen_source" ; then
12298
12299 cf_fix_cppflags=no
12300 cf_new_cflags=
12301 cf_new_cppflags=
12302 cf_new_extra_cppflags=
12303
12304 for cf_add_cflags in $cf_xopen_source
12305 do
12306 case $cf_fix_cppflags in
12307 (no)
12308         case $cf_add_cflags in
12309         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12310                 case $cf_add_cflags in
12311                 (-D*)
12312                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12313
12314                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12315                                 && test -z "${cf_tst_cflags}" \
12316                                 && cf_fix_cppflags=yes
12317
12318                         if test $cf_fix_cppflags = yes ; then
12319
12320         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12321         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12322
12323                                 continue
12324                         elif test "${cf_tst_cflags}" = "\"'" ; then
12325
12326         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12327         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12328
12329                                 continue
12330                         fi
12331                         ;;
12332                 esac
12333                 case "$CPPFLAGS" in
12334                 (*$cf_add_cflags)
12335                         ;;
12336                 (*)
12337                         case $cf_add_cflags in
12338                         (-D*)
12339                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12340
12341 CPPFLAGS=`echo "$CPPFLAGS" | \
12342         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12343                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12344
12345                                 ;;
12346                         esac
12347
12348         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12349         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12350
12351                         ;;
12352                 esac
12353                 ;;
12354         (*)
12355
12356         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12357         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12358
12359                 ;;
12360         esac
12361         ;;
12362 (yes)
12363
12364         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12365         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12366
12367         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12368
12369         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12370                 && test -z "${cf_tst_cflags}" \
12371                 && cf_fix_cppflags=no
12372         ;;
12373 esac
12374 done
12375
12376 if test -n "$cf_new_cflags" ; then
12377         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12378
12379 echo "${as_me:-configure}:12379: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12380
12381         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12382         CFLAGS="${CFLAGS}$cf_new_cflags"
12383
12384 fi
12385
12386 if test -n "$cf_new_cppflags" ; then
12387         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12388
12389 echo "${as_me:-configure}:12389: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12390
12391         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12392         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12393
12394 fi
12395
12396 if test -n "$cf_new_extra_cppflags" ; then
12397         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12398
12399 echo "${as_me:-configure}:12399: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12400
12401         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12402         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12403
12404 fi
12405
12406 fi
12407
12408 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12409         echo "$as_me:12409: checking if _XOPEN_SOURCE really is set" >&5
12410 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12411         cat >conftest.$ac_ext <<_ACEOF
12412 #line 12412 "configure"
12413 #include "confdefs.h"
12414 #include <stdlib.h>
12415 int
12416 main (void)
12417 {
12418
12419 #ifndef _XOPEN_SOURCE
12420 make an error
12421 #endif
12422   ;
12423   return 0;
12424 }
12425 _ACEOF
12426 rm -f conftest.$ac_objext
12427 if { (eval echo "$as_me:12427: \"$ac_compile\"") >&5
12428   (eval $ac_compile) 2>&5
12429   ac_status=$?
12430   echo "$as_me:12430: \$? = $ac_status" >&5
12431   (exit $ac_status); } &&
12432          { ac_try='test -s conftest.$ac_objext'
12433   { (eval echo "$as_me:12433: \"$ac_try\"") >&5
12434   (eval $ac_try) 2>&5
12435   ac_status=$?
12436   echo "$as_me:12436: \$? = $ac_status" >&5
12437   (exit $ac_status); }; }; then
12438   cf_XOPEN_SOURCE_set=yes
12439 else
12440   echo "$as_me: failed program was:" >&5
12441 cat conftest.$ac_ext >&5
12442 cf_XOPEN_SOURCE_set=no
12443 fi
12444 rm -f conftest.$ac_objext conftest.$ac_ext
12445         echo "$as_me:12445: result: $cf_XOPEN_SOURCE_set" >&5
12446 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12447         if test $cf_XOPEN_SOURCE_set = yes
12448         then
12449                 cat >conftest.$ac_ext <<_ACEOF
12450 #line 12450 "configure"
12451 #include "confdefs.h"
12452 #include <stdlib.h>
12453 int
12454 main (void)
12455 {
12456
12457 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12458 make an error
12459 #endif
12460   ;
12461   return 0;
12462 }
12463 _ACEOF
12464 rm -f conftest.$ac_objext
12465 if { (eval echo "$as_me:12465: \"$ac_compile\"") >&5
12466   (eval $ac_compile) 2>&5
12467   ac_status=$?
12468   echo "$as_me:12468: \$? = $ac_status" >&5
12469   (exit $ac_status); } &&
12470          { ac_try='test -s conftest.$ac_objext'
12471   { (eval echo "$as_me:12471: \"$ac_try\"") >&5
12472   (eval $ac_try) 2>&5
12473   ac_status=$?
12474   echo "$as_me:12474: \$? = $ac_status" >&5
12475   (exit $ac_status); }; }; then
12476   cf_XOPEN_SOURCE_set_ok=yes
12477 else
12478   echo "$as_me: failed program was:" >&5
12479 cat conftest.$ac_ext >&5
12480 cf_XOPEN_SOURCE_set_ok=no
12481 fi
12482 rm -f conftest.$ac_objext conftest.$ac_ext
12483                 if test $cf_XOPEN_SOURCE_set_ok = no
12484                 then
12485                         { echo "$as_me:12485: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12486 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12487                 fi
12488         else
12489
12490 echo "$as_me:12490: checking if we should define _XOPEN_SOURCE" >&5
12491 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12492 if test "${cf_cv_xopen_source+set}" = set; then
12493   echo $ECHO_N "(cached) $ECHO_C" >&6
12494 else
12495
12496         cat >conftest.$ac_ext <<_ACEOF
12497 #line 12497 "configure"
12498 #include "confdefs.h"
12499
12500 #include <stdlib.h>
12501 #include <string.h>
12502 #include <sys/types.h>
12503
12504 int
12505 main (void)
12506 {
12507
12508 #ifndef _XOPEN_SOURCE
12509 make an error
12510 #endif
12511   ;
12512   return 0;
12513 }
12514 _ACEOF
12515 rm -f conftest.$ac_objext
12516 if { (eval echo "$as_me:12516: \"$ac_compile\"") >&5
12517   (eval $ac_compile) 2>&5
12518   ac_status=$?
12519   echo "$as_me:12519: \$? = $ac_status" >&5
12520   (exit $ac_status); } &&
12521          { ac_try='test -s conftest.$ac_objext'
12522   { (eval echo "$as_me:12522: \"$ac_try\"") >&5
12523   (eval $ac_try) 2>&5
12524   ac_status=$?
12525   echo "$as_me:12525: \$? = $ac_status" >&5
12526   (exit $ac_status); }; }; then
12527   cf_cv_xopen_source=no
12528 else
12529   echo "$as_me: failed program was:" >&5
12530 cat conftest.$ac_ext >&5
12531 cf_save="$CPPFLAGS"
12532
12533         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12534         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12535
12536          cat >conftest.$ac_ext <<_ACEOF
12537 #line 12537 "configure"
12538 #include "confdefs.h"
12539
12540 #include <stdlib.h>
12541 #include <string.h>
12542 #include <sys/types.h>
12543
12544 int
12545 main (void)
12546 {
12547
12548 #ifdef _XOPEN_SOURCE
12549 make an error
12550 #endif
12551   ;
12552   return 0;
12553 }
12554 _ACEOF
12555 rm -f conftest.$ac_objext
12556 if { (eval echo "$as_me:12556: \"$ac_compile\"") >&5
12557   (eval $ac_compile) 2>&5
12558   ac_status=$?
12559   echo "$as_me:12559: \$? = $ac_status" >&5
12560   (exit $ac_status); } &&
12561          { ac_try='test -s conftest.$ac_objext'
12562   { (eval echo "$as_me:12562: \"$ac_try\"") >&5
12563   (eval $ac_try) 2>&5
12564   ac_status=$?
12565   echo "$as_me:12565: \$? = $ac_status" >&5
12566   (exit $ac_status); }; }; then
12567   cf_cv_xopen_source=no
12568 else
12569   echo "$as_me: failed program was:" >&5
12570 cat conftest.$ac_ext >&5
12571 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12572 fi
12573 rm -f conftest.$ac_objext conftest.$ac_ext
12574         CPPFLAGS="$cf_save"
12575
12576 fi
12577 rm -f conftest.$ac_objext conftest.$ac_ext
12578
12579 fi
12580 echo "$as_me:12580: result: $cf_cv_xopen_source" >&5
12581 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12582
12583 if test "$cf_cv_xopen_source" != no ; then
12584
12585 CFLAGS=`echo "$CFLAGS" | \
12586         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12587                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12588
12589 CPPFLAGS=`echo "$CPPFLAGS" | \
12590         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12591                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12592
12593         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12594
12595 cf_fix_cppflags=no
12596 cf_new_cflags=
12597 cf_new_cppflags=
12598 cf_new_extra_cppflags=
12599
12600 for cf_add_cflags in $cf_temp_xopen_source
12601 do
12602 case $cf_fix_cppflags in
12603 (no)
12604         case $cf_add_cflags in
12605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12606                 case $cf_add_cflags in
12607                 (-D*)
12608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12609
12610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12611                                 && test -z "${cf_tst_cflags}" \
12612                                 && cf_fix_cppflags=yes
12613
12614                         if test $cf_fix_cppflags = yes ; then
12615
12616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12618
12619                                 continue
12620                         elif test "${cf_tst_cflags}" = "\"'" ; then
12621
12622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12624
12625                                 continue
12626                         fi
12627                         ;;
12628                 esac
12629                 case "$CPPFLAGS" in
12630                 (*$cf_add_cflags)
12631                         ;;
12632                 (*)
12633                         case $cf_add_cflags in
12634                         (-D*)
12635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12636
12637 CPPFLAGS=`echo "$CPPFLAGS" | \
12638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12640
12641                                 ;;
12642                         esac
12643
12644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12646
12647                         ;;
12648                 esac
12649                 ;;
12650         (*)
12651
12652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12654
12655                 ;;
12656         esac
12657         ;;
12658 (yes)
12659
12660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12662
12663         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12664
12665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12666                 && test -z "${cf_tst_cflags}" \
12667                 && cf_fix_cppflags=no
12668         ;;
12669 esac
12670 done
12671
12672 if test -n "$cf_new_cflags" ; then
12673
12674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12675         CFLAGS="${CFLAGS}$cf_new_cflags"
12676
12677 fi
12678
12679 if test -n "$cf_new_cppflags" ; then
12680
12681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12683
12684 fi
12685
12686 if test -n "$cf_new_extra_cppflags" ; then
12687
12688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12690
12691 fi
12692
12693 fi
12694
12695         fi
12696 fi
12697 fi # cf_cv_posix_visible
12698
12699 # Check whether --enable-largefile or --disable-largefile was given.
12700 if test "${enable_largefile+set}" = set; then
12701   enableval="$enable_largefile"
12702
12703 fi;
12704 if test "$enable_largefile" != no; then
12705
12706   echo "$as_me:12706: checking for special C compiler options needed for large files" >&5
12707 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12708 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12709   echo $ECHO_N "(cached) $ECHO_C" >&6
12710 else
12711   ac_cv_sys_largefile_CC=no
12712      if test "$GCC" != yes; then
12713        ac_save_CC=$CC
12714        while :; do
12715          # IRIX 6.2 and later do not support large files by default,
12716          # so use the C compiler's -n32 option if that helps.
12717          cat >conftest.$ac_ext <<_ACEOF
12718 #line 12718 "configure"
12719 #include "confdefs.h"
12720 #include <sys/types.h>
12721  /* Check that off_t can represent 2**63 - 1 correctly.
12722     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12723     since some C++ compilers masquerading as C compilers
12724     incorrectly reject 9223372036854775807.  */
12725 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12726   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12727                        && LARGE_OFF_T % 2147483647 == 1)
12728                       ? 1 : -1];
12729 int
12730 main (void)
12731 {
12732
12733   ;
12734   return 0;
12735 }
12736 _ACEOF
12737          rm -f conftest.$ac_objext
12738 if { (eval echo "$as_me:12738: \"$ac_compile\"") >&5
12739   (eval $ac_compile) 2>&5
12740   ac_status=$?
12741   echo "$as_me:12741: \$? = $ac_status" >&5
12742   (exit $ac_status); } &&
12743          { ac_try='test -s conftest.$ac_objext'
12744   { (eval echo "$as_me:12744: \"$ac_try\"") >&5
12745   (eval $ac_try) 2>&5
12746   ac_status=$?
12747   echo "$as_me:12747: \$? = $ac_status" >&5
12748   (exit $ac_status); }; }; then
12749   break
12750 else
12751   echo "$as_me: failed program was:" >&5
12752 cat conftest.$ac_ext >&5
12753 fi
12754 rm -f conftest.$ac_objext
12755          CC="$CC -n32"
12756          rm -f conftest.$ac_objext
12757 if { (eval echo "$as_me:12757: \"$ac_compile\"") >&5
12758   (eval $ac_compile) 2>&5
12759   ac_status=$?
12760   echo "$as_me:12760: \$? = $ac_status" >&5
12761   (exit $ac_status); } &&
12762          { ac_try='test -s conftest.$ac_objext'
12763   { (eval echo "$as_me:12763: \"$ac_try\"") >&5
12764   (eval $ac_try) 2>&5
12765   ac_status=$?
12766   echo "$as_me:12766: \$? = $ac_status" >&5
12767   (exit $ac_status); }; }; then
12768   ac_cv_sys_largefile_CC=' -n32'; break
12769 else
12770   echo "$as_me: failed program was:" >&5
12771 cat conftest.$ac_ext >&5
12772 fi
12773 rm -f conftest.$ac_objext
12774          break
12775        done
12776        CC=$ac_save_CC
12777        rm -f conftest.$ac_ext
12778     fi
12779 fi
12780 echo "$as_me:12780: result: $ac_cv_sys_largefile_CC" >&5
12781 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12782   if test "$ac_cv_sys_largefile_CC" != no; then
12783     CC=$CC$ac_cv_sys_largefile_CC
12784   fi
12785
12786   echo "$as_me:12786: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12787 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12788 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12789   echo $ECHO_N "(cached) $ECHO_C" >&6
12790 else
12791   while :; do
12792   ac_cv_sys_file_offset_bits=no
12793   cat >conftest.$ac_ext <<_ACEOF
12794 #line 12794 "configure"
12795 #include "confdefs.h"
12796 #include <sys/types.h>
12797  /* Check that off_t can represent 2**63 - 1 correctly.
12798     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12799     since some C++ compilers masquerading as C compilers
12800     incorrectly reject 9223372036854775807.  */
12801 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12802   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12803                        && LARGE_OFF_T % 2147483647 == 1)
12804                       ? 1 : -1];
12805 int
12806 main (void)
12807 {
12808
12809   ;
12810   return 0;
12811 }
12812 _ACEOF
12813 rm -f conftest.$ac_objext
12814 if { (eval echo "$as_me:12814: \"$ac_compile\"") >&5
12815   (eval $ac_compile) 2>&5
12816   ac_status=$?
12817   echo "$as_me:12817: \$? = $ac_status" >&5
12818   (exit $ac_status); } &&
12819          { ac_try='test -s conftest.$ac_objext'
12820   { (eval echo "$as_me:12820: \"$ac_try\"") >&5
12821   (eval $ac_try) 2>&5
12822   ac_status=$?
12823   echo "$as_me:12823: \$? = $ac_status" >&5
12824   (exit $ac_status); }; }; then
12825   break
12826 else
12827   echo "$as_me: failed program was:" >&5
12828 cat conftest.$ac_ext >&5
12829 fi
12830 rm -f conftest.$ac_objext conftest.$ac_ext
12831   cat >conftest.$ac_ext <<_ACEOF
12832 #line 12832 "configure"
12833 #include "confdefs.h"
12834 #define _FILE_OFFSET_BITS 64
12835 #include <sys/types.h>
12836  /* Check that off_t can represent 2**63 - 1 correctly.
12837     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12838     since some C++ compilers masquerading as C compilers
12839     incorrectly reject 9223372036854775807.  */
12840 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12841   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12842                        && LARGE_OFF_T % 2147483647 == 1)
12843                       ? 1 : -1];
12844 int
12845 main (void)
12846 {
12847
12848   ;
12849   return 0;
12850 }
12851 _ACEOF
12852 rm -f conftest.$ac_objext
12853 if { (eval echo "$as_me:12853: \"$ac_compile\"") >&5
12854   (eval $ac_compile) 2>&5
12855   ac_status=$?
12856   echo "$as_me:12856: \$? = $ac_status" >&5
12857   (exit $ac_status); } &&
12858          { ac_try='test -s conftest.$ac_objext'
12859   { (eval echo "$as_me:12859: \"$ac_try\"") >&5
12860   (eval $ac_try) 2>&5
12861   ac_status=$?
12862   echo "$as_me:12862: \$? = $ac_status" >&5
12863   (exit $ac_status); }; }; then
12864   ac_cv_sys_file_offset_bits=64; break
12865 else
12866   echo "$as_me: failed program was:" >&5
12867 cat conftest.$ac_ext >&5
12868 fi
12869 rm -f conftest.$ac_objext conftest.$ac_ext
12870   break
12871 done
12872 fi
12873 echo "$as_me:12873: result: $ac_cv_sys_file_offset_bits" >&5
12874 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12875 if test "$ac_cv_sys_file_offset_bits" != no; then
12876
12877 cat >>confdefs.h <<EOF
12878 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12879 EOF
12880
12881 fi
12882 rm -rf conftest*
12883   echo "$as_me:12883: checking for _LARGE_FILES value needed for large files" >&5
12884 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12885 if test "${ac_cv_sys_large_files+set}" = set; then
12886   echo $ECHO_N "(cached) $ECHO_C" >&6
12887 else
12888   while :; do
12889   ac_cv_sys_large_files=no
12890   cat >conftest.$ac_ext <<_ACEOF
12891 #line 12891 "configure"
12892 #include "confdefs.h"
12893 #include <sys/types.h>
12894  /* Check that off_t can represent 2**63 - 1 correctly.
12895     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12896     since some C++ compilers masquerading as C compilers
12897     incorrectly reject 9223372036854775807.  */
12898 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12899   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12900                        && LARGE_OFF_T % 2147483647 == 1)
12901                       ? 1 : -1];
12902 int
12903 main (void)
12904 {
12905
12906   ;
12907   return 0;
12908 }
12909 _ACEOF
12910 rm -f conftest.$ac_objext
12911 if { (eval echo "$as_me:12911: \"$ac_compile\"") >&5
12912   (eval $ac_compile) 2>&5
12913   ac_status=$?
12914   echo "$as_me:12914: \$? = $ac_status" >&5
12915   (exit $ac_status); } &&
12916          { ac_try='test -s conftest.$ac_objext'
12917   { (eval echo "$as_me:12917: \"$ac_try\"") >&5
12918   (eval $ac_try) 2>&5
12919   ac_status=$?
12920   echo "$as_me:12920: \$? = $ac_status" >&5
12921   (exit $ac_status); }; }; then
12922   break
12923 else
12924   echo "$as_me: failed program was:" >&5
12925 cat conftest.$ac_ext >&5
12926 fi
12927 rm -f conftest.$ac_objext conftest.$ac_ext
12928   cat >conftest.$ac_ext <<_ACEOF
12929 #line 12929 "configure"
12930 #include "confdefs.h"
12931 #define _LARGE_FILES 1
12932 #include <sys/types.h>
12933  /* Check that off_t can represent 2**63 - 1 correctly.
12934     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12935     since some C++ compilers masquerading as C compilers
12936     incorrectly reject 9223372036854775807.  */
12937 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12938   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12939                        && LARGE_OFF_T % 2147483647 == 1)
12940                       ? 1 : -1];
12941 int
12942 main (void)
12943 {
12944
12945   ;
12946   return 0;
12947 }
12948 _ACEOF
12949 rm -f conftest.$ac_objext
12950 if { (eval echo "$as_me:12950: \"$ac_compile\"") >&5
12951   (eval $ac_compile) 2>&5
12952   ac_status=$?
12953   echo "$as_me:12953: \$? = $ac_status" >&5
12954   (exit $ac_status); } &&
12955          { ac_try='test -s conftest.$ac_objext'
12956   { (eval echo "$as_me:12956: \"$ac_try\"") >&5
12957   (eval $ac_try) 2>&5
12958   ac_status=$?
12959   echo "$as_me:12959: \$? = $ac_status" >&5
12960   (exit $ac_status); }; }; then
12961   ac_cv_sys_large_files=1; break
12962 else
12963   echo "$as_me: failed program was:" >&5
12964 cat conftest.$ac_ext >&5
12965 fi
12966 rm -f conftest.$ac_objext conftest.$ac_ext
12967   break
12968 done
12969 fi
12970 echo "$as_me:12970: result: $ac_cv_sys_large_files" >&5
12971 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
12972 if test "$ac_cv_sys_large_files" != no; then
12973
12974 cat >>confdefs.h <<EOF
12975 #define _LARGE_FILES $ac_cv_sys_large_files
12976 EOF
12977
12978 fi
12979 rm -rf conftest*
12980 fi
12981
12982         if test "$enable_largefile" != no ; then
12983         echo "$as_me:12983: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12984 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
12985 if test "${ac_cv_sys_largefile_source+set}" = set; then
12986   echo $ECHO_N "(cached) $ECHO_C" >&6
12987 else
12988   while :; do
12989   ac_cv_sys_largefile_source=no
12990   cat >conftest.$ac_ext <<_ACEOF
12991 #line 12991 "configure"
12992 #include "confdefs.h"
12993 #include <stdio.h>
12994 int
12995 main (void)
12996 {
12997 return !fseeko;
12998   ;
12999   return 0;
13000 }
13001 _ACEOF
13002 rm -f conftest.$ac_objext
13003 if { (eval echo "$as_me:13003: \"$ac_compile\"") >&5
13004   (eval $ac_compile) 2>&5
13005   ac_status=$?
13006   echo "$as_me:13006: \$? = $ac_status" >&5
13007   (exit $ac_status); } &&
13008          { ac_try='test -s conftest.$ac_objext'
13009   { (eval echo "$as_me:13009: \"$ac_try\"") >&5
13010   (eval $ac_try) 2>&5
13011   ac_status=$?
13012   echo "$as_me:13012: \$? = $ac_status" >&5
13013   (exit $ac_status); }; }; then
13014   break
13015 else
13016   echo "$as_me: failed program was:" >&5
13017 cat conftest.$ac_ext >&5
13018 fi
13019 rm -f conftest.$ac_objext conftest.$ac_ext
13020   cat >conftest.$ac_ext <<_ACEOF
13021 #line 13021 "configure"
13022 #include "confdefs.h"
13023 #define _LARGEFILE_SOURCE 1
13024 #include <stdio.h>
13025 int
13026 main (void)
13027 {
13028 return !fseeko;
13029   ;
13030   return 0;
13031 }
13032 _ACEOF
13033 rm -f conftest.$ac_objext
13034 if { (eval echo "$as_me:13034: \"$ac_compile\"") >&5
13035   (eval $ac_compile) 2>&5
13036   ac_status=$?
13037   echo "$as_me:13037: \$? = $ac_status" >&5
13038   (exit $ac_status); } &&
13039          { ac_try='test -s conftest.$ac_objext'
13040   { (eval echo "$as_me:13040: \"$ac_try\"") >&5
13041   (eval $ac_try) 2>&5
13042   ac_status=$?
13043   echo "$as_me:13043: \$? = $ac_status" >&5
13044   (exit $ac_status); }; }; then
13045   ac_cv_sys_largefile_source=1; break
13046 else
13047   echo "$as_me: failed program was:" >&5
13048 cat conftest.$ac_ext >&5
13049 fi
13050 rm -f conftest.$ac_objext conftest.$ac_ext
13051   break
13052 done
13053 fi
13054 echo "$as_me:13054: result: $ac_cv_sys_largefile_source" >&5
13055 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13056 if test "$ac_cv_sys_largefile_source" != no; then
13057
13058 cat >>confdefs.h <<EOF
13059 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13060 EOF
13061
13062 fi
13063 rm -rf conftest*
13064
13065 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13066 # in glibc 2.1.3, but that breaks too many other things.
13067 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13068 echo "$as_me:13068: checking for fseeko" >&5
13069 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13070 if test "${ac_cv_func_fseeko+set}" = set; then
13071   echo $ECHO_N "(cached) $ECHO_C" >&6
13072 else
13073   cat >conftest.$ac_ext <<_ACEOF
13074 #line 13074 "configure"
13075 #include "confdefs.h"
13076 #include <stdio.h>
13077 int
13078 main (void)
13079 {
13080 return fseeko && fseeko (stdin, 0, 0);
13081   ;
13082   return 0;
13083 }
13084 _ACEOF
13085 rm -f conftest.$ac_objext conftest$ac_exeext
13086 if { (eval echo "$as_me:13086: \"$ac_link\"") >&5
13087   (eval $ac_link) 2>&5
13088   ac_status=$?
13089   echo "$as_me:13089: \$? = $ac_status" >&5
13090   (exit $ac_status); } &&
13091          { ac_try='test -s conftest$ac_exeext'
13092   { (eval echo "$as_me:13092: \"$ac_try\"") >&5
13093   (eval $ac_try) 2>&5
13094   ac_status=$?
13095   echo "$as_me:13095: \$? = $ac_status" >&5
13096   (exit $ac_status); }; }; then
13097   ac_cv_func_fseeko=yes
13098 else
13099   echo "$as_me: failed program was:" >&5
13100 cat conftest.$ac_ext >&5
13101 ac_cv_func_fseeko=no
13102 fi
13103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13104 fi
13105 echo "$as_me:13105: result: $ac_cv_func_fseeko" >&5
13106 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13107 if test $ac_cv_func_fseeko = yes; then
13108
13109 cat >>confdefs.h <<\EOF
13110 #define HAVE_FSEEKO 1
13111 EOF
13112
13113 fi
13114
13115         # Normally we would collect these definitions in the config.h,
13116         # but (like _XOPEN_SOURCE), some environments rely on having these
13117         # defined before any of the system headers are included.  Another
13118         # case comes up with C++, e.g., on AIX the compiler compiles the
13119         # header files by themselves before looking at the body files it is
13120         # told to compile.  For ncurses, those header files do not include
13121         # the config.h
13122         if test "$ac_cv_sys_large_files" != no
13123         then
13124
13125         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13126         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13127
13128         fi
13129         if test "$ac_cv_sys_largefile_source" != no
13130         then
13131
13132         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13133         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13134
13135         fi
13136         if test "$ac_cv_sys_file_offset_bits" != no
13137         then
13138
13139         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13140         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13141
13142         fi
13143
13144         echo "$as_me:13144: checking whether to use struct dirent64" >&5
13145 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13146 if test "${cf_cv_struct_dirent64+set}" = set; then
13147   echo $ECHO_N "(cached) $ECHO_C" >&6
13148 else
13149
13150                 cat >conftest.$ac_ext <<_ACEOF
13151 #line 13151 "configure"
13152 #include "confdefs.h"
13153
13154 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13155 #include <sys/types.h>
13156 #include <dirent.h>
13157
13158 int
13159 main (void)
13160 {
13161
13162                 /* if transitional largefile support is setup, this is true */
13163                 extern struct dirent64 * readdir(DIR *);
13164                 struct dirent64 *x = readdir((DIR *)0);
13165                 struct dirent *y = readdir((DIR *)0);
13166                 int z = x - y;
13167
13168   ;
13169   return 0;
13170 }
13171 _ACEOF
13172 rm -f conftest.$ac_objext
13173 if { (eval echo "$as_me:13173: \"$ac_compile\"") >&5
13174   (eval $ac_compile) 2>&5
13175   ac_status=$?
13176   echo "$as_me:13176: \$? = $ac_status" >&5
13177   (exit $ac_status); } &&
13178          { ac_try='test -s conftest.$ac_objext'
13179   { (eval echo "$as_me:13179: \"$ac_try\"") >&5
13180   (eval $ac_try) 2>&5
13181   ac_status=$?
13182   echo "$as_me:13182: \$? = $ac_status" >&5
13183   (exit $ac_status); }; }; then
13184   cf_cv_struct_dirent64=yes
13185 else
13186   echo "$as_me: failed program was:" >&5
13187 cat conftest.$ac_ext >&5
13188 cf_cv_struct_dirent64=no
13189 fi
13190 rm -f conftest.$ac_objext conftest.$ac_ext
13191
13192 fi
13193 echo "$as_me:13193: result: $cf_cv_struct_dirent64" >&5
13194 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13195         test "$cf_cv_struct_dirent64" = yes &&
13196 cat >>confdefs.h <<\EOF
13197 #define HAVE_STRUCT_DIRENT64 1
13198 EOF
13199
13200         fi
13201
13202 ### Enable compiling-in rcs id's
13203 echo "$as_me:13203: checking if RCS identifiers should be compiled-in" >&5
13204 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13205
13206 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13207 if test "${with_rcs_ids+set}" = set; then
13208   withval="$with_rcs_ids"
13209   with_rcs_ids=$withval
13210 else
13211   with_rcs_ids=no
13212 fi;
13213 echo "$as_me:13213: result: $with_rcs_ids" >&5
13214 echo "${ECHO_T}$with_rcs_ids" >&6
13215 test "$with_rcs_ids" = yes &&
13216 cat >>confdefs.h <<\EOF
13217 #define USE_RCS_IDS 1
13218 EOF
13219
13220 ###############################################################################
13221
13222 ### Note that some functions (such as const) are normally disabled anyway.
13223 echo "$as_me:13223: checking if you want to build with function extensions" >&5
13224 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13225
13226 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13227 if test "${enable_ext_funcs+set}" = set; then
13228   enableval="$enable_ext_funcs"
13229   with_ext_funcs=$enableval
13230 else
13231   with_ext_funcs=yes
13232 fi;
13233 echo "$as_me:13233: result: $with_ext_funcs" >&5
13234 echo "${ECHO_T}$with_ext_funcs" >&6
13235 if test "$with_ext_funcs" = yes ; then
13236         NCURSES_EXT_FUNCS=1
13237
13238 cat >>confdefs.h <<\EOF
13239 #define HAVE_USE_DEFAULT_COLORS 1
13240 EOF
13241
13242 cat >>confdefs.h <<\EOF
13243 #define NCURSES_EXT_FUNCS 1
13244 EOF
13245
13246 else
13247         NCURSES_EXT_FUNCS=0
13248 fi
13249
13250 ###   use option --enable-const to turn on use of const beyond that in XSI.
13251 echo "$as_me:13251: checking for extended use of const keyword" >&5
13252 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13253
13254 # Check whether --enable-const or --disable-const was given.
13255 if test "${enable_const+set}" = set; then
13256   enableval="$enable_const"
13257   with_ext_const=$enableval
13258 else
13259   with_ext_const=no
13260 fi;
13261 echo "$as_me:13261: result: $with_ext_const" >&5
13262 echo "${ECHO_T}$with_ext_const" >&6
13263 NCURSES_CONST='/*nothing*/'
13264 if test "$with_ext_const" = yes ; then
13265         NCURSES_CONST=const
13266 fi
13267
13268 ###############################################################################
13269 # These options are relatively safe to experiment with.
13270
13271 echo "$as_me:13271: checking if you want all development code" >&5
13272 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13273
13274 # Check whether --with-develop or --without-develop was given.
13275 if test "${with_develop+set}" = set; then
13276   withval="$with_develop"
13277   with_develop=$withval
13278 else
13279   with_develop=no
13280 fi;
13281 echo "$as_me:13281: result: $with_develop" >&5
13282 echo "${ECHO_T}$with_develop" >&6
13283
13284 ###############################################################################
13285 # These are just experimental, probably should not be in a package:
13286
13287 # This is still experimental (20080329), but should ultimately be moved to
13288 # the script-block --with-normal, etc.
13289
13290 echo "$as_me:13290: checking if you want to link with the pthread library" >&5
13291 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13292
13293 # Check whether --with-pthread or --without-pthread was given.
13294 if test "${with_pthread+set}" = set; then
13295   withval="$with_pthread"
13296   with_pthread=$withval
13297 else
13298   with_pthread=no
13299 fi;
13300 echo "$as_me:13300: result: $with_pthread" >&5
13301 echo "${ECHO_T}$with_pthread" >&6
13302
13303 if test "$with_pthread" != no ; then
13304         echo "$as_me:13304: checking for pthread.h" >&5
13305 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13306 if test "${ac_cv_header_pthread_h+set}" = set; then
13307   echo $ECHO_N "(cached) $ECHO_C" >&6
13308 else
13309   cat >conftest.$ac_ext <<_ACEOF
13310 #line 13310 "configure"
13311 #include "confdefs.h"
13312 #include <pthread.h>
13313 _ACEOF
13314 if { (eval echo "$as_me:13314: \"$ac_cpp conftest.$ac_ext\"") >&5
13315   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13316   ac_status=$?
13317   egrep -v '^ *\+' conftest.er1 >conftest.err
13318   rm -f conftest.er1
13319   cat conftest.err >&5
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit $ac_status); } >/dev/null; then
13322   if test -s conftest.err; then
13323     ac_cpp_err=$ac_c_preproc_warn_flag
13324   else
13325     ac_cpp_err=
13326   fi
13327 else
13328   ac_cpp_err=yes
13329 fi
13330 if test -z "$ac_cpp_err"; then
13331   ac_cv_header_pthread_h=yes
13332 else
13333   echo "$as_me: failed program was:" >&5
13334   cat conftest.$ac_ext >&5
13335   ac_cv_header_pthread_h=no
13336 fi
13337 rm -f conftest.err conftest.$ac_ext
13338 fi
13339 echo "$as_me:13339: result: $ac_cv_header_pthread_h" >&5
13340 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13341 if test $ac_cv_header_pthread_h = yes; then
13342
13343 cat >>confdefs.h <<\EOF
13344 #define HAVE_PTHREADS_H 1
13345 EOF
13346
13347         for cf_lib_pthread in pthread c_r
13348         do
13349             echo "$as_me:13349: checking if we can link with the $cf_lib_pthread library" >&5
13350 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13351             cf_save_LIBS="$LIBS"
13352
13353 cf_add_libs="-l$cf_lib_pthread"
13354 # Filter out duplicates - this happens with badly-designed ".pc" files...
13355 for cf_add_1lib in $LIBS
13356 do
13357         for cf_add_2lib in $cf_add_libs
13358         do
13359                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13360                 then
13361                         cf_add_1lib=
13362                         break
13363                 fi
13364         done
13365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13366 done
13367 LIBS="$cf_add_libs"
13368
13369             cat >conftest.$ac_ext <<_ACEOF
13370 #line 13370 "configure"
13371 #include "confdefs.h"
13372
13373 #include <pthread.h>
13374
13375 int
13376 main (void)
13377 {
13378
13379                 int rc = pthread_create(0,0,0,0);
13380                 int r2 = pthread_mutexattr_settype(0, 0);
13381
13382   ;
13383   return 0;
13384 }
13385 _ACEOF
13386 rm -f conftest.$ac_objext conftest$ac_exeext
13387 if { (eval echo "$as_me:13387: \"$ac_link\"") >&5
13388   (eval $ac_link) 2>&5
13389   ac_status=$?
13390   echo "$as_me:13390: \$? = $ac_status" >&5
13391   (exit $ac_status); } &&
13392          { ac_try='test -s conftest$ac_exeext'
13393   { (eval echo "$as_me:13393: \"$ac_try\"") >&5
13394   (eval $ac_try) 2>&5
13395   ac_status=$?
13396   echo "$as_me:13396: \$? = $ac_status" >&5
13397   (exit $ac_status); }; }; then
13398   with_pthread=yes
13399 else
13400   echo "$as_me: failed program was:" >&5
13401 cat conftest.$ac_ext >&5
13402 with_pthread=no
13403 fi
13404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13405             LIBS="$cf_save_LIBS"
13406             echo "$as_me:13406: result: $with_pthread" >&5
13407 echo "${ECHO_T}$with_pthread" >&6
13408             test "$with_pthread" = yes && break
13409         done
13410
13411         if test "$with_pthread" = yes ; then
13412
13413 cf_add_libs="-l$cf_lib_pthread"
13414 # Filter out duplicates - this happens with badly-designed ".pc" files...
13415 for cf_add_1lib in $LIBS
13416 do
13417         for cf_add_2lib in $cf_add_libs
13418         do
13419                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13420                 then
13421                         cf_add_1lib=
13422                         break
13423                 fi
13424         done
13425         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13426 done
13427 LIBS="$cf_add_libs"
13428
13429 cat >>confdefs.h <<\EOF
13430 #define HAVE_LIBPTHREADS 1
13431 EOF
13432
13433         else
13434             { { echo "$as_me:13434: error: Cannot link with pthread library" >&5
13435 echo "$as_me: error: Cannot link with pthread library" >&2;}
13436    { (exit 1); exit 1; }; }
13437         fi
13438
13439 fi
13440
13441 fi
13442
13443 echo "$as_me:13443: checking if you want to use weak-symbols for pthreads" >&5
13444 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13445
13446 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13447 if test "${enable_weak_symbols+set}" = set; then
13448   enableval="$enable_weak_symbols"
13449   use_weak_symbols=$withval
13450 else
13451   use_weak_symbols=no
13452 fi;
13453 echo "$as_me:13453: result: $use_weak_symbols" >&5
13454 echo "${ECHO_T}$use_weak_symbols" >&6
13455 if test "$use_weak_symbols" = yes ; then
13456
13457 echo "$as_me:13457: checking if $CC supports weak symbols" >&5
13458 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13459 if test "${cf_cv_weak_symbols+set}" = set; then
13460   echo $ECHO_N "(cached) $ECHO_C" >&6
13461 else
13462
13463 cat >conftest.$ac_ext <<_ACEOF
13464 #line 13464 "configure"
13465 #include "confdefs.h"
13466
13467 #include <stdio.h>
13468 int
13469 main (void)
13470 {
13471
13472 #if defined(__GNUC__)
13473 #  if defined __USE_ISOC99
13474 #    define _cat_pragma(exp)    _Pragma(#exp)
13475 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13476 #  else
13477 #    define _weak_pragma(exp)
13478 #  endif
13479 #  define _declare(name)        __extension__ extern __typeof__(name) name
13480 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13481 #endif
13482
13483 weak_symbol(fopen);
13484
13485   ;
13486   return 0;
13487 }
13488 _ACEOF
13489 rm -f conftest.$ac_objext
13490 if { (eval echo "$as_me:13490: \"$ac_compile\"") >&5
13491   (eval $ac_compile) 2>&5
13492   ac_status=$?
13493   echo "$as_me:13493: \$? = $ac_status" >&5
13494   (exit $ac_status); } &&
13495          { ac_try='test -s conftest.$ac_objext'
13496   { (eval echo "$as_me:13496: \"$ac_try\"") >&5
13497   (eval $ac_try) 2>&5
13498   ac_status=$?
13499   echo "$as_me:13499: \$? = $ac_status" >&5
13500   (exit $ac_status); }; }; then
13501   cf_cv_weak_symbols=yes
13502 else
13503   echo "$as_me: failed program was:" >&5
13504 cat conftest.$ac_ext >&5
13505 cf_cv_weak_symbols=no
13506 fi
13507 rm -f conftest.$ac_objext conftest.$ac_ext
13508
13509 fi
13510 echo "$as_me:13510: result: $cf_cv_weak_symbols" >&5
13511 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13512
13513 else
13514         cf_cv_weak_symbols=no
13515 fi
13516
13517 if test $cf_cv_weak_symbols = yes ; then
13518
13519 cat >>confdefs.h <<\EOF
13520 #define USE_WEAK_SYMBOLS 1
13521 EOF
13522
13523 fi
13524
13525 PTHREAD=
13526 if test "$with_pthread" = "yes" ; then
13527
13528 cat >>confdefs.h <<\EOF
13529 #define USE_PTHREADS 1
13530 EOF
13531
13532         enable_reentrant=yes
13533         if test $cf_cv_weak_symbols = yes ; then
13534                 PTHREAD=-lpthread
13535         fi
13536 fi
13537
13538 # OpenSUSE is installing ncurses6, using reentrant option.
13539 echo "$as_me:13539: checking for _nc_TABSIZE" >&5
13540 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13541 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13542   echo $ECHO_N "(cached) $ECHO_C" >&6
13543 else
13544   cat >conftest.$ac_ext <<_ACEOF
13545 #line 13545 "configure"
13546 #include "confdefs.h"
13547 #define _nc_TABSIZE autoconf_temporary
13548 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13549 #undef _nc_TABSIZE
13550
13551 #ifdef __cplusplus
13552 extern "C"
13553 #endif
13554
13555 /* We use char because int might match the return type of a gcc2
13556    builtin and then its argument prototype would still apply.  */
13557 char _nc_TABSIZE (void);
13558
13559 int
13560 main (void)
13561 {
13562
13563 /* The GNU C library defines stubs for functions which it implements
13564     to always fail with ENOSYS.  Some functions are actually named
13565     something starting with __ and the normal name is an alias.  */
13566 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13567 #error found stub for _nc_TABSIZE
13568 #endif
13569
13570         return _nc_TABSIZE ();
13571   ;
13572   return 0;
13573 }
13574 _ACEOF
13575 rm -f conftest.$ac_objext conftest$ac_exeext
13576 if { (eval echo "$as_me:13576: \"$ac_link\"") >&5
13577   (eval $ac_link) 2>&5
13578   ac_status=$?
13579   echo "$as_me:13579: \$? = $ac_status" >&5
13580   (exit $ac_status); } &&
13581          { ac_try='test -s conftest$ac_exeext'
13582   { (eval echo "$as_me:13582: \"$ac_try\"") >&5
13583   (eval $ac_try) 2>&5
13584   ac_status=$?
13585   echo "$as_me:13585: \$? = $ac_status" >&5
13586   (exit $ac_status); }; }; then
13587   ac_cv_func__nc_TABSIZE=yes
13588 else
13589   echo "$as_me: failed program was:" >&5
13590 cat conftest.$ac_ext >&5
13591 ac_cv_func__nc_TABSIZE=no
13592 fi
13593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13594 fi
13595 echo "$as_me:13595: result: $ac_cv_func__nc_TABSIZE" >&5
13596 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13597 if test $ac_cv_func__nc_TABSIZE = yes; then
13598   assume_reentrant=yes
13599 else
13600   assume_reentrant=no
13601 fi
13602
13603 # Reentrant code has to be opaque; there's little advantage to making ncurses
13604 # opaque outside of that, so there is no --enable-opaque option.  We can use
13605 # this option without --with-pthreads, but this will be always set for
13606 # pthreads.
13607 echo "$as_me:13607: checking if you want experimental reentrant code" >&5
13608 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13609
13610 # Check whether --enable-reentrant or --disable-reentrant was given.
13611 if test "${enable_reentrant+set}" = set; then
13612   enableval="$enable_reentrant"
13613   with_reentrant=$enableval
13614 else
13615   with_reentrant=$assume_reentrant
13616 fi;
13617 echo "$as_me:13617: result: $with_reentrant" >&5
13618 echo "${ECHO_T}$with_reentrant" >&6
13619 if test "$with_reentrant" = yes ; then
13620         cf_cv_enable_reentrant=1
13621         if test $cf_cv_weak_symbols = yes ; then
13622
13623 # remove pthread library from $LIBS
13624 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13625
13626         elif test "$assume_reentrant" = no ; then
13627                 LIB_SUFFIX="t${LIB_SUFFIX}"
13628         fi
13629
13630 cat >>confdefs.h <<\EOF
13631 #define USE_REENTRANT 1
13632 EOF
13633
13634 else
13635         cf_cv_enable_reentrant=0
13636 fi
13637
13638 ### Allow using a different wrap-prefix
13639 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13640         echo "$as_me:13640: checking for prefix used to wrap public variables" >&5
13641 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13642
13643 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13644 if test "${with_wrap_prefix+set}" = set; then
13645   withval="$with_wrap_prefix"
13646   NCURSES_WRAP_PREFIX=$withval
13647 else
13648   NCURSES_WRAP_PREFIX=_nc_
13649 fi;
13650         echo "$as_me:13650: result: $NCURSES_WRAP_PREFIX" >&5
13651 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13652 else
13653         NCURSES_WRAP_PREFIX=_nc_
13654 fi
13655
13656 cat >>confdefs.h <<EOF
13657 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13658 EOF
13659
13660 ###############################################################################
13661
13662 ###     use option --disable-echo to suppress full display compiling commands
13663
13664 echo "$as_me:13664: checking if you want to see long compiling messages" >&5
13665 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13666
13667 # Check whether --enable-echo or --disable-echo was given.
13668 if test "${enable_echo+set}" = set; then
13669   enableval="$enable_echo"
13670   test "$enableval" != no && enableval=yes
13671         if test "$enableval" != "yes" ; then
13672
13673         ECHO_LT='--silent'
13674         ECHO_LD='@echo linking $@;'
13675         RULE_CC='@echo compiling $<'
13676         SHOW_CC='@echo compiling $@'
13677         ECHO_CC='@'
13678
13679         else
13680
13681         ECHO_LT=''
13682         ECHO_LD=''
13683         RULE_CC=''
13684         SHOW_CC=''
13685         ECHO_CC=''
13686
13687         fi
13688 else
13689   enableval=yes
13690
13691         ECHO_LT=''
13692         ECHO_LD=''
13693         RULE_CC=''
13694         SHOW_CC=''
13695         ECHO_CC=''
13696
13697 fi;
13698 echo "$as_me:13698: result: $enableval" >&5
13699 echo "${ECHO_T}$enableval" >&6
13700
13701 ###     use option --enable-warnings to turn on all gcc warnings
13702 echo "$as_me:13702: checking if you want to see compiler warnings" >&5
13703 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13704
13705 # Check whether --enable-warnings or --disable-warnings was given.
13706 if test "${enable_warnings+set}" = set; then
13707   enableval="$enable_warnings"
13708   with_warnings=$enableval
13709 fi;
13710 echo "$as_me:13710: result: $with_warnings" >&5
13711 echo "${ECHO_T}$with_warnings" >&6
13712
13713 if test "x$with_warnings" = "xyes"; then
13714
13715         ADAFLAGS="$ADAFLAGS -gnatg"
13716
13717 INTEL_COMPILER=no
13718
13719 if test "$GCC" = yes ; then
13720         case $host_os in
13721         (linux*|gnu*)
13722                 echo "$as_me:13722: checking if this is really Intel C compiler" >&5
13723 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
13724                 cf_save_CFLAGS="$CFLAGS"
13725                 CFLAGS="$CFLAGS -no-gcc"
13726                 cat >conftest.$ac_ext <<_ACEOF
13727 #line 13727 "configure"
13728 #include "confdefs.h"
13729
13730 int
13731 main (void)
13732 {
13733
13734 #ifdef __INTEL_COMPILER
13735 #else
13736 make an error
13737 #endif
13738
13739   ;
13740   return 0;
13741 }
13742 _ACEOF
13743 rm -f conftest.$ac_objext
13744 if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5
13745   (eval $ac_compile) 2>&5
13746   ac_status=$?
13747   echo "$as_me:13747: \$? = $ac_status" >&5
13748   (exit $ac_status); } &&
13749          { ac_try='test -s conftest.$ac_objext'
13750   { (eval echo "$as_me:13750: \"$ac_try\"") >&5
13751   (eval $ac_try) 2>&5
13752   ac_status=$?
13753   echo "$as_me:13753: \$? = $ac_status" >&5
13754   (exit $ac_status); }; }; then
13755   INTEL_COMPILER=yes
13756 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
13757
13758 else
13759   echo "$as_me: failed program was:" >&5
13760 cat conftest.$ac_ext >&5
13761 fi
13762 rm -f conftest.$ac_objext conftest.$ac_ext
13763                 CFLAGS="$cf_save_CFLAGS"
13764                 echo "$as_me:13764: result: $INTEL_COMPILER" >&5
13765 echo "${ECHO_T}$INTEL_COMPILER" >&6
13766                 ;;
13767         esac
13768 fi
13769
13770 CLANG_COMPILER=no
13771
13772 if test "$GCC" = yes ; then
13773         echo "$as_me:13773: checking if this is really Clang C compiler" >&5
13774 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
13775         cf_save_CFLAGS="$CFLAGS"
13776         CFLAGS="$CFLAGS -Qunused-arguments"
13777         cat >conftest.$ac_ext <<_ACEOF
13778 #line 13778 "configure"
13779 #include "confdefs.h"
13780
13781 int
13782 main (void)
13783 {
13784
13785 #ifdef __clang__
13786 #else
13787 make an error
13788 #endif
13789
13790   ;
13791   return 0;
13792 }
13793 _ACEOF
13794 rm -f conftest.$ac_objext
13795 if { (eval echo "$as_me:13795: \"$ac_compile\"") >&5
13796   (eval $ac_compile) 2>&5
13797   ac_status=$?
13798   echo "$as_me:13798: \$? = $ac_status" >&5
13799   (exit $ac_status); } &&
13800          { ac_try='test -s conftest.$ac_objext'
13801   { (eval echo "$as_me:13801: \"$ac_try\"") >&5
13802   (eval $ac_try) 2>&5
13803   ac_status=$?
13804   echo "$as_me:13804: \$? = $ac_status" >&5
13805   (exit $ac_status); }; }; then
13806   CLANG_COMPILER=yes
13807 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
13808
13809 else
13810   echo "$as_me: failed program was:" >&5
13811 cat conftest.$ac_ext >&5
13812 fi
13813 rm -f conftest.$ac_objext conftest.$ac_ext
13814         CFLAGS="$cf_save_CFLAGS"
13815         echo "$as_me:13815: result: $CLANG_COMPILER" >&5
13816 echo "${ECHO_T}$CLANG_COMPILER" >&6
13817 fi
13818
13819 cat > conftest.$ac_ext <<EOF
13820 #line 13820 "${as_me:-configure}"
13821 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13822 EOF
13823
13824 if test "$INTEL_COMPILER" = yes
13825 then
13826 # The "-wdXXX" options suppress warnings:
13827 # remark #1419: external declaration in primary source file
13828 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13829 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13830 # remark #193: zero used for undefined preprocessing identifier
13831 # remark #593: variable "curs_sb_left_arrow" was set but never used
13832 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13833 # remark #869: parameter "tw" was never referenced
13834 # remark #981: operands are evaluated in unspecified order
13835 # warning #279: controlling expression is constant
13836
13837         { echo "$as_me:13837: checking for $CC warning options..." >&5
13838 echo "$as_me: checking for $CC warning options..." >&6;}
13839         cf_save_CFLAGS="$CFLAGS"
13840         EXTRA_CFLAGS="-Wall"
13841         for cf_opt in \
13842                 wd1419 \
13843                 wd1683 \
13844                 wd1684 \
13845                 wd193 \
13846                 wd593 \
13847                 wd279 \
13848                 wd810 \
13849                 wd869 \
13850                 wd981
13851         do
13852                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13853                 if { (eval echo "$as_me:13853: \"$ac_compile\"") >&5
13854   (eval $ac_compile) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); }; then
13858                         test -n "$verbose" && echo "$as_me:13858: result: ... -$cf_opt" >&5
13859 echo "${ECHO_T}... -$cf_opt" >&6
13860                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13861                 fi
13862         done
13863         CFLAGS="$cf_save_CFLAGS"
13864
13865 elif test "$GCC" = yes
13866 then
13867         { echo "$as_me:13867: checking for $CC warning options..." >&5
13868 echo "$as_me: checking for $CC warning options..." >&6;}
13869         cf_save_CFLAGS="$CFLAGS"
13870         EXTRA_CFLAGS=
13871         cf_warn_CONST=""
13872         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13873         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13874         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13875         for cf_opt in W Wall \
13876                 Wbad-function-cast \
13877                 Wcast-align \
13878                 Wcast-qual \
13879                 Wdeclaration-after-statement \
13880                 Wextra \
13881                 Winline \
13882                 Wmissing-declarations \
13883                 Wmissing-prototypes \
13884                 Wnested-externs \
13885                 Wpointer-arith \
13886                 Wshadow \
13887                 Wstrict-prototypes \
13888                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
13889         do
13890                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13891                 if { (eval echo "$as_me:13891: \"$ac_compile\"") >&5
13892   (eval $ac_compile) 2>&5
13893   ac_status=$?
13894   echo "$as_me:13894: \$? = $ac_status" >&5
13895   (exit $ac_status); }; then
13896                         test -n "$verbose" && echo "$as_me:13896: result: ... -$cf_opt" >&5
13897 echo "${ECHO_T}... -$cf_opt" >&6
13898                         case $cf_opt in
13899                         (Wcast-qual)
13900
13901         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13902         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13903
13904                                 ;;
13905                         (Winline)
13906                                 case $GCC_VERSION in
13907                                 ([34].*)
13908                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13909
13910 echo "${as_me:-configure}:13910: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13911
13912                                         continue;;
13913                                 esac
13914                                 ;;
13915                         (Wpointer-arith)
13916                                 case $GCC_VERSION in
13917                                 ([12].*)
13918                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13919
13920 echo "${as_me:-configure}:13920: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13921
13922                                         continue;;
13923                                 esac
13924                                 ;;
13925                         esac
13926                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13927                 fi
13928         done
13929         CFLAGS="$cf_save_CFLAGS"
13930 fi
13931 rm -rf conftest*
13932
13933 fi
13934
13935 if test "$GCC" = yes
13936 then
13937 cat > conftest.i <<EOF
13938 #ifndef GCC_PRINTF
13939 #define GCC_PRINTF 0
13940 #endif
13941 #ifndef GCC_SCANF
13942 #define GCC_SCANF 0
13943 #endif
13944 #ifndef GCC_NORETURN
13945 #define GCC_NORETURN /* nothing */
13946 #endif
13947 #ifndef GCC_UNUSED
13948 #define GCC_UNUSED /* nothing */
13949 #endif
13950 EOF
13951 if test "$GCC" = yes
13952 then
13953         { echo "$as_me:13953: checking for $CC __attribute__ directives..." >&5
13954 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
13955 cat > conftest.$ac_ext <<EOF
13956 #line 13956 "${as_me:-configure}"
13957 #include "confdefs.h"
13958 #include "conftest.h"
13959 #include "conftest.i"
13960 #if     GCC_PRINTF
13961 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
13962 #else
13963 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
13964 #endif
13965 #if     GCC_SCANF
13966 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
13967 #else
13968 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
13969 #endif
13970 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
13971 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
13972 extern void foo(void) GCC_NORETURN;
13973 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
13974 EOF
13975         cf_printf_attribute=no
13976         cf_scanf_attribute=no
13977         for cf_attribute in scanf printf unused noreturn
13978         do
13979
13980 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13981
13982                 cf_directive="__attribute__(($cf_attribute))"
13983                 echo "checking for $CC $cf_directive" 1>&5
13984
13985                 case $cf_attribute in
13986                 (printf)
13987                         cf_printf_attribute=yes
13988                         cat >conftest.h <<EOF
13989 #define GCC_$cf_ATTRIBUTE 1
13990 EOF
13991                         ;;
13992                 (scanf)
13993                         cf_scanf_attribute=yes
13994                         cat >conftest.h <<EOF
13995 #define GCC_$cf_ATTRIBUTE 1
13996 EOF
13997                         ;;
13998                 (*)
13999                         cat >conftest.h <<EOF
14000 #define GCC_$cf_ATTRIBUTE $cf_directive
14001 EOF
14002                         ;;
14003                 esac
14004
14005                 if { (eval echo "$as_me:14005: \"$ac_compile\"") >&5
14006   (eval $ac_compile) 2>&5
14007   ac_status=$?
14008   echo "$as_me:14008: \$? = $ac_status" >&5
14009   (exit $ac_status); }; then
14010                         test -n "$verbose" && echo "$as_me:14010: result: ... $cf_attribute" >&5
14011 echo "${ECHO_T}... $cf_attribute" >&6
14012                         cat conftest.h >>confdefs.h
14013                         case $cf_attribute in
14014                         (noreturn)
14015
14016 cat >>confdefs.h <<EOF
14017 #define GCC_NORETURN $cf_directive
14018 EOF
14019
14020                                 ;;
14021                         (printf)
14022                                 cf_value='/* nothing */'
14023                                 if test "$cf_printf_attribute" != no ; then
14024                                         cf_value='__attribute__((format(printf,fmt,var)))'
14025
14026 cat >>confdefs.h <<\EOF
14027 #define GCC_PRINTF 1
14028 EOF
14029
14030                                 fi
14031
14032 cat >>confdefs.h <<EOF
14033 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14034 EOF
14035
14036                                 ;;
14037                         (scanf)
14038                                 cf_value='/* nothing */'
14039                                 if test "$cf_scanf_attribute" != no ; then
14040                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14041
14042 cat >>confdefs.h <<\EOF
14043 #define GCC_SCANF 1
14044 EOF
14045
14046                                 fi
14047
14048 cat >>confdefs.h <<EOF
14049 #define GCC_SCANFLIKE(fmt,var) $cf_value
14050 EOF
14051
14052                                 ;;
14053                         (unused)
14054
14055 cat >>confdefs.h <<EOF
14056 #define GCC_UNUSED $cf_directive
14057 EOF
14058
14059                                 ;;
14060                         esac
14061                 fi
14062         done
14063 else
14064         fgrep define conftest.i >>confdefs.h
14065 fi
14066 rm -rf conftest*
14067 fi
14068
14069 ###     use option --enable-assertions to turn on generation of assertion code
14070 echo "$as_me:14070: checking if you want to enable runtime assertions" >&5
14071 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14072
14073 # Check whether --enable-assertions or --disable-assertions was given.
14074 if test "${enable_assertions+set}" = set; then
14075   enableval="$enable_assertions"
14076   with_assertions=$enableval
14077 else
14078   with_assertions=no
14079 fi;
14080 echo "$as_me:14080: result: $with_assertions" >&5
14081 echo "${ECHO_T}$with_assertions" >&6
14082 if test -n "$GCC"
14083 then
14084         if test "$with_assertions" = no
14085         then
14086                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14087         else
14088
14089         ADAFLAGS="$ADAFLAGS -gnata"
14090
14091         fi
14092 fi
14093
14094 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14095
14096 cat >>confdefs.h <<\EOF
14097 #define HAVE_NC_ALLOC_H 1
14098 EOF
14099
14100 ###     use option --enable-expanded to generate certain macros as functions
14101
14102 # Check whether --enable-expanded or --disable-expanded was given.
14103 if test "${enable_expanded+set}" = set; then
14104   enableval="$enable_expanded"
14105   test "$enableval" = yes &&
14106 cat >>confdefs.h <<\EOF
14107 #define NCURSES_EXPANDED 1
14108 EOF
14109
14110 fi;
14111
14112 ###     use option --disable-macros to suppress macros in favor of functions
14113
14114 # Check whether --enable-macros or --disable-macros was given.
14115 if test "${enable_macros+set}" = set; then
14116   enableval="$enable_macros"
14117   test "$enableval" = no &&
14118 cat >>confdefs.h <<\EOF
14119 #define NCURSES_NOMACROS 1
14120 EOF
14121
14122 fi;
14123
14124 # Normally we only add trace() to the debug-library.  Allow this to be
14125 # extended to all models of the ncurses library:
14126 cf_all_traces=no
14127 case "$CFLAGS $CPPFLAGS" in
14128 (*-DTRACE*)
14129         cf_all_traces=yes
14130         ;;
14131 esac
14132
14133 echo "$as_me:14133: checking whether to add trace feature to all models" >&5
14134 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14135
14136 # Check whether --with-trace or --without-trace was given.
14137 if test "${with_trace+set}" = set; then
14138   withval="$with_trace"
14139   cf_with_trace=$withval
14140 else
14141   cf_with_trace=$cf_all_traces
14142 fi;
14143 echo "$as_me:14143: result: $cf_with_trace" >&5
14144 echo "${ECHO_T}$cf_with_trace" >&6
14145
14146 if test "$cf_with_trace" = yes ; then
14147         ADA_TRACE=TRUE
14148
14149 cf_fix_cppflags=no
14150 cf_new_cflags=
14151 cf_new_cppflags=
14152 cf_new_extra_cppflags=
14153
14154 for cf_add_cflags in -DTRACE
14155 do
14156 case $cf_fix_cppflags in
14157 (no)
14158         case $cf_add_cflags in
14159         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14160                 case $cf_add_cflags in
14161                 (-D*)
14162                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14163
14164                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14165                                 && test -z "${cf_tst_cflags}" \
14166                                 && cf_fix_cppflags=yes
14167
14168                         if test $cf_fix_cppflags = yes ; then
14169
14170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14172
14173                                 continue
14174                         elif test "${cf_tst_cflags}" = "\"'" ; then
14175
14176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14178
14179                                 continue
14180                         fi
14181                         ;;
14182                 esac
14183                 case "$CPPFLAGS" in
14184                 (*$cf_add_cflags)
14185                         ;;
14186                 (*)
14187                         case $cf_add_cflags in
14188                         (-D*)
14189                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14190
14191 CPPFLAGS=`echo "$CPPFLAGS" | \
14192         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14193                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14194
14195                                 ;;
14196                         esac
14197
14198         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14199         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14200
14201                         ;;
14202                 esac
14203                 ;;
14204         (*)
14205
14206         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14207         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14208
14209                 ;;
14210         esac
14211         ;;
14212 (yes)
14213
14214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14216
14217         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14218
14219         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14220                 && test -z "${cf_tst_cflags}" \
14221                 && cf_fix_cppflags=no
14222         ;;
14223 esac
14224 done
14225
14226 if test -n "$cf_new_cflags" ; then
14227
14228         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14229         CFLAGS="${CFLAGS}$cf_new_cflags"
14230
14231 fi
14232
14233 if test -n "$cf_new_cppflags" ; then
14234
14235         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14236         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14237
14238 fi
14239
14240 if test -n "$cf_new_extra_cppflags" ; then
14241
14242         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14243         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14244
14245 fi
14246
14247 else
14248         ADA_TRACE=FALSE
14249 fi
14250
14251 echo "$as_me:14251: checking if we want to use GNAT projects" >&5
14252 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14253
14254 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14255 if test "${enable_gnat_projects+set}" = set; then
14256   enableval="$enable_gnat_projects"
14257   test "$enableval" != no && enableval=yes
14258         if test "$enableval" != "yes" ; then
14259     enable_gnat_projects=no
14260         else
14261                 enable_gnat_projects=yes
14262         fi
14263 else
14264   enableval=yes
14265         enable_gnat_projects=yes
14266
14267 fi;
14268 echo "$as_me:14268: result: $enable_gnat_projects" >&5
14269 echo "${ECHO_T}$enable_gnat_projects" >&6
14270
14271 ###     Checks for libraries.
14272 case $cf_cv_system_name in
14273 (*mingw32*)
14274         ;;
14275 (*)
14276 echo "$as_me:14276: checking for gettimeofday" >&5
14277 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14278 if test "${ac_cv_func_gettimeofday+set}" = set; then
14279   echo $ECHO_N "(cached) $ECHO_C" >&6
14280 else
14281   cat >conftest.$ac_ext <<_ACEOF
14282 #line 14282 "configure"
14283 #include "confdefs.h"
14284 #define gettimeofday autoconf_temporary
14285 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14286 #undef gettimeofday
14287
14288 #ifdef __cplusplus
14289 extern "C"
14290 #endif
14291
14292 /* We use char because int might match the return type of a gcc2
14293    builtin and then its argument prototype would still apply.  */
14294 char gettimeofday (void);
14295
14296 int
14297 main (void)
14298 {
14299
14300 /* The GNU C library defines stubs for functions which it implements
14301     to always fail with ENOSYS.  Some functions are actually named
14302     something starting with __ and the normal name is an alias.  */
14303 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14304 #error found stub for gettimeofday
14305 #endif
14306
14307         return gettimeofday ();
14308   ;
14309   return 0;
14310 }
14311 _ACEOF
14312 rm -f conftest.$ac_objext conftest$ac_exeext
14313 if { (eval echo "$as_me:14313: \"$ac_link\"") >&5
14314   (eval $ac_link) 2>&5
14315   ac_status=$?
14316   echo "$as_me:14316: \$? = $ac_status" >&5
14317   (exit $ac_status); } &&
14318          { ac_try='test -s conftest$ac_exeext'
14319   { (eval echo "$as_me:14319: \"$ac_try\"") >&5
14320   (eval $ac_try) 2>&5
14321   ac_status=$?
14322   echo "$as_me:14322: \$? = $ac_status" >&5
14323   (exit $ac_status); }; }; then
14324   ac_cv_func_gettimeofday=yes
14325 else
14326   echo "$as_me: failed program was:" >&5
14327 cat conftest.$ac_ext >&5
14328 ac_cv_func_gettimeofday=no
14329 fi
14330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14331 fi
14332 echo "$as_me:14332: result: $ac_cv_func_gettimeofday" >&5
14333 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14334 if test $ac_cv_func_gettimeofday = yes; then
14335   cat >>confdefs.h <<\EOF
14336 #define HAVE_GETTIMEOFDAY 1
14337 EOF
14338
14339 else
14340
14341 echo "$as_me:14341: checking for gettimeofday in -lbsd" >&5
14342 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14343 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14344   echo $ECHO_N "(cached) $ECHO_C" >&6
14345 else
14346   ac_check_lib_save_LIBS=$LIBS
14347 LIBS="-lbsd  $LIBS"
14348 cat >conftest.$ac_ext <<_ACEOF
14349 #line 14349 "configure"
14350 #include "confdefs.h"
14351
14352 /* Override any gcc2 internal prototype to avoid an error.  */
14353 #ifdef __cplusplus
14354 extern "C"
14355 #endif
14356 /* We use char because int might match the return type of a gcc2
14357    builtin and then its argument prototype would still apply.  */
14358 char gettimeofday ();
14359 int
14360 main (void)
14361 {
14362 gettimeofday ();
14363   ;
14364   return 0;
14365 }
14366 _ACEOF
14367 rm -f conftest.$ac_objext conftest$ac_exeext
14368 if { (eval echo "$as_me:14368: \"$ac_link\"") >&5
14369   (eval $ac_link) 2>&5
14370   ac_status=$?
14371   echo "$as_me:14371: \$? = $ac_status" >&5
14372   (exit $ac_status); } &&
14373          { ac_try='test -s conftest$ac_exeext'
14374   { (eval echo "$as_me:14374: \"$ac_try\"") >&5
14375   (eval $ac_try) 2>&5
14376   ac_status=$?
14377   echo "$as_me:14377: \$? = $ac_status" >&5
14378   (exit $ac_status); }; }; then
14379   ac_cv_lib_bsd_gettimeofday=yes
14380 else
14381   echo "$as_me: failed program was:" >&5
14382 cat conftest.$ac_ext >&5
14383 ac_cv_lib_bsd_gettimeofday=no
14384 fi
14385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14386 LIBS=$ac_check_lib_save_LIBS
14387 fi
14388 echo "$as_me:14388: result: $ac_cv_lib_bsd_gettimeofday" >&5
14389 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14390 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14391
14392 cat >>confdefs.h <<\EOF
14393 #define HAVE_GETTIMEOFDAY 1
14394 EOF
14395
14396         LIBS="$LIBS -lbsd"
14397 fi
14398
14399 fi
14400         ;;
14401 esac
14402
14403 ###     Checks for header files.
14404 echo "$as_me:14404: checking for ANSI C header files" >&5
14405 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14406 if test "${ac_cv_header_stdc+set}" = set; then
14407   echo $ECHO_N "(cached) $ECHO_C" >&6
14408 else
14409   cat >conftest.$ac_ext <<_ACEOF
14410 #line 14410 "configure"
14411 #include "confdefs.h"
14412 #include <stdlib.h>
14413 #include <stdarg.h>
14414 #include <string.h>
14415 #include <float.h>
14416
14417 _ACEOF
14418 if { (eval echo "$as_me:14418: \"$ac_cpp conftest.$ac_ext\"") >&5
14419   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14420   ac_status=$?
14421   egrep -v '^ *\+' conftest.er1 >conftest.err
14422   rm -f conftest.er1
14423   cat conftest.err >&5
14424   echo "$as_me:14424: \$? = $ac_status" >&5
14425   (exit $ac_status); } >/dev/null; then
14426   if test -s conftest.err; then
14427     ac_cpp_err=$ac_c_preproc_warn_flag
14428   else
14429     ac_cpp_err=
14430   fi
14431 else
14432   ac_cpp_err=yes
14433 fi
14434 if test -z "$ac_cpp_err"; then
14435   ac_cv_header_stdc=yes
14436 else
14437   echo "$as_me: failed program was:" >&5
14438   cat conftest.$ac_ext >&5
14439   ac_cv_header_stdc=no
14440 fi
14441 rm -f conftest.err conftest.$ac_ext
14442
14443 if test $ac_cv_header_stdc = yes; then
14444   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14445   cat >conftest.$ac_ext <<_ACEOF
14446 #line 14446 "configure"
14447 #include "confdefs.h"
14448 #include <string.h>
14449
14450 _ACEOF
14451 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14452   egrep "memchr" >/dev/null 2>&1; then
14453   :
14454 else
14455   ac_cv_header_stdc=no
14456 fi
14457 rm -rf conftest*
14458
14459 fi
14460
14461 if test $ac_cv_header_stdc = yes; then
14462   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14463   cat >conftest.$ac_ext <<_ACEOF
14464 #line 14464 "configure"
14465 #include "confdefs.h"
14466 #include <stdlib.h>
14467
14468 _ACEOF
14469 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14470   egrep "free" >/dev/null 2>&1; then
14471   :
14472 else
14473   ac_cv_header_stdc=no
14474 fi
14475 rm -rf conftest*
14476
14477 fi
14478
14479 if test $ac_cv_header_stdc = yes; then
14480   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14481   if test "$cross_compiling" = yes; then
14482   :
14483 else
14484   cat >conftest.$ac_ext <<_ACEOF
14485 #line 14485 "configure"
14486 #include "confdefs.h"
14487 #include <ctype.h>
14488 #if ((' ' & 0x0FF) == 0x020)
14489 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14490 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14491 #else
14492 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14493                      || ('j' <= (c) && (c) <= 'r') \
14494                      || ('s' <= (c) && (c) <= 'z'))
14495 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14496 #endif
14497
14498 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14499 int
14500 main (void)
14501 {
14502   int i;
14503   for (i = 0; i < 256; i++)
14504     if (XOR (islower (i), ISLOWER (i))
14505         || toupper (i) != TOUPPER (i))
14506       $ac_main_return(2);
14507   $ac_main_return (0);
14508 }
14509 _ACEOF
14510 rm -f conftest$ac_exeext
14511 if { (eval echo "$as_me:14511: \"$ac_link\"") >&5
14512   (eval $ac_link) 2>&5
14513   ac_status=$?
14514   echo "$as_me:14514: \$? = $ac_status" >&5
14515   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14516   { (eval echo "$as_me:14516: \"$ac_try\"") >&5
14517   (eval $ac_try) 2>&5
14518   ac_status=$?
14519   echo "$as_me:14519: \$? = $ac_status" >&5
14520   (exit $ac_status); }; }; then
14521   :
14522 else
14523   echo "$as_me: program exited with status $ac_status" >&5
14524 echo "$as_me: failed program was:" >&5
14525 cat conftest.$ac_ext >&5
14526 ac_cv_header_stdc=no
14527 fi
14528 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14529 fi
14530 fi
14531 fi
14532 echo "$as_me:14532: result: $ac_cv_header_stdc" >&5
14533 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14534 if test $ac_cv_header_stdc = yes; then
14535
14536 cat >>confdefs.h <<\EOF
14537 #define STDC_HEADERS 1
14538 EOF
14539
14540 fi
14541
14542 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14543
14544 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14545                   inttypes.h stdint.h unistd.h
14546 do
14547 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14548 echo "$as_me:14548: checking for $ac_header" >&5
14549 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14550 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14551   echo $ECHO_N "(cached) $ECHO_C" >&6
14552 else
14553   cat >conftest.$ac_ext <<_ACEOF
14554 #line 14554 "configure"
14555 #include "confdefs.h"
14556 $ac_includes_default
14557 #include <$ac_header>
14558 _ACEOF
14559 rm -f conftest.$ac_objext
14560 if { (eval echo "$as_me:14560: \"$ac_compile\"") >&5
14561   (eval $ac_compile) 2>&5
14562   ac_status=$?
14563   echo "$as_me:14563: \$? = $ac_status" >&5
14564   (exit $ac_status); } &&
14565          { ac_try='test -s conftest.$ac_objext'
14566   { (eval echo "$as_me:14566: \"$ac_try\"") >&5
14567   (eval $ac_try) 2>&5
14568   ac_status=$?
14569   echo "$as_me:14569: \$? = $ac_status" >&5
14570   (exit $ac_status); }; }; then
14571   eval "$as_ac_Header=yes"
14572 else
14573   echo "$as_me: failed program was:" >&5
14574 cat conftest.$ac_ext >&5
14575 eval "$as_ac_Header=no"
14576 fi
14577 rm -f conftest.$ac_objext conftest.$ac_ext
14578 fi
14579 echo "$as_me:14579: result: `eval echo '${'$as_ac_Header'}'`" >&5
14580 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14581 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14582   cat >>confdefs.h <<EOF
14583 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14584 EOF
14585
14586 fi
14587 done
14588
14589 echo "$as_me:14589: checking for signed char" >&5
14590 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14591 if test "${ac_cv_type_signed_char+set}" = set; then
14592   echo $ECHO_N "(cached) $ECHO_C" >&6
14593 else
14594   cat >conftest.$ac_ext <<_ACEOF
14595 #line 14595 "configure"
14596 #include "confdefs.h"
14597 $ac_includes_default
14598 int
14599 main (void)
14600 {
14601 if ((signed char *) 0)
14602   return 0;
14603 if (sizeof (signed char))
14604   return 0;
14605   ;
14606   return 0;
14607 }
14608 _ACEOF
14609 rm -f conftest.$ac_objext
14610 if { (eval echo "$as_me:14610: \"$ac_compile\"") >&5
14611   (eval $ac_compile) 2>&5
14612   ac_status=$?
14613   echo "$as_me:14613: \$? = $ac_status" >&5
14614   (exit $ac_status); } &&
14615          { ac_try='test -s conftest.$ac_objext'
14616   { (eval echo "$as_me:14616: \"$ac_try\"") >&5
14617   (eval $ac_try) 2>&5
14618   ac_status=$?
14619   echo "$as_me:14619: \$? = $ac_status" >&5
14620   (exit $ac_status); }; }; then
14621   ac_cv_type_signed_char=yes
14622 else
14623   echo "$as_me: failed program was:" >&5
14624 cat conftest.$ac_ext >&5
14625 ac_cv_type_signed_char=no
14626 fi
14627 rm -f conftest.$ac_objext conftest.$ac_ext
14628 fi
14629 echo "$as_me:14629: result: $ac_cv_type_signed_char" >&5
14630 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14631
14632 echo "$as_me:14632: checking size of signed char" >&5
14633 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14634 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14635   echo $ECHO_N "(cached) $ECHO_C" >&6
14636 else
14637   if test "$ac_cv_type_signed_char" = yes; then
14638   if test "$cross_compiling" = yes; then
14639   # Depending upon the size, compute the lo and hi bounds.
14640 cat >conftest.$ac_ext <<_ACEOF
14641 #line 14641 "configure"
14642 #include "confdefs.h"
14643 $ac_includes_default
14644 int
14645 main (void)
14646 {
14647 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14648   ;
14649   return 0;
14650 }
14651 _ACEOF
14652 rm -f conftest.$ac_objext
14653 if { (eval echo "$as_me:14653: \"$ac_compile\"") >&5
14654   (eval $ac_compile) 2>&5
14655   ac_status=$?
14656   echo "$as_me:14656: \$? = $ac_status" >&5
14657   (exit $ac_status); } &&
14658          { ac_try='test -s conftest.$ac_objext'
14659   { (eval echo "$as_me:14659: \"$ac_try\"") >&5
14660   (eval $ac_try) 2>&5
14661   ac_status=$?
14662   echo "$as_me:14662: \$? = $ac_status" >&5
14663   (exit $ac_status); }; }; then
14664   ac_lo=0 ac_mid=0
14665   while :; do
14666     cat >conftest.$ac_ext <<_ACEOF
14667 #line 14667 "configure"
14668 #include "confdefs.h"
14669 $ac_includes_default
14670 int
14671 main (void)
14672 {
14673 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14674   ;
14675   return 0;
14676 }
14677 _ACEOF
14678 rm -f conftest.$ac_objext
14679 if { (eval echo "$as_me:14679: \"$ac_compile\"") >&5
14680   (eval $ac_compile) 2>&5
14681   ac_status=$?
14682   echo "$as_me:14682: \$? = $ac_status" >&5
14683   (exit $ac_status); } &&
14684          { ac_try='test -s conftest.$ac_objext'
14685   { (eval echo "$as_me:14685: \"$ac_try\"") >&5
14686   (eval $ac_try) 2>&5
14687   ac_status=$?
14688   echo "$as_me:14688: \$? = $ac_status" >&5
14689   (exit $ac_status); }; }; then
14690   ac_hi=$ac_mid; break
14691 else
14692   echo "$as_me: failed program was:" >&5
14693 cat conftest.$ac_ext >&5
14694 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14695 fi
14696 rm -f conftest.$ac_objext conftest.$ac_ext
14697   done
14698 else
14699   echo "$as_me: failed program was:" >&5
14700 cat conftest.$ac_ext >&5
14701 ac_hi=-1 ac_mid=-1
14702   while :; do
14703     cat >conftest.$ac_ext <<_ACEOF
14704 #line 14704 "configure"
14705 #include "confdefs.h"
14706 $ac_includes_default
14707 int
14708 main (void)
14709 {
14710 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14711   ;
14712   return 0;
14713 }
14714 _ACEOF
14715 rm -f conftest.$ac_objext
14716 if { (eval echo "$as_me:14716: \"$ac_compile\"") >&5
14717   (eval $ac_compile) 2>&5
14718   ac_status=$?
14719   echo "$as_me:14719: \$? = $ac_status" >&5
14720   (exit $ac_status); } &&
14721          { ac_try='test -s conftest.$ac_objext'
14722   { (eval echo "$as_me:14722: \"$ac_try\"") >&5
14723   (eval $ac_try) 2>&5
14724   ac_status=$?
14725   echo "$as_me:14725: \$? = $ac_status" >&5
14726   (exit $ac_status); }; }; then
14727   ac_lo=$ac_mid; break
14728 else
14729   echo "$as_me: failed program was:" >&5
14730 cat conftest.$ac_ext >&5
14731 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14732 fi
14733 rm -f conftest.$ac_objext conftest.$ac_ext
14734   done
14735 fi
14736 rm -f conftest.$ac_objext conftest.$ac_ext
14737 # Binary search between lo and hi bounds.
14738 while test "x$ac_lo" != "x$ac_hi"; do
14739   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14740   cat >conftest.$ac_ext <<_ACEOF
14741 #line 14741 "configure"
14742 #include "confdefs.h"
14743 $ac_includes_default
14744 int
14745 main (void)
14746 {
14747 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14748   ;
14749   return 0;
14750 }
14751 _ACEOF
14752 rm -f conftest.$ac_objext
14753 if { (eval echo "$as_me:14753: \"$ac_compile\"") >&5
14754   (eval $ac_compile) 2>&5
14755   ac_status=$?
14756   echo "$as_me:14756: \$? = $ac_status" >&5
14757   (exit $ac_status); } &&
14758          { ac_try='test -s conftest.$ac_objext'
14759   { (eval echo "$as_me:14759: \"$ac_try\"") >&5
14760   (eval $ac_try) 2>&5
14761   ac_status=$?
14762   echo "$as_me:14762: \$? = $ac_status" >&5
14763   (exit $ac_status); }; }; then
14764   ac_hi=$ac_mid
14765 else
14766   echo "$as_me: failed program was:" >&5
14767 cat conftest.$ac_ext >&5
14768 ac_lo=`expr $ac_mid + 1`
14769 fi
14770 rm -f conftest.$ac_objext conftest.$ac_ext
14771 done
14772 ac_cv_sizeof_signed_char=$ac_lo
14773 else
14774   if test "$cross_compiling" = yes; then
14775   { { echo "$as_me:14775: error: cannot run test program while cross compiling" >&5
14776 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14777    { (exit 1); exit 1; }; }
14778 else
14779   cat >conftest.$ac_ext <<_ACEOF
14780 #line 14780 "configure"
14781 #include "confdefs.h"
14782 $ac_includes_default
14783 int
14784 main (void)
14785 {
14786 FILE *f = fopen ("conftest.val", "w");
14787 if (!f)
14788   $ac_main_return (1);
14789 fprintf (f, "%d", (sizeof (signed char)));
14790 fclose (f);
14791   ;
14792   return 0;
14793 }
14794 _ACEOF
14795 rm -f conftest$ac_exeext
14796 if { (eval echo "$as_me:14796: \"$ac_link\"") >&5
14797   (eval $ac_link) 2>&5
14798   ac_status=$?
14799   echo "$as_me:14799: \$? = $ac_status" >&5
14800   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14801   { (eval echo "$as_me:14801: \"$ac_try\"") >&5
14802   (eval $ac_try) 2>&5
14803   ac_status=$?
14804   echo "$as_me:14804: \$? = $ac_status" >&5
14805   (exit $ac_status); }; }; then
14806   ac_cv_sizeof_signed_char=`cat conftest.val`
14807 else
14808   echo "$as_me: program exited with status $ac_status" >&5
14809 echo "$as_me: failed program was:" >&5
14810 cat conftest.$ac_ext >&5
14811 fi
14812 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14813 fi
14814 fi
14815 rm -f conftest.val
14816 else
14817   ac_cv_sizeof_signed_char=0
14818 fi
14819 fi
14820 echo "$as_me:14820: result: $ac_cv_sizeof_signed_char" >&5
14821 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14822 cat >>confdefs.h <<EOF
14823 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14824 EOF
14825
14826 echo "$as_me:14826: checking for ANSI C header files" >&5
14827 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14828 if test "${ac_cv_header_stdc+set}" = set; then
14829   echo $ECHO_N "(cached) $ECHO_C" >&6
14830 else
14831   cat >conftest.$ac_ext <<_ACEOF
14832 #line 14832 "configure"
14833 #include "confdefs.h"
14834 #include <stdlib.h>
14835 #include <stdarg.h>
14836 #include <string.h>
14837 #include <float.h>
14838
14839 _ACEOF
14840 if { (eval echo "$as_me:14840: \"$ac_cpp conftest.$ac_ext\"") >&5
14841   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14842   ac_status=$?
14843   egrep -v '^ *\+' conftest.er1 >conftest.err
14844   rm -f conftest.er1
14845   cat conftest.err >&5
14846   echo "$as_me:14846: \$? = $ac_status" >&5
14847   (exit $ac_status); } >/dev/null; then
14848   if test -s conftest.err; then
14849     ac_cpp_err=$ac_c_preproc_warn_flag
14850   else
14851     ac_cpp_err=
14852   fi
14853 else
14854   ac_cpp_err=yes
14855 fi
14856 if test -z "$ac_cpp_err"; then
14857   ac_cv_header_stdc=yes
14858 else
14859   echo "$as_me: failed program was:" >&5
14860   cat conftest.$ac_ext >&5
14861   ac_cv_header_stdc=no
14862 fi
14863 rm -f conftest.err conftest.$ac_ext
14864
14865 if test $ac_cv_header_stdc = yes; then
14866   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14867   cat >conftest.$ac_ext <<_ACEOF
14868 #line 14868 "configure"
14869 #include "confdefs.h"
14870 #include <string.h>
14871
14872 _ACEOF
14873 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14874   egrep "memchr" >/dev/null 2>&1; then
14875   :
14876 else
14877   ac_cv_header_stdc=no
14878 fi
14879 rm -rf conftest*
14880
14881 fi
14882
14883 if test $ac_cv_header_stdc = yes; then
14884   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14885   cat >conftest.$ac_ext <<_ACEOF
14886 #line 14886 "configure"
14887 #include "confdefs.h"
14888 #include <stdlib.h>
14889
14890 _ACEOF
14891 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14892   egrep "free" >/dev/null 2>&1; then
14893   :
14894 else
14895   ac_cv_header_stdc=no
14896 fi
14897 rm -rf conftest*
14898
14899 fi
14900
14901 if test $ac_cv_header_stdc = yes; then
14902   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14903   if test "$cross_compiling" = yes; then
14904   :
14905 else
14906   cat >conftest.$ac_ext <<_ACEOF
14907 #line 14907 "configure"
14908 #include "confdefs.h"
14909 #include <ctype.h>
14910 #if ((' ' & 0x0FF) == 0x020)
14911 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14912 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14913 #else
14914 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14915                      || ('j' <= (c) && (c) <= 'r') \
14916                      || ('s' <= (c) && (c) <= 'z'))
14917 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14918 #endif
14919
14920 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14921 int
14922 main (void)
14923 {
14924   int i;
14925   for (i = 0; i < 256; i++)
14926     if (XOR (islower (i), ISLOWER (i))
14927         || toupper (i) != TOUPPER (i))
14928       $ac_main_return(2);
14929   $ac_main_return (0);
14930 }
14931 _ACEOF
14932 rm -f conftest$ac_exeext
14933 if { (eval echo "$as_me:14933: \"$ac_link\"") >&5
14934   (eval $ac_link) 2>&5
14935   ac_status=$?
14936   echo "$as_me:14936: \$? = $ac_status" >&5
14937   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14938   { (eval echo "$as_me:14938: \"$ac_try\"") >&5
14939   (eval $ac_try) 2>&5
14940   ac_status=$?
14941   echo "$as_me:14941: \$? = $ac_status" >&5
14942   (exit $ac_status); }; }; then
14943   :
14944 else
14945   echo "$as_me: program exited with status $ac_status" >&5
14946 echo "$as_me: failed program was:" >&5
14947 cat conftest.$ac_ext >&5
14948 ac_cv_header_stdc=no
14949 fi
14950 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14951 fi
14952 fi
14953 fi
14954 echo "$as_me:14954: result: $ac_cv_header_stdc" >&5
14955 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14956 if test $ac_cv_header_stdc = yes; then
14957
14958 cat >>confdefs.h <<\EOF
14959 #define STDC_HEADERS 1
14960 EOF
14961
14962 fi
14963
14964 ac_header_dirent=no
14965 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
14966   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
14967 echo "$as_me:14967: checking for $ac_hdr that defines DIR" >&5
14968 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
14969 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14970   echo $ECHO_N "(cached) $ECHO_C" >&6
14971 else
14972   cat >conftest.$ac_ext <<_ACEOF
14973 #line 14973 "configure"
14974 #include "confdefs.h"
14975 #include <sys/types.h>
14976 #include <$ac_hdr>
14977
14978 int
14979 main (void)
14980 {
14981 if ((DIR *) 0)
14982 return 0;
14983   ;
14984   return 0;
14985 }
14986 _ACEOF
14987 rm -f conftest.$ac_objext
14988 if { (eval echo "$as_me:14988: \"$ac_compile\"") >&5
14989   (eval $ac_compile) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); } &&
14993          { ac_try='test -s conftest.$ac_objext'
14994   { (eval echo "$as_me:14994: \"$ac_try\"") >&5
14995   (eval $ac_try) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit $ac_status); }; }; then
14999   eval "$as_ac_Header=yes"
15000 else
15001   echo "$as_me: failed program was:" >&5
15002 cat conftest.$ac_ext >&5
15003 eval "$as_ac_Header=no"
15004 fi
15005 rm -f conftest.$ac_objext conftest.$ac_ext
15006 fi
15007 echo "$as_me:15007: result: `eval echo '${'$as_ac_Header'}'`" >&5
15008 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15009 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15010   cat >>confdefs.h <<EOF
15011 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15012 EOF
15013
15014 ac_header_dirent=$ac_hdr; break
15015 fi
15016
15017 done
15018 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
15019 if test $ac_header_dirent = dirent.h; then
15020   echo "$as_me:15020: checking for opendir in -ldir" >&5
15021 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
15022 if test "${ac_cv_lib_dir_opendir+set}" = set; then
15023   echo $ECHO_N "(cached) $ECHO_C" >&6
15024 else
15025   ac_check_lib_save_LIBS=$LIBS
15026 LIBS="-ldir  $LIBS"
15027 cat >conftest.$ac_ext <<_ACEOF
15028 #line 15028 "configure"
15029 #include "confdefs.h"
15030
15031 /* Override any gcc2 internal prototype to avoid an error.  */
15032 #ifdef __cplusplus
15033 extern "C"
15034 #endif
15035 /* We use char because int might match the return type of a gcc2
15036    builtin and then its argument prototype would still apply.  */
15037 char opendir ();
15038 int
15039 main (void)
15040 {
15041 opendir ();
15042   ;
15043   return 0;
15044 }
15045 _ACEOF
15046 rm -f conftest.$ac_objext conftest$ac_exeext
15047 if { (eval echo "$as_me:15047: \"$ac_link\"") >&5
15048   (eval $ac_link) 2>&5
15049   ac_status=$?
15050   echo "$as_me:15050: \$? = $ac_status" >&5
15051   (exit $ac_status); } &&
15052          { ac_try='test -s conftest$ac_exeext'
15053   { (eval echo "$as_me:15053: \"$ac_try\"") >&5
15054   (eval $ac_try) 2>&5
15055   ac_status=$?
15056   echo "$as_me:15056: \$? = $ac_status" >&5
15057   (exit $ac_status); }; }; then
15058   ac_cv_lib_dir_opendir=yes
15059 else
15060   echo "$as_me: failed program was:" >&5
15061 cat conftest.$ac_ext >&5
15062 ac_cv_lib_dir_opendir=no
15063 fi
15064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15065 LIBS=$ac_check_lib_save_LIBS
15066 fi
15067 echo "$as_me:15067: result: $ac_cv_lib_dir_opendir" >&5
15068 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15069 if test $ac_cv_lib_dir_opendir = yes; then
15070   LIBS="$LIBS -ldir"
15071 fi
15072
15073 else
15074   echo "$as_me:15074: checking for opendir in -lx" >&5
15075 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15076 if test "${ac_cv_lib_x_opendir+set}" = set; then
15077   echo $ECHO_N "(cached) $ECHO_C" >&6
15078 else
15079   ac_check_lib_save_LIBS=$LIBS
15080 LIBS="-lx  $LIBS"
15081 cat >conftest.$ac_ext <<_ACEOF
15082 #line 15082 "configure"
15083 #include "confdefs.h"
15084
15085 /* Override any gcc2 internal prototype to avoid an error.  */
15086 #ifdef __cplusplus
15087 extern "C"
15088 #endif
15089 /* We use char because int might match the return type of a gcc2
15090    builtin and then its argument prototype would still apply.  */
15091 char opendir ();
15092 int
15093 main (void)
15094 {
15095 opendir ();
15096   ;
15097   return 0;
15098 }
15099 _ACEOF
15100 rm -f conftest.$ac_objext conftest$ac_exeext
15101 if { (eval echo "$as_me:15101: \"$ac_link\"") >&5
15102   (eval $ac_link) 2>&5
15103   ac_status=$?
15104   echo "$as_me:15104: \$? = $ac_status" >&5
15105   (exit $ac_status); } &&
15106          { ac_try='test -s conftest$ac_exeext'
15107   { (eval echo "$as_me:15107: \"$ac_try\"") >&5
15108   (eval $ac_try) 2>&5
15109   ac_status=$?
15110   echo "$as_me:15110: \$? = $ac_status" >&5
15111   (exit $ac_status); }; }; then
15112   ac_cv_lib_x_opendir=yes
15113 else
15114   echo "$as_me: failed program was:" >&5
15115 cat conftest.$ac_ext >&5
15116 ac_cv_lib_x_opendir=no
15117 fi
15118 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15119 LIBS=$ac_check_lib_save_LIBS
15120 fi
15121 echo "$as_me:15121: result: $ac_cv_lib_x_opendir" >&5
15122 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15123 if test $ac_cv_lib_x_opendir = yes; then
15124   LIBS="$LIBS -lx"
15125 fi
15126
15127 fi
15128
15129 echo "$as_me:15129: checking whether time.h and sys/time.h may both be included" >&5
15130 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15131 if test "${ac_cv_header_time+set}" = set; then
15132   echo $ECHO_N "(cached) $ECHO_C" >&6
15133 else
15134   cat >conftest.$ac_ext <<_ACEOF
15135 #line 15135 "configure"
15136 #include "confdefs.h"
15137 #include <sys/types.h>
15138 #include <sys/time.h>
15139 #include <time.h>
15140
15141 int
15142 main (void)
15143 {
15144 if ((struct tm *) 0)
15145 return 0;
15146   ;
15147   return 0;
15148 }
15149 _ACEOF
15150 rm -f conftest.$ac_objext
15151 if { (eval echo "$as_me:15151: \"$ac_compile\"") >&5
15152   (eval $ac_compile) 2>&5
15153   ac_status=$?
15154   echo "$as_me:15154: \$? = $ac_status" >&5
15155   (exit $ac_status); } &&
15156          { ac_try='test -s conftest.$ac_objext'
15157   { (eval echo "$as_me:15157: \"$ac_try\"") >&5
15158   (eval $ac_try) 2>&5
15159   ac_status=$?
15160   echo "$as_me:15160: \$? = $ac_status" >&5
15161   (exit $ac_status); }; }; then
15162   ac_cv_header_time=yes
15163 else
15164   echo "$as_me: failed program was:" >&5
15165 cat conftest.$ac_ext >&5
15166 ac_cv_header_time=no
15167 fi
15168 rm -f conftest.$ac_objext conftest.$ac_ext
15169 fi
15170 echo "$as_me:15170: result: $ac_cv_header_time" >&5
15171 echo "${ECHO_T}$ac_cv_header_time" >&6
15172 if test $ac_cv_header_time = yes; then
15173
15174 cat >>confdefs.h <<\EOF
15175 #define TIME_WITH_SYS_TIME 1
15176 EOF
15177
15178 fi
15179
15180 ###     checks for compiler characteristics
15181 ac_ext=c
15182 ac_cpp='$CPP $CPPFLAGS'
15183 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15184 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15185 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15186 ac_main_return=return
15187
15188 echo "$as_me:15188: checking for an ANSI C-conforming const" >&5
15189 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15190 if test "${ac_cv_c_const+set}" = set; then
15191   echo $ECHO_N "(cached) $ECHO_C" >&6
15192 else
15193   cat >conftest.$ac_ext <<_ACEOF
15194 #line 15194 "configure"
15195 #include "confdefs.h"
15196
15197 int
15198 main (void)
15199 {
15200 /* FIXME: Include the comments suggested by Paul. */
15201 #ifndef __cplusplus
15202   /* Ultrix mips cc rejects this.  */
15203   typedef int charset[2];
15204   const charset x;
15205   /* SunOS 4.1.1 cc rejects this.  */
15206   char const *const *ccp;
15207   char **p;
15208   /* NEC SVR4.0.2 mips cc rejects this.  */
15209   struct point {int x, y;};
15210   static struct point const zero = {0,0};
15211   /* AIX XL C 1.02.0.0 rejects this.
15212      It does not let you subtract one const X* pointer from another in
15213      an arm of an if-expression whose if-part is not a constant
15214      expression */
15215   const char *g = "string";
15216   ccp = &g + (g ? g-g : 0);
15217   /* HPUX 7.0 cc rejects these. */
15218   ++ccp;
15219   p = (char**) ccp;
15220   ccp = (char const *const *) p;
15221   { /* SCO 3.2v4 cc rejects this.  */
15222     char *t;
15223     char const *s = 0 ? (char *) 0 : (char const *) 0;
15224
15225     *t++ = 0;
15226   }
15227   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15228     int x[] = {25, 17};
15229     const int *foo = &x[0];
15230     ++foo;
15231   }
15232   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15233     typedef const int *iptr;
15234     iptr p = 0;
15235     ++p;
15236   }
15237   { /* AIX XL C 1.02.0.0 rejects this saying
15238        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15239     struct s { int j; const int *ap[3]; };
15240     struct s *b; b->j = 5;
15241   }
15242   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15243     const int foo = 10;
15244   }
15245 #endif
15246
15247   ;
15248   return 0;
15249 }
15250 _ACEOF
15251 rm -f conftest.$ac_objext
15252 if { (eval echo "$as_me:15252: \"$ac_compile\"") >&5
15253   (eval $ac_compile) 2>&5
15254   ac_status=$?
15255   echo "$as_me:15255: \$? = $ac_status" >&5
15256   (exit $ac_status); } &&
15257          { ac_try='test -s conftest.$ac_objext'
15258   { (eval echo "$as_me:15258: \"$ac_try\"") >&5
15259   (eval $ac_try) 2>&5
15260   ac_status=$?
15261   echo "$as_me:15261: \$? = $ac_status" >&5
15262   (exit $ac_status); }; }; then
15263   ac_cv_c_const=yes
15264 else
15265   echo "$as_me: failed program was:" >&5
15266 cat conftest.$ac_ext >&5
15267 ac_cv_c_const=no
15268 fi
15269 rm -f conftest.$ac_objext conftest.$ac_ext
15270 fi
15271 echo "$as_me:15271: result: $ac_cv_c_const" >&5
15272 echo "${ECHO_T}$ac_cv_c_const" >&6
15273 if test $ac_cv_c_const = no; then
15274
15275 cat >>confdefs.h <<\EOF
15276 #define const
15277 EOF
15278
15279 fi
15280
15281 ###     Checks for external-data
15282
15283 echo "$as_me:15283: checking if data-only library module links" >&5
15284 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15285 if test "${cf_cv_link_dataonly+set}" = set; then
15286   echo $ECHO_N "(cached) $ECHO_C" >&6
15287 else
15288
15289         rm -f conftest.a
15290         cat >conftest.$ac_ext <<EOF
15291 #line 15291 "configure"
15292 int     testdata[3] = { 123, 456, 789 };
15293 EOF
15294         if { (eval echo "$as_me:15294: \"$ac_compile\"") >&5
15295   (eval $ac_compile) 2>&5
15296   ac_status=$?
15297   echo "$as_me:15297: \$? = $ac_status" >&5
15298   (exit $ac_status); } ; then
15299                 mv conftest.o data.o && \
15300                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15301         fi
15302         rm -f conftest.$ac_ext data.o
15303         cat >conftest.$ac_ext <<EOF
15304 #line 15304 "configure"
15305 int     testfunc(void)
15306 {
15307 #if defined(NeXT)
15308         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15309 #else
15310         extern int testdata[3];
15311         return testdata[0] == 123
15312            &&  testdata[1] == 456
15313            &&  testdata[2] == 789;
15314 #endif
15315 }
15316 EOF
15317         if { (eval echo "$as_me:15317: \"$ac_compile\"") >&5
15318   (eval $ac_compile) 2>&5
15319   ac_status=$?
15320   echo "$as_me:15320: \$? = $ac_status" >&5
15321   (exit $ac_status); }; then
15322                 mv conftest.o func.o && \
15323                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15324         fi
15325         rm -f conftest.$ac_ext func.o
15326         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15327         cf_saveLIBS="$LIBS"
15328         LIBS="conftest.a $LIBS"
15329         if test "$cross_compiling" = yes; then
15330   cf_cv_link_dataonly=unknown
15331 else
15332   cat >conftest.$ac_ext <<_ACEOF
15333 #line 15333 "configure"
15334 #include "confdefs.h"
15335
15336         int main(void)
15337         {
15338                 extern int testfunc();
15339                 ${cf_cv_main_return:-return} (!testfunc());
15340         }
15341
15342 _ACEOF
15343 rm -f conftest$ac_exeext
15344 if { (eval echo "$as_me:15344: \"$ac_link\"") >&5
15345   (eval $ac_link) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15349   { (eval echo "$as_me:15349: \"$ac_try\"") >&5
15350   (eval $ac_try) 2>&5
15351   ac_status=$?
15352   echo "$as_me:15352: \$? = $ac_status" >&5
15353   (exit $ac_status); }; }; then
15354   cf_cv_link_dataonly=yes
15355 else
15356   echo "$as_me: program exited with status $ac_status" >&5
15357 echo "$as_me: failed program was:" >&5
15358 cat conftest.$ac_ext >&5
15359 cf_cv_link_dataonly=no
15360 fi
15361 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15362 fi
15363         LIBS="$cf_saveLIBS"
15364
15365 fi
15366
15367 echo "$as_me:15367: result: $cf_cv_link_dataonly" >&5
15368 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15369
15370 if test "$cf_cv_link_dataonly" = no ; then
15371
15372 cat >>confdefs.h <<\EOF
15373 #define BROKEN_LINKER 1
15374 EOF
15375
15376         BROKEN_LINKER=1
15377 fi
15378
15379 ###     Checks for library functions.
15380
15381 for ac_header in \
15382 unistd.h \
15383
15384 do
15385 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15386 echo "$as_me:15386: checking for $ac_header" >&5
15387 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15388 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15389   echo $ECHO_N "(cached) $ECHO_C" >&6
15390 else
15391   cat >conftest.$ac_ext <<_ACEOF
15392 #line 15392 "configure"
15393 #include "confdefs.h"
15394 #include <$ac_header>
15395 _ACEOF
15396 if { (eval echo "$as_me:15396: \"$ac_cpp conftest.$ac_ext\"") >&5
15397   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15398   ac_status=$?
15399   egrep -v '^ *\+' conftest.er1 >conftest.err
15400   rm -f conftest.er1
15401   cat conftest.err >&5
15402   echo "$as_me:15402: \$? = $ac_status" >&5
15403   (exit $ac_status); } >/dev/null; then
15404   if test -s conftest.err; then
15405     ac_cpp_err=$ac_c_preproc_warn_flag
15406   else
15407     ac_cpp_err=
15408   fi
15409 else
15410   ac_cpp_err=yes
15411 fi
15412 if test -z "$ac_cpp_err"; then
15413   eval "$as_ac_Header=yes"
15414 else
15415   echo "$as_me: failed program was:" >&5
15416   cat conftest.$ac_ext >&5
15417   eval "$as_ac_Header=no"
15418 fi
15419 rm -f conftest.err conftest.$ac_ext
15420 fi
15421 echo "$as_me:15421: result: `eval echo '${'$as_ac_Header'}'`" >&5
15422 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15423 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15424   cat >>confdefs.h <<EOF
15425 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15426 EOF
15427
15428 fi
15429 done
15430
15431 echo "$as_me:15431: checking for working mkstemp" >&5
15432 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15433 if test "${cf_cv_func_mkstemp+set}" = set; then
15434   echo $ECHO_N "(cached) $ECHO_C" >&6
15435 else
15436
15437 rm -rf conftest*
15438 if test "$cross_compiling" = yes; then
15439   cf_cv_func_mkstemp=maybe
15440 else
15441   cat >conftest.$ac_ext <<_ACEOF
15442 #line 15442 "configure"
15443 #include "confdefs.h"
15444
15445 #include <sys/types.h>
15446 #ifdef HAVE_UNISTD_H
15447 #include <unistd.h>
15448 #endif
15449 #include <stdlib.h>
15450 #include <stdio.h>
15451 #include <string.h>
15452 #include <sys/stat.h>
15453 int main(void)
15454 {
15455         char *tmpl = "conftestXXXXXX";
15456         char name[2][80];
15457         int n;
15458         int result = 0;
15459         int fd;
15460         struct stat sb;
15461
15462         umask(077);
15463         for (n = 0; n < 2; ++n) {
15464                 strcpy(name[n], tmpl);
15465                 if ((fd = mkstemp(name[n])) >= 0) {
15466                         if (!strcmp(name[n], tmpl)
15467                          || stat(name[n], &sb) != 0
15468                          || (sb.st_mode & S_IFMT) != S_IFREG
15469                          || (sb.st_mode & 077) != 0) {
15470                                 result = 1;
15471                         }
15472                         close(fd);
15473                 }
15474         }
15475         if (result == 0
15476          && !strcmp(name[0], name[1]))
15477                 result = 1;
15478         ${cf_cv_main_return:-return}(result);
15479 }
15480
15481 _ACEOF
15482 rm -f conftest$ac_exeext
15483 if { (eval echo "$as_me:15483: \"$ac_link\"") >&5
15484   (eval $ac_link) 2>&5
15485   ac_status=$?
15486   echo "$as_me:15486: \$? = $ac_status" >&5
15487   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15488   { (eval echo "$as_me:15488: \"$ac_try\"") >&5
15489   (eval $ac_try) 2>&5
15490   ac_status=$?
15491   echo "$as_me:15491: \$? = $ac_status" >&5
15492   (exit $ac_status); }; }; then
15493   cf_cv_func_mkstemp=yes
15494
15495 else
15496   echo "$as_me: program exited with status $ac_status" >&5
15497 echo "$as_me: failed program was:" >&5
15498 cat conftest.$ac_ext >&5
15499 cf_cv_func_mkstemp=no
15500
15501 fi
15502 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15503 fi
15504
15505 fi
15506 echo "$as_me:15506: result: $cf_cv_func_mkstemp" >&5
15507 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15508 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15509         echo "$as_me:15509: checking for mkstemp" >&5
15510 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15511 if test "${ac_cv_func_mkstemp+set}" = set; then
15512   echo $ECHO_N "(cached) $ECHO_C" >&6
15513 else
15514   cat >conftest.$ac_ext <<_ACEOF
15515 #line 15515 "configure"
15516 #include "confdefs.h"
15517 #define mkstemp autoconf_temporary
15518 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15519 #undef mkstemp
15520
15521 #ifdef __cplusplus
15522 extern "C"
15523 #endif
15524
15525 /* We use char because int might match the return type of a gcc2
15526    builtin and then its argument prototype would still apply.  */
15527 char mkstemp (void);
15528
15529 int
15530 main (void)
15531 {
15532
15533 /* The GNU C library defines stubs for functions which it implements
15534     to always fail with ENOSYS.  Some functions are actually named
15535     something starting with __ and the normal name is an alias.  */
15536 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15537 #error found stub for mkstemp
15538 #endif
15539
15540         return mkstemp ();
15541   ;
15542   return 0;
15543 }
15544 _ACEOF
15545 rm -f conftest.$ac_objext conftest$ac_exeext
15546 if { (eval echo "$as_me:15546: \"$ac_link\"") >&5
15547   (eval $ac_link) 2>&5
15548   ac_status=$?
15549   echo "$as_me:15549: \$? = $ac_status" >&5
15550   (exit $ac_status); } &&
15551          { ac_try='test -s conftest$ac_exeext'
15552   { (eval echo "$as_me:15552: \"$ac_try\"") >&5
15553   (eval $ac_try) 2>&5
15554   ac_status=$?
15555   echo "$as_me:15555: \$? = $ac_status" >&5
15556   (exit $ac_status); }; }; then
15557   ac_cv_func_mkstemp=yes
15558 else
15559   echo "$as_me: failed program was:" >&5
15560 cat conftest.$ac_ext >&5
15561 ac_cv_func_mkstemp=no
15562 fi
15563 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15564 fi
15565 echo "$as_me:15565: result: $ac_cv_func_mkstemp" >&5
15566 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15567
15568 fi
15569 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15570
15571 cat >>confdefs.h <<\EOF
15572 #define HAVE_MKSTEMP 1
15573 EOF
15574
15575 fi
15576
15577 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15578         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15579         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15580 fi
15581
15582 cf_with_ada=yes
15583 if test "$cf_with_ada" != "no" ; then
15584
15585 cf_ada_make=gnatmake
15586 cf_ada_config="#"
15587 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
15588 set dummy $cf_ada_make; ac_word=$2
15589 echo "$as_me:15589: checking for $ac_word" >&5
15590 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15591 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
15592   echo $ECHO_N "(cached) $ECHO_C" >&6
15593 else
15594   if test -n "$gnatmake_exists"; then
15595   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
15596 else
15597   ac_save_IFS=$IFS; IFS=$ac_path_separator
15598 ac_dummy="$PATH"
15599 for ac_dir in $ac_dummy; do
15600   IFS=$ac_save_IFS
15601   test -z "$ac_dir" && ac_dir=.
15602   $as_executable_p "$ac_dir/$ac_word" || continue
15603 ac_cv_prog_gnatmake_exists="yes"
15604 echo "$as_me:15604: found $ac_dir/$ac_word" >&5
15605 break
15606 done
15607
15608   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
15609 fi
15610 fi
15611 gnatmake_exists=$ac_cv_prog_gnatmake_exists
15612 if test -n "$gnatmake_exists"; then
15613   echo "$as_me:15613: result: $gnatmake_exists" >&5
15614 echo "${ECHO_T}$gnatmake_exists" >&6
15615 else
15616   echo "$as_me:15616: result: no" >&5
15617 echo "${ECHO_T}no" >&6
15618 fi
15619
15620 if test "$ac_cv_prog_gnatmake_exists" = no; then
15621         cf_ada_make=
15622         cf_cv_prog_gnat_correct=no
15623 else
15624         # Extract the first word of "gprconfig", so it can be a program name with args.
15625 set dummy gprconfig; ac_word=$2
15626 echo "$as_me:15626: checking for $ac_word" >&5
15627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15628 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
15629   echo $ECHO_N "(cached) $ECHO_C" >&6
15630 else
15631   if test -n "$gprconfig_exists"; then
15632   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
15633 else
15634   ac_save_IFS=$IFS; IFS=$ac_path_separator
15635 ac_dummy="$PATH"
15636 for ac_dir in $ac_dummy; do
15637   IFS=$ac_save_IFS
15638   test -z "$ac_dir" && ac_dir=.
15639   $as_executable_p "$ac_dir/$ac_word" || continue
15640 ac_cv_prog_gprconfig_exists="yes"
15641 echo "$as_me:15641: found $ac_dir/$ac_word" >&5
15642 break
15643 done
15644
15645   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
15646 fi
15647 fi
15648 gprconfig_exists=$ac_cv_prog_gprconfig_exists
15649 if test -n "$gprconfig_exists"; then
15650   echo "$as_me:15650: result: $gprconfig_exists" >&5
15651 echo "${ECHO_T}$gprconfig_exists" >&6
15652 else
15653   echo "$as_me:15653: result: no" >&5
15654 echo "${ECHO_T}no" >&6
15655 fi
15656
15657         if test "$ac_cv_prog_gprconfig_exists" = yes
15658         then
15659                 rm -rf conftest* *~conftest*
15660                 if mkdir conftest.src
15661                 then
15662                         cf_ada_config=""
15663                         cd conftest.src
15664                         for cf_gprconfig in Ada C
15665                         do
15666                                 echo "$as_me:15666: checking for gprconfig name for $cf_gprconfig" >&5
15667 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15668                                 if test $cf_gprconfig = C
15669                                 then
15670                                         for cf_gprconfig_param in \
15671                                                 $cf_gprconfig,,,,GNATGCC \
15672                                                 $cf_gprconfig,,,,GCC \
15673                                                 $cf_gprconfig
15674                                         do
15675                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15676                                                 test -n "$cf_gprconfig_value" && break
15677                                         done
15678                                 else
15679                                         cf_gprconfig_param=$cf_gprconfig
15680                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15681                                 fi
15682                                 if test -n "$cf_gprconfig_value"
15683                                 then
15684                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15685                                         echo "$as_me:15685: result: $cf_gprconfig_value" >&5
15686 echo "${ECHO_T}$cf_gprconfig_value" >&6
15687                                 else
15688                                         echo "$as_me:15688: result: missing" >&5
15689 echo "${ECHO_T}missing" >&6
15690                                         cf_ada_config="#"
15691                                         break
15692                                 fi
15693                         done
15694                         cd ..
15695                         rm -rf conftest* *~conftest*
15696                 fi
15697         else
15698                 # gprconfig is newer than gnatmake; we can continue...
15699                 cf_ada_config="##"
15700         fi
15701         if test "x$cf_ada_config" != "x#"
15702         then
15703
15704 echo "$as_me:15704: checking for gnat version" >&5
15705 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15706 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
15707         grep '[0-9].[0-9][0-9]*' |\
15708         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15709 echo "$as_me:15709: result: $cf_gnat_version" >&5
15710 echo "${ECHO_T}$cf_gnat_version" >&6
15711
15712 case $cf_gnat_version in
15713 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15714         cf_cv_prog_gnat_correct=yes
15715         ;;
15716 (*)
15717         { echo "$as_me:15717: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15718 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15719         cf_cv_prog_gnat_correct=no
15720         ;;
15721 esac
15722
15723                 # Extract the first word of "m4", so it can be a program name with args.
15724 set dummy m4; ac_word=$2
15725 echo "$as_me:15725: checking for $ac_word" >&5
15726 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15727 if test "${ac_cv_prog_M4_exists+set}" = set; then
15728   echo $ECHO_N "(cached) $ECHO_C" >&6
15729 else
15730   if test -n "$M4_exists"; then
15731   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15732 else
15733   ac_save_IFS=$IFS; IFS=$ac_path_separator
15734 ac_dummy="$PATH"
15735 for ac_dir in $ac_dummy; do
15736   IFS=$ac_save_IFS
15737   test -z "$ac_dir" && ac_dir=.
15738   $as_executable_p "$ac_dir/$ac_word" || continue
15739 ac_cv_prog_M4_exists="yes"
15740 echo "$as_me:15740: found $ac_dir/$ac_word" >&5
15741 break
15742 done
15743
15744   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15745 fi
15746 fi
15747 M4_exists=$ac_cv_prog_M4_exists
15748 if test -n "$M4_exists"; then
15749   echo "$as_me:15749: result: $M4_exists" >&5
15750 echo "${ECHO_T}$M4_exists" >&6
15751 else
15752   echo "$as_me:15752: result: no" >&5
15753 echo "${ECHO_T}no" >&6
15754 fi
15755
15756                 if test "$ac_cv_prog_M4_exists" = no; then
15757                         cf_cv_prog_gnat_correct=no
15758                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
15759                 fi
15760                 if test "$cf_cv_prog_gnat_correct" = yes; then
15761                         echo "$as_me:15761: checking if GNAT works" >&5
15762 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15763
15764 rm -rf conftest* *~conftest*
15765 cat >>conftest.ads <<CF_EOF
15766 procedure conftest;
15767 CF_EOF
15768 cat >>conftest.adb <<CF_EOF
15769 with Text_IO;
15770 with GNAT.OS_Lib;
15771 procedure conftest is
15772 begin
15773    Text_IO.Put ("Hello World");
15774    Text_IO.New_Line;
15775    GNAT.OS_Lib.OS_Exit (0);
15776 end conftest;
15777 CF_EOF
15778 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15779    if ( ./conftest 1>&5 2>&1 ) ; then
15780       cf_cv_prog_gnat_correct=yes
15781    else
15782       cf_cv_prog_gnat_correct=no
15783    fi
15784 else
15785    cf_cv_prog_gnat_correct=no
15786 fi
15787 rm -rf conftest* *~conftest*
15788
15789                         echo "$as_me:15789: result: $cf_cv_prog_gnat_correct" >&5
15790 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15791                 fi
15792         else
15793                 cf_cv_prog_gnat_correct=no
15794         fi
15795 fi
15796
15797         if test "$cf_cv_prog_gnat_correct" = yes; then
15798
15799         echo "$as_me:15799: checking optimization options for ADAFLAGS" >&5
15800 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15801         case "$CFLAGS" in
15802         (*-g*)
15803
15804         ADAFLAGS="$ADAFLAGS -g"
15805
15806                 ;;
15807         esac
15808         case "$CFLAGS" in
15809         (*-O*)
15810                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15811
15812         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15813
15814                 ;;
15815         esac
15816         echo "$as_me:15816: result: $ADAFLAGS" >&5
15817 echo "${ECHO_T}$ADAFLAGS" >&6
15818
15819 echo "$as_me:15819: checking if GNATPREP supports -T option" >&5
15820 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15821 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15822   echo $ECHO_N "(cached) $ECHO_C" >&6
15823 else
15824
15825 cf_cv_gnatprep_opt_t=no
15826 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15827
15828 fi
15829 echo "$as_me:15829: result: $cf_cv_gnatprep_opt_t" >&5
15830 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15831 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15832
15833 echo "$as_me:15833: checking if GNAT supports generics" >&5
15834 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15835 case $cf_gnat_version in
15836 (3.[1-9]*|[4-9].*)
15837         cf_gnat_generics=yes
15838         ;;
15839 (*)
15840         cf_gnat_generics=no
15841         ;;
15842 esac
15843 echo "$as_me:15843: result: $cf_gnat_generics" >&5
15844 echo "${ECHO_T}$cf_gnat_generics" >&6
15845
15846 if test "$cf_gnat_generics" = yes
15847 then
15848         cf_compile_generics=generics
15849         cf_generic_objects="\${GENOBJS}"
15850 else
15851         cf_compile_generics=
15852         cf_generic_objects=
15853 fi
15854
15855 echo "$as_me:15855: checking if GNAT supports SIGINT" >&5
15856 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15857 if test "${cf_cv_gnat_sigint+set}" = set; then
15858   echo $ECHO_N "(cached) $ECHO_C" >&6
15859 else
15860
15861 rm -rf conftest* *~conftest*
15862 cat >>conftest.ads <<CF_EOF
15863 with Ada.Interrupts.Names;
15864
15865 package ConfTest is
15866
15867    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15868    pragma Unreserve_All_Interrupts;
15869    pragma Warnings (On);
15870
15871    protected Process is
15872       procedure Stop;
15873       function Continue return Boolean;
15874       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
15875    private
15876       Done : Boolean := False;
15877    end Process;
15878
15879 end ConfTest;
15880 CF_EOF
15881 cat >>conftest.adb <<CF_EOF
15882 package body ConfTest is
15883    protected body Process is
15884       procedure Stop is
15885       begin
15886          Done := True;
15887       end Stop;
15888       function Continue return Boolean is
15889       begin
15890          return not Done;
15891       end Continue;
15892    end Process;
15893 end ConfTest;
15894 CF_EOF
15895 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15896       cf_cv_gnat_sigint=yes
15897 else
15898    cf_cv_gnat_sigint=no
15899 fi
15900 rm -rf conftest* *~conftest*
15901
15902 fi
15903 echo "$as_me:15903: result: $cf_cv_gnat_sigint" >&5
15904 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
15905
15906 if test $cf_cv_gnat_sigint = yes ; then
15907         USE_GNAT_SIGINT=""
15908 else
15909         USE_GNAT_SIGINT="#"
15910 fi
15911
15912 cf_gnat_libraries=no
15913 cf_gnat_projects=no
15914
15915 if test "$enable_gnat_projects" != no ; then
15916 echo "$as_me:15916: checking if GNAT supports project files" >&5
15917 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
15918 case $cf_gnat_version in
15919 (3.[0-9]*)
15920         ;;
15921 (*)
15922         case $cf_cv_system_name in
15923         (cygwin*|msys*)
15924                 ;;
15925         (*)
15926                 rm -rf conftest* *~conftest*
15927                 if mkdir conftest.src conftest.bin conftest.lib
15928                 then
15929                         cd conftest.src
15930                         rm -rf conftest* *~conftest*
15931                         cat >>library.gpr <<CF_EOF
15932 project Library is
15933   Kind := External ("LIB_KIND");
15934   for Library_Name use "ConfTest";
15935   for Object_Dir use ".";
15936   for Library_ALI_Dir use External("LIBRARY_DIR");
15937   for Library_Version use External ("SONAME");
15938   for Library_Kind use Kind;
15939   for Library_Dir use External("BUILD_DIR");
15940   Source_Dir := External ("SOURCE_DIR");
15941   for Source_Dirs use (Source_Dir);
15942 end Library;
15943 CF_EOF
15944                         cat >>confpackage.ads <<CF_EOF
15945 package ConfPackage is
15946    procedure conftest;
15947 end ConfPackage;
15948 CF_EOF
15949                         cat >>confpackage.adb <<CF_EOF
15950 with Text_IO;
15951 package body ConfPackage is
15952    procedure conftest is
15953    begin
15954       Text_IO.Put ("Hello World");
15955       Text_IO.New_Line;
15956    end conftest;
15957 end ConfPackage;
15958 CF_EOF
15959                         if ( $cf_ada_make $ADAFLAGS \
15960                                         -Plibrary.gpr \
15961                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
15962                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
15963                                         -XSOURCE_DIR=`pwd` \
15964                                         -XSONAME=libConfTest.so.1 \
15965                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
15966                                 cf_gnat_projects=yes
15967                         fi
15968                         cd ..
15969                 fi
15970                 if test -f conftest.lib/confpackage.ali
15971                 then
15972                         cf_gnat_libraries=yes
15973                 fi
15974                 rm -rf conftest* *~conftest*
15975                 ;;
15976         esac
15977         ;;
15978 esac
15979 echo "$as_me:15979: result: $cf_gnat_projects" >&5
15980 echo "${ECHO_T}$cf_gnat_projects" >&6
15981 fi # enable_gnat_projects
15982
15983 if test $cf_gnat_projects = yes
15984 then
15985         echo "$as_me:15985: checking if GNAT supports libraries" >&5
15986 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
15987         echo "$as_me:15987: result: $cf_gnat_libraries" >&5
15988 echo "${ECHO_T}$cf_gnat_libraries" >&6
15989 fi
15990
15991 if test "$cf_gnat_projects" = yes
15992 then
15993         USE_OLD_MAKERULES="#"
15994         USE_GNAT_PROJECTS=""
15995 else
15996         USE_OLD_MAKERULES=""
15997         USE_GNAT_PROJECTS="#"
15998 fi
15999
16000 if test "$cf_gnat_libraries" = yes
16001 then
16002         USE_GNAT_LIBRARIES=""
16003 else
16004         USE_GNAT_LIBRARIES="#"
16005 fi
16006
16007 echo "$as_me:16007: checking for ada-compiler" >&5
16008 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
16009
16010 # Check whether --with-ada-compiler or --without-ada-compiler was given.
16011 if test "${with_ada_compiler+set}" = set; then
16012   withval="$with_ada_compiler"
16013   cf_ada_compiler=$withval
16014 else
16015   cf_ada_compiler=gnatmake
16016 fi;
16017
16018 echo "$as_me:16018: result: $cf_ada_compiler" >&5
16019 echo "${ECHO_T}$cf_ada_compiler" >&6
16020
16021                 cf_ada_package=terminal_interface
16022
16023 echo "$as_me:16023: checking for ada-include" >&5
16024 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
16025
16026 # Check whether --with-ada-include or --without-ada-include was given.
16027 if test "${with_ada_include+set}" = set; then
16028   withval="$with_ada_include"
16029
16030 else
16031   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
16032 fi; if test -n "$prefix/share/ada/adainclude" ; then
16033
16034 if test "x$prefix" != xNONE; then
16035         cf_path_syntax="$prefix"
16036 else
16037         cf_path_syntax="$ac_default_prefix"
16038 fi
16039
16040 case ".$withval" in
16041 (.\$\(*\)*|.\'*\'*)
16042         ;;
16043 (..|./*|.\\*)
16044         ;;
16045 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16046         ;;
16047 (.\${*prefix}*|.\${*dir}*)
16048         eval withval="$withval"
16049         case ".$withval" in
16050         (.NONE/*)
16051                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16052                 ;;
16053         esac
16054         ;;
16055 (.no|.NONE/*)
16056         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16057         ;;
16058 (*)
16059         { { echo "$as_me:16059: error: expected a pathname, not \"$withval\"" >&5
16060 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16061    { (exit 1); exit 1; }; }
16062         ;;
16063 esac
16064
16065 fi
16066 eval ADA_INCLUDE="$withval"
16067
16068 echo "$as_me:16068: result: $ADA_INCLUDE" >&5
16069 echo "${ECHO_T}$ADA_INCLUDE" >&6
16070
16071 echo "$as_me:16071: checking for ada-objects" >&5
16072 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
16073
16074 # Check whether --with-ada-objects or --without-ada-objects was given.
16075 if test "${with_ada_objects+set}" = set; then
16076   withval="$with_ada_objects"
16077
16078 else
16079   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16080 fi; if test -n "$prefix/lib/ada/adalib" ; then
16081
16082 if test "x$prefix" != xNONE; then
16083         cf_path_syntax="$prefix"
16084 else
16085         cf_path_syntax="$ac_default_prefix"
16086 fi
16087
16088 case ".$withval" in
16089 (.\$\(*\)*|.\'*\'*)
16090         ;;
16091 (..|./*|.\\*)
16092         ;;
16093 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16094         ;;
16095 (.\${*prefix}*|.\${*dir}*)
16096         eval withval="$withval"
16097         case ".$withval" in
16098         (.NONE/*)
16099                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16100                 ;;
16101         esac
16102         ;;
16103 (.no|.NONE/*)
16104         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16105         ;;
16106 (*)
16107         { { echo "$as_me:16107: error: expected a pathname, not \"$withval\"" >&5
16108 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16109    { (exit 1); exit 1; }; }
16110         ;;
16111 esac
16112
16113 fi
16114 eval ADA_OBJECTS="$withval"
16115
16116 echo "$as_me:16116: result: $ADA_OBJECTS" >&5
16117 echo "${ECHO_T}$ADA_OBJECTS" >&6
16118
16119 echo "$as_me:16119: checking if an Ada95 shared-library should be built" >&5
16120 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16121
16122 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16123 if test "${with_ada_sharedlib+set}" = set; then
16124   withval="$with_ada_sharedlib"
16125   with_ada_sharedlib=$withval
16126 else
16127   with_ada_sharedlib=no
16128 fi;
16129 echo "$as_me:16129: result: $with_ada_sharedlib" >&5
16130 echo "${ECHO_T}$with_ada_sharedlib" >&6
16131
16132 if test "x$with_ada_sharedlib" != xno
16133 then
16134         if test "x$cf_gnat_projects" != xyes
16135         then
16136                 { echo "$as_me:16136: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16137 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16138                 with_ada_sharedlib=no
16139         fi
16140 fi
16141
16142 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16143 MAKE_ADA_SHAREDLIB="#"
16144
16145 if test "x$with_ada_sharedlib" != xno
16146 then
16147         MAKE_ADA_SHAREDLIB=
16148         if test "x$with_ada_sharedlib" != xyes
16149         then
16150                 ADA_SHAREDLIB="$with_ada_sharedlib"
16151         fi
16152 fi
16153
16154         else
16155                 { { echo "$as_me:16155: error: No usable Ada compiler found" >&5
16156 echo "$as_me: error: No usable Ada compiler found" >&2;}
16157    { (exit 1); exit 1; }; }
16158         fi
16159 else
16160         { { echo "$as_me:16160: error: The Ada compiler is needed for this package" >&5
16161 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16162    { (exit 1); exit 1; }; }
16163 fi
16164
16165 ################################################################################
16166
16167 # not needed
16168 TINFO_LDFLAGS2=
16169
16170 TINFO_LIBS=
16171
16172 ### Construct the list of include-directories to be generated
16173
16174 if test "$srcdir" != "."; then
16175         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16176 fi
16177 CPPFLAGS="-I../include $CPPFLAGS"
16178 if test "$srcdir" != "."; then
16179         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16180 fi
16181 CPPFLAGS="-I. $CPPFLAGS"
16182
16183 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16184 if test "$srcdir" != "."; then
16185         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16186 fi
16187 if test "$GCC" != yes; then
16188         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16189 elif test "$includedir" != "/usr/include"; then
16190         if test "$includedir" = '${prefix}/include' ; then
16191                 if test x$prefix != x/usr ; then
16192                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16193                 fi
16194         else
16195                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16196         fi
16197 fi
16198
16199 ### Build up pieces for makefile rules
16200 echo "$as_me:16200: checking default library suffix" >&5
16201 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16202
16203         case $DFT_LWR_MODEL in
16204         (libtool) DFT_ARG_SUFFIX=''   ;;
16205         (normal)  DFT_ARG_SUFFIX=''   ;;
16206         (debug)   DFT_ARG_SUFFIX='_g' ;;
16207         (profile) DFT_ARG_SUFFIX='_p' ;;
16208         (shared)  DFT_ARG_SUFFIX=''   ;;
16209         esac
16210         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16211 echo "$as_me:16211: result: $DFT_ARG_SUFFIX" >&5
16212 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16213
16214 echo "$as_me:16214: checking default library-dependency suffix" >&5
16215 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16216
16217         case X$DFT_LWR_MODEL in
16218         (Xlibtool)
16219                 DFT_LIB_SUFFIX='.la'
16220                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16221                 ;;
16222         (Xdebug)
16223                 DFT_LIB_SUFFIX='_g.a'
16224                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16225                 ;;
16226         (Xprofile)
16227                 DFT_LIB_SUFFIX='_p.a'
16228                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16229                 ;;
16230         (Xshared)
16231                 case $cf_cv_system_name in
16232                 (aix[5-7]*)
16233                         DFT_LIB_SUFFIX='.so'
16234                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16235                         ;;
16236                 (cygwin*|msys*|mingw*)
16237                         DFT_LIB_SUFFIX='.dll'
16238                         DFT_DEP_SUFFIX='.dll.a'
16239                         ;;
16240                 (darwin*)
16241                         DFT_LIB_SUFFIX='.dylib'
16242                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16243                         ;;
16244                 (hpux*)
16245                         case $target in
16246                         (ia64*)
16247                                 DFT_LIB_SUFFIX='.so'
16248                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16249                                 ;;
16250                         (*)
16251                                 DFT_LIB_SUFFIX='.sl'
16252                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16253                                 ;;
16254                         esac
16255                         ;;
16256                 (*)
16257                         DFT_LIB_SUFFIX='.so'
16258                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16259                         ;;
16260                 esac
16261                 ;;
16262         (*)
16263                 DFT_LIB_SUFFIX='.a'
16264                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16265                 ;;
16266         esac
16267         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16268         then
16269                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16270                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16271         fi
16272 echo "$as_me:16272: result: $DFT_DEP_SUFFIX" >&5
16273 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16274
16275 echo "$as_me:16275: checking default object directory" >&5
16276 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16277
16278         case $DFT_LWR_MODEL in
16279         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16280         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16281         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16282         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16283         (shared)
16284                 case $cf_cv_system_name in
16285                 (cygwin|msys)
16286                         DFT_OBJ_SUBDIR='objects' ;;
16287                 (*)
16288                         DFT_OBJ_SUBDIR='obj_s' ;;
16289                 esac
16290         esac
16291 echo "$as_me:16291: result: $DFT_OBJ_SUBDIR" >&5
16292 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16293
16294 ### Set up low-level terminfo dependencies for makefiles.
16295
16296 if test "$DFT_LWR_MODEL" = shared ; then
16297         case $cf_cv_system_name in
16298         (cygwin*)
16299                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16300                 ;;
16301         (msys*)
16302                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16303                 ;;
16304         esac
16305 fi
16306
16307 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
16308
16309 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
16310
16311 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16312
16313 ### Construct the list of subdirectories for which we'll customize makefiles
16314 ### with the appropriate compile-rules.
16315
16316 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16317
16318 cat >>confdefs.h <<EOF
16319 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16320 EOF
16321
16322 ### Now that we're done running tests, add the compiler-warnings, if any
16323
16324 cf_fix_cppflags=no
16325 cf_new_cflags=
16326 cf_new_cppflags=
16327 cf_new_extra_cppflags=
16328
16329 for cf_add_cflags in $EXTRA_CFLAGS
16330 do
16331 case $cf_fix_cppflags in
16332 (no)
16333         case $cf_add_cflags in
16334         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16335                 case $cf_add_cflags in
16336                 (-D*)
16337                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16338
16339                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16340                                 && test -z "${cf_tst_cflags}" \
16341                                 && cf_fix_cppflags=yes
16342
16343                         if test $cf_fix_cppflags = yes ; then
16344
16345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16347
16348                                 continue
16349                         elif test "${cf_tst_cflags}" = "\"'" ; then
16350
16351         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16352         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16353
16354                                 continue
16355                         fi
16356                         ;;
16357                 esac
16358                 case "$CPPFLAGS" in
16359                 (*$cf_add_cflags)
16360                         ;;
16361                 (*)
16362                         case $cf_add_cflags in
16363                         (-D*)
16364                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16365
16366 CPPFLAGS=`echo "$CPPFLAGS" | \
16367         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16368                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16369
16370                                 ;;
16371                         esac
16372
16373         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16374         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16375
16376                         ;;
16377                 esac
16378                 ;;
16379         (*)
16380
16381         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16382         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16383
16384                 ;;
16385         esac
16386         ;;
16387 (yes)
16388
16389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16391
16392         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16393
16394         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16395                 && test -z "${cf_tst_cflags}" \
16396                 && cf_fix_cppflags=no
16397         ;;
16398 esac
16399 done
16400
16401 if test -n "$cf_new_cflags" ; then
16402
16403         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16404         CFLAGS="${CFLAGS}$cf_new_cflags"
16405
16406 fi
16407
16408 if test -n "$cf_new_cppflags" ; then
16409
16410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16411         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16412
16413 fi
16414
16415 if test -n "$cf_new_extra_cppflags" ; then
16416
16417         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16418         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16419
16420 fi
16421
16422 ################################################################################
16423
16424 TEST_ARG2=
16425
16426 TEST_LIBS2=
16427
16428 NCURSES_SHLIB2="sh -c"
16429
16430 ADA_SUBDIRS="include gen src doc"
16431 if test "x$cf_with_tests" != "xno" ; then
16432         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16433 fi
16434 for cf_dir in $ADA_SUBDIRS
16435 do
16436         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16437 done
16438
16439 NCURSES_TREE="#"
16440
16441 EXTERNAL_TREE=
16442
16443 # match layout used by make-tar.sh
16444 ADAHTML_DIR=../doc/ada
16445
16446 if test "x$cross_compiling" = xyes ; then
16447         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16448 else
16449         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16450 fi
16451
16452 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
16453 ac_config_commands="$ac_config_commands default"
16454 cat >confcache <<\_ACEOF
16455 # This file is a shell script that caches the results of configure
16456 # tests run on this system so they can be shared between configure
16457 # scripts and configure runs, see configure's option --config-cache.
16458 # It is not useful on other systems.  If it contains results you don't
16459 # want to keep, you may remove or edit it.
16460 #
16461 # config.status only pays attention to the cache file if you give it
16462 # the --recheck option to rerun configure.
16463 #
16464 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16465 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16466 # following values.
16467
16468 _ACEOF
16469
16470 # The following way of writing the cache mishandles newlines in values,
16471 # but we know of no workaround that is simple, portable, and efficient.
16472 # So, don't put newlines in cache variables' values.
16473 # Ultrix sh set writes to stderr and can't be redirected directly,
16474 # and sets the high bit in the cache file unless we assign to the vars.
16475 {
16476   (set) 2>&1 |
16477     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16478     *ac_space=\ *)
16479       # `set' does not quote correctly, so add quotes (double-quote
16480       # substitution turns \\\\ into \\, and sed turns \\ into \).
16481       sed -n \
16482         "s/'/'\\\\''/g;
16483           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16484       ;;
16485     *)
16486       # `set' quotes correctly as required by POSIX, so do not add quotes.
16487       sed -n \
16488         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16489       ;;
16490     esac;
16491 } |
16492   sed '
16493      t clear
16494      : clear
16495      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16496      t end
16497      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16498      : end' >>confcache
16499 if cmp -s $cache_file confcache; then :; else
16500   if test -w $cache_file; then
16501     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16502     cat confcache >$cache_file
16503   else
16504     echo "not updating unwritable cache $cache_file"
16505   fi
16506 fi
16507 rm -f confcache
16508
16509 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16510 # Let make expand exec_prefix.
16511 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16512
16513 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16514 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16515 # trailing colons and then remove the whole line if VPATH becomes empty
16516 # (actually we leave an empty line to preserve line numbers).
16517 if test "x$srcdir" = x.; then
16518   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16519 s/:*\$(srcdir):*/:/;
16520 s/:*\${srcdir}:*/:/;
16521 s/:*@srcdir@:*/:/;
16522 s/^\([^=]*=[    ]*\):*/\1/;
16523 s/:*$//;
16524 s/^[^=]*=[      ]*$//;
16525 }'
16526 fi
16527
16528 DEFS=-DHAVE_CONFIG_H
16529
16530 : ${CONFIG_STATUS=./config.status}
16531 ac_clean_files_save=$ac_clean_files
16532 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16533 { echo "$as_me:16533: creating $CONFIG_STATUS" >&5
16534 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16535 cat >$CONFIG_STATUS <<_ACEOF
16536 #! $SHELL
16537 # Generated automatically by configure.
16538 # Run this file to recreate the current configuration.
16539 # Compiler output produced by configure, useful for debugging
16540 # configure, is in config.log if it exists.
16541
16542 debug=false
16543 SHELL=\${CONFIG_SHELL-$SHELL}
16544 ac_cs_invocation="\$0 \$@"
16545
16546 _ACEOF
16547
16548 cat >>$CONFIG_STATUS <<\_ACEOF
16549 # Be Bourne compatible
16550 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16551   emulate sh
16552   NULLCMD=:
16553 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16554   set -o posix
16555 fi
16556
16557 # Name of the executable.
16558 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16559
16560 if expr a : '\(a\)' >/dev/null 2>&1; then
16561   as_expr=expr
16562 else
16563   as_expr=false
16564 fi
16565
16566 rm -f conf$$ conf$$.exe conf$$.file
16567 echo >conf$$.file
16568 if ln -s conf$$.file conf$$ 2>/dev/null; then
16569   # We could just check for DJGPP; but this test a) works b) is more generic
16570   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16571   if test -f conf$$.exe; then
16572     # Don't use ln at all; we don't have any links
16573     as_ln_s='cp -p'
16574   else
16575     as_ln_s='ln -s'
16576   fi
16577 elif ln conf$$.file conf$$ 2>/dev/null; then
16578   as_ln_s=ln
16579 else
16580   as_ln_s='cp -p'
16581 fi
16582 rm -f conf$$ conf$$.exe conf$$.file
16583
16584 as_executable_p="test -f"
16585
16586 # Support unset when possible.
16587 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16588   as_unset=unset
16589 else
16590   as_unset=false
16591 fi
16592
16593 # NLS nuisances.
16594 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16595 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16596 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16597 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16598 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16599 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16600 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16601 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16602
16603 # IFS
16604 # We need space, tab and new line, in precisely that order.
16605 as_nl='
16606 '
16607 IFS="   $as_nl"
16608
16609 # CDPATH.
16610 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16611
16612 exec 6>&1
16613
16614 _ACEOF
16615
16616 # Files that config.status was made for.
16617 if test -n "$ac_config_files"; then
16618   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16619 fi
16620
16621 if test -n "$ac_config_headers"; then
16622   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16623 fi
16624
16625 if test -n "$ac_config_links"; then
16626   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16627 fi
16628
16629 if test -n "$ac_config_commands"; then
16630   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16631 fi
16632
16633 cat >>$CONFIG_STATUS <<\EOF
16634
16635 ac_cs_usage="\
16636 \`$as_me' instantiates files from templates according to the
16637 current configuration.
16638
16639 Usage: $0 [OPTIONS] [FILE]...
16640
16641   -h, --help       print this help, then exit
16642   -V, --version    print version number, then exit
16643   -d, --debug      don't remove temporary files
16644       --recheck    update $as_me by reconfiguring in the same conditions
16645   --file=FILE[:TEMPLATE]
16646                    instantiate the configuration file FILE
16647   --header=FILE[:TEMPLATE]
16648                    instantiate the configuration header FILE
16649
16650 Configuration files:
16651 $config_files
16652
16653 Configuration headers:
16654 $config_headers
16655
16656 Configuration commands:
16657 $config_commands
16658
16659 Report bugs to <dickey@invisible-island.net>."
16660 EOF
16661
16662 cat >>$CONFIG_STATUS <<EOF
16663 ac_cs_version="\\
16664 config.status
16665 configured by $0, generated by GNU Autoconf 2.52.20190828,
16666   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16667
16668 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16669 Free Software Foundation, Inc.
16670 This config.status script is free software; the Free Software Foundation
16671 gives unlimited permission to copy, distribute and modify it."
16672 srcdir=$srcdir
16673 INSTALL="$INSTALL"
16674 EOF
16675
16676 cat >>$CONFIG_STATUS <<\EOF
16677 # If no file are specified by the user, then we need to provide default
16678 # value.  By we need to know if files were specified by the user.
16679 ac_need_defaults=:
16680 while test $# != 0
16681 do
16682   case $1 in
16683   --*=*)
16684     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16685     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16686     shift
16687     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16688     shift
16689     ;;
16690   -*);;
16691   *) # This is not an option, so the user has probably given explicit
16692      # arguments.
16693      ac_need_defaults=false;;
16694   esac
16695
16696   case $1 in
16697   # Handling of the options.
16698 EOF
16699 cat >>$CONFIG_STATUS <<EOF
16700   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16701     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16702     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16703 EOF
16704 cat >>$CONFIG_STATUS <<\EOF
16705   --version | --vers* | -V )
16706     echo "$ac_cs_version"; exit 0 ;;
16707   --he | --h)
16708     # Conflict between --help and --header
16709     { { echo "$as_me:16709: error: ambiguous option: $1
16710 Try \`$0 --help' for more information." >&5
16711 echo "$as_me: error: ambiguous option: $1
16712 Try \`$0 --help' for more information." >&2;}
16713    { (exit 1); exit 1; }; };;
16714   --help | --hel | -h )
16715     echo "$ac_cs_usage"; exit 0 ;;
16716   --debug | --d* | -d )
16717     debug=: ;;
16718   --file | --fil | --fi | --f )
16719     shift
16720     CONFIG_FILES="$CONFIG_FILES $1"
16721     ac_need_defaults=false;;
16722   --header | --heade | --head | --hea )
16723     shift
16724     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16725     ac_need_defaults=false;;
16726
16727   # This is an error.
16728   -*) { { echo "$as_me:16728: error: unrecognized option: $1
16729 Try \`$0 --help' for more information." >&5
16730 echo "$as_me: error: unrecognized option: $1
16731 Try \`$0 --help' for more information." >&2;}
16732    { (exit 1); exit 1; }; } ;;
16733
16734   *) ac_config_targets="$ac_config_targets $1" ;;
16735
16736   esac
16737   shift
16738 done
16739
16740 exec 5>>config.log
16741 cat >&5 << _ACEOF
16742
16743 ## ----------------------- ##
16744 ## Running config.status.  ##
16745 ## ----------------------- ##
16746
16747 This file was extended by $as_me 2.52.20190828, executed with
16748   CONFIG_FILES    = $CONFIG_FILES
16749   CONFIG_HEADERS  = $CONFIG_HEADERS
16750   CONFIG_LINKS    = $CONFIG_LINKS
16751   CONFIG_COMMANDS = $CONFIG_COMMANDS
16752   > $ac_cs_invocation
16753 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16754
16755 _ACEOF
16756 EOF
16757
16758 cat >>$CONFIG_STATUS <<EOF
16759 #
16760 # INIT-COMMANDS section.
16761 #
16762
16763 ### Special initialization commands, used to pass information from the
16764 ### configuration-run into config.status
16765
16766 AWK="$AWK"
16767 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16768 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16769 LIB_NAME="$LIB_NAME"
16770 LIB_PREFIX="$LIB_PREFIX"
16771 LIB_SUFFIX="$LIB_SUFFIX"
16772 LN_S="$LN_S"
16773 NCURSES_MAJOR="$NCURSES_MAJOR"
16774 NCURSES_MINOR="$NCURSES_MINOR"
16775 NCURSES_PATCH="$NCURSES_PATCH"
16776 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16777 cf_cv_abi_version="$cf_cv_abi_version"
16778 cf_cv_rel_version="$cf_cv_rel_version"
16779 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16780 cf_cv_shared_soname='$cf_cv_shared_soname'
16781 cf_cv_shlib_version="$cf_cv_shlib_version"
16782 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16783 cf_cv_system_name="$cf_cv_system_name"
16784 host="$host"
16785 target="$target"
16786
16787 EOF
16788
16789 cat >>$CONFIG_STATUS <<\EOF
16790 for ac_config_target in $ac_config_targets
16791 do
16792   case "$ac_config_target" in
16793   # Handling of arguments.
16794   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16795   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16796   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16797   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16798   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16799   *) { { echo "$as_me:16799: error: invalid argument: $ac_config_target" >&5
16800 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16801    { (exit 1); exit 1; }; };;
16802   esac
16803 done
16804
16805 # If the user did not use the arguments to specify the items to instantiate,
16806 # then the envvar interface is used.  Set only those that are not.
16807 # We use the long form for the default assignment because of an extremely
16808 # bizarre bug on SunOS 4.1.3.
16809 if $ac_need_defaults; then
16810   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16811   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16812   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16813 fi
16814
16815 # Create a temporary directory, and hook for its removal unless debugging.
16816 $debug ||
16817 {
16818   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16819   trap '{ (exit 1); exit 1; }' 1 2 13 15
16820 }
16821
16822 # Create a (secure) tmp directory for tmp files.
16823 : ${TMPDIR=/tmp}
16824 {
16825   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16826   test -n "$tmp" && test -d "$tmp"
16827 }  ||
16828 {
16829   tmp=$TMPDIR/cs$$-$RANDOM
16830   (umask 077 && mkdir $tmp)
16831 } ||
16832 {
16833    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16834    { (exit 1); exit 1; }
16835 }
16836
16837 EOF
16838
16839 cat >>$CONFIG_STATUS <<EOF
16840
16841 #
16842 # CONFIG_FILES section.
16843 #
16844
16845 # No need to generate the scripts if there are no CONFIG_FILES.
16846 # This happens for instance when ./config.status config.h
16847 if test -n "\$CONFIG_FILES"; then
16848   # Protect against being on the right side of a sed subst in config.status.
16849   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16850    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16851 s,@SHELL@,$SHELL,;t t
16852 s,@exec_prefix@,$exec_prefix,;t t
16853 s,@prefix@,$prefix,;t t
16854 s,@program_transform_name@,$program_transform_name,;t t
16855 s,@bindir@,$bindir,;t t
16856 s,@sbindir@,$sbindir,;t t
16857 s,@libexecdir@,$libexecdir,;t t
16858 s,@datarootdir@,$datarootdir,;t t
16859 s,@datadir@,$datadir,;t t
16860 s,@sysconfdir@,$sysconfdir,;t t
16861 s,@sharedstatedir@,$sharedstatedir,;t t
16862 s,@localstatedir@,$localstatedir,;t t
16863 s,@runstatedir@,$runstatedir,;t t
16864 s,@libdir@,$libdir,;t t
16865 s,@includedir@,$includedir,;t t
16866 s,@oldincludedir@,$oldincludedir,;t t
16867 s,@infodir@,$infodir,;t t
16868 s,@mandir@,$mandir,;t t
16869 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16870 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16871 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16872 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16873 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16874 s,@build_alias@,$build_alias,;t t
16875 s,@host_alias@,$host_alias,;t t
16876 s,@target_alias@,$target_alias,;t t
16877 s,@ECHO_C@,$ECHO_C,;t t
16878 s,@ECHO_N@,$ECHO_N,;t t
16879 s,@ECHO_T@,$ECHO_T,;t t
16880 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16881 s,@DEFS@,$DEFS,;t t
16882 s,@LIBS@,$LIBS,;t t
16883 s,@top_builddir@,$top_builddir,;t t
16884 s,@build@,$build,;t t
16885 s,@build_cpu@,$build_cpu,;t t
16886 s,@build_vendor@,$build_vendor,;t t
16887 s,@build_os@,$build_os,;t t
16888 s,@host@,$host,;t t
16889 s,@host_cpu@,$host_cpu,;t t
16890 s,@host_vendor@,$host_vendor,;t t
16891 s,@host_os@,$host_os,;t t
16892 s,@target@,$target,;t t
16893 s,@target_cpu@,$target_cpu,;t t
16894 s,@target_vendor@,$target_vendor,;t t
16895 s,@target_os@,$target_os,;t t
16896 s,@CC@,$CC,;t t
16897 s,@CFLAGS@,$CFLAGS,;t t
16898 s,@LDFLAGS@,$LDFLAGS,;t t
16899 s,@CPPFLAGS@,$CPPFLAGS,;t t
16900 s,@ac_ct_CC@,$ac_ct_CC,;t t
16901 s,@EXEEXT@,$EXEEXT,;t t
16902 s,@OBJEXT@,$OBJEXT,;t t
16903 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16904 s,@CPP@,$CPP,;t t
16905 s,@AWK@,$AWK,;t t
16906 s,@EGREP@,$EGREP,;t t
16907 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16908 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16909 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16910 s,@LN_S@,$LN_S,;t t
16911 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
16912 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
16913 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16914 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16915 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
16916 s,@SET_MAKE@,$SET_MAKE,;t t
16917 s,@CTAGS@,$CTAGS,;t t
16918 s,@ETAGS@,$ETAGS,;t t
16919 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16920 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16921 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
16922 s,@RANLIB@,$RANLIB,;t t
16923 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
16924 s,@LD@,$LD,;t t
16925 s,@ac_ct_LD@,$ac_ct_LD,;t t
16926 s,@AR@,$AR,;t t
16927 s,@ac_ct_AR@,$ac_ct_AR,;t t
16928 s,@ARFLAGS@,$ARFLAGS,;t t
16929 s,@DESTDIR@,$DESTDIR,;t t
16930 s,@BUILD_CC@,$BUILD_CC,;t t
16931 s,@BUILD_CPP@,$BUILD_CPP,;t t
16932 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
16933 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
16934 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
16935 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
16936 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
16937 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
16938 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
16939 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16940 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16941 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16942 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
16943 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
16944 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
16945 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16946 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16947 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
16948 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
16949 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
16950 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
16951 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
16952 s,@CC_G_OPT@,$CC_G_OPT,;t t
16953 s,@LD_MODEL@,$LD_MODEL,;t t
16954 s,@shlibdir@,$shlibdir,;t t
16955 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
16956 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16957 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
16958 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16959 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
16960 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
16961 s,@LINK_PROGS@,$LINK_PROGS,;t t
16962 s,@LINK_TESTS@,$LINK_TESTS,;t t
16963 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16964 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16965 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
16966 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
16967 s,@RPATH_LIST@,$RPATH_LIST,;t t
16968 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
16969 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
16970 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
16971 s,@PTHREAD@,$PTHREAD,;t t
16972 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
16973 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16974 s,@ECHO_LT@,$ECHO_LT,;t t
16975 s,@ECHO_LD@,$ECHO_LD,;t t
16976 s,@RULE_CC@,$RULE_CC,;t t
16977 s,@SHOW_CC@,$SHOW_CC,;t t
16978 s,@ECHO_CC@,$ECHO_CC,;t t
16979 s,@ADAFLAGS@,$ADAFLAGS,;t t
16980 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16981 s,@ADA_TRACE@,$ADA_TRACE,;t t
16982 s,@gnatmake_exists@,$gnatmake_exists,;t t
16983 s,@gprconfig_exists@,$gprconfig_exists,;t t
16984 s,@M4_exists@,$M4_exists,;t t
16985 s,@cf_ada_make@,$cf_ada_make,;t t
16986 s,@cf_ada_config@,$cf_ada_config,;t t
16987 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
16988 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
16989 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
16990 s,@cf_compile_generics@,$cf_compile_generics,;t t
16991 s,@cf_generic_objects@,$cf_generic_objects,;t t
16992 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
16993 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
16994 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
16995 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
16996 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
16997 s,@cf_ada_package@,$cf_ada_package,;t t
16998 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
16999 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17000 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17001 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17002 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17003 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17004 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17005 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17006 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17007 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17008 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17009 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17010 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17011 s,@TEST_ARG2@,$TEST_ARG2,;t t
17012 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17013 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17014 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17015 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17016 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17017 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17018 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17019 CEOF
17020
17021 EOF
17022
17023   cat >>$CONFIG_STATUS <<\EOF
17024   # Split the substitutions into bite-sized pieces for seds with
17025   # small command number limits, like on Digital OSF/1 and HP-UX.
17026   ac_max_sed_lines=48
17027   ac_sed_frag=1 # Number of current file.
17028   ac_beg=1 # First line for current file.
17029   ac_end=$ac_max_sed_lines # Line after last line for current file.
17030   ac_more_lines=:
17031   ac_sed_cmds=
17032   while $ac_more_lines; do
17033     if test $ac_beg -gt 1; then
17034       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17035     else
17036       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17037     fi
17038     if test ! -s $tmp/subs.frag; then
17039       ac_more_lines=false
17040     else
17041       # The purpose of the label and of the branching condition is to
17042       # speed up the sed processing (if there are no `@' at all, there
17043       # is no need to browse any of the substitutions).
17044       # These are the two extra sed commands mentioned above.
17045       (echo ':t
17046   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17047       # It is possible to make a multiline substitution using escaped newlines.
17048       # Ensure that we do not split the substitution between script fragments.
17049       ac_BEG=$ac_end
17050       ac_END=`expr $ac_end + $ac_max_sed_lines`
17051       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
17052       if test -s $tmp/subs.next; then
17053         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
17054         if test ! -s $tmp/subs.edit; then
17055           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
17056           if test ! -s $tmp/subs.edit; then
17057             if test $ac_beg -gt 1; then
17058               ac_end=`expr $ac_end - 1`
17059               continue
17060             fi
17061           fi
17062         fi
17063       fi
17064
17065       if test -z "$ac_sed_cmds"; then
17066         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17067       else
17068         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17069       fi
17070       ac_sed_frag=`expr $ac_sed_frag + 1`
17071       ac_beg=$ac_end
17072       ac_end=`expr $ac_end + $ac_max_sed_lines`
17073     fi
17074   done
17075   if test -z "$ac_sed_cmds"; then
17076     ac_sed_cmds=cat
17077   fi
17078 fi # test -n "$CONFIG_FILES"
17079
17080 EOF
17081 cat >>$CONFIG_STATUS <<\EOF
17082 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17083   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17084   case $ac_file in
17085   - | *:- | *:-:* ) # input from stdin
17086         cat >$tmp/stdin
17087         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17088         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17089   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17090         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17091   * )   ac_file_in=$ac_file.in ;;
17092   esac
17093
17094   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17095   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17096          X"$ac_file" : 'X\(//\)[^/]' \| \
17097          X"$ac_file" : 'X\(//\)$' \| \
17098          X"$ac_file" : 'X\(/\)' \| \
17099          .     : '\(.\)' 2>/dev/null ||
17100 echo X"$ac_file" |
17101     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17102           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17103           /^X\(\/\/\)$/{ s//\1/; q; }
17104           /^X\(\/\).*/{ s//\1/; q; }
17105           s/.*/./; q'`
17106   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17107     { case "$ac_dir" in
17108   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17109   *)                      as_incr_dir=.;;
17110 esac
17111 as_dummy="$ac_dir"
17112 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17113   case $as_mkdir_dir in
17114     # Skip DOS drivespec
17115     ?:) as_incr_dir=$as_mkdir_dir ;;
17116     *)
17117       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17118       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17119     ;;
17120   esac
17121 done; }
17122
17123     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17124     # A "../" for each directory in $ac_dir_suffix.
17125     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17126   else
17127     ac_dir_suffix= ac_dots=
17128   fi
17129
17130   case $srcdir in
17131   .)  ac_srcdir=.
17132       if test -z "$ac_dots"; then
17133          ac_top_srcdir=.
17134       else
17135          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17136       fi ;;
17137   [\\/]* | ?:[\\/]* )
17138       ac_srcdir=$srcdir$ac_dir_suffix;
17139       ac_top_srcdir=$srcdir ;;
17140   *) # Relative path.
17141     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17142     ac_top_srcdir=$ac_dots$srcdir ;;
17143   esac
17144
17145   case $INSTALL in
17146   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17147   *) ac_INSTALL=$ac_dots$INSTALL ;;
17148   esac
17149
17150   if test x"$ac_file" != x-; then
17151     { echo "$as_me:17151: creating $ac_file" >&5
17152 echo "$as_me: creating $ac_file" >&6;}
17153     rm -f "$ac_file"
17154   fi
17155   # Let's still pretend it is `configure' which instantiates (i.e., don't
17156   # use $as_me), people would be surprised to read:
17157   #    /* config.h.  Generated automatically by config.status.  */
17158   configure_input="Generated automatically from `echo $ac_file_in |
17159                                                  sed 's,.*/,,'` by configure."
17160
17161   # First look for the input files in the build tree, otherwise in the
17162   # src tree.
17163   ac_file_inputs=`IFS=:
17164     for f in $ac_file_in; do
17165       case $f in
17166       -) echo $tmp/stdin ;;
17167       [\\/$]*)
17168          # Absolute (can't be DOS-style, as IFS=:)
17169          test -f "$f" || { { echo "$as_me:17169: error: cannot find input file: $f" >&5
17170 echo "$as_me: error: cannot find input file: $f" >&2;}
17171    { (exit 1); exit 1; }; }
17172          echo $f;;
17173       *) # Relative
17174          if test -f "$f"; then
17175            # Build tree
17176            echo $f
17177          elif test -f "$srcdir/$f"; then
17178            # Source tree
17179            echo $srcdir/$f
17180          else
17181            # /dev/null tree
17182            { { echo "$as_me:17182: error: cannot find input file: $f" >&5
17183 echo "$as_me: error: cannot find input file: $f" >&2;}
17184    { (exit 1); exit 1; }; }
17185          fi;;
17186       esac
17187     done` || { (exit 1); exit 1; }
17188 EOF
17189 cat >>$CONFIG_STATUS <<\EOF
17190   ac_warn_datarootdir=no
17191   if test x"$ac_file" != x-; then
17192     for ac_item in $ac_file_inputs
17193     do
17194       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17195       if test -n "$ac_seen"; then
17196         ac_used=`grep '@datarootdir@' $ac_item`
17197         if test -z "$ac_used"; then
17198           { echo "$as_me:17198: WARNING: datarootdir was used implicitly but not set:
17199 $ac_seen" >&5
17200 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17201 $ac_seen" >&2;}
17202           ac_warn_datarootdir=yes
17203         fi
17204       fi
17205       ac_seen=`grep '${datarootdir}' $ac_item`
17206       if test -n "$ac_seen"; then
17207         { echo "$as_me:17207: WARNING: datarootdir was used explicitly but not set:
17208 $ac_seen" >&5
17209 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17210 $ac_seen" >&2;}
17211         ac_warn_datarootdir=yes
17212       fi
17213     done
17214   fi
17215
17216 if test "x$ac_warn_datarootdir" = xyes; then
17217   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17218 fi
17219
17220 EOF
17221 cat >>$CONFIG_STATUS <<EOF
17222   sed "$ac_vpsub
17223 $extrasub
17224 EOF
17225 cat >>$CONFIG_STATUS <<\EOF
17226 :t
17227 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17228 s,@configure_input@,$configure_input,;t t
17229 s,@srcdir@,$ac_srcdir,;t t
17230 s,@top_srcdir@,$ac_top_srcdir,;t t
17231 s,@INSTALL@,$ac_INSTALL,;t t
17232 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17233   rm -f $tmp/stdin
17234   if test x"$ac_file" != x-; then
17235     cp $tmp/out $ac_file
17236
17237     for ac_name in prefix exec_prefix datarootdir
17238     do
17239         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17240         if test -n "$ac_seen"; then
17241             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17242             if test -z "$ac_init"; then
17243               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17244               { echo "$as_me:17244: WARNING: Variable $ac_name is used but was not set:
17245 $ac_seen" >&5
17246 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17247 $ac_seen" >&2;}
17248             fi
17249         fi
17250     done
17251     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17252     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17253     if test -s $tmp/out; then
17254       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17255       { echo "$as_me:17255: WARNING: Some variables may not be substituted:
17256 $ac_seen" >&5
17257 echo "$as_me: WARNING: Some variables may not be substituted:
17258 $ac_seen" >&2;}
17259     fi
17260   else
17261     cat $tmp/out
17262   fi
17263   rm -f $tmp/out
17264
17265 done
17266 EOF
17267 cat >>$CONFIG_STATUS <<\EOF
17268
17269 #
17270 # CONFIG_HEADER section.
17271 #
17272
17273 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17274 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17275 #
17276 # ac_d sets the value in "#define NAME VALUE" lines.
17277 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17278 ac_dB='[        ].*$,\1#\2'
17279 ac_dC=' '
17280 ac_dD=',;t'
17281 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17282 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17283 ac_iB='\([      ]\),\1#\2define\3'
17284 ac_iC=' '
17285 ac_iD='\4,;t'
17286 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17287 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17288 ac_uB='$,\1#\2define\3'
17289 ac_uC=' '
17290 ac_uD=',;t'
17291
17292 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17293   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17294   case $ac_file in
17295   - | *:- | *:-:* ) # input from stdin
17296         cat >$tmp/stdin
17297         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17298         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17299   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17300         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17301   * )   ac_file_in=$ac_file.in ;;
17302   esac
17303
17304   test x"$ac_file" != x- && { echo "$as_me:17304: creating $ac_file" >&5
17305 echo "$as_me: creating $ac_file" >&6;}
17306
17307   # First look for the input files in the build tree, otherwise in the
17308   # src tree.
17309   ac_file_inputs=`IFS=:
17310     for f in $ac_file_in; do
17311       case $f in
17312       -) echo $tmp/stdin ;;
17313       [\\/$]*)
17314          # Absolute (can't be DOS-style, as IFS=:)
17315          test -f "$f" || { { echo "$as_me:17315: error: cannot find input file: $f" >&5
17316 echo "$as_me: error: cannot find input file: $f" >&2;}
17317    { (exit 1); exit 1; }; }
17318          echo $f;;
17319       *) # Relative
17320          if test -f "$f"; then
17321            # Build tree
17322            echo $f
17323          elif test -f "$srcdir/$f"; then
17324            # Source tree
17325            echo $srcdir/$f
17326          else
17327            # /dev/null tree
17328            { { echo "$as_me:17328: error: cannot find input file: $f" >&5
17329 echo "$as_me: error: cannot find input file: $f" >&2;}
17330    { (exit 1); exit 1; }; }
17331          fi;;
17332       esac
17333     done` || { (exit 1); exit 1; }
17334   # Remove the trailing spaces.
17335   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17336
17337 EOF
17338
17339 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17340 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17341 # be either 'cat' or 'sort'.
17342 cat confdefs.h | uniq >conftest.vals
17343
17344 # Break up conftest.vals because some shells have a limit on
17345 # the size of here documents, and old seds have small limits too.
17346
17347 rm -f conftest.tail
17348 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17349 while grep . conftest.vals >/dev/null
17350 do
17351   # Write chunks of a limited-size here document to conftest.frag.
17352   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17353   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17354   echo 'CEOF' >> $CONFIG_STATUS
17355   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17356   rm -f conftest.vals
17357   mv conftest.tail conftest.vals
17358 done
17359 rm -f conftest.vals
17360
17361 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17362 # marker @DEFS@.
17363 echo '  cat >> conftest.edit <<CEOF
17364 /@DEFS@/r conftest.frag
17365 /@DEFS@/d
17366 CEOF
17367 sed -f conftest.edit $tmp/in > $tmp/out
17368 rm -f $tmp/in
17369 mv $tmp/out $tmp/in
17370 rm -f conftest.edit conftest.frag
17371 ' >> $CONFIG_STATUS
17372
17373 cat >>$CONFIG_STATUS <<\EOF
17374   # Let's still pretend it is `configure' which instantiates (i.e., don't
17375   # use $as_me), people would be surprised to read:
17376   #    /* config.h.  Generated automatically by config.status.  */
17377   if test x"$ac_file" = x-; then
17378     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17379   else
17380     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17381   fi
17382   cat $tmp/in >>$tmp/config.h
17383   rm -f $tmp/in
17384   if test x"$ac_file" != x-; then
17385     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17386       { echo "$as_me:17386: $ac_file is unchanged" >&5
17387 echo "$as_me: $ac_file is unchanged" >&6;}
17388     else
17389       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17390          X"$ac_file" : 'X\(//\)[^/]' \| \
17391          X"$ac_file" : 'X\(//\)$' \| \
17392          X"$ac_file" : 'X\(/\)' \| \
17393          .     : '\(.\)' 2>/dev/null ||
17394 echo X"$ac_file" |
17395     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17396           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17397           /^X\(\/\/\)$/{ s//\1/; q; }
17398           /^X\(\/\).*/{ s//\1/; q; }
17399           s/.*/./; q'`
17400       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17401         { case "$ac_dir" in
17402   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17403   *)                      as_incr_dir=.;;
17404 esac
17405 as_dummy="$ac_dir"
17406 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17407   case $as_mkdir_dir in
17408     # Skip DOS drivespec
17409     ?:) as_incr_dir=$as_mkdir_dir ;;
17410     *)
17411       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17412       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17413     ;;
17414   esac
17415 done; }
17416
17417       fi
17418       rm -f $ac_file
17419       mv $tmp/config.h $ac_file
17420     fi
17421   else
17422     cat $tmp/config.h
17423     rm -f $tmp/config.h
17424   fi
17425 done
17426 EOF
17427 cat >>$CONFIG_STATUS <<\EOF
17428 #
17429 # CONFIG_COMMANDS section.
17430 #
17431 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17432   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17433   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17434
17435   case $ac_dest in
17436     default )
17437 if test -z "$USE_OLD_MAKERULES" ; then
17438         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17439 fi
17440  ;;
17441   esac
17442 done
17443 EOF
17444
17445 cat >>$CONFIG_STATUS <<\EOF
17446
17447 { (exit 0); exit 0; }
17448 EOF
17449 chmod +x $CONFIG_STATUS
17450 ac_clean_files=$ac_clean_files_save
17451
17452 # configure is writing to config.log, and then calls config.status.
17453 # config.status does its own redirection, appending to config.log.
17454 # Unfortunately, on DOS this fails, as config.log is still kept open
17455 # by configure, so config.status won't be able to write to it; its
17456 # output is simply discarded.  So we exec the FD to /dev/null,
17457 # effectively closing config.log, so it can be properly (re)opened and
17458 # appended to by config.status.  When coming back to configure, we
17459 # need to make the FD available again.
17460 if test "$no_create" != yes; then
17461   ac_cs_success=:
17462   exec 5>/dev/null
17463   $SHELL $CONFIG_STATUS || ac_cs_success=false
17464   exec 5>>config.log
17465   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17466   # would make configure fail if this is the last instruction.
17467   $ac_cs_success || { (exit 1); exit 1; }
17468 fi
17469 ${MAKE:-make} preinstall