]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
b2ade1d23906d4062fb9bc9a46d8d7bc4ecebe3e
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.78 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20200802.
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-warnings       test: turn on gcc compiler warnings
742   --enable-assertions     test: turn on generation of assertion code
743   --enable-expanded       test: generate functions for certain macros
744   --disable-macros        test: use functions rather than macros
745   --with-trace            test: add trace() function to all models of ncurses
746   --disable-gnat-projects test: disable GNAT projects even if usable
747 Ada95 Binding Options:
748   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
749   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
750   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
751   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
752   --with-ada-libname=XXX  override default Ada library-name
753
754 Some influential environment variables:
755   CC          C compiler command
756   CFLAGS      C compiler flags
757   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
758               nonstandard directory <lib dir>
759   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
760               headers in a nonstandard directory <include dir>
761   CPP         C preprocessor
762
763 Use these variables to override the choices made by `configure' or to help
764 it to find libraries and programs with nonstandard names/locations.
765
766 EOF
767 fi
768
769 if test "$ac_init_help" = "recursive"; then
770   # If there are subdirs, report their specific --help.
771   ac_popdir=`pwd`
772   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
773     cd $ac_subdir
774     # A "../" for each directory in /$ac_subdir.
775     ac_dots=`echo $ac_subdir |
776              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
777
778     case $srcdir in
779     .) # No --srcdir option.  We are building in place.
780       ac_sub_srcdir=$srcdir ;;
781     [\\/]* | ?:[\\/]* ) # Absolute path.
782       ac_sub_srcdir=$srcdir/$ac_subdir ;;
783     *) # Relative path.
784       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
785     esac
786
787     # Check for guested configure; otherwise get Cygnus style configure.
788     if test -f $ac_sub_srcdir/configure.gnu; then
789       echo
790       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
791     elif test -f $ac_sub_srcdir/configure; then
792       echo
793       $SHELL $ac_sub_srcdir/configure  --help=recursive
794     elif test -f $ac_sub_srcdir/configure.ac ||
795            test -f $ac_sub_srcdir/configure.in; then
796       echo
797       $ac_configure --help
798     else
799       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
800     fi
801     cd $ac_popdir
802   done
803 fi
804
805 test -n "$ac_init_help" && exit 0
806 if $ac_init_version; then
807   cat <<\EOF
808
809 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
810 Free Software Foundation, Inc.
811 This configure script is free software; the Free Software Foundation
812 gives unlimited permission to copy, distribute and modify it.
813 EOF
814   exit 0
815 fi
816 exec 5>config.log
817 cat >&5 <<EOF
818 This file contains any messages produced by compilers while
819 running configure, to aid debugging if configure makes a mistake.
820
821 It was created by $as_me, which was
822 generated by GNU Autoconf 2.52.20200802.  Invocation command line was
823
824   $ $0 $@
825
826 EOF
827 {
828 cat <<_ASUNAME
829 ## ---------- ##
830 ## Platform.  ##
831 ## ---------- ##
832
833 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
834 uname -m = `(uname -m) 2>/dev/null || echo unknown`
835 uname -r = `(uname -r) 2>/dev/null || echo unknown`
836 uname -s = `(uname -s) 2>/dev/null || echo unknown`
837 uname -v = `(uname -v) 2>/dev/null || echo unknown`
838
839 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
840 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
841
842 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
843 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
844 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
845 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
846 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
847 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
848 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
849
850 PATH = $PATH
851
852 _ASUNAME
853 } >&5
854
855 cat >&5 <<EOF
856 ## ------------ ##
857 ## Core tests.  ##
858 ## ------------ ##
859
860 EOF
861
862 # Keep a trace of the command line.
863 # Strip out --no-create and --no-recursion so they do not pile up.
864 # Also quote any args containing shell meta-characters.
865 ac_configure_args=
866 ac_sep=
867 for ac_arg
868 do
869   case $ac_arg in
870   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
871   | --no-cr | --no-c) ;;
872   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
873   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
874   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
875     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
876     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
877     ac_sep=" " ;;
878   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
879      ac_sep=" " ;;
880   esac
881   # Get rid of the leading space.
882 done
883
884 # When interrupted or exit'd, cleanup temporary files, and complete
885 # config.log.  We remove comments because anyway the quotes in there
886 # would cause problems or look ugly.
887 trap 'exit_status=$?
888   # Save into config.log some information that might help in debugging.
889   echo >&5
890   echo "## ----------------- ##" >&5
891   echo "## Cache variables.  ##" >&5
892   echo "## ----------------- ##" >&5
893   echo >&5
894   # The following way of writing the cache mishandles newlines in values,
895 {
896   (set) 2>&1 |
897     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
898     *ac_space=\ *)
899       sed -n \
900         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
901           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
902       ;;
903     *)
904       sed -n \
905         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
906       ;;
907     esac;
908 } >&5
909   sed "/^$/d" confdefs.h >conftest.log
910   if test -s conftest.log; then
911     echo >&5
912     echo "## ------------ ##" >&5
913     echo "## confdefs.h.  ##" >&5
914     echo "## ------------ ##" >&5
915     echo >&5
916     cat conftest.log >&5
917   fi
918   (echo; echo) >&5
919   test "$ac_signal" != 0 &&
920     echo "$as_me: caught signal $ac_signal" >&5
921   echo "$as_me: exit $exit_status" >&5
922   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
923     exit $exit_status
924      ' 0
925 for ac_signal in 1 2 13 15; do
926   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
927 done
928 ac_signal=0
929
930 # confdefs.h avoids OS command line length limits that DEFS can exceed.
931 rm -rf conftest* confdefs.h
932 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
933 echo >confdefs.h
934
935 # Let the site file select an alternate cache file if it wants to.
936 # Prefer explicitly selected file to automatically selected ones.
937 if test -z "$CONFIG_SITE"; then
938   if test "x$prefix" != xNONE; then
939     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
940   else
941     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
942   fi
943 fi
944 for ac_site_file in $CONFIG_SITE; do
945   if test -r "$ac_site_file"; then
946     { echo "$as_me:946: loading site script $ac_site_file" >&5
947 echo "$as_me: loading site script $ac_site_file" >&6;}
948     cat "$ac_site_file" >&5
949     . "$ac_site_file"
950   fi
951 done
952
953 if test -r "$cache_file"; then
954   # Some versions of bash will fail to source /dev/null (special
955   # files actually), so we avoid doing that.
956   if test -f "$cache_file"; then
957     { echo "$as_me:957: loading cache $cache_file" >&5
958 echo "$as_me: loading cache $cache_file" >&6;}
959     case $cache_file in
960       [\\/]* | ?:[\\/]* ) . $cache_file;;
961       *)                      . ./$cache_file;;
962     esac
963   fi
964 else
965   { echo "$as_me:965: creating cache $cache_file" >&5
966 echo "$as_me: creating cache $cache_file" >&6;}
967   >$cache_file
968 fi
969
970 # Check that the precious variables saved in the cache have kept the same
971 # value.
972 ac_cache_corrupted=false
973 for ac_var in `(set) 2>&1 |
974                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
975   eval ac_old_set=\$ac_cv_env_${ac_var}_set
976   eval ac_new_set=\$ac_env_${ac_var}_set
977   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
978   eval ac_new_val="\$ac_env_${ac_var}_value"
979   case $ac_old_set,$ac_new_set in
980     set,)
981       { echo "$as_me:981: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
982 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
983       ac_cache_corrupted=: ;;
984     ,set)
985       { echo "$as_me:985: error: \`$ac_var' was not set in the previous run" >&5
986 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
987       ac_cache_corrupted=: ;;
988     ,);;
989     *)
990       if test "x$ac_old_val" != "x$ac_new_val"; then
991         { echo "$as_me:991: error: \`$ac_var' has changed since the previous run:" >&5
992 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
993         { echo "$as_me:993:   former value:  $ac_old_val" >&5
994 echo "$as_me:   former value:  $ac_old_val" >&2;}
995         { echo "$as_me:995:   current value: $ac_new_val" >&5
996 echo "$as_me:   current value: $ac_new_val" >&2;}
997         ac_cache_corrupted=:
998       fi;;
999   esac
1000   # Pass precious variables to config.status.  It doesn't matter if
1001   # we pass some twice (in addition to the command line arguments).
1002   if test "$ac_new_set" = set; then
1003     case $ac_new_val in
1004     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1005       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1006       ac_configure_args="$ac_configure_args '$ac_arg'"
1007       ;;
1008     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1009        ;;
1010     esac
1011   fi
1012 done
1013 if $ac_cache_corrupted; then
1014   { echo "$as_me:1014: error: changes in the environment can compromise the build" >&5
1015 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1016   { { echo "$as_me:1016: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1017 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1018    { (exit 1); exit 1; }; }
1019 fi
1020
1021 ac_ext=c
1022 ac_cpp='$CPP $CPPFLAGS'
1023 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1024 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1025 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1026 ac_main_return=return
1027
1028 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1029   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1030                    ECHO_T='     ' ;;
1031   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1032   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1033 esac
1034 echo "#! $SHELL" >conftest.sh
1035 echo  "exit 0"   >>conftest.sh
1036 chmod +x conftest.sh
1037 if { (echo "$as_me:1037: PATH=\".;.\"; conftest.sh") >&5
1038   (PATH=".;."; conftest.sh) 2>&5
1039   ac_status=$?
1040   echo "$as_me:1040: \$? = $ac_status" >&5
1041   (exit $ac_status); }; then
1042   ac_path_separator=';'
1043 else
1044   ac_path_separator=:
1045 fi
1046 PATH_SEPARATOR="$ac_path_separator"
1047 rm -f conftest.sh
1048
1049 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1050
1051 top_builddir=`pwd`
1052
1053 ac_aux_dir=
1054 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1055   if test -f $ac_dir/install-sh; then
1056     ac_aux_dir=$ac_dir
1057     ac_install_sh="$ac_aux_dir/install-sh -c"
1058     break
1059   elif test -f $ac_dir/install.sh; then
1060     ac_aux_dir=$ac_dir
1061     ac_install_sh="$ac_aux_dir/install.sh -c"
1062     break
1063   elif test -f $ac_dir/shtool; then
1064     ac_aux_dir=$ac_dir
1065     ac_install_sh="$ac_aux_dir/shtool install -c"
1066     break
1067   fi
1068 done
1069 if test -z "$ac_aux_dir"; then
1070   { { echo "$as_me:1070: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1071 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1072    { (exit 1); exit 1; }; }
1073 fi
1074 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1075 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1076 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1077
1078 # Make sure we can run config.sub.
1079 $ac_config_sub sun4 >/dev/null 2>&1 ||
1080   { { echo "$as_me:1080: error: cannot run $ac_config_sub" >&5
1081 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1082    { (exit 1); exit 1; }; }
1083
1084 echo "$as_me:1084: checking build system type" >&5
1085 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1086 if test "${ac_cv_build+set}" = set; then
1087   echo $ECHO_N "(cached) $ECHO_C" >&6
1088 else
1089   ac_cv_build_alias=$build_alias
1090 test -z "$ac_cv_build_alias" &&
1091   ac_cv_build_alias=`$ac_config_guess`
1092 test -z "$ac_cv_build_alias" &&
1093   { { echo "$as_me:1093: error: cannot guess build type; you must specify one" >&5
1094 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1095    { (exit 1); exit 1; }; }
1096 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1097   { { echo "$as_me:1097: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1098 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1099    { (exit 1); exit 1; }; }
1100
1101 fi
1102 echo "$as_me:1102: result: $ac_cv_build" >&5
1103 echo "${ECHO_T}$ac_cv_build" >&6
1104 build=$ac_cv_build
1105 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1106 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1107 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1108
1109 echo "$as_me:1109: checking host system type" >&5
1110 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1111 if test "${ac_cv_host+set}" = set; then
1112   echo $ECHO_N "(cached) $ECHO_C" >&6
1113 else
1114   ac_cv_host_alias=$host_alias
1115 test -z "$ac_cv_host_alias" &&
1116   ac_cv_host_alias=$ac_cv_build_alias
1117 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1118   { { echo "$as_me:1118: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1119 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1120    { (exit 1); exit 1; }; }
1121
1122 fi
1123 echo "$as_me:1123: result: $ac_cv_host" >&5
1124 echo "${ECHO_T}$ac_cv_host" >&6
1125 host=$ac_cv_host
1126 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1127 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1128 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1129
1130 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1131         echo "$as_me:1131: checking target system type" >&5
1132 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1133 if test "${ac_cv_target+set}" = set; then
1134   echo $ECHO_N "(cached) $ECHO_C" >&6
1135 else
1136   ac_cv_target_alias=$target_alias
1137 test "x$ac_cv_target_alias" = "x" &&
1138   ac_cv_target_alias=$ac_cv_host_alias
1139 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1140   { { echo "$as_me:1140: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1141 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1142    { (exit 1); exit 1; }; }
1143
1144 fi
1145 echo "$as_me:1145: result: $ac_cv_target" >&5
1146 echo "${ECHO_T}$ac_cv_target" >&6
1147 target=$ac_cv_target
1148 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1149 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1150 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1151
1152 # The aliases save the names the user supplied, while $host etc.
1153 # will get canonicalized.
1154 test -n "$target_alias" &&
1155   test "$program_prefix$program_suffix$program_transform_name" = \
1156     NONENONEs,x,x, &&
1157   program_prefix=${target_alias}-
1158         system_name="$host_os"
1159 else
1160         system_name="`(uname -s -r) 2>/dev/null`"
1161         if test -z "$system_name" ; then
1162                 system_name="`(hostname) 2>/dev/null`"
1163         fi
1164 fi
1165 test -n "$system_name" &&
1166 cat >>confdefs.h <<EOF
1167 #define SYSTEM_NAME "$system_name"
1168 EOF
1169
1170 if test "${cf_cv_system_name+set}" = set; then
1171   echo $ECHO_N "(cached) $ECHO_C" >&6
1172 else
1173   cf_cv_system_name="$system_name"
1174 fi
1175
1176 test -z "$system_name" && system_name="$cf_cv_system_name"
1177 test -n "$cf_cv_system_name" && echo "$as_me:1177: result: Configuring for $cf_cv_system_name" >&5
1178 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1179
1180 if test ".$system_name" != ".$cf_cv_system_name" ; then
1181         echo "$as_me:1181: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1182 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1183         { { echo "$as_me:1183: error: \"Please remove config.cache and try again.\"" >&5
1184 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1185    { (exit 1); exit 1; }; }
1186 fi
1187
1188 # Check whether --with-system-type or --without-system-type was given.
1189 if test "${with_system_type+set}" = set; then
1190   withval="$with_system_type"
1191   { echo "$as_me:1191: WARNING: overriding system type to $withval" >&5
1192 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1193         cf_cv_system_name=$withval
1194         host_os=$withval
1195
1196 fi;
1197
1198 ###     Save the given $CFLAGS to allow user-override.
1199 cf_user_CFLAGS="$CFLAGS"
1200
1201 ###     Default install-location
1202
1203 echo "$as_me:1203: checking for prefix" >&5
1204 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1205 if test "x$prefix" = "xNONE" ; then
1206         case "$cf_cv_system_name" in
1207                 # non-vendor systems don't have a conflict
1208         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1209                 prefix=/usr
1210                 ;;
1211         (*)     prefix=$ac_default_prefix
1212                 ;;
1213         esac
1214 fi
1215 echo "$as_me:1215: result: $prefix" >&5
1216 echo "${ECHO_T}$prefix" >&6
1217
1218 if test "x$prefix" = "xNONE" ; then
1219 echo "$as_me:1219: checking for default include-directory" >&5
1220 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1221 test -n "$verbose" && echo 1>&6
1222 for cf_symbol in \
1223         $includedir \
1224         $includedir/ncurses \
1225         $prefix/include \
1226         $prefix/include/ncurses \
1227         /usr/local/include \
1228         /usr/local/include/ncurses \
1229         /usr/include \
1230         /usr/include/ncurses
1231 do
1232         cf_dir=`eval echo $cf_symbol`
1233         if test -f $cf_dir/curses.h ; then
1234         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1235                 includedir="$cf_symbol"
1236                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1237                 break
1238         fi
1239         fi
1240         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1241 done
1242 echo "$as_me:1242: result: $includedir" >&5
1243 echo "${ECHO_T}$includedir" >&6
1244 fi
1245
1246 ###     Checks for programs.
1247
1248 ac_ext=c
1249 ac_cpp='$CPP $CPPFLAGS'
1250 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1251 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1252 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1253 ac_main_return=return
1254 if test -n "$ac_tool_prefix"; then
1255   for ac_prog in gnatgcc gcc cc
1256   do
1257     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1258 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1259 echo "$as_me:1259: checking for $ac_word" >&5
1260 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1261 if test "${ac_cv_prog_CC+set}" = set; then
1262   echo $ECHO_N "(cached) $ECHO_C" >&6
1263 else
1264   if test -n "$CC"; then
1265   ac_cv_prog_CC="$CC" # Let the user override the test.
1266 else
1267   ac_save_IFS=$IFS; IFS=$ac_path_separator
1268 ac_dummy="$PATH"
1269 for ac_dir in $ac_dummy; do
1270   IFS=$ac_save_IFS
1271   test -z "$ac_dir" && ac_dir=.
1272   $as_executable_p "$ac_dir/$ac_word" || continue
1273 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1274 echo "$as_me:1274: found $ac_dir/$ac_word" >&5
1275 break
1276 done
1277
1278 fi
1279 fi
1280 CC=$ac_cv_prog_CC
1281 if test -n "$CC"; then
1282   echo "$as_me:1282: result: $CC" >&5
1283 echo "${ECHO_T}$CC" >&6
1284 else
1285   echo "$as_me:1285: result: no" >&5
1286 echo "${ECHO_T}no" >&6
1287 fi
1288
1289     test -n "$CC" && break
1290   done
1291 fi
1292 if test -z "$CC"; then
1293   ac_ct_CC=$CC
1294   for ac_prog in gnatgcc gcc cc
1295 do
1296   # Extract the first word of "$ac_prog", so it can be a program name with args.
1297 set dummy $ac_prog; ac_word=$2
1298 echo "$as_me:1298: checking for $ac_word" >&5
1299 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1300 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1301   echo $ECHO_N "(cached) $ECHO_C" >&6
1302 else
1303   if test -n "$ac_ct_CC"; then
1304   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1305 else
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 ac_cv_prog_ac_ct_CC="$ac_prog"
1313 echo "$as_me:1313: found $ac_dir/$ac_word" >&5
1314 break
1315 done
1316
1317 fi
1318 fi
1319 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1320 if test -n "$ac_ct_CC"; then
1321   echo "$as_me:1321: result: $ac_ct_CC" >&5
1322 echo "${ECHO_T}$ac_ct_CC" >&6
1323 else
1324   echo "$as_me:1324: result: no" >&5
1325 echo "${ECHO_T}no" >&6
1326 fi
1327
1328   test -n "$ac_ct_CC" && break
1329 done
1330
1331   CC=$ac_ct_CC
1332 fi
1333
1334 test -z "$CC" && { { echo "$as_me:1334: error: no acceptable cc found in \$PATH" >&5
1335 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1336    { (exit 1); exit 1; }; }
1337
1338 # Provide some information about the compiler.
1339 echo "$as_me:1339:" \
1340      "checking for C compiler version" >&5
1341 ac_compiler=`set X $ac_compile; echo $2`
1342 { (eval echo "$as_me:1342: \"$ac_compiler --version </dev/null >&5\"") >&5
1343   (eval $ac_compiler --version </dev/null >&5) 2>&5
1344   ac_status=$?
1345   echo "$as_me:1345: \$? = $ac_status" >&5
1346   (exit $ac_status); }
1347 { (eval echo "$as_me:1347: \"$ac_compiler -v </dev/null >&5\"") >&5
1348   (eval $ac_compiler -v </dev/null >&5) 2>&5
1349   ac_status=$?
1350   echo "$as_me:1350: \$? = $ac_status" >&5
1351   (exit $ac_status); }
1352 { (eval echo "$as_me:1352: \"$ac_compiler -V </dev/null >&5\"") >&5
1353   (eval $ac_compiler -V </dev/null >&5) 2>&5
1354   ac_status=$?
1355   echo "$as_me:1355: \$? = $ac_status" >&5
1356   (exit $ac_status); }
1357
1358 cat >conftest.$ac_ext <<_ACEOF
1359 #line 1359 "configure"
1360 #include "confdefs.h"
1361
1362 int
1363 main (void)
1364 {
1365
1366   ;
1367   return 0;
1368 }
1369 _ACEOF
1370 ac_clean_files_save=$ac_clean_files
1371 ac_clean_files="$ac_clean_files a.out a.exe"
1372 # Try to create an executable without -o first, disregard a.out.
1373 # It will help us diagnose broken compilers, and finding out an intuition
1374 # of exeext.
1375 echo "$as_me:1375: checking for C compiler default output" >&5
1376 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1377 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1378 if { (eval echo "$as_me:1378: \"$ac_link_default\"") >&5
1379   (eval $ac_link_default) 2>&5
1380   ac_status=$?
1381   echo "$as_me:1381: \$? = $ac_status" >&5
1382   (exit $ac_status); }; then
1383   # Find the output, starting from the most likely.  This scheme is
1384 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1385 # resort.
1386 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1387                 ls a.out conftest 2>/dev/null;
1388                 ls a.* conftest.* 2>/dev/null`; do
1389   case $ac_file in
1390     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1391     a.out ) # We found the default executable, but exeext='' is most
1392             # certainly right.
1393             break;;
1394     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1395           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1396           export ac_cv_exeext
1397           break;;
1398     * ) break;;
1399   esac
1400 done
1401 else
1402   echo "$as_me: failed program was:" >&5
1403 cat conftest.$ac_ext >&5
1404 { { echo "$as_me:1404: error: C compiler cannot create executables" >&5
1405 echo "$as_me: error: C compiler cannot create executables" >&2;}
1406    { (exit 77); exit 77; }; }
1407 fi
1408
1409 ac_exeext=$ac_cv_exeext
1410 echo "$as_me:1410: result: $ac_file" >&5
1411 echo "${ECHO_T}$ac_file" >&6
1412
1413 # Check the compiler produces executables we can run.  If not, either
1414 # the compiler is broken, or we cross compile.
1415 echo "$as_me:1415: checking whether the C compiler works" >&5
1416 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1417 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1418 # If not cross compiling, check that we can run a simple program.
1419 if test "$cross_compiling" != yes; then
1420   if { ac_try='./$ac_file'
1421   { (eval echo "$as_me:1421: \"$ac_try\"") >&5
1422   (eval $ac_try) 2>&5
1423   ac_status=$?
1424   echo "$as_me:1424: \$? = $ac_status" >&5
1425   (exit $ac_status); }; }; then
1426     cross_compiling=no
1427   else
1428     if test "$cross_compiling" = maybe; then
1429         cross_compiling=yes
1430     else
1431         { { echo "$as_me:1431: error: cannot run C compiled programs.
1432 If you meant to cross compile, use \`--host'." >&5
1433 echo "$as_me: error: cannot run C compiled programs.
1434 If you meant to cross compile, use \`--host'." >&2;}
1435    { (exit 1); exit 1; }; }
1436     fi
1437   fi
1438 fi
1439 echo "$as_me:1439: result: yes" >&5
1440 echo "${ECHO_T}yes" >&6
1441
1442 rm -f a.out a.exe conftest$ac_cv_exeext
1443 ac_clean_files=$ac_clean_files_save
1444 # Check the compiler produces executables we can run.  If not, either
1445 # the compiler is broken, or we cross compile.
1446 echo "$as_me:1446: checking whether we are cross compiling" >&5
1447 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1448 echo "$as_me:1448: result: $cross_compiling" >&5
1449 echo "${ECHO_T}$cross_compiling" >&6
1450
1451 echo "$as_me:1451: checking for executable suffix" >&5
1452 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1453 if { (eval echo "$as_me:1453: \"$ac_link\"") >&5
1454   (eval $ac_link) 2>&5
1455   ac_status=$?
1456   echo "$as_me:1456: \$? = $ac_status" >&5
1457   (exit $ac_status); }; then
1458   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1459 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1460 # work properly (i.e., refer to `conftest.exe'), while it won't with
1461 # `rm'.
1462 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1463   case $ac_file in
1464     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1465     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1466           export ac_cv_exeext
1467           break;;
1468     * ) break;;
1469   esac
1470 done
1471 else
1472   { { echo "$as_me:1472: error: cannot compute EXEEXT: cannot compile and link" >&5
1473 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1474    { (exit 1); exit 1; }; }
1475 fi
1476
1477 rm -f conftest$ac_cv_exeext
1478 echo "$as_me:1478: result: $ac_cv_exeext" >&5
1479 echo "${ECHO_T}$ac_cv_exeext" >&6
1480
1481 rm -f conftest.$ac_ext
1482 EXEEXT=$ac_cv_exeext
1483 ac_exeext=$EXEEXT
1484 echo "$as_me:1484: checking for object suffix" >&5
1485 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1486 if test "${ac_cv_objext+set}" = set; then
1487   echo $ECHO_N "(cached) $ECHO_C" >&6
1488 else
1489   cat >conftest.$ac_ext <<_ACEOF
1490 #line 1490 "configure"
1491 #include "confdefs.h"
1492
1493 int
1494 main (void)
1495 {
1496
1497   ;
1498   return 0;
1499 }
1500 _ACEOF
1501 rm -f conftest.o conftest.obj
1502 if { (eval echo "$as_me:1502: \"$ac_compile\"") >&5
1503   (eval $ac_compile) 2>&5
1504   ac_status=$?
1505   echo "$as_me:1505: \$? = $ac_status" >&5
1506   (exit $ac_status); }; then
1507   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1508   case $ac_file in
1509     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1510     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1511        break;;
1512   esac
1513 done
1514 else
1515   echo "$as_me: failed program was:" >&5
1516 cat conftest.$ac_ext >&5
1517 { { echo "$as_me:1517: error: cannot compute OBJEXT: cannot compile" >&5
1518 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1519    { (exit 1); exit 1; }; }
1520 fi
1521
1522 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1523 fi
1524 echo "$as_me:1524: result: $ac_cv_objext" >&5
1525 echo "${ECHO_T}$ac_cv_objext" >&6
1526 OBJEXT=$ac_cv_objext
1527 ac_objext=$OBJEXT
1528 echo "$as_me:1528: checking whether we are using the GNU C compiler" >&5
1529 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1530 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1531   echo $ECHO_N "(cached) $ECHO_C" >&6
1532 else
1533   cat >conftest.$ac_ext <<_ACEOF
1534 #line 1534 "configure"
1535 #include "confdefs.h"
1536
1537 int
1538 main (void)
1539 {
1540 #ifndef __GNUC__
1541        choke me
1542 #endif
1543
1544   ;
1545   return 0;
1546 }
1547 _ACEOF
1548 rm -f conftest.$ac_objext
1549 if { (eval echo "$as_me:1549: \"$ac_compile\"") >&5
1550   (eval $ac_compile) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); } &&
1554          { ac_try='test -s conftest.$ac_objext'
1555   { (eval echo "$as_me:1555: \"$ac_try\"") >&5
1556   (eval $ac_try) 2>&5
1557   ac_status=$?
1558   echo "$as_me:1558: \$? = $ac_status" >&5
1559   (exit $ac_status); }; }; then
1560   ac_compiler_gnu=yes
1561 else
1562   echo "$as_me: failed program was:" >&5
1563 cat conftest.$ac_ext >&5
1564 ac_compiler_gnu=no
1565 fi
1566 rm -f conftest.$ac_objext conftest.$ac_ext
1567 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1568
1569 fi
1570 echo "$as_me:1570: result: $ac_cv_c_compiler_gnu" >&5
1571 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1572 GCC=`test $ac_compiler_gnu = yes && echo yes`
1573 ac_test_CFLAGS=${CFLAGS+set}
1574 ac_save_CFLAGS=$CFLAGS
1575 CFLAGS="-g"
1576 echo "$as_me:1576: checking whether $CC accepts -g" >&5
1577 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1578 if test "${ac_cv_prog_cc_g+set}" = set; then
1579   echo $ECHO_N "(cached) $ECHO_C" >&6
1580 else
1581   cat >conftest.$ac_ext <<_ACEOF
1582 #line 1582 "configure"
1583 #include "confdefs.h"
1584
1585 int
1586 main (void)
1587 {
1588
1589   ;
1590   return 0;
1591 }
1592 _ACEOF
1593 rm -f conftest.$ac_objext
1594 if { (eval echo "$as_me:1594: \"$ac_compile\"") >&5
1595   (eval $ac_compile) 2>&5
1596   ac_status=$?
1597   echo "$as_me:1597: \$? = $ac_status" >&5
1598   (exit $ac_status); } &&
1599          { ac_try='test -s conftest.$ac_objext'
1600   { (eval echo "$as_me:1600: \"$ac_try\"") >&5
1601   (eval $ac_try) 2>&5
1602   ac_status=$?
1603   echo "$as_me:1603: \$? = $ac_status" >&5
1604   (exit $ac_status); }; }; then
1605   ac_cv_prog_cc_g=yes
1606 else
1607   echo "$as_me: failed program was:" >&5
1608 cat conftest.$ac_ext >&5
1609 ac_cv_prog_cc_g=no
1610 fi
1611 rm -f conftest.$ac_objext conftest.$ac_ext
1612 fi
1613 echo "$as_me:1613: result: $ac_cv_prog_cc_g" >&5
1614 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1615 if test "$ac_test_CFLAGS" = set; then
1616   CFLAGS=$ac_save_CFLAGS
1617 elif test $ac_cv_prog_cc_g = yes; then
1618   if test "$GCC" = yes; then
1619     CFLAGS="-g -O2"
1620   else
1621     CFLAGS="-g"
1622   fi
1623 else
1624   if test "$GCC" = yes; then
1625     CFLAGS="-O2"
1626   else
1627     CFLAGS=
1628   fi
1629 fi
1630 # Some people use a C++ compiler to compile C.  Since we use `exit',
1631 # in C++ we need to declare it.  In case someone uses the same compiler
1632 # for both compiling C and C++ we need to have the C++ compiler decide
1633 # the declaration of exit, since it's the most demanding environment.
1634 cat >conftest.$ac_ext <<_ACEOF
1635 #ifndef __cplusplus
1636   choke me
1637 #endif
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   for ac_declaration in \
1652    ''\
1653    '#include <stdlib.h>' \
1654    'extern "C" void std::exit (int) throw (); using std::exit;' \
1655    'extern "C" void std::exit (int); using std::exit;' \
1656    'extern "C" void exit (int) throw ();' \
1657    'extern "C" void exit (int);' \
1658    'void exit (int);'
1659 do
1660   cat >conftest.$ac_ext <<_ACEOF
1661 #line 1661 "configure"
1662 #include "confdefs.h"
1663 #include <stdlib.h>
1664 $ac_declaration
1665 int
1666 main (void)
1667 {
1668 exit (42);
1669   ;
1670   return 0;
1671 }
1672 _ACEOF
1673 rm -f conftest.$ac_objext
1674 if { (eval echo "$as_me:1674: \"$ac_compile\"") >&5
1675   (eval $ac_compile) 2>&5
1676   ac_status=$?
1677   echo "$as_me:1677: \$? = $ac_status" >&5
1678   (exit $ac_status); } &&
1679          { ac_try='test -s conftest.$ac_objext'
1680   { (eval echo "$as_me:1680: \"$ac_try\"") >&5
1681   (eval $ac_try) 2>&5
1682   ac_status=$?
1683   echo "$as_me:1683: \$? = $ac_status" >&5
1684   (exit $ac_status); }; }; then
1685   :
1686 else
1687   echo "$as_me: failed program was:" >&5
1688 cat conftest.$ac_ext >&5
1689 continue
1690 fi
1691 rm -f conftest.$ac_objext conftest.$ac_ext
1692   cat >conftest.$ac_ext <<_ACEOF
1693 #line 1693 "configure"
1694 #include "confdefs.h"
1695 $ac_declaration
1696 int
1697 main (void)
1698 {
1699 exit (42);
1700   ;
1701   return 0;
1702 }
1703 _ACEOF
1704 rm -f conftest.$ac_objext
1705 if { (eval echo "$as_me:1705: \"$ac_compile\"") >&5
1706   (eval $ac_compile) 2>&5
1707   ac_status=$?
1708   echo "$as_me:1708: \$? = $ac_status" >&5
1709   (exit $ac_status); } &&
1710          { ac_try='test -s conftest.$ac_objext'
1711   { (eval echo "$as_me:1711: \"$ac_try\"") >&5
1712   (eval $ac_try) 2>&5
1713   ac_status=$?
1714   echo "$as_me:1714: \$? = $ac_status" >&5
1715   (exit $ac_status); }; }; then
1716   break
1717 else
1718   echo "$as_me: failed program was:" >&5
1719 cat conftest.$ac_ext >&5
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 done
1723 rm -rf conftest*
1724 if test -n "$ac_declaration"; then
1725   echo '#ifdef __cplusplus' >>confdefs.h
1726   echo $ac_declaration      >>confdefs.h
1727   echo '#endif'             >>confdefs.h
1728 fi
1729
1730 else
1731   echo "$as_me: failed program was:" >&5
1732 cat conftest.$ac_ext >&5
1733 fi
1734 rm -f conftest.$ac_objext conftest.$ac_ext
1735 ac_ext=c
1736 ac_cpp='$CPP $CPPFLAGS'
1737 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1738 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1739 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1740 ac_main_return=return
1741
1742 GCC_VERSION=none
1743 if test "$GCC" = yes ; then
1744         echo "$as_me:1744: checking version of $CC" >&5
1745 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1746         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.].*//'`"
1747         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1748         echo "$as_me:1748: result: $GCC_VERSION" >&5
1749 echo "${ECHO_T}$GCC_VERSION" >&6
1750 fi
1751
1752 INTEL_COMPILER=no
1753
1754 if test "$GCC" = yes ; then
1755         case $host_os in
1756         (linux*|gnu*)
1757                 echo "$as_me:1757: checking if this is really Intel C compiler" >&5
1758 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1759                 cf_save_CFLAGS="$CFLAGS"
1760                 CFLAGS="$CFLAGS -no-gcc"
1761                 cat >conftest.$ac_ext <<_ACEOF
1762 #line 1762 "configure"
1763 #include "confdefs.h"
1764
1765 int
1766 main (void)
1767 {
1768
1769 #ifdef __INTEL_COMPILER
1770 #else
1771 make an error
1772 #endif
1773
1774   ;
1775   return 0;
1776 }
1777 _ACEOF
1778 rm -f conftest.$ac_objext
1779 if { (eval echo "$as_me:1779: \"$ac_compile\"") >&5
1780   (eval $ac_compile) 2>&5
1781   ac_status=$?
1782   echo "$as_me:1782: \$? = $ac_status" >&5
1783   (exit $ac_status); } &&
1784          { ac_try='test -s conftest.$ac_objext'
1785   { (eval echo "$as_me:1785: \"$ac_try\"") >&5
1786   (eval $ac_try) 2>&5
1787   ac_status=$?
1788   echo "$as_me:1788: \$? = $ac_status" >&5
1789   (exit $ac_status); }; }; then
1790   INTEL_COMPILER=yes
1791 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1792
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 fi
1797 rm -f conftest.$ac_objext conftest.$ac_ext
1798                 CFLAGS="$cf_save_CFLAGS"
1799                 echo "$as_me:1799: result: $INTEL_COMPILER" >&5
1800 echo "${ECHO_T}$INTEL_COMPILER" >&6
1801                 ;;
1802         esac
1803 fi
1804
1805 CLANG_COMPILER=no
1806
1807 if test "$GCC" = yes ; then
1808         echo "$as_me:1808: checking if this is really Clang C compiler" >&5
1809 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1810         cf_save_CFLAGS="$CFLAGS"
1811         CFLAGS="$CFLAGS -Qunused-arguments"
1812         cat >conftest.$ac_ext <<_ACEOF
1813 #line 1813 "configure"
1814 #include "confdefs.h"
1815
1816 int
1817 main (void)
1818 {
1819
1820 #ifdef __clang__
1821 #else
1822 make an error
1823 #endif
1824
1825   ;
1826   return 0;
1827 }
1828 _ACEOF
1829 rm -f conftest.$ac_objext
1830 if { (eval echo "$as_me:1830: \"$ac_compile\"") >&5
1831   (eval $ac_compile) 2>&5
1832   ac_status=$?
1833   echo "$as_me:1833: \$? = $ac_status" >&5
1834   (exit $ac_status); } &&
1835          { ac_try='test -s conftest.$ac_objext'
1836   { (eval echo "$as_me:1836: \"$ac_try\"") >&5
1837   (eval $ac_try) 2>&5
1838   ac_status=$?
1839   echo "$as_me:1839: \$? = $ac_status" >&5
1840   (exit $ac_status); }; }; then
1841   CLANG_COMPILER=yes
1842 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1843
1844 else
1845   echo "$as_me: failed program was:" >&5
1846 cat conftest.$ac_ext >&5
1847 fi
1848 rm -f conftest.$ac_objext conftest.$ac_ext
1849         CFLAGS="$cf_save_CFLAGS"
1850         echo "$as_me:1850: result: $CLANG_COMPILER" >&5
1851 echo "${ECHO_T}$CLANG_COMPILER" >&6
1852 fi
1853
1854 if test "x$CLANG_COMPILER" = "xyes" ; then
1855
1856         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1857         CFLAGS="${CFLAGS}-Wno-error=implicit-function-declaration"
1858
1859 fi
1860
1861 echo "$as_me:1861: checking for $CC option to accept ANSI C" >&5
1862 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1863 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1864   echo $ECHO_N "(cached) $ECHO_C" >&6
1865 else
1866   ac_cv_prog_cc_stdc=no
1867 ac_save_CC=$CC
1868 cat >conftest.$ac_ext <<_ACEOF
1869 #line 1869 "configure"
1870 #include "confdefs.h"
1871 #include <stdarg.h>
1872 #include <stdio.h>
1873 #include <sys/types.h>
1874 #include <sys/stat.h>
1875 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1876 struct buf { int x; };
1877 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1878 static char *e (p, i)
1879      char **p;
1880      int i;
1881 {
1882   return p[i];
1883 }
1884 static char *f (char * (*g) (char **, int), char **p, ...)
1885 {
1886   char *s;
1887   va_list v;
1888   va_start (v,p);
1889   s = g (p, va_arg (v,int));
1890   va_end (v);
1891   return s;
1892 }
1893 int test (int i, double x);
1894 struct s1 {int (*f) (int a);};
1895 struct s2 {int (*f) (double a);};
1896 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1897 int argc;
1898 char **argv;
1899 int
1900 main (void)
1901 {
1902 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1903   ;
1904   return 0;
1905 }
1906 _ACEOF
1907 # Don't try gcc -ansi; that turns off useful extensions and
1908 # breaks some systems' header files.
1909 # AIX                   -qlanglvl=ansi
1910 # Ultrix and OSF/1      -std1
1911 # HP-UX 10.20 and later -Ae
1912 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1913 # SVR4                  -Xc -D__EXTENSIONS__
1914 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1915 do
1916   CC="$ac_save_CC $ac_arg"
1917   rm -f conftest.$ac_objext
1918 if { (eval echo "$as_me:1918: \"$ac_compile\"") >&5
1919   (eval $ac_compile) 2>&5
1920   ac_status=$?
1921   echo "$as_me:1921: \$? = $ac_status" >&5
1922   (exit $ac_status); } &&
1923          { ac_try='test -s conftest.$ac_objext'
1924   { (eval echo "$as_me:1924: \"$ac_try\"") >&5
1925   (eval $ac_try) 2>&5
1926   ac_status=$?
1927   echo "$as_me:1927: \$? = $ac_status" >&5
1928   (exit $ac_status); }; }; then
1929   ac_cv_prog_cc_stdc=$ac_arg
1930 break
1931 else
1932   echo "$as_me: failed program was:" >&5
1933 cat conftest.$ac_ext >&5
1934 fi
1935 rm -f conftest.$ac_objext
1936 done
1937 rm -f conftest.$ac_ext conftest.$ac_objext
1938 CC=$ac_save_CC
1939
1940 fi
1941
1942 case "x$ac_cv_prog_cc_stdc" in
1943   x|xno)
1944     echo "$as_me:1944: result: none needed" >&5
1945 echo "${ECHO_T}none needed" >&6 ;;
1946   *)
1947     echo "$as_me:1947: result: $ac_cv_prog_cc_stdc" >&5
1948 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1949     CC="$CC $ac_cv_prog_cc_stdc" ;;
1950 esac
1951
1952 # This should have been defined by AC_PROG_CC
1953 : ${CC:=cc}
1954
1955 echo "$as_me:1955: checking \$CFLAGS variable" >&5
1956 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1957 case "x$CFLAGS" in
1958 (*-[IUD]*)
1959         echo "$as_me:1959: result: broken" >&5
1960 echo "${ECHO_T}broken" >&6
1961         { echo "$as_me:1961: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1962 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1963         cf_flags="$CFLAGS"
1964         CFLAGS=
1965         for cf_arg in $cf_flags
1966         do
1967
1968 cf_fix_cppflags=no
1969 cf_new_cflags=
1970 cf_new_cppflags=
1971 cf_new_extra_cppflags=
1972
1973 for cf_add_cflags in $cf_arg
1974 do
1975 case $cf_fix_cppflags in
1976 (no)
1977         case $cf_add_cflags in
1978         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1979                 case $cf_add_cflags in
1980                 (-D*)
1981                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1982
1983                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1984                                 && test -z "${cf_tst_cflags}" \
1985                                 && cf_fix_cppflags=yes
1986
1987                         if test $cf_fix_cppflags = yes ; then
1988
1989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1991
1992                                 continue
1993                         elif test "${cf_tst_cflags}" = "\"'" ; then
1994
1995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1997
1998                                 continue
1999                         fi
2000                         ;;
2001                 esac
2002                 case "$CPPFLAGS" in
2003                 (*$cf_add_cflags)
2004                         ;;
2005                 (*)
2006                         case $cf_add_cflags in
2007                         (-D*)
2008                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2009
2010 CPPFLAGS=`echo "$CPPFLAGS" | \
2011         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2012                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2013
2014                                 ;;
2015                         esac
2016
2017         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2018         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2019
2020                         ;;
2021                 esac
2022                 ;;
2023         (*)
2024
2025         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2026         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2027
2028                 ;;
2029         esac
2030         ;;
2031 (yes)
2032
2033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2035
2036         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2037
2038         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2039                 && test -z "${cf_tst_cflags}" \
2040                 && cf_fix_cppflags=no
2041         ;;
2042 esac
2043 done
2044
2045 if test -n "$cf_new_cflags" ; then
2046
2047         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2048         CFLAGS="${CFLAGS}$cf_new_cflags"
2049
2050 fi
2051
2052 if test -n "$cf_new_cppflags" ; then
2053
2054         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2055         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2056
2057 fi
2058
2059 if test -n "$cf_new_extra_cppflags" ; then
2060
2061         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2062         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2063
2064 fi
2065
2066         done
2067         ;;
2068 (*)
2069         echo "$as_me:2069: result: ok" >&5
2070 echo "${ECHO_T}ok" >&6
2071         ;;
2072 esac
2073
2074 echo "$as_me:2074: checking \$CC variable" >&5
2075 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2076 case "$CC" in
2077 (*[\ \  ]-*)
2078         echo "$as_me:2078: result: broken" >&5
2079 echo "${ECHO_T}broken" >&6
2080         { echo "$as_me:2080: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2081 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2082         # humor him...
2083         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2084         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2085         CC="$cf_prog"
2086         for cf_arg in $cf_flags
2087         do
2088                 case "x$cf_arg" in
2089                 (x-[IUDfgOW]*)
2090
2091 cf_fix_cppflags=no
2092 cf_new_cflags=
2093 cf_new_cppflags=
2094 cf_new_extra_cppflags=
2095
2096 for cf_add_cflags in $cf_arg
2097 do
2098 case $cf_fix_cppflags in
2099 (no)
2100         case $cf_add_cflags in
2101         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2102                 case $cf_add_cflags in
2103                 (-D*)
2104                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2105
2106                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2107                                 && test -z "${cf_tst_cflags}" \
2108                                 && cf_fix_cppflags=yes
2109
2110                         if test $cf_fix_cppflags = yes ; then
2111
2112         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2113         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2114
2115                                 continue
2116                         elif test "${cf_tst_cflags}" = "\"'" ; then
2117
2118         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2119         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2120
2121                                 continue
2122                         fi
2123                         ;;
2124                 esac
2125                 case "$CPPFLAGS" in
2126                 (*$cf_add_cflags)
2127                         ;;
2128                 (*)
2129                         case $cf_add_cflags in
2130                         (-D*)
2131                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2132
2133 CPPFLAGS=`echo "$CPPFLAGS" | \
2134         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2135                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2136
2137                                 ;;
2138                         esac
2139
2140         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2141         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2142
2143                         ;;
2144                 esac
2145                 ;;
2146         (*)
2147
2148         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2149         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2150
2151                 ;;
2152         esac
2153         ;;
2154 (yes)
2155
2156         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2157         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2158
2159         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2160
2161         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2162                 && test -z "${cf_tst_cflags}" \
2163                 && cf_fix_cppflags=no
2164         ;;
2165 esac
2166 done
2167
2168 if test -n "$cf_new_cflags" ; then
2169
2170         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2171         CFLAGS="${CFLAGS}$cf_new_cflags"
2172
2173 fi
2174
2175 if test -n "$cf_new_cppflags" ; then
2176
2177         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2178         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2179
2180 fi
2181
2182 if test -n "$cf_new_extra_cppflags" ; then
2183
2184         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2185         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2186
2187 fi
2188
2189                         ;;
2190                 (*)
2191                         CC="$CC $cf_arg"
2192                         ;;
2193                 esac
2194         done
2195         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2196
2197 echo "${as_me:-configure}:2197: testing resulting CC: '$CC' ..." 1>&5
2198
2199         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2200
2201 echo "${as_me:-configure}:2201: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2202
2203         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2204
2205 echo "${as_me:-configure}:2205: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2206
2207         ;;
2208 (*)
2209         echo "$as_me:2209: result: ok" >&5
2210 echo "${ECHO_T}ok" >&6
2211         ;;
2212 esac
2213
2214 ac_ext=c
2215 ac_cpp='$CPP $CPPFLAGS'
2216 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2217 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2218 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2219 ac_main_return=return
2220 echo "$as_me:2220: checking how to run the C preprocessor" >&5
2221 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2222 # On Suns, sometimes $CPP names a directory.
2223 if test -n "$CPP" && test -d "$CPP"; then
2224   CPP=
2225 fi
2226 if test -z "$CPP"; then
2227   if test "${ac_cv_prog_CPP+set}" = set; then
2228   echo $ECHO_N "(cached) $ECHO_C" >&6
2229 else
2230       # Double quotes because CPP needs to be expanded
2231     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2232     do
2233       ac_preproc_ok=false
2234 for ac_c_preproc_warn_flag in '' yes
2235 do
2236   # Use a header file that comes with gcc, so configuring glibc
2237   # with a fresh cross-compiler works.
2238   # On the NeXT, cc -E runs the code through the compiler's parser,
2239   # not just through cpp. "Syntax error" is here to catch this case.
2240   cat >conftest.$ac_ext <<_ACEOF
2241 #line 2241 "configure"
2242 #include "confdefs.h"
2243 #include <assert.h>
2244                      Syntax error
2245 _ACEOF
2246 if { (eval echo "$as_me:2246: \"$ac_cpp conftest.$ac_ext\"") >&5
2247   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2248   ac_status=$?
2249   egrep -v '^ *\+' conftest.er1 >conftest.err
2250   rm -f conftest.er1
2251   cat conftest.err >&5
2252   echo "$as_me:2252: \$? = $ac_status" >&5
2253   (exit $ac_status); } >/dev/null; then
2254   if test -s conftest.err; then
2255     ac_cpp_err=$ac_c_preproc_warn_flag
2256   else
2257     ac_cpp_err=
2258   fi
2259 else
2260   ac_cpp_err=yes
2261 fi
2262 if test -z "$ac_cpp_err"; then
2263   :
2264 else
2265   echo "$as_me: failed program was:" >&5
2266   cat conftest.$ac_ext >&5
2267   # Broken: fails on valid input.
2268 continue
2269 fi
2270 rm -f conftest.err conftest.$ac_ext
2271
2272   # OK, works on sane cases.  Now check whether non-existent headers
2273   # can be detected and how.
2274   cat >conftest.$ac_ext <<_ACEOF
2275 #line 2275 "configure"
2276 #include "confdefs.h"
2277 #include <ac_nonexistent.h>
2278 _ACEOF
2279 if { (eval echo "$as_me:2279: \"$ac_cpp conftest.$ac_ext\"") >&5
2280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2281   ac_status=$?
2282   egrep -v '^ *\+' conftest.er1 >conftest.err
2283   rm -f conftest.er1
2284   cat conftest.err >&5
2285   echo "$as_me:2285: \$? = $ac_status" >&5
2286   (exit $ac_status); } >/dev/null; then
2287   if test -s conftest.err; then
2288     ac_cpp_err=$ac_c_preproc_warn_flag
2289   else
2290     ac_cpp_err=
2291   fi
2292 else
2293   ac_cpp_err=yes
2294 fi
2295 if test -z "$ac_cpp_err"; then
2296   # Broken: success on invalid input.
2297 continue
2298 else
2299   echo "$as_me: failed program was:" >&5
2300   cat conftest.$ac_ext >&5
2301   # Passes both tests.
2302 ac_preproc_ok=:
2303 break
2304 fi
2305 rm -f conftest.err conftest.$ac_ext
2306
2307 done
2308 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2309 rm -f conftest.err conftest.$ac_ext
2310 if $ac_preproc_ok; then
2311   break
2312 fi
2313
2314     done
2315     ac_cv_prog_CPP=$CPP
2316
2317 fi
2318   CPP=$ac_cv_prog_CPP
2319 else
2320   ac_cv_prog_CPP=$CPP
2321 fi
2322 echo "$as_me:2322: result: $CPP" >&5
2323 echo "${ECHO_T}$CPP" >&6
2324 ac_preproc_ok=false
2325 for ac_c_preproc_warn_flag in '' yes
2326 do
2327   # Use a header file that comes with gcc, so configuring glibc
2328   # with a fresh cross-compiler works.
2329   # On the NeXT, cc -E runs the code through the compiler's parser,
2330   # not just through cpp. "Syntax error" is here to catch this case.
2331   cat >conftest.$ac_ext <<_ACEOF
2332 #line 2332 "configure"
2333 #include "confdefs.h"
2334 #include <assert.h>
2335                      Syntax error
2336 _ACEOF
2337 if { (eval echo "$as_me:2337: \"$ac_cpp conftest.$ac_ext\"") >&5
2338   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2339   ac_status=$?
2340   egrep -v '^ *\+' conftest.er1 >conftest.err
2341   rm -f conftest.er1
2342   cat conftest.err >&5
2343   echo "$as_me:2343: \$? = $ac_status" >&5
2344   (exit $ac_status); } >/dev/null; then
2345   if test -s conftest.err; then
2346     ac_cpp_err=$ac_c_preproc_warn_flag
2347   else
2348     ac_cpp_err=
2349   fi
2350 else
2351   ac_cpp_err=yes
2352 fi
2353 if test -z "$ac_cpp_err"; then
2354   :
2355 else
2356   echo "$as_me: failed program was:" >&5
2357   cat conftest.$ac_ext >&5
2358   # Broken: fails on valid input.
2359 continue
2360 fi
2361 rm -f conftest.err conftest.$ac_ext
2362
2363   # OK, works on sane cases.  Now check whether non-existent headers
2364   # can be detected and how.
2365   cat >conftest.$ac_ext <<_ACEOF
2366 #line 2366 "configure"
2367 #include "confdefs.h"
2368 #include <ac_nonexistent.h>
2369 _ACEOF
2370 if { (eval echo "$as_me:2370: \"$ac_cpp conftest.$ac_ext\"") >&5
2371   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2372   ac_status=$?
2373   egrep -v '^ *\+' conftest.er1 >conftest.err
2374   rm -f conftest.er1
2375   cat conftest.err >&5
2376   echo "$as_me:2376: \$? = $ac_status" >&5
2377   (exit $ac_status); } >/dev/null; then
2378   if test -s conftest.err; then
2379     ac_cpp_err=$ac_c_preproc_warn_flag
2380   else
2381     ac_cpp_err=
2382   fi
2383 else
2384   ac_cpp_err=yes
2385 fi
2386 if test -z "$ac_cpp_err"; then
2387   # Broken: success on invalid input.
2388 continue
2389 else
2390   echo "$as_me: failed program was:" >&5
2391   cat conftest.$ac_ext >&5
2392   # Passes both tests.
2393 ac_preproc_ok=:
2394 break
2395 fi
2396 rm -f conftest.err conftest.$ac_ext
2397
2398 done
2399 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2400 rm -f conftest.err conftest.$ac_ext
2401 if $ac_preproc_ok; then
2402   :
2403 else
2404   { { echo "$as_me:2404: error: C preprocessor \"$CPP\" fails sanity check" >&5
2405 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2406    { (exit 1); exit 1; }; }
2407 fi
2408
2409 ac_ext=c
2410 ac_cpp='$CPP $CPPFLAGS'
2411 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2412 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2413 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2414 ac_main_return=return
2415
2416 if test $ac_cv_c_compiler_gnu = yes; then
2417     echo "$as_me:2417: checking whether $CC needs -traditional" >&5
2418 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2419 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2420   echo $ECHO_N "(cached) $ECHO_C" >&6
2421 else
2422     ac_pattern="Autoconf.*'x'"
2423   cat >conftest.$ac_ext <<_ACEOF
2424 #line 2424 "configure"
2425 #include "confdefs.h"
2426 #include <sgtty.h>
2427 int Autoconf = TIOCGETP;
2428 _ACEOF
2429 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2430   egrep "$ac_pattern" >/dev/null 2>&1; then
2431   ac_cv_prog_gcc_traditional=yes
2432 else
2433   ac_cv_prog_gcc_traditional=no
2434 fi
2435 rm -rf conftest*
2436
2437   if test $ac_cv_prog_gcc_traditional = no; then
2438     cat >conftest.$ac_ext <<_ACEOF
2439 #line 2439 "configure"
2440 #include "confdefs.h"
2441 #include <termio.h>
2442 int Autoconf = TCGETA;
2443 _ACEOF
2444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2445   egrep "$ac_pattern" >/dev/null 2>&1; then
2446   ac_cv_prog_gcc_traditional=yes
2447 fi
2448 rm -rf conftest*
2449
2450   fi
2451 fi
2452 echo "$as_me:2452: result: $ac_cv_prog_gcc_traditional" >&5
2453 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2454   if test $ac_cv_prog_gcc_traditional = yes; then
2455     CC="$CC -traditional"
2456   fi
2457 fi
2458
2459 echo "$as_me:2459: checking whether $CC understands -c and -o together" >&5
2460 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2461 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2462   echo $ECHO_N "(cached) $ECHO_C" >&6
2463 else
2464
2465 cat > conftest.$ac_ext <<CF_EOF
2466 int main(void)
2467 {
2468         ${cf_cv_main_return:-return}(0);
2469 }
2470 CF_EOF
2471 # We do the test twice because some compilers refuse to overwrite an
2472 # existing .o file with -o, though they will create one.
2473 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2474 if { (eval echo "$as_me:2474: \"$ac_try\"") >&5
2475   (eval $ac_try) 2>&5
2476   ac_status=$?
2477   echo "$as_me:2477: \$? = $ac_status" >&5
2478   (exit $ac_status); } &&
2479   test -f conftest2.$ac_objext && { (eval echo "$as_me:2479: \"$ac_try\"") >&5
2480   (eval $ac_try) 2>&5
2481   ac_status=$?
2482   echo "$as_me:2482: \$? = $ac_status" >&5
2483   (exit $ac_status); };
2484 then
2485   eval cf_cv_prog_CC_c_o=yes
2486 else
2487   eval cf_cv_prog_CC_c_o=no
2488 fi
2489 rm -rf conftest*
2490
2491 fi
2492 if test $cf_cv_prog_CC_c_o = yes; then
2493   echo "$as_me:2493: result: yes" >&5
2494 echo "${ECHO_T}yes" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500 test "$program_prefix" != NONE &&
2501   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2502 # Use a double $ so make ignores it.
2503 test "$program_suffix" != NONE &&
2504   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2505 # Double any \ or $.  echo might interpret backslashes.
2506 # By default was `s,x,x', remove it if useless.
2507 cat <<\_ACEOF >conftest.sed
2508 s/[\\$]/&&/g;s/;s,x,x,$//
2509 _ACEOF
2510 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2511 rm conftest.sed
2512
2513 for ac_prog in mawk gawk nawk awk
2514 do
2515   # Extract the first word of "$ac_prog", so it can be a program name with args.
2516 set dummy $ac_prog; ac_word=$2
2517 echo "$as_me:2517: checking for $ac_word" >&5
2518 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2519 if test "${ac_cv_prog_AWK+set}" = set; then
2520   echo $ECHO_N "(cached) $ECHO_C" >&6
2521 else
2522   if test -n "$AWK"; then
2523   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2524 else
2525   ac_save_IFS=$IFS; IFS=$ac_path_separator
2526 ac_dummy="$PATH"
2527 for ac_dir in $ac_dummy; do
2528   IFS=$ac_save_IFS
2529   test -z "$ac_dir" && ac_dir=.
2530   $as_executable_p "$ac_dir/$ac_word" || continue
2531 ac_cv_prog_AWK="$ac_prog"
2532 echo "$as_me:2532: found $ac_dir/$ac_word" >&5
2533 break
2534 done
2535
2536 fi
2537 fi
2538 AWK=$ac_cv_prog_AWK
2539 if test -n "$AWK"; then
2540   echo "$as_me:2540: result: $AWK" >&5
2541 echo "${ECHO_T}$AWK" >&6
2542 else
2543   echo "$as_me:2543: result: no" >&5
2544 echo "${ECHO_T}no" >&6
2545 fi
2546
2547   test -n "$AWK" && break
2548 done
2549
2550 test -z "$AWK" && { { echo "$as_me:2550: error: No awk program found" >&5
2551 echo "$as_me: error: No awk program found" >&2;}
2552    { (exit 1); exit 1; }; }
2553
2554 echo "$as_me:2554: checking for egrep" >&5
2555 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2556 if test "${ac_cv_prog_egrep+set}" = set; then
2557   echo $ECHO_N "(cached) $ECHO_C" >&6
2558 else
2559   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2560                 then ac_cv_prog_egrep='grep -E'
2561                 else ac_cv_prog_egrep='egrep'
2562         fi
2563 fi
2564 echo "$as_me:2564: result: $ac_cv_prog_egrep" >&5
2565 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2566         EGREP=$ac_cv_prog_egrep
2567
2568         test -z "$EGREP" && { { echo "$as_me:2568: error: No egrep program found" >&5
2569 echo "$as_me: error: No egrep program found" >&2;}
2570    { (exit 1); exit 1; }; }
2571
2572 # Find a good install program.  We prefer a C program (faster),
2573 # so one script is as good as another.  But avoid the broken or
2574 # incompatible versions:
2575 # SysV /etc/install, /usr/sbin/install
2576 # SunOS /usr/etc/install
2577 # IRIX /sbin/install
2578 # AIX /bin/install
2579 # AmigaOS /C/install, which installs bootblocks on floppy discs
2580 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2581 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2582 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2583 # ./install, which can be erroneously created by make from ./install.sh.
2584 echo "$as_me:2584: checking for a BSD compatible install" >&5
2585 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2586 if test -z "$INSTALL"; then
2587 if test "${ac_cv_path_install+set}" = set; then
2588   echo $ECHO_N "(cached) $ECHO_C" >&6
2589 else
2590     ac_save_IFS=$IFS; IFS=$ac_path_separator
2591   for ac_dir in $PATH; do
2592     IFS=$ac_save_IFS
2593     # Account for people who put trailing slashes in PATH elements.
2594     case $ac_dir/ in
2595     / | ./ | .// | /cC/* \
2596     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2597     | /usr/ucb/* ) ;;
2598     *)
2599       # OSF1 and SCO ODT 3.0 have their own names for install.
2600       # Don't use installbsd from OSF since it installs stuff as root
2601       # by default.
2602       for ac_prog in ginstall scoinst install; do
2603         if $as_executable_p "$ac_dir/$ac_prog"; then
2604           if test $ac_prog = install &&
2605             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2606             # AIX install.  It has an incompatible calling convention.
2607             :
2608           elif test $ac_prog = install &&
2609             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2610             # program-specific install script used by HP pwplus--don't use.
2611             :
2612           else
2613             ac_cv_path_install="$ac_dir/$ac_prog -c"
2614             break 2
2615           fi
2616         fi
2617       done
2618       ;;
2619     esac
2620   done
2621
2622 fi
2623   if test "${ac_cv_path_install+set}" = set; then
2624     INSTALL=$ac_cv_path_install
2625   else
2626     # As a last resort, use the slow shell script.  We don't cache a
2627     # path for INSTALL within a source directory, because that will
2628     # break other packages using the cache if that directory is
2629     # removed, or if the path is relative.
2630     INSTALL=$ac_install_sh
2631   fi
2632 fi
2633 echo "$as_me:2633: result: $INSTALL" >&5
2634 echo "${ECHO_T}$INSTALL" >&6
2635
2636 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2637 # It thinks the first close brace ends the variable substitution.
2638 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2639
2640 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2641
2642 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2643
2644 echo "$as_me:2644: checking whether ln -s works" >&5
2645 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2646 LN_S=$as_ln_s
2647 if test "$LN_S" = "ln -s"; then
2648   echo "$as_me:2648: result: yes" >&5
2649 echo "${ECHO_T}yes" >&6
2650 else
2651   echo "$as_me:2651: result: no, using $LN_S" >&5
2652 echo "${ECHO_T}no, using $LN_S" >&6
2653 fi
2654
2655 echo "$as_me:2655: checking if $LN_S -f options work" >&5
2656 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2657
2658 rm -f conf$$.src conf$$dst
2659 echo >conf$$.dst
2660 echo first >conf$$.src
2661 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2662         cf_prog_ln_sf=yes
2663 else
2664         cf_prog_ln_sf=no
2665 fi
2666 rm -f conf$$.dst conf$$src
2667 echo "$as_me:2667: result: $cf_prog_ln_sf" >&5
2668 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2669
2670 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2671
2672 # Find a good install program.  We prefer a C program (faster),
2673 # so one script is as good as another.  But avoid the broken or
2674 # incompatible versions:
2675 # SysV /etc/install, /usr/sbin/install
2676 # SunOS /usr/etc/install
2677 # IRIX /sbin/install
2678 # AIX /bin/install
2679 # AmigaOS /C/install, which installs bootblocks on floppy discs
2680 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2681 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2682 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2683 # ./install, which can be erroneously created by make from ./install.sh.
2684 echo "$as_me:2684: checking for a BSD compatible install" >&5
2685 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2686 if test -z "$INSTALL"; then
2687 if test "${ac_cv_path_install+set}" = set; then
2688   echo $ECHO_N "(cached) $ECHO_C" >&6
2689 else
2690     ac_save_IFS=$IFS; IFS=$ac_path_separator
2691   for ac_dir in $PATH; do
2692     IFS=$ac_save_IFS
2693     # Account for people who put trailing slashes in PATH elements.
2694     case $ac_dir/ in
2695     / | ./ | .// | /cC/* \
2696     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2697     | /usr/ucb/* ) ;;
2698     *)
2699       # OSF1 and SCO ODT 3.0 have their own names for install.
2700       # Don't use installbsd from OSF since it installs stuff as root
2701       # by default.
2702       for ac_prog in ginstall scoinst install; do
2703         if $as_executable_p "$ac_dir/$ac_prog"; then
2704           if test $ac_prog = install &&
2705             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2706             # AIX install.  It has an incompatible calling convention.
2707             :
2708           elif test $ac_prog = install &&
2709             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2710             # program-specific install script used by HP pwplus--don't use.
2711             :
2712           else
2713             ac_cv_path_install="$ac_dir/$ac_prog -c"
2714             break 2
2715           fi
2716         fi
2717       done
2718       ;;
2719     esac
2720   done
2721
2722 fi
2723   if test "${ac_cv_path_install+set}" = set; then
2724     INSTALL=$ac_cv_path_install
2725   else
2726     # As a last resort, use the slow shell script.  We don't cache a
2727     # path for INSTALL within a source directory, because that will
2728     # break other packages using the cache if that directory is
2729     # removed, or if the path is relative.
2730     INSTALL=$ac_install_sh
2731   fi
2732 fi
2733 echo "$as_me:2733: result: $INSTALL" >&5
2734 echo "${ECHO_T}$INSTALL" >&6
2735
2736 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2737 # It thinks the first close brace ends the variable substitution.
2738 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2739
2740 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2741
2742 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2743
2744 case $INSTALL in
2745 (/*)
2746         ;;
2747 (*)
2748         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2749         test -z "$cf_dir" && cf_dir=.
2750         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2751         ;;
2752 esac
2753
2754 echo "$as_me:2754: checking if you want to install stripped executables" >&5
2755 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2756
2757 # Check whether --enable-stripping or --disable-stripping was given.
2758 if test "${enable_stripping+set}" = set; then
2759   enableval="$enable_stripping"
2760   test "$enableval" != no && enableval=yes
2761         if test "$enableval" != "yes" ; then
2762     with_stripping=no
2763         else
2764                 with_stripping=yes
2765         fi
2766 else
2767   enableval=yes
2768         with_stripping=yes
2769
2770 fi;
2771 echo "$as_me:2771: result: $with_stripping" >&5
2772 echo "${ECHO_T}$with_stripping" >&6
2773
2774 if test "$with_stripping" = yes
2775 then
2776         INSTALL_OPT_S="-s"
2777 else
2778         INSTALL_OPT_S=
2779 fi
2780
2781 : ${INSTALL:=install}
2782 echo "$as_me:2782: checking if install accepts -p option" >&5
2783 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2784 if test "${cf_cv_install_p+set}" = set; then
2785   echo $ECHO_N "(cached) $ECHO_C" >&6
2786 else
2787
2788         rm -rf conftest*
2789         date >conftest.in
2790         mkdir conftest.out
2791         sleep 3
2792         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2793         then
2794                 if test -f conftest.out/conftest.in
2795                 then
2796                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2797                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2798                         if test -s conftest.err
2799                         then
2800                                 cf_cv_install_p=no
2801                         else
2802                                 cf_cv_install_p=yes
2803                         fi
2804                 else
2805                         cf_cv_install_p=no
2806                 fi
2807         else
2808                 cf_cv_install_p=no
2809         fi
2810         rm -rf conftest*
2811
2812 fi
2813 echo "$as_me:2813: result: $cf_cv_install_p" >&5
2814 echo "${ECHO_T}$cf_cv_install_p" >&6
2815
2816 echo "$as_me:2816: checking if install needs to be told about ownership" >&5
2817 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2818 case `$ac_config_guess` in
2819 (*minix)
2820         with_install_o=yes
2821         ;;
2822 (*)
2823         with_install_o=no
2824         ;;
2825 esac
2826
2827 echo "$as_me:2827: result: $with_install_o" >&5
2828 echo "${ECHO_T}$with_install_o" >&6
2829 if test "x$with_install_o" = xyes
2830 then
2831         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'`
2832 else
2833         INSTALL_OPT_O=
2834 fi
2835
2836 echo "$as_me:2836: checking for long file names" >&5
2837 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2838 if test "${ac_cv_sys_long_file_names+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841   ac_cv_sys_long_file_names=yes
2842 # Test for long file names in all the places we know might matter:
2843 #      .                the current directory, where building will happen
2844 #      $prefix/lib      where we will be installing things
2845 #      $exec_prefix/lib likewise
2846 # eval it to expand exec_prefix.
2847 #      $TMPDIR          if set, where it might want to write temporary files
2848 # if $TMPDIR is not set:
2849 #      /tmp             where it might want to write temporary files
2850 #      /var/tmp         likewise
2851 #      /usr/tmp         likewise
2852 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2853   ac_tmpdirs=$TMPDIR
2854 else
2855   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2856 fi
2857 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2858   test -d $ac_dir || continue
2859   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2860   ac_xdir=$ac_dir/cf$$
2861   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2862   ac_tf1=$ac_xdir/conftest9012345
2863   ac_tf2=$ac_xdir/conftest9012346
2864   (echo 1 >$ac_tf1) 2>/dev/null
2865   (echo 2 >$ac_tf2) 2>/dev/null
2866   ac_val=`cat $ac_tf1 2>/dev/null`
2867   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2868     ac_cv_sys_long_file_names=no
2869     rm -rf $ac_xdir 2>/dev/null
2870     break
2871   fi
2872   rm -rf $ac_xdir 2>/dev/null
2873 done
2874 fi
2875 echo "$as_me:2875: result: $ac_cv_sys_long_file_names" >&5
2876 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2877 if test $ac_cv_sys_long_file_names = yes; then
2878
2879 cat >>confdefs.h <<\EOF
2880 #define HAVE_LONG_FILE_NAMES 1
2881 EOF
2882
2883 fi
2884
2885 # if we find pkg-config, check if we should install the ".pc" files.
2886
2887 echo "$as_me:2887: checking if you want to use pkg-config" >&5
2888 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2889
2890 # Check whether --with-pkg-config or --without-pkg-config was given.
2891 if test "${with_pkg_config+set}" = set; then
2892   withval="$with_pkg_config"
2893   cf_pkg_config=$withval
2894 else
2895   cf_pkg_config=yes
2896 fi;
2897 echo "$as_me:2897: result: $cf_pkg_config" >&5
2898 echo "${ECHO_T}$cf_pkg_config" >&6
2899
2900 case $cf_pkg_config in
2901 (no)
2902         PKG_CONFIG=none
2903         ;;
2904 (yes)
2905
2906 if test -n "$ac_tool_prefix"; then
2907   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2908 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2909 echo "$as_me:2909: checking for $ac_word" >&5
2910 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2911 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2912   echo $ECHO_N "(cached) $ECHO_C" >&6
2913 else
2914   case $PKG_CONFIG in
2915   [\\/]* | ?:[\\/]*)
2916   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2917   ;;
2918   *)
2919   ac_save_IFS=$IFS; IFS=$ac_path_separator
2920 ac_dummy="$PATH"
2921 for ac_dir in $ac_dummy; do
2922   IFS=$ac_save_IFS
2923   test -z "$ac_dir" && ac_dir=.
2924   if $as_executable_p "$ac_dir/$ac_word"; then
2925    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2926    echo "$as_me:2926: found $ac_dir/$ac_word" >&5
2927    break
2928 fi
2929 done
2930
2931   ;;
2932 esac
2933 fi
2934 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2935
2936 if test -n "$PKG_CONFIG"; then
2937   echo "$as_me:2937: result: $PKG_CONFIG" >&5
2938 echo "${ECHO_T}$PKG_CONFIG" >&6
2939 else
2940   echo "$as_me:2940: result: no" >&5
2941 echo "${ECHO_T}no" >&6
2942 fi
2943
2944 fi
2945 if test -z "$ac_cv_path_PKG_CONFIG"; then
2946   ac_pt_PKG_CONFIG=$PKG_CONFIG
2947   # Extract the first word of "pkg-config", so it can be a program name with args.
2948 set dummy pkg-config; ac_word=$2
2949 echo "$as_me:2949: checking for $ac_word" >&5
2950 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2951 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2952   echo $ECHO_N "(cached) $ECHO_C" >&6
2953 else
2954   case $ac_pt_PKG_CONFIG in
2955   [\\/]* | ?:[\\/]*)
2956   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2957   ;;
2958   *)
2959   ac_save_IFS=$IFS; IFS=$ac_path_separator
2960 ac_dummy="$PATH"
2961 for ac_dir in $ac_dummy; do
2962   IFS=$ac_save_IFS
2963   test -z "$ac_dir" && ac_dir=.
2964   if $as_executable_p "$ac_dir/$ac_word"; then
2965    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2966    echo "$as_me:2966: found $ac_dir/$ac_word" >&5
2967    break
2968 fi
2969 done
2970
2971   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2972   ;;
2973 esac
2974 fi
2975 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2976
2977 if test -n "$ac_pt_PKG_CONFIG"; then
2978   echo "$as_me:2978: result: $ac_pt_PKG_CONFIG" >&5
2979 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2980 else
2981   echo "$as_me:2981: result: no" >&5
2982 echo "${ECHO_T}no" >&6
2983 fi
2984
2985   PKG_CONFIG=$ac_pt_PKG_CONFIG
2986 else
2987   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2988 fi
2989
2990         ;;
2991 (*)
2992         PKG_CONFIG=$withval
2993         ;;
2994 esac
2995
2996 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2997 if test "$PKG_CONFIG" != none ; then
2998
2999 if test "x$prefix" != xNONE; then
3000         cf_path_syntax="$prefix"
3001 else
3002         cf_path_syntax="$ac_default_prefix"
3003 fi
3004
3005 case ".$PKG_CONFIG" in
3006 (.\$\(*\)*|.\'*\'*)
3007         ;;
3008 (..|./*|.\\*)
3009         ;;
3010 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3011         ;;
3012 (.\${*prefix}*|.\${*dir}*)
3013         eval PKG_CONFIG="$PKG_CONFIG"
3014         case ".$PKG_CONFIG" in
3015         (.NONE/*)
3016                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3017                 ;;
3018         esac
3019         ;;
3020 (.no|.NONE/*)
3021         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3022         ;;
3023 (*)
3024         { { echo "$as_me:3024: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3025 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3026    { (exit 1); exit 1; }; }
3027         ;;
3028 esac
3029
3030 elif test "x$cf_pkg_config" != xno ; then
3031         { echo "$as_me:3031: WARNING: pkg-config is not installed" >&5
3032 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3033 fi
3034
3035 case $PKG_CONFIG in
3036 (no|none|yes)
3037         echo "$as_me:3037: checking for pkg-config library directory" >&5
3038 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3039         ;;
3040 (*)
3041         echo "$as_me:3041: checking for $PKG_CONFIG library directory" >&5
3042 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3043         ;;
3044 esac
3045
3046 PKG_CONFIG_LIBDIR=no
3047
3048 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3049 if test "${with_pkg_config_libdir+set}" = set; then
3050   withval="$with_pkg_config_libdir"
3051   PKG_CONFIG_LIBDIR=$withval
3052 else
3053   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3054 fi;
3055
3056 case x$PKG_CONFIG_LIBDIR in
3057 (x/*)
3058         ;;
3059 (xyes)
3060         # Look for the library directory using the same prefix as the executable
3061         if test "x$PKG_CONFIG" = xnone
3062         then
3063                 cf_path=$prefix
3064         else
3065                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3066         fi
3067
3068         # If you don't like using the default architecture, you have to specify the
3069         # intended library directory and corresponding compiler/linker options.
3070         #
3071         # This case allows for Debian's 2014-flavor of multiarch, along with the
3072         # most common variations before that point.  Some other variants spell the
3073         # directory differently, e.g., "pkg-config", and put it in unusual places.
3074         # pkg-config has always been poorly standardized, which is ironic...
3075         case x`(arch) 2>/dev/null` in
3076         (*64)
3077                 cf_search_path="\
3078                         $cf_path/lib/*64-linux-gnu \
3079                         $cf_path/share \
3080                         $cf_path/lib64 \
3081                         $cf_path/lib32 \
3082                         $cf_path/lib"
3083                 ;;
3084         (*)
3085                 cf_search_path="\
3086                         $cf_path/lib/*-linux-gnu \
3087                         $cf_path/share \
3088                         $cf_path/lib32 \
3089                         $cf_path/lib \
3090                         $cf_path/libdata"
3091                 ;;
3092         esac
3093
3094         test -n "$verbose" && echo "    list..." 1>&6
3095
3096 echo "${as_me:-configure}:3096: testing list... ..." 1>&5
3097
3098         for cf_config in $cf_search_path
3099         do
3100                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3101
3102 echo "${as_me:-configure}:3102: testing checking $cf_config/pkgconfig ..." 1>&5
3103
3104                 if test -d $cf_config/pkgconfig
3105                 then
3106                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3107                         echo "$as_me:3107: checking done" >&5
3108 echo $ECHO_N "checking done... $ECHO_C" >&6
3109                         break
3110                 fi
3111         done
3112         ;;
3113 (*)
3114         ;;
3115 esac
3116
3117 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3118         echo "$as_me:3118: result: $PKG_CONFIG_LIBDIR" >&5
3119 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3120 fi
3121
3122 echo "$as_me:3122: checking if you want to build test-programs" >&5
3123 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3124
3125 # Check whether --with-tests or --without-tests was given.
3126 if test "${with_tests+set}" = set; then
3127   withval="$with_tests"
3128   cf_with_tests=$withval
3129 else
3130   cf_with_tests=yes
3131 fi;
3132 echo "$as_me:3132: result: $cf_with_tests" >&5
3133 echo "${ECHO_T}$cf_with_tests" >&6
3134
3135 echo "$as_me:3135: checking if we should assume mixed-case filenames" >&5
3136 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3137
3138 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3139 if test "${enable_mixed_case+set}" = set; then
3140   enableval="$enable_mixed_case"
3141   enable_mixedcase=$enableval
3142 else
3143   enable_mixedcase=auto
3144 fi;
3145 echo "$as_me:3145: result: $enable_mixedcase" >&5
3146 echo "${ECHO_T}$enable_mixedcase" >&6
3147 if test "$enable_mixedcase" = "auto" ; then
3148
3149 echo "$as_me:3149: checking if filesystem supports mixed-case filenames" >&5
3150 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3151 if test "${cf_cv_mixedcase+set}" = set; then
3152   echo $ECHO_N "(cached) $ECHO_C" >&6
3153 else
3154
3155 if test "$cross_compiling" = yes ; then
3156         case $target_alias in
3157         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3158                 cf_cv_mixedcase=no
3159                 ;;
3160         (*)
3161                 cf_cv_mixedcase=yes
3162                 ;;
3163         esac
3164 else
3165         rm -f conftest CONFTEST
3166         echo test >conftest
3167         if test -f CONFTEST ; then
3168                 cf_cv_mixedcase=no
3169         else
3170                 cf_cv_mixedcase=yes
3171         fi
3172         rm -f conftest CONFTEST
3173 fi
3174
3175 fi
3176 echo "$as_me:3176: result: $cf_cv_mixedcase" >&5
3177 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3178 test "$cf_cv_mixedcase" = yes &&
3179 cat >>confdefs.h <<\EOF
3180 #define MIXEDCASE_FILENAMES 1
3181 EOF
3182
3183 else
3184         cf_cv_mixedcase=$enable_mixedcase
3185         if test "$enable_mixedcase" = "yes" ; then
3186                 cat >>confdefs.h <<\EOF
3187 #define MIXEDCASE_FILENAMES 1
3188 EOF
3189
3190         fi
3191 fi
3192
3193 # do this after mixed-case option (tags/TAGS is not as important as tic).
3194 echo "$as_me:3194: checking whether ${MAKE-make} sets \${MAKE}" >&5
3195 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3196 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3197 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3198   echo $ECHO_N "(cached) $ECHO_C" >&6
3199 else
3200   cat >conftest.make <<\EOF
3201 all:
3202         @echo 'ac_maketemp="${MAKE}"'
3203 EOF
3204 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3205 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3206 if test -n "$ac_maketemp"; then
3207   eval ac_cv_prog_make_${ac_make}_set=yes
3208 else
3209   eval ac_cv_prog_make_${ac_make}_set=no
3210 fi
3211 rm -f conftest.make
3212 fi
3213 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3214   echo "$as_me:3214: result: yes" >&5
3215 echo "${ECHO_T}yes" >&6
3216   SET_MAKE=
3217 else
3218   echo "$as_me:3218: result: no" >&5
3219 echo "${ECHO_T}no" >&6
3220   SET_MAKE="MAKE=${MAKE-make}"
3221 fi
3222
3223 for ac_prog in exctags ctags
3224 do
3225   # Extract the first word of "$ac_prog", so it can be a program name with args.
3226 set dummy $ac_prog; ac_word=$2
3227 echo "$as_me:3227: checking for $ac_word" >&5
3228 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3229 if test "${ac_cv_prog_CTAGS+set}" = set; then
3230   echo $ECHO_N "(cached) $ECHO_C" >&6
3231 else
3232   if test -n "$CTAGS"; then
3233   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3234 else
3235   ac_save_IFS=$IFS; IFS=$ac_path_separator
3236 ac_dummy="$PATH"
3237 for ac_dir in $ac_dummy; do
3238   IFS=$ac_save_IFS
3239   test -z "$ac_dir" && ac_dir=.
3240   $as_executable_p "$ac_dir/$ac_word" || continue
3241 ac_cv_prog_CTAGS="$ac_prog"
3242 echo "$as_me:3242: found $ac_dir/$ac_word" >&5
3243 break
3244 done
3245
3246 fi
3247 fi
3248 CTAGS=$ac_cv_prog_CTAGS
3249 if test -n "$CTAGS"; then
3250   echo "$as_me:3250: result: $CTAGS" >&5
3251 echo "${ECHO_T}$CTAGS" >&6
3252 else
3253   echo "$as_me:3253: result: no" >&5
3254 echo "${ECHO_T}no" >&6
3255 fi
3256
3257   test -n "$CTAGS" && break
3258 done
3259
3260 for ac_prog in exetags etags
3261 do
3262   # Extract the first word of "$ac_prog", so it can be a program name with args.
3263 set dummy $ac_prog; ac_word=$2
3264 echo "$as_me:3264: checking for $ac_word" >&5
3265 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3266 if test "${ac_cv_prog_ETAGS+set}" = set; then
3267   echo $ECHO_N "(cached) $ECHO_C" >&6
3268 else
3269   if test -n "$ETAGS"; then
3270   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3271 else
3272   ac_save_IFS=$IFS; IFS=$ac_path_separator
3273 ac_dummy="$PATH"
3274 for ac_dir in $ac_dummy; do
3275   IFS=$ac_save_IFS
3276   test -z "$ac_dir" && ac_dir=.
3277   $as_executable_p "$ac_dir/$ac_word" || continue
3278 ac_cv_prog_ETAGS="$ac_prog"
3279 echo "$as_me:3279: found $ac_dir/$ac_word" >&5
3280 break
3281 done
3282
3283 fi
3284 fi
3285 ETAGS=$ac_cv_prog_ETAGS
3286 if test -n "$ETAGS"; then
3287   echo "$as_me:3287: result: $ETAGS" >&5
3288 echo "${ECHO_T}$ETAGS" >&6
3289 else
3290   echo "$as_me:3290: result: no" >&5
3291 echo "${ECHO_T}no" >&6
3292 fi
3293
3294   test -n "$ETAGS" && break
3295 done
3296
3297 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3298 set dummy ${CTAGS:-ctags}; ac_word=$2
3299 echo "$as_me:3299: checking for $ac_word" >&5
3300 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3301 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3302   echo $ECHO_N "(cached) $ECHO_C" >&6
3303 else
3304   if test -n "$MAKE_LOWER_TAGS"; then
3305   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3306 else
3307   ac_save_IFS=$IFS; IFS=$ac_path_separator
3308 ac_dummy="$PATH"
3309 for ac_dir in $ac_dummy; do
3310   IFS=$ac_save_IFS
3311   test -z "$ac_dir" && ac_dir=.
3312   $as_executable_p "$ac_dir/$ac_word" || continue
3313 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3314 echo "$as_me:3314: found $ac_dir/$ac_word" >&5
3315 break
3316 done
3317
3318   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3319 fi
3320 fi
3321 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3322 if test -n "$MAKE_LOWER_TAGS"; then
3323   echo "$as_me:3323: result: $MAKE_LOWER_TAGS" >&5
3324 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3325 else
3326   echo "$as_me:3326: result: no" >&5
3327 echo "${ECHO_T}no" >&6
3328 fi
3329
3330 if test "$cf_cv_mixedcase" = yes ; then
3331         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3332 set dummy ${ETAGS:-etags}; ac_word=$2
3333 echo "$as_me:3333: checking for $ac_word" >&5
3334 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3335 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3336   echo $ECHO_N "(cached) $ECHO_C" >&6
3337 else
3338   if test -n "$MAKE_UPPER_TAGS"; then
3339   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3340 else
3341   ac_save_IFS=$IFS; IFS=$ac_path_separator
3342 ac_dummy="$PATH"
3343 for ac_dir in $ac_dummy; do
3344   IFS=$ac_save_IFS
3345   test -z "$ac_dir" && ac_dir=.
3346   $as_executable_p "$ac_dir/$ac_word" || continue
3347 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3348 echo "$as_me:3348: found $ac_dir/$ac_word" >&5
3349 break
3350 done
3351
3352   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3353 fi
3354 fi
3355 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3356 if test -n "$MAKE_UPPER_TAGS"; then
3357   echo "$as_me:3357: result: $MAKE_UPPER_TAGS" >&5
3358 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3359 else
3360   echo "$as_me:3360: result: no" >&5
3361 echo "${ECHO_T}no" >&6
3362 fi
3363
3364 else
3365         MAKE_UPPER_TAGS=no
3366 fi
3367
3368 if test "$MAKE_UPPER_TAGS" = yes ; then
3369         MAKE_UPPER_TAGS=
3370 else
3371         MAKE_UPPER_TAGS="#"
3372 fi
3373
3374 if test "$MAKE_LOWER_TAGS" = yes ; then
3375         MAKE_LOWER_TAGS=
3376 else
3377         MAKE_LOWER_TAGS="#"
3378 fi
3379
3380 echo "$as_me:3380: checking for makeflags variable" >&5
3381 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3382 if test "${cf_cv_makeflags+set}" = set; then
3383   echo $ECHO_N "(cached) $ECHO_C" >&6
3384 else
3385
3386         cf_cv_makeflags=''
3387         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3388         do
3389                 cat >cf_makeflags.tmp <<CF_EOF
3390 SHELL = $SHELL
3391 all :
3392         @ echo '.$cf_option'
3393 CF_EOF
3394                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3395                 case "$cf_result" in
3396                 (.*k|.*kw)
3397                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3398                         case "$cf_result" in
3399                         (.*CC=*)        cf_cv_makeflags=
3400                                 ;;
3401                         (*)     cf_cv_makeflags=$cf_option
3402                                 ;;
3403                         esac
3404                         break
3405                         ;;
3406                 (.-)
3407                         ;;
3408                 (*)
3409
3410 echo "${as_me:-configure}:3410: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3411
3412                         ;;
3413                 esac
3414         done
3415         rm -f cf_makeflags.tmp
3416
3417 fi
3418 echo "$as_me:3418: result: $cf_cv_makeflags" >&5
3419 echo "${ECHO_T}$cf_cv_makeflags" >&6
3420
3421 if test -n "$ac_tool_prefix"; then
3422   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3423 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3424 echo "$as_me:3424: checking for $ac_word" >&5
3425 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3426 if test "${ac_cv_prog_RANLIB+set}" = set; then
3427   echo $ECHO_N "(cached) $ECHO_C" >&6
3428 else
3429   if test -n "$RANLIB"; then
3430   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3431 else
3432   ac_save_IFS=$IFS; IFS=$ac_path_separator
3433 ac_dummy="$PATH"
3434 for ac_dir in $ac_dummy; do
3435   IFS=$ac_save_IFS
3436   test -z "$ac_dir" && ac_dir=.
3437   $as_executable_p "$ac_dir/$ac_word" || continue
3438 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3439 echo "$as_me:3439: found $ac_dir/$ac_word" >&5
3440 break
3441 done
3442
3443 fi
3444 fi
3445 RANLIB=$ac_cv_prog_RANLIB
3446 if test -n "$RANLIB"; then
3447   echo "$as_me:3447: result: $RANLIB" >&5
3448 echo "${ECHO_T}$RANLIB" >&6
3449 else
3450   echo "$as_me:3450: result: no" >&5
3451 echo "${ECHO_T}no" >&6
3452 fi
3453
3454 fi
3455 if test -z "$ac_cv_prog_RANLIB"; then
3456   ac_ct_RANLIB=$RANLIB
3457   # Extract the first word of "ranlib", so it can be a program name with args.
3458 set dummy ranlib; ac_word=$2
3459 echo "$as_me:3459: checking for $ac_word" >&5
3460 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3461 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3462   echo $ECHO_N "(cached) $ECHO_C" >&6
3463 else
3464   if test -n "$ac_ct_RANLIB"; then
3465   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3466 else
3467   ac_save_IFS=$IFS; IFS=$ac_path_separator
3468 ac_dummy="$PATH"
3469 for ac_dir in $ac_dummy; do
3470   IFS=$ac_save_IFS
3471   test -z "$ac_dir" && ac_dir=.
3472   $as_executable_p "$ac_dir/$ac_word" || continue
3473 ac_cv_prog_ac_ct_RANLIB="ranlib"
3474 echo "$as_me:3474: found $ac_dir/$ac_word" >&5
3475 break
3476 done
3477
3478   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3479 fi
3480 fi
3481 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3482 if test -n "$ac_ct_RANLIB"; then
3483   echo "$as_me:3483: result: $ac_ct_RANLIB" >&5
3484 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3485 else
3486   echo "$as_me:3486: result: no" >&5
3487 echo "${ECHO_T}no" >&6
3488 fi
3489
3490   RANLIB=$ac_ct_RANLIB
3491 else
3492   RANLIB="$ac_cv_prog_RANLIB"
3493 fi
3494
3495 if test -n "$ac_tool_prefix"; then
3496   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3497 set dummy ${ac_tool_prefix}ld; ac_word=$2
3498 echo "$as_me:3498: checking for $ac_word" >&5
3499 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3500 if test "${ac_cv_prog_LD+set}" = set; then
3501   echo $ECHO_N "(cached) $ECHO_C" >&6
3502 else
3503   if test -n "$LD"; then
3504   ac_cv_prog_LD="$LD" # Let the user override the test.
3505 else
3506   ac_save_IFS=$IFS; IFS=$ac_path_separator
3507 ac_dummy="$PATH"
3508 for ac_dir in $ac_dummy; do
3509   IFS=$ac_save_IFS
3510   test -z "$ac_dir" && ac_dir=.
3511   $as_executable_p "$ac_dir/$ac_word" || continue
3512 ac_cv_prog_LD="${ac_tool_prefix}ld"
3513 echo "$as_me:3513: found $ac_dir/$ac_word" >&5
3514 break
3515 done
3516
3517 fi
3518 fi
3519 LD=$ac_cv_prog_LD
3520 if test -n "$LD"; then
3521   echo "$as_me:3521: result: $LD" >&5
3522 echo "${ECHO_T}$LD" >&6
3523 else
3524   echo "$as_me:3524: result: no" >&5
3525 echo "${ECHO_T}no" >&6
3526 fi
3527
3528 fi
3529 if test -z "$ac_cv_prog_LD"; then
3530   ac_ct_LD=$LD
3531   # Extract the first word of "ld", so it can be a program name with args.
3532 set dummy ld; ac_word=$2
3533 echo "$as_me:3533: checking for $ac_word" >&5
3534 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3535 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3536   echo $ECHO_N "(cached) $ECHO_C" >&6
3537 else
3538   if test -n "$ac_ct_LD"; then
3539   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3540 else
3541   ac_save_IFS=$IFS; IFS=$ac_path_separator
3542 ac_dummy="$PATH"
3543 for ac_dir in $ac_dummy; do
3544   IFS=$ac_save_IFS
3545   test -z "$ac_dir" && ac_dir=.
3546   $as_executable_p "$ac_dir/$ac_word" || continue
3547 ac_cv_prog_ac_ct_LD="ld"
3548 echo "$as_me:3548: found $ac_dir/$ac_word" >&5
3549 break
3550 done
3551
3552   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3553 fi
3554 fi
3555 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3556 if test -n "$ac_ct_LD"; then
3557   echo "$as_me:3557: result: $ac_ct_LD" >&5
3558 echo "${ECHO_T}$ac_ct_LD" >&6
3559 else
3560   echo "$as_me:3560: result: no" >&5
3561 echo "${ECHO_T}no" >&6
3562 fi
3563
3564   LD=$ac_ct_LD
3565 else
3566   LD="$ac_cv_prog_LD"
3567 fi
3568
3569 if test -n "$ac_tool_prefix"; then
3570   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3571 set dummy ${ac_tool_prefix}ar; ac_word=$2
3572 echo "$as_me:3572: checking for $ac_word" >&5
3573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3574 if test "${ac_cv_prog_AR+set}" = set; then
3575   echo $ECHO_N "(cached) $ECHO_C" >&6
3576 else
3577   if test -n "$AR"; then
3578   ac_cv_prog_AR="$AR" # Let the user override the test.
3579 else
3580   ac_save_IFS=$IFS; IFS=$ac_path_separator
3581 ac_dummy="$PATH"
3582 for ac_dir in $ac_dummy; do
3583   IFS=$ac_save_IFS
3584   test -z "$ac_dir" && ac_dir=.
3585   $as_executable_p "$ac_dir/$ac_word" || continue
3586 ac_cv_prog_AR="${ac_tool_prefix}ar"
3587 echo "$as_me:3587: found $ac_dir/$ac_word" >&5
3588 break
3589 done
3590
3591 fi
3592 fi
3593 AR=$ac_cv_prog_AR
3594 if test -n "$AR"; then
3595   echo "$as_me:3595: result: $AR" >&5
3596 echo "${ECHO_T}$AR" >&6
3597 else
3598   echo "$as_me:3598: result: no" >&5
3599 echo "${ECHO_T}no" >&6
3600 fi
3601
3602 fi
3603 if test -z "$ac_cv_prog_AR"; then
3604   ac_ct_AR=$AR
3605   # Extract the first word of "ar", so it can be a program name with args.
3606 set dummy ar; ac_word=$2
3607 echo "$as_me:3607: checking for $ac_word" >&5
3608 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3609 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3610   echo $ECHO_N "(cached) $ECHO_C" >&6
3611 else
3612   if test -n "$ac_ct_AR"; then
3613   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3614 else
3615   ac_save_IFS=$IFS; IFS=$ac_path_separator
3616 ac_dummy="$PATH"
3617 for ac_dir in $ac_dummy; do
3618   IFS=$ac_save_IFS
3619   test -z "$ac_dir" && ac_dir=.
3620   $as_executable_p "$ac_dir/$ac_word" || continue
3621 ac_cv_prog_ac_ct_AR="ar"
3622 echo "$as_me:3622: found $ac_dir/$ac_word" >&5
3623 break
3624 done
3625
3626   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3627 fi
3628 fi
3629 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3630 if test -n "$ac_ct_AR"; then
3631   echo "$as_me:3631: result: $ac_ct_AR" >&5
3632 echo "${ECHO_T}$ac_ct_AR" >&6
3633 else
3634   echo "$as_me:3634: result: no" >&5
3635 echo "${ECHO_T}no" >&6
3636 fi
3637
3638   AR=$ac_ct_AR
3639 else
3640   AR="$ac_cv_prog_AR"
3641 fi
3642
3643 if test -n "$ac_tool_prefix"; then
3644   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3645 set dummy ${ac_tool_prefix}ar; ac_word=$2
3646 echo "$as_me:3646: checking for $ac_word" >&5
3647 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3648 if test "${ac_cv_prog_AR+set}" = set; then
3649   echo $ECHO_N "(cached) $ECHO_C" >&6
3650 else
3651   if test -n "$AR"; then
3652   ac_cv_prog_AR="$AR" # Let the user override the test.
3653 else
3654   ac_save_IFS=$IFS; IFS=$ac_path_separator
3655 ac_dummy="$PATH"
3656 for ac_dir in $ac_dummy; do
3657   IFS=$ac_save_IFS
3658   test -z "$ac_dir" && ac_dir=.
3659   $as_executable_p "$ac_dir/$ac_word" || continue
3660 ac_cv_prog_AR="${ac_tool_prefix}ar"
3661 echo "$as_me:3661: found $ac_dir/$ac_word" >&5
3662 break
3663 done
3664
3665 fi
3666 fi
3667 AR=$ac_cv_prog_AR
3668 if test -n "$AR"; then
3669   echo "$as_me:3669: result: $AR" >&5
3670 echo "${ECHO_T}$AR" >&6
3671 else
3672   echo "$as_me:3672: result: no" >&5
3673 echo "${ECHO_T}no" >&6
3674 fi
3675
3676 fi
3677 if test -z "$ac_cv_prog_AR"; then
3678   ac_ct_AR=$AR
3679   # Extract the first word of "ar", so it can be a program name with args.
3680 set dummy ar; ac_word=$2
3681 echo "$as_me:3681: checking for $ac_word" >&5
3682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3683 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3684   echo $ECHO_N "(cached) $ECHO_C" >&6
3685 else
3686   if test -n "$ac_ct_AR"; then
3687   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3688 else
3689   ac_save_IFS=$IFS; IFS=$ac_path_separator
3690 ac_dummy="$PATH"
3691 for ac_dir in $ac_dummy; do
3692   IFS=$ac_save_IFS
3693   test -z "$ac_dir" && ac_dir=.
3694   $as_executable_p "$ac_dir/$ac_word" || continue
3695 ac_cv_prog_ac_ct_AR="ar"
3696 echo "$as_me:3696: found $ac_dir/$ac_word" >&5
3697 break
3698 done
3699
3700   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3701 fi
3702 fi
3703 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3704 if test -n "$ac_ct_AR"; then
3705   echo "$as_me:3705: result: $ac_ct_AR" >&5
3706 echo "${ECHO_T}$ac_ct_AR" >&6
3707 else
3708   echo "$as_me:3708: result: no" >&5
3709 echo "${ECHO_T}no" >&6
3710 fi
3711
3712   AR=$ac_ct_AR
3713 else
3714   AR="$ac_cv_prog_AR"
3715 fi
3716
3717 echo "$as_me:3717: checking for options to update archives" >&5
3718 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3719 if test "${cf_cv_ar_flags+set}" = set; then
3720   echo $ECHO_N "(cached) $ECHO_C" >&6
3721 else
3722
3723         case $cf_cv_system_name in
3724         (*-msvc*)
3725                 cf_cv_ar_flags=''
3726                 cat >mk_static_lib.sh <<-EOF
3727                 #!$SHELL
3728                 MSVC_BIN="$AR"
3729                 out="\$1"
3730                 shift
3731                 exec \$MSVC_BIN -out:"\$out" \$@
3732                 EOF
3733                 chmod +x mk_static_lib.sh
3734                 AR=`pwd`/mk_static_lib.sh
3735                 ;;
3736         (*)
3737                 cf_cv_ar_flags=unknown
3738                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3739                 do
3740
3741                         # check if $ARFLAGS already contains this choice
3742                         if test "x$ARFLAGS" != "x" ; then
3743                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3744                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3745                                         cf_cv_ar_flags=
3746                                         break
3747                                 fi
3748                         fi
3749
3750                         rm -f conftest.$ac_cv_objext
3751                         rm -f conftest.a
3752
3753                         cat >conftest.$ac_ext <<EOF
3754 #line 3754 "configure"
3755 int     testdata[3] = { 123, 456, 789 };
3756 EOF
3757                         if { (eval echo "$as_me:3757: \"$ac_compile\"") >&5
3758   (eval $ac_compile) 2>&5
3759   ac_status=$?
3760   echo "$as_me:3760: \$? = $ac_status" >&5
3761   (exit $ac_status); } ; then
3762                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3763                                 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3764                                 if test -f conftest.a ; then
3765                                         cf_cv_ar_flags=$cf_ar_flags
3766                                         break
3767                                 fi
3768                         else
3769                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3770
3771 echo "${as_me:-configure}:3771: testing cannot compile test-program ..." 1>&5
3772
3773                                 break
3774                         fi
3775                 done
3776                 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3777                 ;;
3778         esac
3779
3780 fi
3781 echo "$as_me:3781: result: $cf_cv_ar_flags" >&5
3782 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3783
3784 if test -n "$ARFLAGS" ; then
3785         if test -n "$cf_cv_ar_flags" ; then
3786                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3787         fi
3788 else
3789         ARFLAGS=$cf_cv_ar_flags
3790 fi
3791
3792         echo "$as_me:3792: checking for PATH separator" >&5
3793 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3794         case $cf_cv_system_name in
3795         (os2*)  PATH_SEPARATOR=';'  ;;
3796         (*)     ${PATH_SEPARATOR:=':'}  ;;
3797         esac
3798
3799         echo "$as_me:3799: result: $PATH_SEPARATOR" >&5
3800 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3801
3802 echo "$as_me:3802: checking if you have specified an install-prefix" >&5
3803 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3804
3805 # Check whether --with-install-prefix or --without-install-prefix was given.
3806 if test "${with_install_prefix+set}" = set; then
3807   withval="$with_install_prefix"
3808   case "$withval" in
3809         (yes|no)
3810                 ;;
3811         (*)     DESTDIR="$withval"
3812                 ;;
3813         esac
3814 fi;
3815 echo "$as_me:3815: result: $DESTDIR" >&5
3816 echo "${ECHO_T}$DESTDIR" >&6
3817
3818 ###############################################################################
3819
3820 # If we're cross-compiling, allow the user to override the tools and their
3821 # options.  The configure script is oriented toward identifying the host
3822 # compiler, etc., but we need a build compiler to generate parts of the source.
3823
3824 if test "$cross_compiling" = yes ; then
3825
3826         # defaults that we might want to override
3827         : ${BUILD_CFLAGS:=''}
3828         : ${BUILD_CPPFLAGS:=''}
3829         : ${BUILD_LDFLAGS:=''}
3830         : ${BUILD_LIBS:=''}
3831         : ${BUILD_EXEEXT:='$x'}
3832         : ${BUILD_OBJEXT:='o'}
3833
3834 # Check whether --with-build-cc or --without-build-cc was given.
3835 if test "${with_build_cc+set}" = set; then
3836   withval="$with_build_cc"
3837   BUILD_CC="$withval"
3838 else
3839   for ac_prog in gcc clang c99 c89 cc cl
3840 do
3841   # Extract the first word of "$ac_prog", so it can be a program name with args.
3842 set dummy $ac_prog; ac_word=$2
3843 echo "$as_me:3843: checking for $ac_word" >&5
3844 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3845 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3846   echo $ECHO_N "(cached) $ECHO_C" >&6
3847 else
3848   if test -n "$BUILD_CC"; then
3849   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3850 else
3851   ac_save_IFS=$IFS; IFS=$ac_path_separator
3852 ac_dummy="$PATH"
3853 for ac_dir in $ac_dummy; do
3854   IFS=$ac_save_IFS
3855   test -z "$ac_dir" && ac_dir=.
3856   $as_executable_p "$ac_dir/$ac_word" || continue
3857 ac_cv_prog_BUILD_CC="$ac_prog"
3858 echo "$as_me:3858: found $ac_dir/$ac_word" >&5
3859 break
3860 done
3861
3862 fi
3863 fi
3864 BUILD_CC=$ac_cv_prog_BUILD_CC
3865 if test -n "$BUILD_CC"; then
3866   echo "$as_me:3866: result: $BUILD_CC" >&5
3867 echo "${ECHO_T}$BUILD_CC" >&6
3868 else
3869   echo "$as_me:3869: result: no" >&5
3870 echo "${ECHO_T}no" >&6
3871 fi
3872
3873   test -n "$BUILD_CC" && break
3874 done
3875 test -n "$BUILD_CC" || BUILD_CC="none"
3876
3877 fi;
3878         echo "$as_me:3878: checking for native build C compiler" >&5
3879 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3880         echo "$as_me:3880: result: $BUILD_CC" >&5
3881 echo "${ECHO_T}$BUILD_CC" >&6
3882
3883         echo "$as_me:3883: checking for native build C preprocessor" >&5
3884 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3885
3886 # Check whether --with-build-cpp or --without-build-cpp was given.
3887 if test "${with_build_cpp+set}" = set; then
3888   withval="$with_build_cpp"
3889   BUILD_CPP="$withval"
3890 else
3891   BUILD_CPP='${BUILD_CC} -E'
3892 fi;
3893         echo "$as_me:3893: result: $BUILD_CPP" >&5
3894 echo "${ECHO_T}$BUILD_CPP" >&6
3895
3896         echo "$as_me:3896: checking for native build C flags" >&5
3897 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3898
3899 # Check whether --with-build-cflags or --without-build-cflags was given.
3900 if test "${with_build_cflags+set}" = set; then
3901   withval="$with_build_cflags"
3902   BUILD_CFLAGS="$withval"
3903 fi;
3904         echo "$as_me:3904: result: $BUILD_CFLAGS" >&5
3905 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3906
3907         echo "$as_me:3907: checking for native build C preprocessor-flags" >&5
3908 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3909
3910 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3911 if test "${with_build_cppflags+set}" = set; then
3912   withval="$with_build_cppflags"
3913   BUILD_CPPFLAGS="$withval"
3914 fi;
3915         echo "$as_me:3915: result: $BUILD_CPPFLAGS" >&5
3916 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3917
3918         echo "$as_me:3918: checking for native build linker-flags" >&5
3919 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3920
3921 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3922 if test "${with_build_ldflags+set}" = set; then
3923   withval="$with_build_ldflags"
3924   BUILD_LDFLAGS="$withval"
3925 fi;
3926         echo "$as_me:3926: result: $BUILD_LDFLAGS" >&5
3927 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3928
3929         echo "$as_me:3929: checking for native build linker-libraries" >&5
3930 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3931
3932 # Check whether --with-build-libs or --without-build-libs was given.
3933 if test "${with_build_libs+set}" = set; then
3934   withval="$with_build_libs"
3935   BUILD_LIBS="$withval"
3936 fi;
3937         echo "$as_me:3937: result: $BUILD_LIBS" >&5
3938 echo "${ECHO_T}$BUILD_LIBS" >&6
3939
3940         # this assumes we're on Unix.
3941         BUILD_EXEEXT=
3942         BUILD_OBJEXT=o
3943
3944         : ${BUILD_CC:='${CC}'}
3945
3946         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3947                 { { echo "$as_me:3947: error: Cross-build requires two compilers.
3948 Use --with-build-cc to specify the native compiler." >&5
3949 echo "$as_me: error: Cross-build requires two compilers.
3950 Use --with-build-cc to specify the native compiler." >&2;}
3951    { (exit 1); exit 1; }; }
3952         fi
3953
3954 else
3955         : ${BUILD_CC:='${CC}'}
3956         : ${BUILD_CPP:='${CPP}'}
3957         : ${BUILD_CFLAGS:='${CFLAGS}'}
3958         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3959         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3960         : ${BUILD_LIBS:='${LIBS}'}
3961         : ${BUILD_EXEEXT:='$x'}
3962         : ${BUILD_OBJEXT:='o'}
3963 fi
3964
3965 ###############################################################################
3966
3967 ### Options to allow the user to specify the set of libraries which are used.
3968 ### Use "--without-normal --with-shared" to allow the default model to be
3969 ### shared, for example.
3970 cf_list_models=""
3971
3972 echo "$as_me:3972: checking if you want to build shared C-objects" >&5
3973 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3974
3975 # Check whether --with-shared or --without-shared was given.
3976 if test "${with_shared+set}" = set; then
3977   withval="$with_shared"
3978   with_shared=$withval
3979 else
3980   with_shared=no
3981 fi;
3982 echo "$as_me:3982: result: $with_shared" >&5
3983 echo "${ECHO_T}$with_shared" >&6
3984 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3985
3986 echo "$as_me:3986: checking for specified models" >&5
3987 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3988 test -z "$cf_list_models" && cf_list_models=normal
3989 echo "$as_me:3989: result: $cf_list_models" >&5
3990 echo "${ECHO_T}$cf_list_models" >&6
3991
3992 ### Use the first model as the default, and save its suffix for use in building
3993 ### up test-applications.
3994 echo "$as_me:3994: checking for default model" >&5
3995 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3996 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3997 echo "$as_me:3997: result: $DFT_LWR_MODEL" >&5
3998 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3999
4000 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4001
4002 echo "$as_me:4002: checking for specific curses-directory" >&5
4003 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4004
4005 # Check whether --with-curses-dir or --without-curses-dir was given.
4006 if test "${with_curses_dir+set}" = set; then
4007   withval="$with_curses_dir"
4008   cf_cv_curses_dir=$withval
4009 else
4010   cf_cv_curses_dir=no
4011 fi;
4012 echo "$as_me:4012: result: $cf_cv_curses_dir" >&5
4013 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4014
4015 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4016 then
4017
4018 if test "x$prefix" != xNONE; then
4019         cf_path_syntax="$prefix"
4020 else
4021         cf_path_syntax="$ac_default_prefix"
4022 fi
4023
4024 case ".$withval" in
4025 (.\$\(*\)*|.\'*\'*)
4026         ;;
4027 (..|./*|.\\*)
4028         ;;
4029 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4030         ;;
4031 (.\${*prefix}*|.\${*dir}*)
4032         eval withval="$withval"
4033         case ".$withval" in
4034         (.NONE/*)
4035                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4036                 ;;
4037         esac
4038         ;;
4039 (.no|.NONE/*)
4040         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4041         ;;
4042 (*)
4043         { { echo "$as_me:4043: error: expected a pathname, not \"$withval\"" >&5
4044 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4045    { (exit 1); exit 1; }; }
4046         ;;
4047 esac
4048
4049         if test -d "$cf_cv_curses_dir"
4050         then
4051
4052 if test -n "$cf_cv_curses_dir/include" ; then
4053   for cf_add_incdir in $cf_cv_curses_dir/include
4054   do
4055         while test $cf_add_incdir != /usr/include
4056         do
4057           if test -d $cf_add_incdir
4058           then
4059                 cf_have_incdir=no
4060                 if test -n "$CFLAGS$CPPFLAGS" ; then
4061                   # a loop is needed to ensure we can add subdirs of existing dirs
4062                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4063                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4064                           cf_have_incdir=yes; break
4065                         fi
4066                   done
4067                 fi
4068
4069                 if test "$cf_have_incdir" = no ; then
4070                   if test "$cf_add_incdir" = /usr/local/include ; then
4071                         if test "$GCC" = yes
4072                         then
4073                           cf_save_CPPFLAGS=$CPPFLAGS
4074
4075         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4076         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4077
4078                           cat >conftest.$ac_ext <<_ACEOF
4079 #line 4079 "configure"
4080 #include "confdefs.h"
4081 #include <stdio.h>
4082 int
4083 main (void)
4084 {
4085 printf("Hello")
4086   ;
4087   return 0;
4088 }
4089 _ACEOF
4090 rm -f conftest.$ac_objext
4091 if { (eval echo "$as_me:4091: \"$ac_compile\"") >&5
4092   (eval $ac_compile) 2>&5
4093   ac_status=$?
4094   echo "$as_me:4094: \$? = $ac_status" >&5
4095   (exit $ac_status); } &&
4096          { ac_try='test -s conftest.$ac_objext'
4097   { (eval echo "$as_me:4097: \"$ac_try\"") >&5
4098   (eval $ac_try) 2>&5
4099   ac_status=$?
4100   echo "$as_me:4100: \$? = $ac_status" >&5
4101   (exit $ac_status); }; }; then
4102   :
4103 else
4104   echo "$as_me: failed program was:" >&5
4105 cat conftest.$ac_ext >&5
4106 cf_have_incdir=yes
4107 fi
4108 rm -f conftest.$ac_objext conftest.$ac_ext
4109                           CPPFLAGS=$cf_save_CPPFLAGS
4110                         fi
4111                   fi
4112                 fi
4113
4114                 if test "$cf_have_incdir" = no ; then
4115                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4116
4117 echo "${as_me:-configure}:4117: testing adding $cf_add_incdir to include-path ..." 1>&5
4118
4119                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4120
4121                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4122                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4123                   cf_add_incdir="$cf_top_incdir"
4124                 else
4125                   break
4126                 fi
4127           else
4128                 break
4129           fi
4130         done
4131   done
4132 fi
4133
4134 if test -n "$cf_cv_curses_dir/lib" ; then
4135         for cf_add_libdir in $cf_cv_curses_dir/lib
4136         do
4137                 if test $cf_add_libdir = /usr/lib ; then
4138                         :
4139                 elif test -d $cf_add_libdir
4140                 then
4141                         cf_have_libdir=no
4142                         if test -n "$LDFLAGS$LIBS" ; then
4143                                 # a loop is needed to ensure we can add subdirs of existing dirs
4144                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4145                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4146                                                 cf_have_libdir=yes; break
4147                                         fi
4148                                 done
4149                         fi
4150                         if test "$cf_have_libdir" = no ; then
4151                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4152
4153 echo "${as_me:-configure}:4153: testing adding $cf_add_libdir to library-path ..." 1>&5
4154
4155                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4156                         fi
4157                 fi
4158         done
4159 fi
4160
4161         fi
4162 fi
4163
4164 cf_ncuconfig_root=ncurses
4165 cf_have_ncuconfig=no
4166
4167 if test "x${PKG_CONFIG:=none}" != xnone; then
4168         echo "$as_me:4168: checking pkg-config for $cf_ncuconfig_root" >&5
4169 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4170         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4171                 echo "$as_me:4171: result: yes" >&5
4172 echo "${ECHO_T}yes" >&6
4173
4174                 echo "$as_me:4174: checking if the $cf_ncuconfig_root package files work" >&5
4175 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4176                 cf_have_ncuconfig=unknown
4177
4178                 cf_save_CFLAGS="$CFLAGS"
4179                 cf_save_CPPFLAGS="$CPPFLAGS"
4180                 cf_save_LIBS="$LIBS"
4181
4182                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4183                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4184
4185                 # while -W for passing linker flags is prevalent, it is not "standard".
4186                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4187                 # incompatible _and_ non-standard -W option which gives an error.  Work
4188                 # around that pitfall.
4189                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4190                 (x*c[89]9@@*-W*)
4191
4192 cf_fix_cppflags=no
4193 cf_new_cflags=
4194 cf_new_cppflags=
4195 cf_new_extra_cppflags=
4196
4197 for cf_add_cflags in $cf_pkg_cflags
4198 do
4199 case $cf_fix_cppflags in
4200 (no)
4201         case $cf_add_cflags in
4202         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4203                 case $cf_add_cflags in
4204                 (-D*)
4205                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4206
4207                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4208                                 && test -z "${cf_tst_cflags}" \
4209                                 && cf_fix_cppflags=yes
4210
4211                         if test $cf_fix_cppflags = yes ; then
4212
4213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4215
4216                                 continue
4217                         elif test "${cf_tst_cflags}" = "\"'" ; then
4218
4219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4221
4222                                 continue
4223                         fi
4224                         ;;
4225                 esac
4226                 case "$CPPFLAGS" in
4227                 (*$cf_add_cflags)
4228                         ;;
4229                 (*)
4230                         case $cf_add_cflags in
4231                         (-D*)
4232                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4233
4234 CPPFLAGS=`echo "$CPPFLAGS" | \
4235         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4236                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4237
4238                                 ;;
4239                         esac
4240
4241         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4242         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4243
4244                         ;;
4245                 esac
4246                 ;;
4247         (*)
4248
4249         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4250         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4251
4252                 ;;
4253         esac
4254         ;;
4255 (yes)
4256
4257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4259
4260         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4261
4262         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4263                 && test -z "${cf_tst_cflags}" \
4264                 && cf_fix_cppflags=no
4265         ;;
4266 esac
4267 done
4268
4269 if test -n "$cf_new_cflags" ; then
4270
4271         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4272         CFLAGS="${CFLAGS}$cf_new_cflags"
4273
4274 fi
4275
4276 if test -n "$cf_new_cppflags" ; then
4277
4278         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4279         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4280
4281 fi
4282
4283 if test -n "$cf_new_extra_cppflags" ; then
4284
4285         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4286         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4287
4288 fi
4289
4290 cf_add_libs="$LIBS"
4291 # reverse order
4292 cf_add_0lib=
4293 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4294 # filter duplicates
4295 for cf_add_1lib in $cf_add_0lib; do
4296         for cf_add_2lib in $cf_add_libs; do
4297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4298                         cf_add_1lib=
4299                         break
4300                 fi
4301         done
4302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4303 done
4304 LIBS="$cf_add_libs"
4305
4306                         cat >conftest.$ac_ext <<_ACEOF
4307 #line 4307 "configure"
4308 #include "confdefs.h"
4309 #include <${cf_cv_ncurses_header:-curses.h}>
4310 int
4311 main (void)
4312 {
4313 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4314   ;
4315   return 0;
4316 }
4317 _ACEOF
4318 rm -f conftest.$ac_objext conftest$ac_exeext
4319 if { (eval echo "$as_me:4319: \"$ac_link\"") >&5
4320   (eval $ac_link) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit $ac_status); } &&
4324          { ac_try='test -s conftest$ac_exeext'
4325   { (eval echo "$as_me:4325: \"$ac_try\"") >&5
4326   (eval $ac_try) 2>&5
4327   ac_status=$?
4328   echo "$as_me:4328: \$? = $ac_status" >&5
4329   (exit $ac_status); }; }; then
4330   if test "$cross_compiling" = yes; then
4331   cf_test_ncuconfig=maybe
4332 else
4333   cat >conftest.$ac_ext <<_ACEOF
4334 #line 4334 "configure"
4335 #include "confdefs.h"
4336 #include <${cf_cv_ncurses_header:-curses.h}>
4337                                         int main(void)
4338                                         { char *xx = curses_version(); return (xx == 0); }
4339 _ACEOF
4340 rm -f conftest$ac_exeext
4341 if { (eval echo "$as_me:4341: \"$ac_link\"") >&5
4342   (eval $ac_link) 2>&5
4343   ac_status=$?
4344   echo "$as_me:4344: \$? = $ac_status" >&5
4345   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4346   { (eval echo "$as_me:4346: \"$ac_try\"") >&5
4347   (eval $ac_try) 2>&5
4348   ac_status=$?
4349   echo "$as_me:4349: \$? = $ac_status" >&5
4350   (exit $ac_status); }; }; then
4351   cf_test_ncuconfig=yes
4352 else
4353   echo "$as_me: program exited with status $ac_status" >&5
4354 echo "$as_me: failed program was:" >&5
4355 cat conftest.$ac_ext >&5
4356 cf_test_ncuconfig=no
4357 fi
4358 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4359 fi
4360 else
4361   echo "$as_me: failed program was:" >&5
4362 cat conftest.$ac_ext >&5
4363 cf_test_ncuconfig=no
4364 fi
4365 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4366
4367                         CFLAGS="$cf_save_CFLAGS"
4368                         CPPFLAGS="$cf_save_CPPFLAGS"
4369                         LIBS="$cf_save_LIBS"
4370
4371                         if test "x$cf_test_ncuconfig" != xyes; then
4372                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4373                                 cf_pkg_cflags="$cf_temp"
4374                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4375                                 cf_pkg_libs="$cf_temp"
4376                         fi
4377                         ;;
4378                 esac
4379
4380 cf_fix_cppflags=no
4381 cf_new_cflags=
4382 cf_new_cppflags=
4383 cf_new_extra_cppflags=
4384
4385 for cf_add_cflags in $cf_pkg_cflags
4386 do
4387 case $cf_fix_cppflags in
4388 (no)
4389         case $cf_add_cflags in
4390         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4391                 case $cf_add_cflags in
4392                 (-D*)
4393                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4394
4395                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4396                                 && test -z "${cf_tst_cflags}" \
4397                                 && cf_fix_cppflags=yes
4398
4399                         if test $cf_fix_cppflags = yes ; then
4400
4401         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4402         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4403
4404                                 continue
4405                         elif test "${cf_tst_cflags}" = "\"'" ; then
4406
4407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4409
4410                                 continue
4411                         fi
4412                         ;;
4413                 esac
4414                 case "$CPPFLAGS" in
4415                 (*$cf_add_cflags)
4416                         ;;
4417                 (*)
4418                         case $cf_add_cflags in
4419                         (-D*)
4420                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4421
4422 CPPFLAGS=`echo "$CPPFLAGS" | \
4423         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4424                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4425
4426                                 ;;
4427                         esac
4428
4429         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4430         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4431
4432                         ;;
4433                 esac
4434                 ;;
4435         (*)
4436
4437         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4438         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4439
4440                 ;;
4441         esac
4442         ;;
4443 (yes)
4444
4445         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4446         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4447
4448         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4449
4450         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4451                 && test -z "${cf_tst_cflags}" \
4452                 && cf_fix_cppflags=no
4453         ;;
4454 esac
4455 done
4456
4457 if test -n "$cf_new_cflags" ; then
4458
4459         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4460         CFLAGS="${CFLAGS}$cf_new_cflags"
4461
4462 fi
4463
4464 if test -n "$cf_new_cppflags" ; then
4465
4466         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4467         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4468
4469 fi
4470
4471 if test -n "$cf_new_extra_cppflags" ; then
4472
4473         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4474         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4475
4476 fi
4477
4478 cf_add_libs="$LIBS"
4479 # reverse order
4480 cf_add_0lib=
4481 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4482 # filter duplicates
4483 for cf_add_1lib in $cf_add_0lib; do
4484         for cf_add_2lib in $cf_add_libs; do
4485                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4486                         cf_add_1lib=
4487                         break
4488                 fi
4489         done
4490         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4491 done
4492 LIBS="$cf_add_libs"
4493
4494                 cat >conftest.$ac_ext <<_ACEOF
4495 #line 4495 "configure"
4496 #include "confdefs.h"
4497 #include <${cf_cv_ncurses_header:-curses.h}>
4498 int
4499 main (void)
4500 {
4501 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4502   ;
4503   return 0;
4504 }
4505 _ACEOF
4506 rm -f conftest.$ac_objext conftest$ac_exeext
4507 if { (eval echo "$as_me:4507: \"$ac_link\"") >&5
4508   (eval $ac_link) 2>&5
4509   ac_status=$?
4510   echo "$as_me:4510: \$? = $ac_status" >&5
4511   (exit $ac_status); } &&
4512          { ac_try='test -s conftest$ac_exeext'
4513   { (eval echo "$as_me:4513: \"$ac_try\"") >&5
4514   (eval $ac_try) 2>&5
4515   ac_status=$?
4516   echo "$as_me:4516: \$? = $ac_status" >&5
4517   (exit $ac_status); }; }; then
4518   if test "$cross_compiling" = yes; then
4519   cf_have_ncuconfig=maybe
4520 else
4521   cat >conftest.$ac_ext <<_ACEOF
4522 #line 4522 "configure"
4523 #include "confdefs.h"
4524 #include <${cf_cv_ncurses_header:-curses.h}>
4525                                 int main(void)
4526                                 { char *xx = curses_version(); return (xx == 0); }
4527 _ACEOF
4528 rm -f conftest$ac_exeext
4529 if { (eval echo "$as_me:4529: \"$ac_link\"") >&5
4530   (eval $ac_link) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4534   { (eval echo "$as_me:4534: \"$ac_try\"") >&5
4535   (eval $ac_try) 2>&5
4536   ac_status=$?
4537   echo "$as_me:4537: \$? = $ac_status" >&5
4538   (exit $ac_status); }; }; then
4539   cf_have_ncuconfig=yes
4540 else
4541   echo "$as_me: program exited with status $ac_status" >&5
4542 echo "$as_me: failed program was:" >&5
4543 cat conftest.$ac_ext >&5
4544 cf_have_ncuconfig=no
4545 fi
4546 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4547 fi
4548 else
4549   echo "$as_me: failed program was:" >&5
4550 cat conftest.$ac_ext >&5
4551 cf_have_ncuconfig=no
4552 fi
4553 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4554                 echo "$as_me:4554: result: $cf_have_ncuconfig" >&5
4555 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4556                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4557                 if test "$cf_have_ncuconfig" != "yes"
4558                 then
4559                         CPPFLAGS="$cf_save_CPPFLAGS"
4560                         LIBS="$cf_save_LIBS"
4561                         NCURSES_CONFIG_PKG=none
4562                 else
4563
4564 cat >>confdefs.h <<\EOF
4565 #define NCURSES 1
4566 EOF
4567
4568                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4569
4570 echo "$as_me:4570: checking for terminfo header" >&5
4571 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4572 if test "${cf_cv_term_header+set}" = set; then
4573   echo $ECHO_N "(cached) $ECHO_C" >&6
4574 else
4575
4576 case ${cf_cv_ncurses_header} in
4577 (*/ncurses.h|*/ncursesw.h)
4578         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4579         ;;
4580 (*)
4581         cf_term_header=term.h
4582         ;;
4583 esac
4584
4585 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4586 do
4587 cat >conftest.$ac_ext <<_ACEOF
4588 #line 4588 "configure"
4589 #include "confdefs.h"
4590 #include <stdio.h>
4591 #include <${cf_cv_ncurses_header:-curses.h}>
4592 #include <$cf_test>
4593
4594 int
4595 main (void)
4596 {
4597 int x = auto_left_margin; (void)x
4598   ;
4599   return 0;
4600 }
4601 _ACEOF
4602 rm -f conftest.$ac_objext
4603 if { (eval echo "$as_me:4603: \"$ac_compile\"") >&5
4604   (eval $ac_compile) 2>&5
4605   ac_status=$?
4606   echo "$as_me:4606: \$? = $ac_status" >&5
4607   (exit $ac_status); } &&
4608          { ac_try='test -s conftest.$ac_objext'
4609   { (eval echo "$as_me:4609: \"$ac_try\"") >&5
4610   (eval $ac_try) 2>&5
4611   ac_status=$?
4612   echo "$as_me:4612: \$? = $ac_status" >&5
4613   (exit $ac_status); }; }; then
4614
4615         cf_cv_term_header="$cf_test"
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat conftest.$ac_ext >&5
4619
4620         cf_cv_term_header=unknown
4621
4622 fi
4623 rm -f conftest.$ac_objext conftest.$ac_ext
4624         test "$cf_cv_term_header" != unknown && break
4625 done
4626
4627 fi
4628 echo "$as_me:4628: result: $cf_cv_term_header" >&5
4629 echo "${ECHO_T}$cf_cv_term_header" >&6
4630
4631 # Set definitions to allow ifdef'ing to accommodate subdirectories
4632
4633 case $cf_cv_term_header in
4634 (*term.h)
4635
4636 cat >>confdefs.h <<\EOF
4637 #define HAVE_TERM_H 1
4638 EOF
4639
4640         ;;
4641 esac
4642
4643 case $cf_cv_term_header in
4644 (ncurses/term.h)
4645
4646 cat >>confdefs.h <<\EOF
4647 #define HAVE_NCURSES_TERM_H 1
4648 EOF
4649
4650         ;;
4651 (ncursesw/term.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_NCURSESW_TERM_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660                 fi
4661
4662         else
4663                 echo "$as_me:4663: result: no" >&5
4664 echo "${ECHO_T}no" >&6
4665                 NCURSES_CONFIG_PKG=none
4666         fi
4667 else
4668         NCURSES_CONFIG_PKG=none
4669 fi
4670
4671 if test "x$cf_have_ncuconfig" = "xno"; then
4672         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4673
4674 if test -n "$ac_tool_prefix"; then
4675   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4676   do
4677     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4678 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4679 echo "$as_me:4679: checking for $ac_word" >&5
4680 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4681 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4682   echo $ECHO_N "(cached) $ECHO_C" >&6
4683 else
4684   if test -n "$NCURSES_CONFIG"; then
4685   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4686 else
4687   ac_save_IFS=$IFS; IFS=$ac_path_separator
4688 ac_dummy="$PATH"
4689 for ac_dir in $ac_dummy; do
4690   IFS=$ac_save_IFS
4691   test -z "$ac_dir" && ac_dir=.
4692   $as_executable_p "$ac_dir/$ac_word" || continue
4693 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4694 echo "$as_me:4694: found $ac_dir/$ac_word" >&5
4695 break
4696 done
4697
4698 fi
4699 fi
4700 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4701 if test -n "$NCURSES_CONFIG"; then
4702   echo "$as_me:4702: result: $NCURSES_CONFIG" >&5
4703 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4704 else
4705   echo "$as_me:4705: result: no" >&5
4706 echo "${ECHO_T}no" >&6
4707 fi
4708
4709     test -n "$NCURSES_CONFIG" && break
4710   done
4711 fi
4712 if test -z "$NCURSES_CONFIG"; then
4713   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4714   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4715 do
4716   # Extract the first word of "$ac_prog", so it can be a program name with args.
4717 set dummy $ac_prog; ac_word=$2
4718 echo "$as_me:4718: checking for $ac_word" >&5
4719 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4720 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4721   echo $ECHO_N "(cached) $ECHO_C" >&6
4722 else
4723   if test -n "$ac_ct_NCURSES_CONFIG"; then
4724   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4725 else
4726   ac_save_IFS=$IFS; IFS=$ac_path_separator
4727 ac_dummy="$PATH"
4728 for ac_dir in $ac_dummy; do
4729   IFS=$ac_save_IFS
4730   test -z "$ac_dir" && ac_dir=.
4731   $as_executable_p "$ac_dir/$ac_word" || continue
4732 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4733 echo "$as_me:4733: found $ac_dir/$ac_word" >&5
4734 break
4735 done
4736
4737 fi
4738 fi
4739 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4740 if test -n "$ac_ct_NCURSES_CONFIG"; then
4741   echo "$as_me:4741: result: $ac_ct_NCURSES_CONFIG" >&5
4742 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4743 else
4744   echo "$as_me:4744: result: no" >&5
4745 echo "${ECHO_T}no" >&6
4746 fi
4747
4748   test -n "$ac_ct_NCURSES_CONFIG" && break
4749 done
4750 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4751
4752   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4753 fi
4754
4755         if test "$NCURSES_CONFIG" != none ; then
4756
4757 cf_fix_cppflags=no
4758 cf_new_cflags=
4759 cf_new_cppflags=
4760 cf_new_extra_cppflags=
4761
4762 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4763 do
4764 case $cf_fix_cppflags in
4765 (no)
4766         case $cf_add_cflags in
4767         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4768                 case $cf_add_cflags in
4769                 (-D*)
4770                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4771
4772                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4773                                 && test -z "${cf_tst_cflags}" \
4774                                 && cf_fix_cppflags=yes
4775
4776                         if test $cf_fix_cppflags = yes ; then
4777
4778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4780
4781                                 continue
4782                         elif test "${cf_tst_cflags}" = "\"'" ; then
4783
4784         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4785         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4786
4787                                 continue
4788                         fi
4789                         ;;
4790                 esac
4791                 case "$CPPFLAGS" in
4792                 (*$cf_add_cflags)
4793                         ;;
4794                 (*)
4795                         case $cf_add_cflags in
4796                         (-D*)
4797                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4798
4799 CPPFLAGS=`echo "$CPPFLAGS" | \
4800         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4801                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4802
4803                                 ;;
4804                         esac
4805
4806         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4807         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4808
4809                         ;;
4810                 esac
4811                 ;;
4812         (*)
4813
4814         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4815         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4816
4817                 ;;
4818         esac
4819         ;;
4820 (yes)
4821
4822         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4823         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4824
4825         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4826
4827         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4828                 && test -z "${cf_tst_cflags}" \
4829                 && cf_fix_cppflags=no
4830         ;;
4831 esac
4832 done
4833
4834 if test -n "$cf_new_cflags" ; then
4835
4836         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4837         CFLAGS="${CFLAGS}$cf_new_cflags"
4838
4839 fi
4840
4841 if test -n "$cf_new_cppflags" ; then
4842
4843         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4844         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4845
4846 fi
4847
4848 if test -n "$cf_new_extra_cppflags" ; then
4849
4850         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4851         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4852
4853 fi
4854
4855 cf_add_libs="$LIBS"
4856 # reverse order
4857 cf_add_0lib=
4858 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4859 # filter duplicates
4860 for cf_add_1lib in $cf_add_0lib; do
4861         for cf_add_2lib in $cf_add_libs; do
4862                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4863                         cf_add_1lib=
4864                         break
4865                 fi
4866         done
4867         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4868 done
4869 LIBS="$cf_add_libs"
4870
4871                 # even with config script, some packages use no-override for curses.h
4872
4873 echo "$as_me:4873: checking if we have identified curses headers" >&5
4874 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4875 if test "${cf_cv_ncurses_header+set}" = set; then
4876   echo $ECHO_N "(cached) $ECHO_C" >&6
4877 else
4878
4879 cf_cv_ncurses_header=none
4880 for cf_header in \
4881         ncurses.h ncurses/ncurses.h \
4882         curses.h ncurses/curses.h
4883 do
4884 cat >conftest.$ac_ext <<_ACEOF
4885 #line 4885 "configure"
4886 #include "confdefs.h"
4887 #include <${cf_header}>
4888 int
4889 main (void)
4890 {
4891 initscr(); tgoto("?", 0,0)
4892   ;
4893   return 0;
4894 }
4895 _ACEOF
4896 rm -f conftest.$ac_objext
4897 if { (eval echo "$as_me:4897: \"$ac_compile\"") >&5
4898   (eval $ac_compile) 2>&5
4899   ac_status=$?
4900   echo "$as_me:4900: \$? = $ac_status" >&5
4901   (exit $ac_status); } &&
4902          { ac_try='test -s conftest.$ac_objext'
4903   { (eval echo "$as_me:4903: \"$ac_try\"") >&5
4904   (eval $ac_try) 2>&5
4905   ac_status=$?
4906   echo "$as_me:4906: \$? = $ac_status" >&5
4907   (exit $ac_status); }; }; then
4908   cf_cv_ncurses_header=$cf_header; break
4909 else
4910   echo "$as_me: failed program was:" >&5
4911 cat conftest.$ac_ext >&5
4912 fi
4913 rm -f conftest.$ac_objext conftest.$ac_ext
4914 done
4915
4916 fi
4917 echo "$as_me:4917: result: $cf_cv_ncurses_header" >&5
4918 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4919
4920 if test "$cf_cv_ncurses_header" = none ; then
4921         { { echo "$as_me:4921: error: No curses header-files found" >&5
4922 echo "$as_me: error: No curses header-files found" >&2;}
4923    { (exit 1); exit 1; }; }
4924 fi
4925
4926 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4927
4928 for ac_header in $cf_cv_ncurses_header
4929 do
4930 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4931 echo "$as_me:4931: checking for $ac_header" >&5
4932 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4933 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4934   echo $ECHO_N "(cached) $ECHO_C" >&6
4935 else
4936   cat >conftest.$ac_ext <<_ACEOF
4937 #line 4937 "configure"
4938 #include "confdefs.h"
4939 #include <$ac_header>
4940 _ACEOF
4941 if { (eval echo "$as_me:4941: \"$ac_cpp conftest.$ac_ext\"") >&5
4942   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4943   ac_status=$?
4944   egrep -v '^ *\+' conftest.er1 >conftest.err
4945   rm -f conftest.er1
4946   cat conftest.err >&5
4947   echo "$as_me:4947: \$? = $ac_status" >&5
4948   (exit $ac_status); } >/dev/null; then
4949   if test -s conftest.err; then
4950     ac_cpp_err=$ac_c_preproc_warn_flag
4951   else
4952     ac_cpp_err=
4953   fi
4954 else
4955   ac_cpp_err=yes
4956 fi
4957 if test -z "$ac_cpp_err"; then
4958   eval "$as_ac_Header=yes"
4959 else
4960   echo "$as_me: failed program was:" >&5
4961   cat conftest.$ac_ext >&5
4962   eval "$as_ac_Header=no"
4963 fi
4964 rm -f conftest.err conftest.$ac_ext
4965 fi
4966 echo "$as_me:4966: result: `eval echo '${'$as_ac_Header'}'`" >&5
4967 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4968 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4969   cat >>confdefs.h <<EOF
4970 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4971 EOF
4972
4973 fi
4974 done
4975
4976 cat >>confdefs.h <<\EOF
4977 #define NCURSES 1
4978 EOF
4979
4980 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4981
4982                 cat >>confdefs.h <<EOF
4983 #define $cf_nculib_ROOT 1
4984 EOF
4985
4986                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4987
4988         else
4989
4990 cf_ncuhdr_root=ncurses
4991
4992 test -n "$cf_cv_curses_dir" && \
4993 test "$cf_cv_curses_dir" != "no" && { \
4994
4995 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4996   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4997   do
4998         while test $cf_add_incdir != /usr/include
4999         do
5000           if test -d $cf_add_incdir
5001           then
5002                 cf_have_incdir=no
5003                 if test -n "$CFLAGS$CPPFLAGS" ; then
5004                   # a loop is needed to ensure we can add subdirs of existing dirs
5005                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5006                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5007                           cf_have_incdir=yes; break
5008                         fi
5009                   done
5010                 fi
5011
5012                 if test "$cf_have_incdir" = no ; then
5013                   if test "$cf_add_incdir" = /usr/local/include ; then
5014                         if test "$GCC" = yes
5015                         then
5016                           cf_save_CPPFLAGS=$CPPFLAGS
5017
5018         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5019         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5020
5021                           cat >conftest.$ac_ext <<_ACEOF
5022 #line 5022 "configure"
5023 #include "confdefs.h"
5024 #include <stdio.h>
5025 int
5026 main (void)
5027 {
5028 printf("Hello")
5029   ;
5030   return 0;
5031 }
5032 _ACEOF
5033 rm -f conftest.$ac_objext
5034 if { (eval echo "$as_me:5034: \"$ac_compile\"") >&5
5035   (eval $ac_compile) 2>&5
5036   ac_status=$?
5037   echo "$as_me:5037: \$? = $ac_status" >&5
5038   (exit $ac_status); } &&
5039          { ac_try='test -s conftest.$ac_objext'
5040   { (eval echo "$as_me:5040: \"$ac_try\"") >&5
5041   (eval $ac_try) 2>&5
5042   ac_status=$?
5043   echo "$as_me:5043: \$? = $ac_status" >&5
5044   (exit $ac_status); }; }; then
5045   :
5046 else
5047   echo "$as_me: failed program was:" >&5
5048 cat conftest.$ac_ext >&5
5049 cf_have_incdir=yes
5050 fi
5051 rm -f conftest.$ac_objext conftest.$ac_ext
5052                           CPPFLAGS=$cf_save_CPPFLAGS
5053                         fi
5054                   fi
5055                 fi
5056
5057                 if test "$cf_have_incdir" = no ; then
5058                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5059
5060 echo "${as_me:-configure}:5060: testing adding $cf_add_incdir to include-path ..." 1>&5
5061
5062                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5063
5064                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5065                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5066                   cf_add_incdir="$cf_top_incdir"
5067                 else
5068                   break
5069                 fi
5070           else
5071                 break
5072           fi
5073         done
5074   done
5075 fi
5076
5077 }
5078
5079 echo "$as_me:5079: checking for $cf_ncuhdr_root header in include-path" >&5
5080 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5081 if test "${cf_cv_ncurses_h+set}" = set; then
5082   echo $ECHO_N "(cached) $ECHO_C" >&6
5083 else
5084
5085         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5086         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5087         for cf_header in $cf_header_list
5088         do
5089
5090         cat >conftest.$ac_ext <<_ACEOF
5091 #line 5091 "configure"
5092 #include "confdefs.h"
5093
5094 #include <$cf_header>
5095 int
5096 main (void)
5097 {
5098
5099 #ifdef NCURSES_VERSION
5100
5101 printf("%s\n", NCURSES_VERSION);
5102 #else
5103 #ifdef __NCURSES_H
5104 printf("old\n");
5105 #else
5106         make an error
5107 #endif
5108 #endif
5109
5110   ;
5111   return 0;
5112 }
5113 _ACEOF
5114 rm -f conftest.$ac_objext
5115 if { (eval echo "$as_me:5115: \"$ac_compile\"") >&5
5116   (eval $ac_compile) 2>&5
5117   ac_status=$?
5118   echo "$as_me:5118: \$? = $ac_status" >&5
5119   (exit $ac_status); } &&
5120          { ac_try='test -s conftest.$ac_objext'
5121   { (eval echo "$as_me:5121: \"$ac_try\"") >&5
5122   (eval $ac_try) 2>&5
5123   ac_status=$?
5124   echo "$as_me:5124: \$? = $ac_status" >&5
5125   (exit $ac_status); }; }; then
5126   cf_cv_ncurses_h=$cf_header
5127
5128 else
5129   echo "$as_me: failed program was:" >&5
5130 cat conftest.$ac_ext >&5
5131 cf_cv_ncurses_h=no
5132 fi
5133 rm -f conftest.$ac_objext conftest.$ac_ext
5134
5135                 test "$cf_cv_ncurses_h" != no && break
5136         done
5137
5138 fi
5139 echo "$as_me:5139: result: $cf_cv_ncurses_h" >&5
5140 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5141
5142 if test "$cf_cv_ncurses_h" != no ; then
5143         cf_cv_ncurses_header=$cf_cv_ncurses_h
5144 else
5145
5146 echo "$as_me:5146: checking for $cf_ncuhdr_root include-path" >&5
5147 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5148 if test "${cf_cv_ncurses_h2+set}" = set; then
5149   echo $ECHO_N "(cached) $ECHO_C" >&6
5150 else
5151
5152         test -n "$verbose" && echo
5153
5154 cf_search=
5155
5156 # collect the current set of include-directories from compiler flags
5157 cf_header_path_list=""
5158 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5159         for cf_header_path in $CPPFLAGS $CFLAGS
5160         do
5161                 case $cf_header_path in
5162                 (-I*)
5163                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5164
5165 test "x$cf_header_path" != "xNONE" && \
5166 test -d "$cf_header_path" && \
5167  {
5168         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5169         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5170         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5171         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5172         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5173         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"
5174 }
5175
5176                         cf_header_path_list="$cf_header_path_list $cf_search"
5177                         ;;
5178                 esac
5179         done
5180 fi
5181
5182 # add the variations for the package we are looking for
5183
5184 cf_search=
5185
5186 test "x$prefix" != "xNONE" && \
5187 test -d "$prefix" && \
5188  {
5189         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5190         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5191         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5192         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5193         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5194         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5195 }
5196
5197 for cf_subdir_prefix in \
5198         /usr \
5199         /usr/local \
5200         /usr/pkg \
5201         /opt \
5202         /opt/local \
5203         $HOME
5204 do
5205
5206 test "x$cf_subdir_prefix" != "x$prefix" && \
5207 test -d "$cf_subdir_prefix" && \
5208 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5209         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5210         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5211         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5212         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5213         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5214         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"
5215 }
5216
5217 done
5218
5219 test "$includedir" != NONE && \
5220 test "$includedir" != "/usr/include" && \
5221 test -d "$includedir" && {
5222         test -d $includedir &&    cf_search="$cf_search $includedir"
5223         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5224 }
5225
5226 test "$oldincludedir" != NONE && \
5227 test "$oldincludedir" != "/usr/include" && \
5228 test -d "$oldincludedir" && {
5229         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5230         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5231 }
5232
5233 cf_search="$cf_search $cf_header_path_list"
5234
5235         test -n "$verbose" && echo search path $cf_search
5236         cf_save2_CPPFLAGS="$CPPFLAGS"
5237         for cf_incdir in $cf_search
5238         do
5239
5240 if test -n "$cf_incdir" ; then
5241   for cf_add_incdir in $cf_incdir
5242   do
5243         while test $cf_add_incdir != /usr/include
5244         do
5245           if test -d $cf_add_incdir
5246           then
5247                 cf_have_incdir=no
5248                 if test -n "$CFLAGS$CPPFLAGS" ; then
5249                   # a loop is needed to ensure we can add subdirs of existing dirs
5250                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5251                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5252                           cf_have_incdir=yes; break
5253                         fi
5254                   done
5255                 fi
5256
5257                 if test "$cf_have_incdir" = no ; then
5258                   if test "$cf_add_incdir" = /usr/local/include ; then
5259                         if test "$GCC" = yes
5260                         then
5261                           cf_save_CPPFLAGS=$CPPFLAGS
5262
5263         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5264         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5265
5266                           cat >conftest.$ac_ext <<_ACEOF
5267 #line 5267 "configure"
5268 #include "confdefs.h"
5269 #include <stdio.h>
5270 int
5271 main (void)
5272 {
5273 printf("Hello")
5274   ;
5275   return 0;
5276 }
5277 _ACEOF
5278 rm -f conftest.$ac_objext
5279 if { (eval echo "$as_me:5279: \"$ac_compile\"") >&5
5280   (eval $ac_compile) 2>&5
5281   ac_status=$?
5282   echo "$as_me:5282: \$? = $ac_status" >&5
5283   (exit $ac_status); } &&
5284          { ac_try='test -s conftest.$ac_objext'
5285   { (eval echo "$as_me:5285: \"$ac_try\"") >&5
5286   (eval $ac_try) 2>&5
5287   ac_status=$?
5288   echo "$as_me:5288: \$? = $ac_status" >&5
5289   (exit $ac_status); }; }; then
5290   :
5291 else
5292   echo "$as_me: failed program was:" >&5
5293 cat conftest.$ac_ext >&5
5294 cf_have_incdir=yes
5295 fi
5296 rm -f conftest.$ac_objext conftest.$ac_ext
5297                           CPPFLAGS=$cf_save_CPPFLAGS
5298                         fi
5299                   fi
5300                 fi
5301
5302                 if test "$cf_have_incdir" = no ; then
5303                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5304
5305 echo "${as_me:-configure}:5305: testing adding $cf_add_incdir to include-path ..." 1>&5
5306
5307                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5308
5309                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5310                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5311                   cf_add_incdir="$cf_top_incdir"
5312                 else
5313                   break
5314                 fi
5315           else
5316                 break
5317           fi
5318         done
5319   done
5320 fi
5321
5322                 for cf_header in \
5323                         ncurses.h \
5324                         curses.h
5325                 do
5326
5327         cat >conftest.$ac_ext <<_ACEOF
5328 #line 5328 "configure"
5329 #include "confdefs.h"
5330
5331 #include <$cf_header>
5332 int
5333 main (void)
5334 {
5335
5336 #ifdef NCURSES_VERSION
5337
5338 printf("%s\n", NCURSES_VERSION);
5339 #else
5340 #ifdef __NCURSES_H
5341 printf("old\n");
5342 #else
5343         make an error
5344 #endif
5345 #endif
5346
5347   ;
5348   return 0;
5349 }
5350 _ACEOF
5351 rm -f conftest.$ac_objext
5352 if { (eval echo "$as_me:5352: \"$ac_compile\"") >&5
5353   (eval $ac_compile) 2>&5
5354   ac_status=$?
5355   echo "$as_me:5355: \$? = $ac_status" >&5
5356   (exit $ac_status); } &&
5357          { ac_try='test -s conftest.$ac_objext'
5358   { (eval echo "$as_me:5358: \"$ac_try\"") >&5
5359   (eval $ac_try) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit $ac_status); }; }; then
5363   cf_cv_ncurses_h2=$cf_header
5364
5365 else
5366   echo "$as_me: failed program was:" >&5
5367 cat conftest.$ac_ext >&5
5368 cf_cv_ncurses_h2=no
5369 fi
5370 rm -f conftest.$ac_objext conftest.$ac_ext
5371
5372                         if test "$cf_cv_ncurses_h2" != no ; then
5373                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5374                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5375                                 break
5376                         fi
5377                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5378                 done
5379                 CPPFLAGS="$cf_save2_CPPFLAGS"
5380                 test "$cf_cv_ncurses_h2" != no && break
5381         done
5382         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5382: error: not found" >&5
5383 echo "$as_me: error: not found" >&2;}
5384    { (exit 1); exit 1; }; }
5385
5386 fi
5387 echo "$as_me:5387: result: $cf_cv_ncurses_h2" >&5
5388 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5389
5390         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5391         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5392         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5393                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5394         fi
5395
5396 if test -n "$cf_1st_incdir" ; then
5397   for cf_add_incdir in $cf_1st_incdir
5398   do
5399         while test $cf_add_incdir != /usr/include
5400         do
5401           if test -d $cf_add_incdir
5402           then
5403                 cf_have_incdir=no
5404                 if test -n "$CFLAGS$CPPFLAGS" ; then
5405                   # a loop is needed to ensure we can add subdirs of existing dirs
5406                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5407                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5408                           cf_have_incdir=yes; break
5409                         fi
5410                   done
5411                 fi
5412
5413                 if test "$cf_have_incdir" = no ; then
5414                   if test "$cf_add_incdir" = /usr/local/include ; then
5415                         if test "$GCC" = yes
5416                         then
5417                           cf_save_CPPFLAGS=$CPPFLAGS
5418
5419         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5420         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5421
5422                           cat >conftest.$ac_ext <<_ACEOF
5423 #line 5423 "configure"
5424 #include "confdefs.h"
5425 #include <stdio.h>
5426 int
5427 main (void)
5428 {
5429 printf("Hello")
5430   ;
5431   return 0;
5432 }
5433 _ACEOF
5434 rm -f conftest.$ac_objext
5435 if { (eval echo "$as_me:5435: \"$ac_compile\"") >&5
5436   (eval $ac_compile) 2>&5
5437   ac_status=$?
5438   echo "$as_me:5438: \$? = $ac_status" >&5
5439   (exit $ac_status); } &&
5440          { ac_try='test -s conftest.$ac_objext'
5441   { (eval echo "$as_me:5441: \"$ac_try\"") >&5
5442   (eval $ac_try) 2>&5
5443   ac_status=$?
5444   echo "$as_me:5444: \$? = $ac_status" >&5
5445   (exit $ac_status); }; }; then
5446   :
5447 else
5448   echo "$as_me: failed program was:" >&5
5449 cat conftest.$ac_ext >&5
5450 cf_have_incdir=yes
5451 fi
5452 rm -f conftest.$ac_objext conftest.$ac_ext
5453                           CPPFLAGS=$cf_save_CPPFLAGS
5454                         fi
5455                   fi
5456                 fi
5457
5458                 if test "$cf_have_incdir" = no ; then
5459                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5460
5461 echo "${as_me:-configure}:5461: testing adding $cf_add_incdir to include-path ..." 1>&5
5462
5463                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5464
5465                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5466                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5467                   cf_add_incdir="$cf_top_incdir"
5468                 else
5469                   break
5470                 fi
5471           else
5472                 break
5473           fi
5474         done
5475   done
5476 fi
5477
5478 fi
5479
5480 # Set definitions to allow ifdef'ing for ncurses.h
5481
5482 case $cf_cv_ncurses_header in
5483 (*ncurses.h)
5484
5485 cat >>confdefs.h <<\EOF
5486 #define HAVE_NCURSES_H 1
5487 EOF
5488
5489         ;;
5490 esac
5491
5492 case $cf_cv_ncurses_header in
5493 (ncurses/curses.h|ncurses/ncurses.h)
5494
5495 cat >>confdefs.h <<\EOF
5496 #define HAVE_NCURSES_NCURSES_H 1
5497 EOF
5498
5499         ;;
5500 (ncursesw/curses.h|ncursesw/ncurses.h)
5501
5502 cat >>confdefs.h <<\EOF
5503 #define HAVE_NCURSESW_NCURSES_H 1
5504 EOF
5505
5506         ;;
5507 esac
5508
5509 echo "$as_me:5509: checking for terminfo header" >&5
5510 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5511 if test "${cf_cv_term_header+set}" = set; then
5512   echo $ECHO_N "(cached) $ECHO_C" >&6
5513 else
5514
5515 case ${cf_cv_ncurses_header} in
5516 (*/ncurses.h|*/ncursesw.h)
5517         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5518         ;;
5519 (*)
5520         cf_term_header=term.h
5521         ;;
5522 esac
5523
5524 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5525 do
5526 cat >conftest.$ac_ext <<_ACEOF
5527 #line 5527 "configure"
5528 #include "confdefs.h"
5529 #include <stdio.h>
5530 #include <${cf_cv_ncurses_header:-curses.h}>
5531 #include <$cf_test>
5532
5533 int
5534 main (void)
5535 {
5536 int x = auto_left_margin; (void)x
5537   ;
5538   return 0;
5539 }
5540 _ACEOF
5541 rm -f conftest.$ac_objext
5542 if { (eval echo "$as_me:5542: \"$ac_compile\"") >&5
5543   (eval $ac_compile) 2>&5
5544   ac_status=$?
5545   echo "$as_me:5545: \$? = $ac_status" >&5
5546   (exit $ac_status); } &&
5547          { ac_try='test -s conftest.$ac_objext'
5548   { (eval echo "$as_me:5548: \"$ac_try\"") >&5
5549   (eval $ac_try) 2>&5
5550   ac_status=$?
5551   echo "$as_me:5551: \$? = $ac_status" >&5
5552   (exit $ac_status); }; }; then
5553
5554         cf_cv_term_header="$cf_test"
5555 else
5556   echo "$as_me: failed program was:" >&5
5557 cat conftest.$ac_ext >&5
5558
5559         cf_cv_term_header=unknown
5560
5561 fi
5562 rm -f conftest.$ac_objext conftest.$ac_ext
5563         test "$cf_cv_term_header" != unknown && break
5564 done
5565
5566 fi
5567 echo "$as_me:5567: result: $cf_cv_term_header" >&5
5568 echo "${ECHO_T}$cf_cv_term_header" >&6
5569
5570 # Set definitions to allow ifdef'ing to accommodate subdirectories
5571
5572 case $cf_cv_term_header in
5573 (*term.h)
5574
5575 cat >>confdefs.h <<\EOF
5576 #define HAVE_TERM_H 1
5577 EOF
5578
5579         ;;
5580 esac
5581
5582 case $cf_cv_term_header in
5583 (ncurses/term.h)
5584
5585 cat >>confdefs.h <<\EOF
5586 #define HAVE_NCURSES_TERM_H 1
5587 EOF
5588
5589         ;;
5590 (ncursesw/term.h)
5591
5592 cat >>confdefs.h <<\EOF
5593 #define HAVE_NCURSESW_TERM_H 1
5594 EOF
5595
5596         ;;
5597 esac
5598
5599 # some applications need this, but should check for NCURSES_VERSION
5600
5601 cat >>confdefs.h <<\EOF
5602 #define NCURSES 1
5603 EOF
5604
5605 echo "$as_me:5605: checking for ncurses version" >&5
5606 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5607 if test "${cf_cv_ncurses_version+set}" = set; then
5608   echo $ECHO_N "(cached) $ECHO_C" >&6
5609 else
5610
5611         cf_cv_ncurses_version=no
5612         cf_tempfile=out$$
5613         rm -f $cf_tempfile
5614         if test "$cross_compiling" = yes; then
5615
5616         # This will not work if the preprocessor splits the line after the
5617         # Autoconf token.  The 'unproto' program does that.
5618         cat > conftest.$ac_ext <<EOF
5619 #include <${cf_cv_ncurses_header:-curses.h}>
5620 #undef Autoconf
5621 #ifdef NCURSES_VERSION
5622 Autoconf NCURSES_VERSION
5623 #else
5624 #ifdef __NCURSES_H
5625 Autoconf "old"
5626 #endif
5627 ;
5628 #endif
5629 EOF
5630         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5631         { (eval echo "$as_me:5631: \"$cf_try\"") >&5
5632   (eval $cf_try) 2>&5
5633   ac_status=$?
5634   echo "$as_me:5634: \$? = $ac_status" >&5
5635   (exit $ac_status); }
5636         if test -f conftest.out ; then
5637                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5638                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5639                 rm -f conftest.out
5640         fi
5641
5642 else
5643   cat >conftest.$ac_ext <<_ACEOF
5644 #line 5644 "configure"
5645 #include "confdefs.h"
5646
5647 #include <${cf_cv_ncurses_header:-curses.h}>
5648 #include <stdio.h>
5649 int main(void)
5650 {
5651         FILE *fp = fopen("$cf_tempfile", "w");
5652 #ifdef NCURSES_VERSION
5653 # ifdef NCURSES_VERSION_PATCH
5654         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5655 # else
5656         fprintf(fp, "%s\n", NCURSES_VERSION);
5657 # endif
5658 #else
5659 # ifdef __NCURSES_H
5660         fprintf(fp, "old\n");
5661 # else
5662         make an error
5663 # endif
5664 #endif
5665         ${cf_cv_main_return:-return}(0);
5666 }
5667 _ACEOF
5668 rm -f conftest$ac_exeext
5669 if { (eval echo "$as_me:5669: \"$ac_link\"") >&5
5670   (eval $ac_link) 2>&5
5671   ac_status=$?
5672   echo "$as_me:5672: \$? = $ac_status" >&5
5673   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5674   { (eval echo "$as_me:5674: \"$ac_try\"") >&5
5675   (eval $ac_try) 2>&5
5676   ac_status=$?
5677   echo "$as_me:5677: \$? = $ac_status" >&5
5678   (exit $ac_status); }; }; then
5679
5680         cf_cv_ncurses_version=`cat $cf_tempfile`
5681 else
5682   echo "$as_me: program exited with status $ac_status" >&5
5683 echo "$as_me: failed program was:" >&5
5684 cat conftest.$ac_ext >&5
5685 fi
5686 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5687 fi
5688         rm -f $cf_tempfile
5689
5690 fi
5691 echo "$as_me:5691: result: $cf_cv_ncurses_version" >&5
5692 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5693 test "$cf_cv_ncurses_version" = no ||
5694 cat >>confdefs.h <<\EOF
5695 #define NCURSES 1
5696 EOF
5697
5698 cf_nculib_root=ncurses
5699         # This works, except for the special case where we find gpm, but
5700         # ncurses is in a nonstandard location via $LIBS, and we really want
5701         # to link gpm.
5702 cf_ncurses_LIBS=""
5703 cf_ncurses_SAVE="$LIBS"
5704 echo "$as_me:5704: checking for Gpm_Open in -lgpm" >&5
5705 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5706 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5707   echo $ECHO_N "(cached) $ECHO_C" >&6
5708 else
5709   ac_check_lib_save_LIBS=$LIBS
5710 LIBS="-lgpm  $LIBS"
5711 cat >conftest.$ac_ext <<_ACEOF
5712 #line 5712 "configure"
5713 #include "confdefs.h"
5714
5715 /* Override any gcc2 internal prototype to avoid an error.  */
5716 #ifdef __cplusplus
5717 extern "C"
5718 #endif
5719 /* We use char because int might match the return type of a gcc2
5720    builtin and then its argument prototype would still apply.  */
5721 char Gpm_Open ();
5722 int
5723 main (void)
5724 {
5725 Gpm_Open ();
5726   ;
5727   return 0;
5728 }
5729 _ACEOF
5730 rm -f conftest.$ac_objext conftest$ac_exeext
5731 if { (eval echo "$as_me:5731: \"$ac_link\"") >&5
5732   (eval $ac_link) 2>&5
5733   ac_status=$?
5734   echo "$as_me:5734: \$? = $ac_status" >&5
5735   (exit $ac_status); } &&
5736          { ac_try='test -s conftest$ac_exeext'
5737   { (eval echo "$as_me:5737: \"$ac_try\"") >&5
5738   (eval $ac_try) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit $ac_status); }; }; then
5742   ac_cv_lib_gpm_Gpm_Open=yes
5743 else
5744   echo "$as_me: failed program was:" >&5
5745 cat conftest.$ac_ext >&5
5746 ac_cv_lib_gpm_Gpm_Open=no
5747 fi
5748 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5749 LIBS=$ac_check_lib_save_LIBS
5750 fi
5751 echo "$as_me:5751: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5752 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5753 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5754   echo "$as_me:5754: checking for initscr in -lgpm" >&5
5755 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5756 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5757   echo $ECHO_N "(cached) $ECHO_C" >&6
5758 else
5759   ac_check_lib_save_LIBS=$LIBS
5760 LIBS="-lgpm  $LIBS"
5761 cat >conftest.$ac_ext <<_ACEOF
5762 #line 5762 "configure"
5763 #include "confdefs.h"
5764
5765 /* Override any gcc2 internal prototype to avoid an error.  */
5766 #ifdef __cplusplus
5767 extern "C"
5768 #endif
5769 /* We use char because int might match the return type of a gcc2
5770    builtin and then its argument prototype would still apply.  */
5771 char initscr ();
5772 int
5773 main (void)
5774 {
5775 initscr ();
5776   ;
5777   return 0;
5778 }
5779 _ACEOF
5780 rm -f conftest.$ac_objext conftest$ac_exeext
5781 if { (eval echo "$as_me:5781: \"$ac_link\"") >&5
5782   (eval $ac_link) 2>&5
5783   ac_status=$?
5784   echo "$as_me:5784: \$? = $ac_status" >&5
5785   (exit $ac_status); } &&
5786          { ac_try='test -s conftest$ac_exeext'
5787   { (eval echo "$as_me:5787: \"$ac_try\"") >&5
5788   (eval $ac_try) 2>&5
5789   ac_status=$?
5790   echo "$as_me:5790: \$? = $ac_status" >&5
5791   (exit $ac_status); }; }; then
5792   ac_cv_lib_gpm_initscr=yes
5793 else
5794   echo "$as_me: failed program was:" >&5
5795 cat conftest.$ac_ext >&5
5796 ac_cv_lib_gpm_initscr=no
5797 fi
5798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5799 LIBS=$ac_check_lib_save_LIBS
5800 fi
5801 echo "$as_me:5801: result: $ac_cv_lib_gpm_initscr" >&5
5802 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5803 if test $ac_cv_lib_gpm_initscr = yes; then
5804   LIBS="$cf_ncurses_SAVE"
5805 else
5806   cf_ncurses_LIBS="-lgpm"
5807 fi
5808
5809 fi
5810
5811 case $host_os in
5812 (freebsd*)
5813         # This is only necessary if you are linking against an obsolete
5814         # version of ncurses (but it should do no harm, since it's static).
5815         if test "$cf_nculib_root" = ncurses ; then
5816                 echo "$as_me:5816: checking for tgoto in -lmytinfo" >&5
5817 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5818 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5819   echo $ECHO_N "(cached) $ECHO_C" >&6
5820 else
5821   ac_check_lib_save_LIBS=$LIBS
5822 LIBS="-lmytinfo  $LIBS"
5823 cat >conftest.$ac_ext <<_ACEOF
5824 #line 5824 "configure"
5825 #include "confdefs.h"
5826
5827 /* Override any gcc2 internal prototype to avoid an error.  */
5828 #ifdef __cplusplus
5829 extern "C"
5830 #endif
5831 /* We use char because int might match the return type of a gcc2
5832    builtin and then its argument prototype would still apply.  */
5833 char tgoto ();
5834 int
5835 main (void)
5836 {
5837 tgoto ();
5838   ;
5839   return 0;
5840 }
5841 _ACEOF
5842 rm -f conftest.$ac_objext conftest$ac_exeext
5843 if { (eval echo "$as_me:5843: \"$ac_link\"") >&5
5844   (eval $ac_link) 2>&5
5845   ac_status=$?
5846   echo "$as_me:5846: \$? = $ac_status" >&5
5847   (exit $ac_status); } &&
5848          { ac_try='test -s conftest$ac_exeext'
5849   { (eval echo "$as_me:5849: \"$ac_try\"") >&5
5850   (eval $ac_try) 2>&5
5851   ac_status=$?
5852   echo "$as_me:5852: \$? = $ac_status" >&5
5853   (exit $ac_status); }; }; then
5854   ac_cv_lib_mytinfo_tgoto=yes
5855 else
5856   echo "$as_me: failed program was:" >&5
5857 cat conftest.$ac_ext >&5
5858 ac_cv_lib_mytinfo_tgoto=no
5859 fi
5860 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5861 LIBS=$ac_check_lib_save_LIBS
5862 fi
5863 echo "$as_me:5863: result: $ac_cv_lib_mytinfo_tgoto" >&5
5864 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5865 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5866   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5867 fi
5868
5869         fi
5870         ;;
5871 esac
5872
5873 cf_add_libs="$LIBS"
5874 # reverse order
5875 cf_add_0lib=
5876 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5877 # filter duplicates
5878 for cf_add_1lib in $cf_add_0lib; do
5879         for cf_add_2lib in $cf_add_libs; do
5880                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5881                         cf_add_1lib=
5882                         break
5883                 fi
5884         done
5885         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5886 done
5887 LIBS="$cf_add_libs"
5888
5889 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5890 then
5891
5892 cf_add_libs="$LIBS"
5893 # reverse order
5894 cf_add_0lib=
5895 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5896 # filter duplicates
5897 for cf_add_1lib in $cf_add_0lib; do
5898         for cf_add_2lib in $cf_add_libs; do
5899                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5900                         cf_add_1lib=
5901                         break
5902                 fi
5903         done
5904         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5905 done
5906 LIBS="$cf_add_libs"
5907
5908 else
5909
5910         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5911         cf_libdir=""
5912         echo "$as_me:5912: checking for initscr" >&5
5913 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5914 if test "${ac_cv_func_initscr+set}" = set; then
5915   echo $ECHO_N "(cached) $ECHO_C" >&6
5916 else
5917   cat >conftest.$ac_ext <<_ACEOF
5918 #line 5918 "configure"
5919 #include "confdefs.h"
5920 #define initscr autoconf_temporary
5921 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5922 #undef initscr
5923
5924 #ifdef __cplusplus
5925 extern "C"
5926 #endif
5927
5928 /* We use char because int might match the return type of a gcc2
5929    builtin and then its argument prototype would still apply.  */
5930 char initscr (void);
5931
5932 int
5933 main (void)
5934 {
5935
5936 /* The GNU C library defines stubs for functions which it implements
5937     to always fail with ENOSYS.  Some functions are actually named
5938     something starting with __ and the normal name is an alias.  */
5939 #if defined (__stub_initscr) || defined (__stub___initscr)
5940 #error found stub for initscr
5941 #endif
5942
5943         return initscr ();
5944   ;
5945   return 0;
5946 }
5947 _ACEOF
5948 rm -f conftest.$ac_objext conftest$ac_exeext
5949 if { (eval echo "$as_me:5949: \"$ac_link\"") >&5
5950   (eval $ac_link) 2>&5
5951   ac_status=$?
5952   echo "$as_me:5952: \$? = $ac_status" >&5
5953   (exit $ac_status); } &&
5954          { ac_try='test -s conftest$ac_exeext'
5955   { (eval echo "$as_me:5955: \"$ac_try\"") >&5
5956   (eval $ac_try) 2>&5
5957   ac_status=$?
5958   echo "$as_me:5958: \$? = $ac_status" >&5
5959   (exit $ac_status); }; }; then
5960   ac_cv_func_initscr=yes
5961 else
5962   echo "$as_me: failed program was:" >&5
5963 cat conftest.$ac_ext >&5
5964 ac_cv_func_initscr=no
5965 fi
5966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5967 fi
5968 echo "$as_me:5968: result: $ac_cv_func_initscr" >&5
5969 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5970 if test $ac_cv_func_initscr = yes; then
5971   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5972 else
5973
5974                 cf_save_LIBS="$LIBS"
5975                 echo "$as_me:5975: checking for initscr in -l$cf_nculib_root" >&5
5976 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5977                 LIBS="-l$cf_nculib_root $LIBS"
5978                 cat >conftest.$ac_ext <<_ACEOF
5979 #line 5979 "configure"
5980 #include "confdefs.h"
5981 #include <${cf_cv_ncurses_header:-curses.h}>
5982 int
5983 main (void)
5984 {
5985 initscr()
5986   ;
5987   return 0;
5988 }
5989 _ACEOF
5990 rm -f conftest.$ac_objext conftest$ac_exeext
5991 if { (eval echo "$as_me:5991: \"$ac_link\"") >&5
5992   (eval $ac_link) 2>&5
5993   ac_status=$?
5994   echo "$as_me:5994: \$? = $ac_status" >&5
5995   (exit $ac_status); } &&
5996          { ac_try='test -s conftest$ac_exeext'
5997   { (eval echo "$as_me:5997: \"$ac_try\"") >&5
5998   (eval $ac_try) 2>&5
5999   ac_status=$?
6000   echo "$as_me:6000: \$? = $ac_status" >&5
6001   (exit $ac_status); }; }; then
6002   echo "$as_me:6002: result: yes" >&5
6003 echo "${ECHO_T}yes" >&6
6004                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6005
6006 else
6007   echo "$as_me: failed program was:" >&5
6008 cat conftest.$ac_ext >&5
6009 echo "$as_me:6009: result: no" >&5
6010 echo "${ECHO_T}no" >&6
6011
6012 cf_search=
6013 cf_library_path_list=""
6014 if test -n "${LDFLAGS}${LIBS}" ; then
6015         for cf_library_path in $LDFLAGS $LIBS
6016         do
6017                 case $cf_library_path in
6018                 (-L*)
6019                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6020
6021 test "x$cf_library_path" != "xNONE" && \
6022 test -d "$cf_library_path" && \
6023  {
6024         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6025         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6026         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6027         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6028         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6029         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"
6030 }
6031
6032                         cf_library_path_list="$cf_library_path_list $cf_search"
6033                         ;;
6034                 esac
6035         done
6036 fi
6037
6038 cf_search=
6039
6040 test "x$prefix" != "xNONE" && \
6041 test -d "$prefix" && \
6042  {
6043         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6044         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6045         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6046         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6047         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6048         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6049 }
6050
6051 for cf_subdir_prefix in \
6052         /usr \
6053         /usr/local \
6054         /usr/pkg \
6055         /opt \
6056         /opt/local \
6057         $HOME
6058 do
6059
6060 test "x$cf_subdir_prefix" != "x$prefix" && \
6061 test -d "$cf_subdir_prefix" && \
6062 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6063         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6064         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6065         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6066         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6067         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6068         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"
6069 }
6070
6071 done
6072
6073 cf_search="$cf_library_path_list $cf_search"
6074
6075                         for cf_libdir in $cf_search
6076                         do
6077                                 echo "$as_me:6077: checking for -l$cf_nculib_root in $cf_libdir" >&5
6078 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6079                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6080                                 cat >conftest.$ac_ext <<_ACEOF
6081 #line 6081 "configure"
6082 #include "confdefs.h"
6083 #include <${cf_cv_ncurses_header:-curses.h}>
6084 int
6085 main (void)
6086 {
6087 initscr()
6088   ;
6089   return 0;
6090 }
6091 _ACEOF
6092 rm -f conftest.$ac_objext conftest$ac_exeext
6093 if { (eval echo "$as_me:6093: \"$ac_link\"") >&5
6094   (eval $ac_link) 2>&5
6095   ac_status=$?
6096   echo "$as_me:6096: \$? = $ac_status" >&5
6097   (exit $ac_status); } &&
6098          { ac_try='test -s conftest$ac_exeext'
6099   { (eval echo "$as_me:6099: \"$ac_try\"") >&5
6100   (eval $ac_try) 2>&5
6101   ac_status=$?
6102   echo "$as_me:6102: \$? = $ac_status" >&5
6103   (exit $ac_status); }; }; then
6104   echo "$as_me:6104: result: yes" >&5
6105 echo "${ECHO_T}yes" >&6
6106                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6107                                          break
6108 else
6109   echo "$as_me: failed program was:" >&5
6110 cat conftest.$ac_ext >&5
6111 echo "$as_me:6111: result: no" >&5
6112 echo "${ECHO_T}no" >&6
6113                                          LIBS="$cf_save_LIBS"
6114 fi
6115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6116                         done
6117
6118 fi
6119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6120
6121 fi
6122
6123 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6124
6125 if test $cf_found_library = no ; then
6126         { { echo "$as_me:6126: error: Cannot link $cf_nculib_root library" >&5
6127 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6128    { (exit 1); exit 1; }; }
6129 fi
6130
6131 fi
6132
6133 if test -n "$cf_ncurses_LIBS" ; then
6134         echo "$as_me:6134: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6135 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6136         cf_ncurses_SAVE="$LIBS"
6137         for p in $cf_ncurses_LIBS ; do
6138                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6139                 if test "$q" != "$LIBS" ; then
6140                         LIBS="$q"
6141                 fi
6142         done
6143         cat >conftest.$ac_ext <<_ACEOF
6144 #line 6144 "configure"
6145 #include "confdefs.h"
6146 #include <${cf_cv_ncurses_header:-curses.h}>
6147 int
6148 main (void)
6149 {
6150 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6151   ;
6152   return 0;
6153 }
6154 _ACEOF
6155 rm -f conftest.$ac_objext conftest$ac_exeext
6156 if { (eval echo "$as_me:6156: \"$ac_link\"") >&5
6157   (eval $ac_link) 2>&5
6158   ac_status=$?
6159   echo "$as_me:6159: \$? = $ac_status" >&5
6160   (exit $ac_status); } &&
6161          { ac_try='test -s conftest$ac_exeext'
6162   { (eval echo "$as_me:6162: \"$ac_try\"") >&5
6163   (eval $ac_try) 2>&5
6164   ac_status=$?
6165   echo "$as_me:6165: \$? = $ac_status" >&5
6166   (exit $ac_status); }; }; then
6167   echo "$as_me:6167: result: yes" >&5
6168 echo "${ECHO_T}yes" >&6
6169 else
6170   echo "$as_me: failed program was:" >&5
6171 cat conftest.$ac_ext >&5
6172 echo "$as_me:6172: result: no" >&5
6173 echo "${ECHO_T}no" >&6
6174                  LIBS="$cf_ncurses_SAVE"
6175 fi
6176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6177 fi
6178
6179 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6180
6181 cat >>confdefs.h <<EOF
6182 #define $cf_nculib_ROOT 1
6183 EOF
6184
6185         fi
6186 else
6187         NCURSES_CONFIG=none
6188 fi
6189
6190 echo "$as_me:6190: checking if you want wide-character code" >&5
6191 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6192
6193 # Check whether --enable-widec or --disable-widec was given.
6194 if test "${enable_widec+set}" = set; then
6195   enableval="$enable_widec"
6196   with_widec=$enableval
6197 else
6198   with_widec=no
6199 fi;
6200 echo "$as_me:6200: result: $with_widec" >&5
6201 echo "${ECHO_T}$with_widec" >&6
6202 if test "$with_widec" = yes ; then
6203
6204 echo "$as_me:6204: checking for multibyte character support" >&5
6205 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6206 if test "${cf_cv_utf8_lib+set}" = set; then
6207   echo $ECHO_N "(cached) $ECHO_C" >&6
6208 else
6209
6210         cf_save_LIBS="$LIBS"
6211         cat >conftest.$ac_ext <<_ACEOF
6212 #line 6212 "configure"
6213 #include "confdefs.h"
6214
6215 #include <stdlib.h>
6216 int
6217 main (void)
6218 {
6219 putwc(0,0);
6220   ;
6221   return 0;
6222 }
6223 _ACEOF
6224 rm -f conftest.$ac_objext conftest$ac_exeext
6225 if { (eval echo "$as_me:6225: \"$ac_link\"") >&5
6226   (eval $ac_link) 2>&5
6227   ac_status=$?
6228   echo "$as_me:6228: \$? = $ac_status" >&5
6229   (exit $ac_status); } &&
6230          { ac_try='test -s conftest$ac_exeext'
6231   { (eval echo "$as_me:6231: \"$ac_try\"") >&5
6232   (eval $ac_try) 2>&5
6233   ac_status=$?
6234   echo "$as_me:6234: \$? = $ac_status" >&5
6235   (exit $ac_status); }; }; then
6236   cf_cv_utf8_lib=yes
6237 else
6238   echo "$as_me: failed program was:" >&5
6239 cat conftest.$ac_ext >&5
6240
6241 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6242 # will be set on completion of the AC_TRY_LINK below.
6243 cf_cv_header_path_utf8=
6244 cf_cv_library_path_utf8=
6245
6246 echo "${as_me:-configure}:6246: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6247
6248 cf_save_LIBS="$LIBS"
6249
6250 cat >conftest.$ac_ext <<_ACEOF
6251 #line 6251 "configure"
6252 #include "confdefs.h"
6253
6254 #include <libutf8.h>
6255 int
6256 main (void)
6257 {
6258 putwc(0,0);
6259   ;
6260   return 0;
6261 }
6262 _ACEOF
6263 rm -f conftest.$ac_objext conftest$ac_exeext
6264 if { (eval echo "$as_me:6264: \"$ac_link\"") >&5
6265   (eval $ac_link) 2>&5
6266   ac_status=$?
6267   echo "$as_me:6267: \$? = $ac_status" >&5
6268   (exit $ac_status); } &&
6269          { ac_try='test -s conftest$ac_exeext'
6270   { (eval echo "$as_me:6270: \"$ac_try\"") >&5
6271   (eval $ac_try) 2>&5
6272   ac_status=$?
6273   echo "$as_me:6273: \$? = $ac_status" >&5
6274   (exit $ac_status); }; }; then
6275
6276         cf_cv_find_linkage_utf8=yes
6277         cf_cv_header_path_utf8=/usr/include
6278         cf_cv_library_path_utf8=/usr/lib
6279
6280 else
6281   echo "$as_me: failed program was:" >&5
6282 cat conftest.$ac_ext >&5
6283
6284 LIBS="-lutf8  $cf_save_LIBS"
6285
6286 cat >conftest.$ac_ext <<_ACEOF
6287 #line 6287 "configure"
6288 #include "confdefs.h"
6289
6290 #include <libutf8.h>
6291 int
6292 main (void)
6293 {
6294 putwc(0,0);
6295   ;
6296   return 0;
6297 }
6298 _ACEOF
6299 rm -f conftest.$ac_objext conftest$ac_exeext
6300 if { (eval echo "$as_me:6300: \"$ac_link\"") >&5
6301   (eval $ac_link) 2>&5
6302   ac_status=$?
6303   echo "$as_me:6303: \$? = $ac_status" >&5
6304   (exit $ac_status); } &&
6305          { ac_try='test -s conftest$ac_exeext'
6306   { (eval echo "$as_me:6306: \"$ac_try\"") >&5
6307   (eval $ac_try) 2>&5
6308   ac_status=$?
6309   echo "$as_me:6309: \$? = $ac_status" >&5
6310   (exit $ac_status); }; }; then
6311
6312         cf_cv_find_linkage_utf8=yes
6313         cf_cv_header_path_utf8=/usr/include
6314         cf_cv_library_path_utf8=/usr/lib
6315         cf_cv_library_file_utf8="-lutf8"
6316
6317 else
6318   echo "$as_me: failed program was:" >&5
6319 cat conftest.$ac_ext >&5
6320
6321         cf_cv_find_linkage_utf8=no
6322         LIBS="$cf_save_LIBS"
6323
6324         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6325
6326 echo "${as_me:-configure}:6326: testing find linkage for utf8 library ..." 1>&5
6327
6328 echo "${as_me:-configure}:6328: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6329
6330         cf_save_CPPFLAGS="$CPPFLAGS"
6331         cf_test_CPPFLAGS="$CPPFLAGS"
6332
6333 cf_search=
6334
6335 # collect the current set of include-directories from compiler flags
6336 cf_header_path_list=""
6337 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6338         for cf_header_path in $CPPFLAGS $CFLAGS
6339         do
6340                 case $cf_header_path in
6341                 (-I*)
6342                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6343
6344 test "x$cf_header_path" != "xNONE" && \
6345 test -d "$cf_header_path" && \
6346  {
6347         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6348         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6349         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6350         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6351         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6352         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6353 }
6354
6355                         cf_header_path_list="$cf_header_path_list $cf_search"
6356                         ;;
6357                 esac
6358         done
6359 fi
6360
6361 # add the variations for the package we are looking for
6362
6363 cf_search=
6364
6365 test "x$prefix" != "xNONE" && \
6366 test -d "$prefix" && \
6367  {
6368         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6369         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6370         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6371         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6372         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6373         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6374 }
6375
6376 for cf_subdir_prefix in \
6377         /usr \
6378         /usr/local \
6379         /usr/pkg \
6380         /opt \
6381         /opt/local \
6382         $HOME
6383 do
6384
6385 test "x$cf_subdir_prefix" != "x$prefix" && \
6386 test -d "$cf_subdir_prefix" && \
6387 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6388         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6389         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6390         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6391         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6392         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6393         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6394 }
6395
6396 done
6397
6398 test "$includedir" != NONE && \
6399 test "$includedir" != "/usr/include" && \
6400 test -d "$includedir" && {
6401         test -d $includedir &&    cf_search="$cf_search $includedir"
6402         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6403 }
6404
6405 test "$oldincludedir" != NONE && \
6406 test "$oldincludedir" != "/usr/include" && \
6407 test -d "$oldincludedir" && {
6408         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6409         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6410 }
6411
6412 cf_search="$cf_search $cf_header_path_list"
6413
6414         for cf_cv_header_path_utf8 in $cf_search
6415         do
6416                 if test -d $cf_cv_header_path_utf8 ; then
6417                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6418
6419 echo "${as_me:-configure}:6419: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6420
6421                         CPPFLAGS="$cf_save_CPPFLAGS"
6422
6423         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6424         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6425
6426                         cat >conftest.$ac_ext <<_ACEOF
6427 #line 6427 "configure"
6428 #include "confdefs.h"
6429
6430 #include <libutf8.h>
6431 int
6432 main (void)
6433 {
6434 putwc(0,0);
6435   ;
6436   return 0;
6437 }
6438 _ACEOF
6439 rm -f conftest.$ac_objext
6440 if { (eval echo "$as_me:6440: \"$ac_compile\"") >&5
6441   (eval $ac_compile) 2>&5
6442   ac_status=$?
6443   echo "$as_me:6443: \$? = $ac_status" >&5
6444   (exit $ac_status); } &&
6445          { ac_try='test -s conftest.$ac_objext'
6446   { (eval echo "$as_me:6446: \"$ac_try\"") >&5
6447   (eval $ac_try) 2>&5
6448   ac_status=$?
6449   echo "$as_me:6449: \$? = $ac_status" >&5
6450   (exit $ac_status); }; }; then
6451
6452                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6453
6454 echo "${as_me:-configure}:6454: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6455
6456                                 cf_cv_find_linkage_utf8=maybe
6457                                 cf_test_CPPFLAGS="$CPPFLAGS"
6458                                 break
6459 else
6460   echo "$as_me: failed program was:" >&5
6461 cat conftest.$ac_ext >&5
6462
6463                                 CPPFLAGS="$cf_save_CPPFLAGS"
6464
6465 fi
6466 rm -f conftest.$ac_objext conftest.$ac_ext
6467                 fi
6468         done
6469
6470         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6471
6472 echo "${as_me:-configure}:6472: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6473
6474                 cf_save_LIBS="$LIBS"
6475                 cf_save_LDFLAGS="$LDFLAGS"
6476
6477                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6478
6479 cf_search=
6480 cf_library_path_list=""
6481 if test -n "${LDFLAGS}${LIBS}" ; then
6482         for cf_library_path in $LDFLAGS $LIBS
6483         do
6484                 case $cf_library_path in
6485                 (-L*)
6486                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6487
6488 test "x$cf_library_path" != "xNONE" && \
6489 test -d "$cf_library_path" && \
6490  {
6491         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6492         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6493         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6494         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6495         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6496         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6497 }
6498
6499                         cf_library_path_list="$cf_library_path_list $cf_search"
6500                         ;;
6501                 esac
6502         done
6503 fi
6504
6505 cf_search=
6506
6507 test "x$prefix" != "xNONE" && \
6508 test -d "$prefix" && \
6509  {
6510         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6511         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6512         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6513         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6514         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6515         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6516 }
6517
6518 for cf_subdir_prefix in \
6519         /usr \
6520         /usr/local \
6521         /usr/pkg \
6522         /opt \
6523         /opt/local \
6524         $HOME
6525 do
6526
6527 test "x$cf_subdir_prefix" != "x$prefix" && \
6528 test -d "$cf_subdir_prefix" && \
6529 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6530         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6531         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6532         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6533         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6534         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6535         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6536 }
6537
6538 done
6539
6540 cf_search="$cf_library_path_list $cf_search"
6541
6542                         for cf_cv_library_path_utf8 in $cf_search
6543                         do
6544                                 if test -d $cf_cv_library_path_utf8 ; then
6545                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6546
6547 echo "${as_me:-configure}:6547: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6548
6549                                         CPPFLAGS="$cf_test_CPPFLAGS"
6550                                         LIBS="-lutf8  $cf_save_LIBS"
6551                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6552                                         cat >conftest.$ac_ext <<_ACEOF
6553 #line 6553 "configure"
6554 #include "confdefs.h"
6555
6556 #include <libutf8.h>
6557 int
6558 main (void)
6559 {
6560 putwc(0,0);
6561   ;
6562   return 0;
6563 }
6564 _ACEOF
6565 rm -f conftest.$ac_objext conftest$ac_exeext
6566 if { (eval echo "$as_me:6566: \"$ac_link\"") >&5
6567   (eval $ac_link) 2>&5
6568   ac_status=$?
6569   echo "$as_me:6569: \$? = $ac_status" >&5
6570   (exit $ac_status); } &&
6571          { ac_try='test -s conftest$ac_exeext'
6572   { (eval echo "$as_me:6572: \"$ac_try\"") >&5
6573   (eval $ac_try) 2>&5
6574   ac_status=$?
6575   echo "$as_me:6575: \$? = $ac_status" >&5
6576   (exit $ac_status); }; }; then
6577
6578                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6579
6580 echo "${as_me:-configure}:6580: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6581
6582                                         cf_cv_find_linkage_utf8=yes
6583                                         cf_cv_library_file_utf8="-lutf8"
6584                                         break
6585 else
6586   echo "$as_me: failed program was:" >&5
6587 cat conftest.$ac_ext >&5
6588
6589                                         CPPFLAGS="$cf_save_CPPFLAGS"
6590                                         LIBS="$cf_save_LIBS"
6591                                         LDFLAGS="$cf_save_LDFLAGS"
6592
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595                                 fi
6596                         done
6597                         CPPFLAGS="$cf_save_CPPFLAGS"
6598                         LDFLAGS="$cf_save_LDFLAGS"
6599                 fi
6600
6601         else
6602                 cf_cv_find_linkage_utf8=no
6603         fi
6604
6605 fi
6606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6607
6608 fi
6609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6610
6611 LIBS="$cf_save_LIBS"
6612
6613 if test "$cf_cv_find_linkage_utf8" = yes ; then
6614 cf_cv_utf8_lib=add-on
6615 else
6616 cf_cv_utf8_lib=no
6617 fi
6618
6619 fi
6620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6621 fi
6622 echo "$as_me:6622: result: $cf_cv_utf8_lib" >&5
6623 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6624
6625 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6626 # ncurses/ncursesw:
6627 if test "$cf_cv_utf8_lib" = "add-on" ; then
6628
6629 cat >>confdefs.h <<\EOF
6630 #define HAVE_LIBUTF8_H 1
6631 EOF
6632
6633 if test -n "$cf_cv_header_path_utf8" ; then
6634   for cf_add_incdir in $cf_cv_header_path_utf8
6635   do
6636         while test $cf_add_incdir != /usr/include
6637         do
6638           if test -d $cf_add_incdir
6639           then
6640                 cf_have_incdir=no
6641                 if test -n "$CFLAGS$CPPFLAGS" ; then
6642                   # a loop is needed to ensure we can add subdirs of existing dirs
6643                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6644                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6645                           cf_have_incdir=yes; break
6646                         fi
6647                   done
6648                 fi
6649
6650                 if test "$cf_have_incdir" = no ; then
6651                   if test "$cf_add_incdir" = /usr/local/include ; then
6652                         if test "$GCC" = yes
6653                         then
6654                           cf_save_CPPFLAGS=$CPPFLAGS
6655
6656         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6657         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6658
6659                           cat >conftest.$ac_ext <<_ACEOF
6660 #line 6660 "configure"
6661 #include "confdefs.h"
6662 #include <stdio.h>
6663 int
6664 main (void)
6665 {
6666 printf("Hello")
6667   ;
6668   return 0;
6669 }
6670 _ACEOF
6671 rm -f conftest.$ac_objext
6672 if { (eval echo "$as_me:6672: \"$ac_compile\"") >&5
6673   (eval $ac_compile) 2>&5
6674   ac_status=$?
6675   echo "$as_me:6675: \$? = $ac_status" >&5
6676   (exit $ac_status); } &&
6677          { ac_try='test -s conftest.$ac_objext'
6678   { (eval echo "$as_me:6678: \"$ac_try\"") >&5
6679   (eval $ac_try) 2>&5
6680   ac_status=$?
6681   echo "$as_me:6681: \$? = $ac_status" >&5
6682   (exit $ac_status); }; }; then
6683   :
6684 else
6685   echo "$as_me: failed program was:" >&5
6686 cat conftest.$ac_ext >&5
6687 cf_have_incdir=yes
6688 fi
6689 rm -f conftest.$ac_objext conftest.$ac_ext
6690                           CPPFLAGS=$cf_save_CPPFLAGS
6691                         fi
6692                   fi
6693                 fi
6694
6695                 if test "$cf_have_incdir" = no ; then
6696                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6697
6698 echo "${as_me:-configure}:6698: testing adding $cf_add_incdir to include-path ..." 1>&5
6699
6700                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6701
6702                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6703                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6704                   cf_add_incdir="$cf_top_incdir"
6705                 else
6706                   break
6707                 fi
6708           else
6709                 break
6710           fi
6711         done
6712   done
6713 fi
6714
6715 if test -n "$cf_cv_library_path_utf8" ; then
6716         for cf_add_libdir in $cf_cv_library_path_utf8
6717         do
6718                 if test $cf_add_libdir = /usr/lib ; then
6719                         :
6720                 elif test -d $cf_add_libdir
6721                 then
6722                         cf_have_libdir=no
6723                         if test -n "$LDFLAGS$LIBS" ; then
6724                                 # a loop is needed to ensure we can add subdirs of existing dirs
6725                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6726                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6727                                                 cf_have_libdir=yes; break
6728                                         fi
6729                                 done
6730                         fi
6731                         if test "$cf_have_libdir" = no ; then
6732                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6733
6734 echo "${as_me:-configure}:6734: testing adding $cf_add_libdir to library-path ..." 1>&5
6735
6736                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6737                         fi
6738                 fi
6739         done
6740 fi
6741
6742 cf_add_libs="$LIBS"
6743 # reverse order
6744 cf_add_0lib=
6745 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6746 # filter duplicates
6747 for cf_add_1lib in $cf_add_0lib; do
6748         for cf_add_2lib in $cf_add_libs; do
6749                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6750                         cf_add_1lib=
6751                         break
6752                 fi
6753         done
6754         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6755 done
6756 LIBS="$cf_add_libs"
6757
6758 fi
6759
6760 cf_ncuconfig_root=ncursesw
6761 cf_have_ncuconfig=no
6762
6763 if test "x${PKG_CONFIG:=none}" != xnone; then
6764         echo "$as_me:6764: checking pkg-config for $cf_ncuconfig_root" >&5
6765 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6766         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6767                 echo "$as_me:6767: result: yes" >&5
6768 echo "${ECHO_T}yes" >&6
6769
6770                 echo "$as_me:6770: checking if the $cf_ncuconfig_root package files work" >&5
6771 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6772                 cf_have_ncuconfig=unknown
6773
6774                 cf_save_CFLAGS="$CFLAGS"
6775                 cf_save_CPPFLAGS="$CPPFLAGS"
6776                 cf_save_LIBS="$LIBS"
6777
6778                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6779                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6780
6781                 # while -W for passing linker flags is prevalent, it is not "standard".
6782                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6783                 # incompatible _and_ non-standard -W option which gives an error.  Work
6784                 # around that pitfall.
6785                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6786                 (x*c[89]9@@*-W*)
6787
6788 cf_fix_cppflags=no
6789 cf_new_cflags=
6790 cf_new_cppflags=
6791 cf_new_extra_cppflags=
6792
6793 for cf_add_cflags in $cf_pkg_cflags
6794 do
6795 case $cf_fix_cppflags in
6796 (no)
6797         case $cf_add_cflags in
6798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6799                 case $cf_add_cflags in
6800                 (-D*)
6801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6802
6803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6804                                 && test -z "${cf_tst_cflags}" \
6805                                 && cf_fix_cppflags=yes
6806
6807                         if test $cf_fix_cppflags = yes ; then
6808
6809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6811
6812                                 continue
6813                         elif test "${cf_tst_cflags}" = "\"'" ; then
6814
6815         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6816         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6817
6818                                 continue
6819                         fi
6820                         ;;
6821                 esac
6822                 case "$CPPFLAGS" in
6823                 (*$cf_add_cflags)
6824                         ;;
6825                 (*)
6826                         case $cf_add_cflags in
6827                         (-D*)
6828                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6829
6830 CPPFLAGS=`echo "$CPPFLAGS" | \
6831         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6832                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6833
6834                                 ;;
6835                         esac
6836
6837         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6838         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6839
6840                         ;;
6841                 esac
6842                 ;;
6843         (*)
6844
6845         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6846         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6847
6848                 ;;
6849         esac
6850         ;;
6851 (yes)
6852
6853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6855
6856         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6857
6858         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6859                 && test -z "${cf_tst_cflags}" \
6860                 && cf_fix_cppflags=no
6861         ;;
6862 esac
6863 done
6864
6865 if test -n "$cf_new_cflags" ; then
6866
6867         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6868         CFLAGS="${CFLAGS}$cf_new_cflags"
6869
6870 fi
6871
6872 if test -n "$cf_new_cppflags" ; then
6873
6874         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6875         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6876
6877 fi
6878
6879 if test -n "$cf_new_extra_cppflags" ; then
6880
6881         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6882         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6883
6884 fi
6885
6886 cf_add_libs="$LIBS"
6887 # reverse order
6888 cf_add_0lib=
6889 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6890 # filter duplicates
6891 for cf_add_1lib in $cf_add_0lib; do
6892         for cf_add_2lib in $cf_add_libs; do
6893                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6894                         cf_add_1lib=
6895                         break
6896                 fi
6897         done
6898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6899 done
6900 LIBS="$cf_add_libs"
6901
6902                         cat >conftest.$ac_ext <<_ACEOF
6903 #line 6903 "configure"
6904 #include "confdefs.h"
6905 #include <${cf_cv_ncurses_header:-curses.h}>
6906 int
6907 main (void)
6908 {
6909 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6910   ;
6911   return 0;
6912 }
6913 _ACEOF
6914 rm -f conftest.$ac_objext conftest$ac_exeext
6915 if { (eval echo "$as_me:6915: \"$ac_link\"") >&5
6916   (eval $ac_link) 2>&5
6917   ac_status=$?
6918   echo "$as_me:6918: \$? = $ac_status" >&5
6919   (exit $ac_status); } &&
6920          { ac_try='test -s conftest$ac_exeext'
6921   { (eval echo "$as_me:6921: \"$ac_try\"") >&5
6922   (eval $ac_try) 2>&5
6923   ac_status=$?
6924   echo "$as_me:6924: \$? = $ac_status" >&5
6925   (exit $ac_status); }; }; then
6926   if test "$cross_compiling" = yes; then
6927   cf_test_ncuconfig=maybe
6928 else
6929   cat >conftest.$ac_ext <<_ACEOF
6930 #line 6930 "configure"
6931 #include "confdefs.h"
6932 #include <${cf_cv_ncurses_header:-curses.h}>
6933                                         int main(void)
6934                                         { char *xx = curses_version(); return (xx == 0); }
6935 _ACEOF
6936 rm -f conftest$ac_exeext
6937 if { (eval echo "$as_me:6937: \"$ac_link\"") >&5
6938   (eval $ac_link) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6942   { (eval echo "$as_me:6942: \"$ac_try\"") >&5
6943   (eval $ac_try) 2>&5
6944   ac_status=$?
6945   echo "$as_me:6945: \$? = $ac_status" >&5
6946   (exit $ac_status); }; }; then
6947   cf_test_ncuconfig=yes
6948 else
6949   echo "$as_me: program exited with status $ac_status" >&5
6950 echo "$as_me: failed program was:" >&5
6951 cat conftest.$ac_ext >&5
6952 cf_test_ncuconfig=no
6953 fi
6954 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6955 fi
6956 else
6957   echo "$as_me: failed program was:" >&5
6958 cat conftest.$ac_ext >&5
6959 cf_test_ncuconfig=no
6960 fi
6961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6962
6963                         CFLAGS="$cf_save_CFLAGS"
6964                         CPPFLAGS="$cf_save_CPPFLAGS"
6965                         LIBS="$cf_save_LIBS"
6966
6967                         if test "x$cf_test_ncuconfig" != xyes; then
6968                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
6969                                 cf_pkg_cflags="$cf_temp"
6970                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
6971                                 cf_pkg_libs="$cf_temp"
6972                         fi
6973                         ;;
6974                 esac
6975
6976 cf_fix_cppflags=no
6977 cf_new_cflags=
6978 cf_new_cppflags=
6979 cf_new_extra_cppflags=
6980
6981 for cf_add_cflags in $cf_pkg_cflags
6982 do
6983 case $cf_fix_cppflags in
6984 (no)
6985         case $cf_add_cflags in
6986         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6987                 case $cf_add_cflags in
6988                 (-D*)
6989                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6990
6991                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6992                                 && test -z "${cf_tst_cflags}" \
6993                                 && cf_fix_cppflags=yes
6994
6995                         if test $cf_fix_cppflags = yes ; then
6996
6997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6999
7000                                 continue
7001                         elif test "${cf_tst_cflags}" = "\"'" ; then
7002
7003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7005
7006                                 continue
7007                         fi
7008                         ;;
7009                 esac
7010                 case "$CPPFLAGS" in
7011                 (*$cf_add_cflags)
7012                         ;;
7013                 (*)
7014                         case $cf_add_cflags in
7015                         (-D*)
7016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7017
7018 CPPFLAGS=`echo "$CPPFLAGS" | \
7019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7021
7022                                 ;;
7023                         esac
7024
7025         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7026         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7027
7028                         ;;
7029                 esac
7030                 ;;
7031         (*)
7032
7033         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7034         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7035
7036                 ;;
7037         esac
7038         ;;
7039 (yes)
7040
7041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7043
7044         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7045
7046         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7047                 && test -z "${cf_tst_cflags}" \
7048                 && cf_fix_cppflags=no
7049         ;;
7050 esac
7051 done
7052
7053 if test -n "$cf_new_cflags" ; then
7054
7055         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7056         CFLAGS="${CFLAGS}$cf_new_cflags"
7057
7058 fi
7059
7060 if test -n "$cf_new_cppflags" ; then
7061
7062         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7063         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7064
7065 fi
7066
7067 if test -n "$cf_new_extra_cppflags" ; then
7068
7069         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7070         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7071
7072 fi
7073
7074 cf_add_libs="$LIBS"
7075 # reverse order
7076 cf_add_0lib=
7077 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7078 # filter duplicates
7079 for cf_add_1lib in $cf_add_0lib; do
7080         for cf_add_2lib in $cf_add_libs; do
7081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7082                         cf_add_1lib=
7083                         break
7084                 fi
7085         done
7086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7087 done
7088 LIBS="$cf_add_libs"
7089
7090                 cat >conftest.$ac_ext <<_ACEOF
7091 #line 7091 "configure"
7092 #include "confdefs.h"
7093 #include <${cf_cv_ncurses_header:-curses.h}>
7094 int
7095 main (void)
7096 {
7097 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7098   ;
7099   return 0;
7100 }
7101 _ACEOF
7102 rm -f conftest.$ac_objext conftest$ac_exeext
7103 if { (eval echo "$as_me:7103: \"$ac_link\"") >&5
7104   (eval $ac_link) 2>&5
7105   ac_status=$?
7106   echo "$as_me:7106: \$? = $ac_status" >&5
7107   (exit $ac_status); } &&
7108          { ac_try='test -s conftest$ac_exeext'
7109   { (eval echo "$as_me:7109: \"$ac_try\"") >&5
7110   (eval $ac_try) 2>&5
7111   ac_status=$?
7112   echo "$as_me:7112: \$? = $ac_status" >&5
7113   (exit $ac_status); }; }; then
7114   if test "$cross_compiling" = yes; then
7115   cf_have_ncuconfig=maybe
7116 else
7117   cat >conftest.$ac_ext <<_ACEOF
7118 #line 7118 "configure"
7119 #include "confdefs.h"
7120 #include <${cf_cv_ncurses_header:-curses.h}>
7121                                 int main(void)
7122                                 { char *xx = curses_version(); return (xx == 0); }
7123 _ACEOF
7124 rm -f conftest$ac_exeext
7125 if { (eval echo "$as_me:7125: \"$ac_link\"") >&5
7126   (eval $ac_link) 2>&5
7127   ac_status=$?
7128   echo "$as_me:7128: \$? = $ac_status" >&5
7129   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7130   { (eval echo "$as_me:7130: \"$ac_try\"") >&5
7131   (eval $ac_try) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit $ac_status); }; }; then
7135   cf_have_ncuconfig=yes
7136 else
7137   echo "$as_me: program exited with status $ac_status" >&5
7138 echo "$as_me: failed program was:" >&5
7139 cat conftest.$ac_ext >&5
7140 cf_have_ncuconfig=no
7141 fi
7142 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7143 fi
7144 else
7145   echo "$as_me: failed program was:" >&5
7146 cat conftest.$ac_ext >&5
7147 cf_have_ncuconfig=no
7148 fi
7149 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7150                 echo "$as_me:7150: result: $cf_have_ncuconfig" >&5
7151 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7152                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7153                 if test "$cf_have_ncuconfig" != "yes"
7154                 then
7155                         CPPFLAGS="$cf_save_CPPFLAGS"
7156                         LIBS="$cf_save_LIBS"
7157                         NCURSES_CONFIG_PKG=none
7158                 else
7159
7160 cat >>confdefs.h <<\EOF
7161 #define NCURSES 1
7162 EOF
7163
7164                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7165
7166 echo "$as_me:7166: checking for terminfo header" >&5
7167 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7168 if test "${cf_cv_term_header+set}" = set; then
7169   echo $ECHO_N "(cached) $ECHO_C" >&6
7170 else
7171
7172 case ${cf_cv_ncurses_header} in
7173 (*/ncurses.h|*/ncursesw.h)
7174         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7175         ;;
7176 (*)
7177         cf_term_header=term.h
7178         ;;
7179 esac
7180
7181 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7182 do
7183 cat >conftest.$ac_ext <<_ACEOF
7184 #line 7184 "configure"
7185 #include "confdefs.h"
7186 #include <stdio.h>
7187 #include <${cf_cv_ncurses_header:-curses.h}>
7188 #include <$cf_test>
7189
7190 int
7191 main (void)
7192 {
7193 int x = auto_left_margin; (void)x
7194   ;
7195   return 0;
7196 }
7197 _ACEOF
7198 rm -f conftest.$ac_objext
7199 if { (eval echo "$as_me:7199: \"$ac_compile\"") >&5
7200   (eval $ac_compile) 2>&5
7201   ac_status=$?
7202   echo "$as_me:7202: \$? = $ac_status" >&5
7203   (exit $ac_status); } &&
7204          { ac_try='test -s conftest.$ac_objext'
7205   { (eval echo "$as_me:7205: \"$ac_try\"") >&5
7206   (eval $ac_try) 2>&5
7207   ac_status=$?
7208   echo "$as_me:7208: \$? = $ac_status" >&5
7209   (exit $ac_status); }; }; then
7210
7211         cf_cv_term_header="$cf_test"
7212 else
7213   echo "$as_me: failed program was:" >&5
7214 cat conftest.$ac_ext >&5
7215
7216         cf_cv_term_header=unknown
7217
7218 fi
7219 rm -f conftest.$ac_objext conftest.$ac_ext
7220         test "$cf_cv_term_header" != unknown && break
7221 done
7222
7223 fi
7224 echo "$as_me:7224: result: $cf_cv_term_header" >&5
7225 echo "${ECHO_T}$cf_cv_term_header" >&6
7226
7227 # Set definitions to allow ifdef'ing to accommodate subdirectories
7228
7229 case $cf_cv_term_header in
7230 (*term.h)
7231
7232 cat >>confdefs.h <<\EOF
7233 #define HAVE_TERM_H 1
7234 EOF
7235
7236         ;;
7237 esac
7238
7239 case $cf_cv_term_header in
7240 (ncurses/term.h)
7241
7242 cat >>confdefs.h <<\EOF
7243 #define HAVE_NCURSES_TERM_H 1
7244 EOF
7245
7246         ;;
7247 (ncursesw/term.h)
7248
7249 cat >>confdefs.h <<\EOF
7250 #define HAVE_NCURSESW_TERM_H 1
7251 EOF
7252
7253         ;;
7254 esac
7255
7256                 fi
7257
7258         else
7259                 echo "$as_me:7259: result: no" >&5
7260 echo "${ECHO_T}no" >&6
7261                 NCURSES_CONFIG_PKG=none
7262         fi
7263 else
7264         NCURSES_CONFIG_PKG=none
7265 fi
7266
7267 if test "x$cf_have_ncuconfig" = "xno"; then
7268         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7269
7270 if test -n "$ac_tool_prefix"; then
7271   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7272   do
7273     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7274 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7275 echo "$as_me:7275: checking for $ac_word" >&5
7276 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7277 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7278   echo $ECHO_N "(cached) $ECHO_C" >&6
7279 else
7280   if test -n "$NCURSES_CONFIG"; then
7281   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7282 else
7283   ac_save_IFS=$IFS; IFS=$ac_path_separator
7284 ac_dummy="$PATH"
7285 for ac_dir in $ac_dummy; do
7286   IFS=$ac_save_IFS
7287   test -z "$ac_dir" && ac_dir=.
7288   $as_executable_p "$ac_dir/$ac_word" || continue
7289 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7290 echo "$as_me:7290: found $ac_dir/$ac_word" >&5
7291 break
7292 done
7293
7294 fi
7295 fi
7296 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7297 if test -n "$NCURSES_CONFIG"; then
7298   echo "$as_me:7298: result: $NCURSES_CONFIG" >&5
7299 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7300 else
7301   echo "$as_me:7301: result: no" >&5
7302 echo "${ECHO_T}no" >&6
7303 fi
7304
7305     test -n "$NCURSES_CONFIG" && break
7306   done
7307 fi
7308 if test -z "$NCURSES_CONFIG"; then
7309   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7310   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7311 do
7312   # Extract the first word of "$ac_prog", so it can be a program name with args.
7313 set dummy $ac_prog; ac_word=$2
7314 echo "$as_me:7314: checking for $ac_word" >&5
7315 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7316 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7317   echo $ECHO_N "(cached) $ECHO_C" >&6
7318 else
7319   if test -n "$ac_ct_NCURSES_CONFIG"; then
7320   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7321 else
7322   ac_save_IFS=$IFS; IFS=$ac_path_separator
7323 ac_dummy="$PATH"
7324 for ac_dir in $ac_dummy; do
7325   IFS=$ac_save_IFS
7326   test -z "$ac_dir" && ac_dir=.
7327   $as_executable_p "$ac_dir/$ac_word" || continue
7328 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7329 echo "$as_me:7329: found $ac_dir/$ac_word" >&5
7330 break
7331 done
7332
7333 fi
7334 fi
7335 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7336 if test -n "$ac_ct_NCURSES_CONFIG"; then
7337   echo "$as_me:7337: result: $ac_ct_NCURSES_CONFIG" >&5
7338 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7339 else
7340   echo "$as_me:7340: result: no" >&5
7341 echo "${ECHO_T}no" >&6
7342 fi
7343
7344   test -n "$ac_ct_NCURSES_CONFIG" && break
7345 done
7346 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7347
7348   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7349 fi
7350
7351         if test "$NCURSES_CONFIG" != none ; then
7352
7353 cf_fix_cppflags=no
7354 cf_new_cflags=
7355 cf_new_cppflags=
7356 cf_new_extra_cppflags=
7357
7358 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7359 do
7360 case $cf_fix_cppflags in
7361 (no)
7362         case $cf_add_cflags in
7363         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7364                 case $cf_add_cflags in
7365                 (-D*)
7366                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7367
7368                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7369                                 && test -z "${cf_tst_cflags}" \
7370                                 && cf_fix_cppflags=yes
7371
7372                         if test $cf_fix_cppflags = yes ; then
7373
7374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7376
7377                                 continue
7378                         elif test "${cf_tst_cflags}" = "\"'" ; then
7379
7380         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7381         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7382
7383                                 continue
7384                         fi
7385                         ;;
7386                 esac
7387                 case "$CPPFLAGS" in
7388                 (*$cf_add_cflags)
7389                         ;;
7390                 (*)
7391                         case $cf_add_cflags in
7392                         (-D*)
7393                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7394
7395 CPPFLAGS=`echo "$CPPFLAGS" | \
7396         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7397                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7398
7399                                 ;;
7400                         esac
7401
7402         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7403         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7404
7405                         ;;
7406                 esac
7407                 ;;
7408         (*)
7409
7410         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7411         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7412
7413                 ;;
7414         esac
7415         ;;
7416 (yes)
7417
7418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7420
7421         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7422
7423         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7424                 && test -z "${cf_tst_cflags}" \
7425                 && cf_fix_cppflags=no
7426         ;;
7427 esac
7428 done
7429
7430 if test -n "$cf_new_cflags" ; then
7431
7432         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7433         CFLAGS="${CFLAGS}$cf_new_cflags"
7434
7435 fi
7436
7437 if test -n "$cf_new_cppflags" ; then
7438
7439         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7440         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7441
7442 fi
7443
7444 if test -n "$cf_new_extra_cppflags" ; then
7445
7446         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7447         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7448
7449 fi
7450
7451 cf_add_libs="$LIBS"
7452 # reverse order
7453 cf_add_0lib=
7454 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7455 # filter duplicates
7456 for cf_add_1lib in $cf_add_0lib; do
7457         for cf_add_2lib in $cf_add_libs; do
7458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7459                         cf_add_1lib=
7460                         break
7461                 fi
7462         done
7463         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7464 done
7465 LIBS="$cf_add_libs"
7466
7467                 # even with config script, some packages use no-override for curses.h
7468
7469 echo "$as_me:7469: checking if we have identified curses headers" >&5
7470 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7471 if test "${cf_cv_ncurses_header+set}" = set; then
7472   echo $ECHO_N "(cached) $ECHO_C" >&6
7473 else
7474
7475 cf_cv_ncurses_header=none
7476 for cf_header in \
7477         ncurses.h ncursesw/ncurses.h \
7478         curses.h ncursesw/curses.h
7479 do
7480 cat >conftest.$ac_ext <<_ACEOF
7481 #line 7481 "configure"
7482 #include "confdefs.h"
7483 #include <${cf_header}>
7484 int
7485 main (void)
7486 {
7487 initscr(); tgoto("?", 0,0)
7488   ;
7489   return 0;
7490 }
7491 _ACEOF
7492 rm -f conftest.$ac_objext
7493 if { (eval echo "$as_me:7493: \"$ac_compile\"") >&5
7494   (eval $ac_compile) 2>&5
7495   ac_status=$?
7496   echo "$as_me:7496: \$? = $ac_status" >&5
7497   (exit $ac_status); } &&
7498          { ac_try='test -s conftest.$ac_objext'
7499   { (eval echo "$as_me:7499: \"$ac_try\"") >&5
7500   (eval $ac_try) 2>&5
7501   ac_status=$?
7502   echo "$as_me:7502: \$? = $ac_status" >&5
7503   (exit $ac_status); }; }; then
7504   cf_cv_ncurses_header=$cf_header; break
7505 else
7506   echo "$as_me: failed program was:" >&5
7507 cat conftest.$ac_ext >&5
7508 fi
7509 rm -f conftest.$ac_objext conftest.$ac_ext
7510 done
7511
7512 fi
7513 echo "$as_me:7513: result: $cf_cv_ncurses_header" >&5
7514 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7515
7516 if test "$cf_cv_ncurses_header" = none ; then
7517         { { echo "$as_me:7517: error: No curses header-files found" >&5
7518 echo "$as_me: error: No curses header-files found" >&2;}
7519    { (exit 1); exit 1; }; }
7520 fi
7521
7522 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7523
7524 for ac_header in $cf_cv_ncurses_header
7525 do
7526 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7527 echo "$as_me:7527: checking for $ac_header" >&5
7528 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7529 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7530   echo $ECHO_N "(cached) $ECHO_C" >&6
7531 else
7532   cat >conftest.$ac_ext <<_ACEOF
7533 #line 7533 "configure"
7534 #include "confdefs.h"
7535 #include <$ac_header>
7536 _ACEOF
7537 if { (eval echo "$as_me:7537: \"$ac_cpp conftest.$ac_ext\"") >&5
7538   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7539   ac_status=$?
7540   egrep -v '^ *\+' conftest.er1 >conftest.err
7541   rm -f conftest.er1
7542   cat conftest.err >&5
7543   echo "$as_me:7543: \$? = $ac_status" >&5
7544   (exit $ac_status); } >/dev/null; then
7545   if test -s conftest.err; then
7546     ac_cpp_err=$ac_c_preproc_warn_flag
7547   else
7548     ac_cpp_err=
7549   fi
7550 else
7551   ac_cpp_err=yes
7552 fi
7553 if test -z "$ac_cpp_err"; then
7554   eval "$as_ac_Header=yes"
7555 else
7556   echo "$as_me: failed program was:" >&5
7557   cat conftest.$ac_ext >&5
7558   eval "$as_ac_Header=no"
7559 fi
7560 rm -f conftest.err conftest.$ac_ext
7561 fi
7562 echo "$as_me:7562: result: `eval echo '${'$as_ac_Header'}'`" >&5
7563 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7564 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7565   cat >>confdefs.h <<EOF
7566 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7567 EOF
7568
7569 fi
7570 done
7571
7572 cat >>confdefs.h <<\EOF
7573 #define NCURSES 1
7574 EOF
7575
7576 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7577
7578                 cat >>confdefs.h <<EOF
7579 #define $cf_nculib_ROOT 1
7580 EOF
7581
7582                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7583
7584         else
7585
7586 cf_ncuhdr_root=ncursesw
7587
7588 test -n "$cf_cv_curses_dir" && \
7589 test "$cf_cv_curses_dir" != "no" && { \
7590
7591 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7592   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7593   do
7594         while test $cf_add_incdir != /usr/include
7595         do
7596           if test -d $cf_add_incdir
7597           then
7598                 cf_have_incdir=no
7599                 if test -n "$CFLAGS$CPPFLAGS" ; then
7600                   # a loop is needed to ensure we can add subdirs of existing dirs
7601                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7602                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7603                           cf_have_incdir=yes; break
7604                         fi
7605                   done
7606                 fi
7607
7608                 if test "$cf_have_incdir" = no ; then
7609                   if test "$cf_add_incdir" = /usr/local/include ; then
7610                         if test "$GCC" = yes
7611                         then
7612                           cf_save_CPPFLAGS=$CPPFLAGS
7613
7614         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7615         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7616
7617                           cat >conftest.$ac_ext <<_ACEOF
7618 #line 7618 "configure"
7619 #include "confdefs.h"
7620 #include <stdio.h>
7621 int
7622 main (void)
7623 {
7624 printf("Hello")
7625   ;
7626   return 0;
7627 }
7628 _ACEOF
7629 rm -f conftest.$ac_objext
7630 if { (eval echo "$as_me:7630: \"$ac_compile\"") >&5
7631   (eval $ac_compile) 2>&5
7632   ac_status=$?
7633   echo "$as_me:7633: \$? = $ac_status" >&5
7634   (exit $ac_status); } &&
7635          { ac_try='test -s conftest.$ac_objext'
7636   { (eval echo "$as_me:7636: \"$ac_try\"") >&5
7637   (eval $ac_try) 2>&5
7638   ac_status=$?
7639   echo "$as_me:7639: \$? = $ac_status" >&5
7640   (exit $ac_status); }; }; then
7641   :
7642 else
7643   echo "$as_me: failed program was:" >&5
7644 cat conftest.$ac_ext >&5
7645 cf_have_incdir=yes
7646 fi
7647 rm -f conftest.$ac_objext conftest.$ac_ext
7648                           CPPFLAGS=$cf_save_CPPFLAGS
7649                         fi
7650                   fi
7651                 fi
7652
7653                 if test "$cf_have_incdir" = no ; then
7654                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7655
7656 echo "${as_me:-configure}:7656: testing adding $cf_add_incdir to include-path ..." 1>&5
7657
7658                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7659
7660                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7661                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7662                   cf_add_incdir="$cf_top_incdir"
7663                 else
7664                   break
7665                 fi
7666           else
7667                 break
7668           fi
7669         done
7670   done
7671 fi
7672
7673 }
7674
7675 echo "$as_me:7675: checking for $cf_ncuhdr_root header in include-path" >&5
7676 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7677 if test "${cf_cv_ncurses_h+set}" = set; then
7678   echo $ECHO_N "(cached) $ECHO_C" >&6
7679 else
7680
7681         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7682         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7683         for cf_header in $cf_header_list
7684         do
7685
7686         cat >conftest.$ac_ext <<_ACEOF
7687 #line 7687 "configure"
7688 #include "confdefs.h"
7689
7690 #define _XOPEN_SOURCE_EXTENDED
7691 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7692 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7693
7694 #include <$cf_header>
7695 int
7696 main (void)
7697 {
7698
7699 #ifdef NCURSES_VERSION
7700
7701 #ifndef WACS_BSSB
7702         make an error
7703 #endif
7704
7705 printf("%s\n", NCURSES_VERSION);
7706 #else
7707 #ifdef __NCURSES_H
7708 printf("old\n");
7709 #else
7710         make an error
7711 #endif
7712 #endif
7713
7714   ;
7715   return 0;
7716 }
7717 _ACEOF
7718 rm -f conftest.$ac_objext
7719 if { (eval echo "$as_me:7719: \"$ac_compile\"") >&5
7720   (eval $ac_compile) 2>&5
7721   ac_status=$?
7722   echo "$as_me:7722: \$? = $ac_status" >&5
7723   (exit $ac_status); } &&
7724          { ac_try='test -s conftest.$ac_objext'
7725   { (eval echo "$as_me:7725: \"$ac_try\"") >&5
7726   (eval $ac_try) 2>&5
7727   ac_status=$?
7728   echo "$as_me:7728: \$? = $ac_status" >&5
7729   (exit $ac_status); }; }; then
7730   cf_cv_ncurses_h=$cf_header
7731
7732 else
7733   echo "$as_me: failed program was:" >&5
7734 cat conftest.$ac_ext >&5
7735 cf_cv_ncurses_h=no
7736 fi
7737 rm -f conftest.$ac_objext conftest.$ac_ext
7738
7739                 test "$cf_cv_ncurses_h" != no && break
7740         done
7741
7742 fi
7743 echo "$as_me:7743: result: $cf_cv_ncurses_h" >&5
7744 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7745
7746 if test "$cf_cv_ncurses_h" != no ; then
7747         cf_cv_ncurses_header=$cf_cv_ncurses_h
7748 else
7749
7750 echo "$as_me:7750: checking for $cf_ncuhdr_root include-path" >&5
7751 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7752 if test "${cf_cv_ncurses_h2+set}" = set; then
7753   echo $ECHO_N "(cached) $ECHO_C" >&6
7754 else
7755
7756         test -n "$verbose" && echo
7757
7758 cf_search=
7759
7760 # collect the current set of include-directories from compiler flags
7761 cf_header_path_list=""
7762 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7763         for cf_header_path in $CPPFLAGS $CFLAGS
7764         do
7765                 case $cf_header_path in
7766                 (-I*)
7767                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7768
7769 test "x$cf_header_path" != "xNONE" && \
7770 test -d "$cf_header_path" && \
7771  {
7772         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7773         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7774         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7775         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7776         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7777         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"
7778 }
7779
7780                         cf_header_path_list="$cf_header_path_list $cf_search"
7781                         ;;
7782                 esac
7783         done
7784 fi
7785
7786 # add the variations for the package we are looking for
7787
7788 cf_search=
7789
7790 test "x$prefix" != "xNONE" && \
7791 test -d "$prefix" && \
7792  {
7793         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7794         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7795         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7796         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7797         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7798         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7799 }
7800
7801 for cf_subdir_prefix in \
7802         /usr \
7803         /usr/local \
7804         /usr/pkg \
7805         /opt \
7806         /opt/local \
7807         $HOME
7808 do
7809
7810 test "x$cf_subdir_prefix" != "x$prefix" && \
7811 test -d "$cf_subdir_prefix" && \
7812 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7813         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7814         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7815         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7816         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7817         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7818         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"
7819 }
7820
7821 done
7822
7823 test "$includedir" != NONE && \
7824 test "$includedir" != "/usr/include" && \
7825 test -d "$includedir" && {
7826         test -d $includedir &&    cf_search="$cf_search $includedir"
7827         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7828 }
7829
7830 test "$oldincludedir" != NONE && \
7831 test "$oldincludedir" != "/usr/include" && \
7832 test -d "$oldincludedir" && {
7833         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7834         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7835 }
7836
7837 cf_search="$cf_search $cf_header_path_list"
7838
7839         test -n "$verbose" && echo search path $cf_search
7840         cf_save2_CPPFLAGS="$CPPFLAGS"
7841         for cf_incdir in $cf_search
7842         do
7843
7844 if test -n "$cf_incdir" ; then
7845   for cf_add_incdir in $cf_incdir
7846   do
7847         while test $cf_add_incdir != /usr/include
7848         do
7849           if test -d $cf_add_incdir
7850           then
7851                 cf_have_incdir=no
7852                 if test -n "$CFLAGS$CPPFLAGS" ; then
7853                   # a loop is needed to ensure we can add subdirs of existing dirs
7854                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7855                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7856                           cf_have_incdir=yes; break
7857                         fi
7858                   done
7859                 fi
7860
7861                 if test "$cf_have_incdir" = no ; then
7862                   if test "$cf_add_incdir" = /usr/local/include ; then
7863                         if test "$GCC" = yes
7864                         then
7865                           cf_save_CPPFLAGS=$CPPFLAGS
7866
7867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7868         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7869
7870                           cat >conftest.$ac_ext <<_ACEOF
7871 #line 7871 "configure"
7872 #include "confdefs.h"
7873 #include <stdio.h>
7874 int
7875 main (void)
7876 {
7877 printf("Hello")
7878   ;
7879   return 0;
7880 }
7881 _ACEOF
7882 rm -f conftest.$ac_objext
7883 if { (eval echo "$as_me:7883: \"$ac_compile\"") >&5
7884   (eval $ac_compile) 2>&5
7885   ac_status=$?
7886   echo "$as_me:7886: \$? = $ac_status" >&5
7887   (exit $ac_status); } &&
7888          { ac_try='test -s conftest.$ac_objext'
7889   { (eval echo "$as_me:7889: \"$ac_try\"") >&5
7890   (eval $ac_try) 2>&5
7891   ac_status=$?
7892   echo "$as_me:7892: \$? = $ac_status" >&5
7893   (exit $ac_status); }; }; then
7894   :
7895 else
7896   echo "$as_me: failed program was:" >&5
7897 cat conftest.$ac_ext >&5
7898 cf_have_incdir=yes
7899 fi
7900 rm -f conftest.$ac_objext conftest.$ac_ext
7901                           CPPFLAGS=$cf_save_CPPFLAGS
7902                         fi
7903                   fi
7904                 fi
7905
7906                 if test "$cf_have_incdir" = no ; then
7907                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7908
7909 echo "${as_me:-configure}:7909: testing adding $cf_add_incdir to include-path ..." 1>&5
7910
7911                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7912
7913                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7914                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7915                   cf_add_incdir="$cf_top_incdir"
7916                 else
7917                   break
7918                 fi
7919           else
7920                 break
7921           fi
7922         done
7923   done
7924 fi
7925
7926                 for cf_header in \
7927                         ncurses.h \
7928                         curses.h
7929                 do
7930
7931         cat >conftest.$ac_ext <<_ACEOF
7932 #line 7932 "configure"
7933 #include "confdefs.h"
7934
7935 #include <$cf_header>
7936 int
7937 main (void)
7938 {
7939
7940 #ifdef NCURSES_VERSION
7941
7942 printf("%s\n", NCURSES_VERSION);
7943 #else
7944 #ifdef __NCURSES_H
7945 printf("old\n");
7946 #else
7947         make an error
7948 #endif
7949 #endif
7950
7951   ;
7952   return 0;
7953 }
7954 _ACEOF
7955 rm -f conftest.$ac_objext
7956 if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5
7957   (eval $ac_compile) 2>&5
7958   ac_status=$?
7959   echo "$as_me:7959: \$? = $ac_status" >&5
7960   (exit $ac_status); } &&
7961          { ac_try='test -s conftest.$ac_objext'
7962   { (eval echo "$as_me:7962: \"$ac_try\"") >&5
7963   (eval $ac_try) 2>&5
7964   ac_status=$?
7965   echo "$as_me:7965: \$? = $ac_status" >&5
7966   (exit $ac_status); }; }; then
7967   cf_cv_ncurses_h2=$cf_header
7968
7969 else
7970   echo "$as_me: failed program was:" >&5
7971 cat conftest.$ac_ext >&5
7972 cf_cv_ncurses_h2=no
7973 fi
7974 rm -f conftest.$ac_objext conftest.$ac_ext
7975
7976                         if test "$cf_cv_ncurses_h2" != no ; then
7977                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7978                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7979                                 break
7980                         fi
7981                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7982                 done
7983                 CPPFLAGS="$cf_save2_CPPFLAGS"
7984                 test "$cf_cv_ncurses_h2" != no && break
7985         done
7986         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7986: error: not found" >&5
7987 echo "$as_me: error: not found" >&2;}
7988    { (exit 1); exit 1; }; }
7989
7990 fi
7991 echo "$as_me:7991: result: $cf_cv_ncurses_h2" >&5
7992 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7993
7994         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7995         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7996         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7997                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7998         fi
7999
8000 if test -n "$cf_1st_incdir" ; then
8001   for cf_add_incdir in $cf_1st_incdir
8002   do
8003         while test $cf_add_incdir != /usr/include
8004         do
8005           if test -d $cf_add_incdir
8006           then
8007                 cf_have_incdir=no
8008                 if test -n "$CFLAGS$CPPFLAGS" ; then
8009                   # a loop is needed to ensure we can add subdirs of existing dirs
8010                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8011                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8012                           cf_have_incdir=yes; break
8013                         fi
8014                   done
8015                 fi
8016
8017                 if test "$cf_have_incdir" = no ; then
8018                   if test "$cf_add_incdir" = /usr/local/include ; then
8019                         if test "$GCC" = yes
8020                         then
8021                           cf_save_CPPFLAGS=$CPPFLAGS
8022
8023         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8024         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8025
8026                           cat >conftest.$ac_ext <<_ACEOF
8027 #line 8027 "configure"
8028 #include "confdefs.h"
8029 #include <stdio.h>
8030 int
8031 main (void)
8032 {
8033 printf("Hello")
8034   ;
8035   return 0;
8036 }
8037 _ACEOF
8038 rm -f conftest.$ac_objext
8039 if { (eval echo "$as_me:8039: \"$ac_compile\"") >&5
8040   (eval $ac_compile) 2>&5
8041   ac_status=$?
8042   echo "$as_me:8042: \$? = $ac_status" >&5
8043   (exit $ac_status); } &&
8044          { ac_try='test -s conftest.$ac_objext'
8045   { (eval echo "$as_me:8045: \"$ac_try\"") >&5
8046   (eval $ac_try) 2>&5
8047   ac_status=$?
8048   echo "$as_me:8048: \$? = $ac_status" >&5
8049   (exit $ac_status); }; }; then
8050   :
8051 else
8052   echo "$as_me: failed program was:" >&5
8053 cat conftest.$ac_ext >&5
8054 cf_have_incdir=yes
8055 fi
8056 rm -f conftest.$ac_objext conftest.$ac_ext
8057                           CPPFLAGS=$cf_save_CPPFLAGS
8058                         fi
8059                   fi
8060                 fi
8061
8062                 if test "$cf_have_incdir" = no ; then
8063                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8064
8065 echo "${as_me:-configure}:8065: testing adding $cf_add_incdir to include-path ..." 1>&5
8066
8067                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8068
8069                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8070                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8071                   cf_add_incdir="$cf_top_incdir"
8072                 else
8073                   break
8074                 fi
8075           else
8076                 break
8077           fi
8078         done
8079   done
8080 fi
8081
8082 fi
8083
8084 # Set definitions to allow ifdef'ing for ncurses.h
8085
8086 case $cf_cv_ncurses_header in
8087 (*ncurses.h)
8088
8089 cat >>confdefs.h <<\EOF
8090 #define HAVE_NCURSES_H 1
8091 EOF
8092
8093         ;;
8094 esac
8095
8096 case $cf_cv_ncurses_header in
8097 (ncurses/curses.h|ncurses/ncurses.h)
8098
8099 cat >>confdefs.h <<\EOF
8100 #define HAVE_NCURSES_NCURSES_H 1
8101 EOF
8102
8103         ;;
8104 (ncursesw/curses.h|ncursesw/ncurses.h)
8105
8106 cat >>confdefs.h <<\EOF
8107 #define HAVE_NCURSESW_NCURSES_H 1
8108 EOF
8109
8110         ;;
8111 esac
8112
8113 echo "$as_me:8113: checking for terminfo header" >&5
8114 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8115 if test "${cf_cv_term_header+set}" = set; then
8116   echo $ECHO_N "(cached) $ECHO_C" >&6
8117 else
8118
8119 case ${cf_cv_ncurses_header} in
8120 (*/ncurses.h|*/ncursesw.h)
8121         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8122         ;;
8123 (*)
8124         cf_term_header=term.h
8125         ;;
8126 esac
8127
8128 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8129 do
8130 cat >conftest.$ac_ext <<_ACEOF
8131 #line 8131 "configure"
8132 #include "confdefs.h"
8133 #include <stdio.h>
8134 #include <${cf_cv_ncurses_header:-curses.h}>
8135 #include <$cf_test>
8136
8137 int
8138 main (void)
8139 {
8140 int x = auto_left_margin; (void)x
8141   ;
8142   return 0;
8143 }
8144 _ACEOF
8145 rm -f conftest.$ac_objext
8146 if { (eval echo "$as_me:8146: \"$ac_compile\"") >&5
8147   (eval $ac_compile) 2>&5
8148   ac_status=$?
8149   echo "$as_me:8149: \$? = $ac_status" >&5
8150   (exit $ac_status); } &&
8151          { ac_try='test -s conftest.$ac_objext'
8152   { (eval echo "$as_me:8152: \"$ac_try\"") >&5
8153   (eval $ac_try) 2>&5
8154   ac_status=$?
8155   echo "$as_me:8155: \$? = $ac_status" >&5
8156   (exit $ac_status); }; }; then
8157
8158         cf_cv_term_header="$cf_test"
8159 else
8160   echo "$as_me: failed program was:" >&5
8161 cat conftest.$ac_ext >&5
8162
8163         cf_cv_term_header=unknown
8164
8165 fi
8166 rm -f conftest.$ac_objext conftest.$ac_ext
8167         test "$cf_cv_term_header" != unknown && break
8168 done
8169
8170 fi
8171 echo "$as_me:8171: result: $cf_cv_term_header" >&5
8172 echo "${ECHO_T}$cf_cv_term_header" >&6
8173
8174 # Set definitions to allow ifdef'ing to accommodate subdirectories
8175
8176 case $cf_cv_term_header in
8177 (*term.h)
8178
8179 cat >>confdefs.h <<\EOF
8180 #define HAVE_TERM_H 1
8181 EOF
8182
8183         ;;
8184 esac
8185
8186 case $cf_cv_term_header in
8187 (ncurses/term.h)
8188
8189 cat >>confdefs.h <<\EOF
8190 #define HAVE_NCURSES_TERM_H 1
8191 EOF
8192
8193         ;;
8194 (ncursesw/term.h)
8195
8196 cat >>confdefs.h <<\EOF
8197 #define HAVE_NCURSESW_TERM_H 1
8198 EOF
8199
8200         ;;
8201 esac
8202
8203 # some applications need this, but should check for NCURSES_VERSION
8204
8205 cat >>confdefs.h <<\EOF
8206 #define NCURSES 1
8207 EOF
8208
8209 echo "$as_me:8209: checking for ncurses version" >&5
8210 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8211 if test "${cf_cv_ncurses_version+set}" = set; then
8212   echo $ECHO_N "(cached) $ECHO_C" >&6
8213 else
8214
8215         cf_cv_ncurses_version=no
8216         cf_tempfile=out$$
8217         rm -f $cf_tempfile
8218         if test "$cross_compiling" = yes; then
8219
8220         # This will not work if the preprocessor splits the line after the
8221         # Autoconf token.  The 'unproto' program does that.
8222         cat > conftest.$ac_ext <<EOF
8223 #include <${cf_cv_ncurses_header:-curses.h}>
8224 #undef Autoconf
8225 #ifdef NCURSES_VERSION
8226 Autoconf NCURSES_VERSION
8227 #else
8228 #ifdef __NCURSES_H
8229 Autoconf "old"
8230 #endif
8231 ;
8232 #endif
8233 EOF
8234         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8235         { (eval echo "$as_me:8235: \"$cf_try\"") >&5
8236   (eval $cf_try) 2>&5
8237   ac_status=$?
8238   echo "$as_me:8238: \$? = $ac_status" >&5
8239   (exit $ac_status); }
8240         if test -f conftest.out ; then
8241                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8242                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8243                 rm -f conftest.out
8244         fi
8245
8246 else
8247   cat >conftest.$ac_ext <<_ACEOF
8248 #line 8248 "configure"
8249 #include "confdefs.h"
8250
8251 #include <${cf_cv_ncurses_header:-curses.h}>
8252 #include <stdio.h>
8253 int main(void)
8254 {
8255         FILE *fp = fopen("$cf_tempfile", "w");
8256 #ifdef NCURSES_VERSION
8257 # ifdef NCURSES_VERSION_PATCH
8258         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8259 # else
8260         fprintf(fp, "%s\n", NCURSES_VERSION);
8261 # endif
8262 #else
8263 # ifdef __NCURSES_H
8264         fprintf(fp, "old\n");
8265 # else
8266         make an error
8267 # endif
8268 #endif
8269         ${cf_cv_main_return:-return}(0);
8270 }
8271 _ACEOF
8272 rm -f conftest$ac_exeext
8273 if { (eval echo "$as_me:8273: \"$ac_link\"") >&5
8274   (eval $ac_link) 2>&5
8275   ac_status=$?
8276   echo "$as_me:8276: \$? = $ac_status" >&5
8277   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8278   { (eval echo "$as_me:8278: \"$ac_try\"") >&5
8279   (eval $ac_try) 2>&5
8280   ac_status=$?
8281   echo "$as_me:8281: \$? = $ac_status" >&5
8282   (exit $ac_status); }; }; then
8283
8284         cf_cv_ncurses_version=`cat $cf_tempfile`
8285 else
8286   echo "$as_me: program exited with status $ac_status" >&5
8287 echo "$as_me: failed program was:" >&5
8288 cat conftest.$ac_ext >&5
8289 fi
8290 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8291 fi
8292         rm -f $cf_tempfile
8293
8294 fi
8295 echo "$as_me:8295: result: $cf_cv_ncurses_version" >&5
8296 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8297 test "$cf_cv_ncurses_version" = no ||
8298 cat >>confdefs.h <<\EOF
8299 #define NCURSES 1
8300 EOF
8301
8302 cf_nculib_root=ncursesw
8303         # This works, except for the special case where we find gpm, but
8304         # ncurses is in a nonstandard location via $LIBS, and we really want
8305         # to link gpm.
8306 cf_ncurses_LIBS=""
8307 cf_ncurses_SAVE="$LIBS"
8308 echo "$as_me:8308: checking for Gpm_Open in -lgpm" >&5
8309 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8310 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8311   echo $ECHO_N "(cached) $ECHO_C" >&6
8312 else
8313   ac_check_lib_save_LIBS=$LIBS
8314 LIBS="-lgpm  $LIBS"
8315 cat >conftest.$ac_ext <<_ACEOF
8316 #line 8316 "configure"
8317 #include "confdefs.h"
8318
8319 /* Override any gcc2 internal prototype to avoid an error.  */
8320 #ifdef __cplusplus
8321 extern "C"
8322 #endif
8323 /* We use char because int might match the return type of a gcc2
8324    builtin and then its argument prototype would still apply.  */
8325 char Gpm_Open ();
8326 int
8327 main (void)
8328 {
8329 Gpm_Open ();
8330   ;
8331   return 0;
8332 }
8333 _ACEOF
8334 rm -f conftest.$ac_objext conftest$ac_exeext
8335 if { (eval echo "$as_me:8335: \"$ac_link\"") >&5
8336   (eval $ac_link) 2>&5
8337   ac_status=$?
8338   echo "$as_me:8338: \$? = $ac_status" >&5
8339   (exit $ac_status); } &&
8340          { ac_try='test -s conftest$ac_exeext'
8341   { (eval echo "$as_me:8341: \"$ac_try\"") >&5
8342   (eval $ac_try) 2>&5
8343   ac_status=$?
8344   echo "$as_me:8344: \$? = $ac_status" >&5
8345   (exit $ac_status); }; }; then
8346   ac_cv_lib_gpm_Gpm_Open=yes
8347 else
8348   echo "$as_me: failed program was:" >&5
8349 cat conftest.$ac_ext >&5
8350 ac_cv_lib_gpm_Gpm_Open=no
8351 fi
8352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8353 LIBS=$ac_check_lib_save_LIBS
8354 fi
8355 echo "$as_me:8355: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8356 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8357 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8358   echo "$as_me:8358: checking for initscr in -lgpm" >&5
8359 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8360 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8361   echo $ECHO_N "(cached) $ECHO_C" >&6
8362 else
8363   ac_check_lib_save_LIBS=$LIBS
8364 LIBS="-lgpm  $LIBS"
8365 cat >conftest.$ac_ext <<_ACEOF
8366 #line 8366 "configure"
8367 #include "confdefs.h"
8368
8369 /* Override any gcc2 internal prototype to avoid an error.  */
8370 #ifdef __cplusplus
8371 extern "C"
8372 #endif
8373 /* We use char because int might match the return type of a gcc2
8374    builtin and then its argument prototype would still apply.  */
8375 char initscr ();
8376 int
8377 main (void)
8378 {
8379 initscr ();
8380   ;
8381   return 0;
8382 }
8383 _ACEOF
8384 rm -f conftest.$ac_objext conftest$ac_exeext
8385 if { (eval echo "$as_me:8385: \"$ac_link\"") >&5
8386   (eval $ac_link) 2>&5
8387   ac_status=$?
8388   echo "$as_me:8388: \$? = $ac_status" >&5
8389   (exit $ac_status); } &&
8390          { ac_try='test -s conftest$ac_exeext'
8391   { (eval echo "$as_me:8391: \"$ac_try\"") >&5
8392   (eval $ac_try) 2>&5
8393   ac_status=$?
8394   echo "$as_me:8394: \$? = $ac_status" >&5
8395   (exit $ac_status); }; }; then
8396   ac_cv_lib_gpm_initscr=yes
8397 else
8398   echo "$as_me: failed program was:" >&5
8399 cat conftest.$ac_ext >&5
8400 ac_cv_lib_gpm_initscr=no
8401 fi
8402 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8403 LIBS=$ac_check_lib_save_LIBS
8404 fi
8405 echo "$as_me:8405: result: $ac_cv_lib_gpm_initscr" >&5
8406 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8407 if test $ac_cv_lib_gpm_initscr = yes; then
8408   LIBS="$cf_ncurses_SAVE"
8409 else
8410   cf_ncurses_LIBS="-lgpm"
8411 fi
8412
8413 fi
8414
8415 case $host_os in
8416 (freebsd*)
8417         # This is only necessary if you are linking against an obsolete
8418         # version of ncurses (but it should do no harm, since it's static).
8419         if test "$cf_nculib_root" = ncurses ; then
8420                 echo "$as_me:8420: checking for tgoto in -lmytinfo" >&5
8421 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8422 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8423   echo $ECHO_N "(cached) $ECHO_C" >&6
8424 else
8425   ac_check_lib_save_LIBS=$LIBS
8426 LIBS="-lmytinfo  $LIBS"
8427 cat >conftest.$ac_ext <<_ACEOF
8428 #line 8428 "configure"
8429 #include "confdefs.h"
8430
8431 /* Override any gcc2 internal prototype to avoid an error.  */
8432 #ifdef __cplusplus
8433 extern "C"
8434 #endif
8435 /* We use char because int might match the return type of a gcc2
8436    builtin and then its argument prototype would still apply.  */
8437 char tgoto ();
8438 int
8439 main (void)
8440 {
8441 tgoto ();
8442   ;
8443   return 0;
8444 }
8445 _ACEOF
8446 rm -f conftest.$ac_objext conftest$ac_exeext
8447 if { (eval echo "$as_me:8447: \"$ac_link\"") >&5
8448   (eval $ac_link) 2>&5
8449   ac_status=$?
8450   echo "$as_me:8450: \$? = $ac_status" >&5
8451   (exit $ac_status); } &&
8452          { ac_try='test -s conftest$ac_exeext'
8453   { (eval echo "$as_me:8453: \"$ac_try\"") >&5
8454   (eval $ac_try) 2>&5
8455   ac_status=$?
8456   echo "$as_me:8456: \$? = $ac_status" >&5
8457   (exit $ac_status); }; }; then
8458   ac_cv_lib_mytinfo_tgoto=yes
8459 else
8460   echo "$as_me: failed program was:" >&5
8461 cat conftest.$ac_ext >&5
8462 ac_cv_lib_mytinfo_tgoto=no
8463 fi
8464 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8465 LIBS=$ac_check_lib_save_LIBS
8466 fi
8467 echo "$as_me:8467: result: $ac_cv_lib_mytinfo_tgoto" >&5
8468 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8469 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8470   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8471 fi
8472
8473         fi
8474         ;;
8475 esac
8476
8477 cf_add_libs="$LIBS"
8478 # reverse order
8479 cf_add_0lib=
8480 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8481 # filter duplicates
8482 for cf_add_1lib in $cf_add_0lib; do
8483         for cf_add_2lib in $cf_add_libs; do
8484                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8485                         cf_add_1lib=
8486                         break
8487                 fi
8488         done
8489         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8490 done
8491 LIBS="$cf_add_libs"
8492
8493 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8494 then
8495
8496 cf_add_libs="$LIBS"
8497 # reverse order
8498 cf_add_0lib=
8499 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8500 # filter duplicates
8501 for cf_add_1lib in $cf_add_0lib; do
8502         for cf_add_2lib in $cf_add_libs; do
8503                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8504                         cf_add_1lib=
8505                         break
8506                 fi
8507         done
8508         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8509 done
8510 LIBS="$cf_add_libs"
8511
8512 else
8513
8514         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8515         cf_libdir=""
8516         echo "$as_me:8516: checking for initscr" >&5
8517 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8518 if test "${ac_cv_func_initscr+set}" = set; then
8519   echo $ECHO_N "(cached) $ECHO_C" >&6
8520 else
8521   cat >conftest.$ac_ext <<_ACEOF
8522 #line 8522 "configure"
8523 #include "confdefs.h"
8524 #define initscr autoconf_temporary
8525 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8526 #undef initscr
8527
8528 #ifdef __cplusplus
8529 extern "C"
8530 #endif
8531
8532 /* We use char because int might match the return type of a gcc2
8533    builtin and then its argument prototype would still apply.  */
8534 char initscr (void);
8535
8536 int
8537 main (void)
8538 {
8539
8540 /* The GNU C library defines stubs for functions which it implements
8541     to always fail with ENOSYS.  Some functions are actually named
8542     something starting with __ and the normal name is an alias.  */
8543 #if defined (__stub_initscr) || defined (__stub___initscr)
8544 #error found stub for initscr
8545 #endif
8546
8547         return initscr ();
8548   ;
8549   return 0;
8550 }
8551 _ACEOF
8552 rm -f conftest.$ac_objext conftest$ac_exeext
8553 if { (eval echo "$as_me:8553: \"$ac_link\"") >&5
8554   (eval $ac_link) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit $ac_status); } &&
8558          { ac_try='test -s conftest$ac_exeext'
8559   { (eval echo "$as_me:8559: \"$ac_try\"") >&5
8560   (eval $ac_try) 2>&5
8561   ac_status=$?
8562   echo "$as_me:8562: \$? = $ac_status" >&5
8563   (exit $ac_status); }; }; then
8564   ac_cv_func_initscr=yes
8565 else
8566   echo "$as_me: failed program was:" >&5
8567 cat conftest.$ac_ext >&5
8568 ac_cv_func_initscr=no
8569 fi
8570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8571 fi
8572 echo "$as_me:8572: result: $ac_cv_func_initscr" >&5
8573 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8574 if test $ac_cv_func_initscr = yes; then
8575   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8576 else
8577
8578                 cf_save_LIBS="$LIBS"
8579                 echo "$as_me:8579: checking for initscr in -l$cf_nculib_root" >&5
8580 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8581                 LIBS="-l$cf_nculib_root $LIBS"
8582                 cat >conftest.$ac_ext <<_ACEOF
8583 #line 8583 "configure"
8584 #include "confdefs.h"
8585 #include <${cf_cv_ncurses_header:-curses.h}>
8586 int
8587 main (void)
8588 {
8589 initscr()
8590   ;
8591   return 0;
8592 }
8593 _ACEOF
8594 rm -f conftest.$ac_objext conftest$ac_exeext
8595 if { (eval echo "$as_me:8595: \"$ac_link\"") >&5
8596   (eval $ac_link) 2>&5
8597   ac_status=$?
8598   echo "$as_me:8598: \$? = $ac_status" >&5
8599   (exit $ac_status); } &&
8600          { ac_try='test -s conftest$ac_exeext'
8601   { (eval echo "$as_me:8601: \"$ac_try\"") >&5
8602   (eval $ac_try) 2>&5
8603   ac_status=$?
8604   echo "$as_me:8604: \$? = $ac_status" >&5
8605   (exit $ac_status); }; }; then
8606   echo "$as_me:8606: result: yes" >&5
8607 echo "${ECHO_T}yes" >&6
8608                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8609
8610 else
8611   echo "$as_me: failed program was:" >&5
8612 cat conftest.$ac_ext >&5
8613 echo "$as_me:8613: result: no" >&5
8614 echo "${ECHO_T}no" >&6
8615
8616 cf_search=
8617 cf_library_path_list=""
8618 if test -n "${LDFLAGS}${LIBS}" ; then
8619         for cf_library_path in $LDFLAGS $LIBS
8620         do
8621                 case $cf_library_path in
8622                 (-L*)
8623                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8624
8625 test "x$cf_library_path" != "xNONE" && \
8626 test -d "$cf_library_path" && \
8627  {
8628         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8629         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8630         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8631         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8632         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8633         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"
8634 }
8635
8636                         cf_library_path_list="$cf_library_path_list $cf_search"
8637                         ;;
8638                 esac
8639         done
8640 fi
8641
8642 cf_search=
8643
8644 test "x$prefix" != "xNONE" && \
8645 test -d "$prefix" && \
8646  {
8647         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8648         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8649         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8650         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8651         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8652         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8653 }
8654
8655 for cf_subdir_prefix in \
8656         /usr \
8657         /usr/local \
8658         /usr/pkg \
8659         /opt \
8660         /opt/local \
8661         $HOME
8662 do
8663
8664 test "x$cf_subdir_prefix" != "x$prefix" && \
8665 test -d "$cf_subdir_prefix" && \
8666 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8667         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8668         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8669         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8670         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8671         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8672         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"
8673 }
8674
8675 done
8676
8677 cf_search="$cf_library_path_list $cf_search"
8678
8679                         for cf_libdir in $cf_search
8680                         do
8681                                 echo "$as_me:8681: checking for -l$cf_nculib_root in $cf_libdir" >&5
8682 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8683                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8684                                 cat >conftest.$ac_ext <<_ACEOF
8685 #line 8685 "configure"
8686 #include "confdefs.h"
8687 #include <${cf_cv_ncurses_header:-curses.h}>
8688 int
8689 main (void)
8690 {
8691 initscr()
8692   ;
8693   return 0;
8694 }
8695 _ACEOF
8696 rm -f conftest.$ac_objext conftest$ac_exeext
8697 if { (eval echo "$as_me:8697: \"$ac_link\"") >&5
8698   (eval $ac_link) 2>&5
8699   ac_status=$?
8700   echo "$as_me:8700: \$? = $ac_status" >&5
8701   (exit $ac_status); } &&
8702          { ac_try='test -s conftest$ac_exeext'
8703   { (eval echo "$as_me:8703: \"$ac_try\"") >&5
8704   (eval $ac_try) 2>&5
8705   ac_status=$?
8706   echo "$as_me:8706: \$? = $ac_status" >&5
8707   (exit $ac_status); }; }; then
8708   echo "$as_me:8708: result: yes" >&5
8709 echo "${ECHO_T}yes" >&6
8710                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8711                                          break
8712 else
8713   echo "$as_me: failed program was:" >&5
8714 cat conftest.$ac_ext >&5
8715 echo "$as_me:8715: result: no" >&5
8716 echo "${ECHO_T}no" >&6
8717                                          LIBS="$cf_save_LIBS"
8718 fi
8719 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8720                         done
8721
8722 fi
8723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8724
8725 fi
8726
8727 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8728
8729 if test $cf_found_library = no ; then
8730         { { echo "$as_me:8730: error: Cannot link $cf_nculib_root library" >&5
8731 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8732    { (exit 1); exit 1; }; }
8733 fi
8734
8735 fi
8736
8737 if test -n "$cf_ncurses_LIBS" ; then
8738         echo "$as_me:8738: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8739 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8740         cf_ncurses_SAVE="$LIBS"
8741         for p in $cf_ncurses_LIBS ; do
8742                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8743                 if test "$q" != "$LIBS" ; then
8744                         LIBS="$q"
8745                 fi
8746         done
8747         cat >conftest.$ac_ext <<_ACEOF
8748 #line 8748 "configure"
8749 #include "confdefs.h"
8750 #include <${cf_cv_ncurses_header:-curses.h}>
8751 int
8752 main (void)
8753 {
8754 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8755   ;
8756   return 0;
8757 }
8758 _ACEOF
8759 rm -f conftest.$ac_objext conftest$ac_exeext
8760 if { (eval echo "$as_me:8760: \"$ac_link\"") >&5
8761   (eval $ac_link) 2>&5
8762   ac_status=$?
8763   echo "$as_me:8763: \$? = $ac_status" >&5
8764   (exit $ac_status); } &&
8765          { ac_try='test -s conftest$ac_exeext'
8766   { (eval echo "$as_me:8766: \"$ac_try\"") >&5
8767   (eval $ac_try) 2>&5
8768   ac_status=$?
8769   echo "$as_me:8769: \$? = $ac_status" >&5
8770   (exit $ac_status); }; }; then
8771   echo "$as_me:8771: result: yes" >&5
8772 echo "${ECHO_T}yes" >&6
8773 else
8774   echo "$as_me: failed program was:" >&5
8775 cat conftest.$ac_ext >&5
8776 echo "$as_me:8776: result: no" >&5
8777 echo "${ECHO_T}no" >&6
8778                  LIBS="$cf_ncurses_SAVE"
8779 fi
8780 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8781 fi
8782
8783 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8784
8785 cat >>confdefs.h <<EOF
8786 #define $cf_nculib_ROOT 1
8787 EOF
8788
8789         fi
8790 else
8791         NCURSES_CONFIG=none
8792 fi
8793
8794 else
8795
8796 cf_ncuconfig_root=ncurses
8797 cf_have_ncuconfig=no
8798
8799 if test "x${PKG_CONFIG:=none}" != xnone; then
8800         echo "$as_me:8800: checking pkg-config for $cf_ncuconfig_root" >&5
8801 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8802         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8803                 echo "$as_me:8803: result: yes" >&5
8804 echo "${ECHO_T}yes" >&6
8805
8806                 echo "$as_me:8806: checking if the $cf_ncuconfig_root package files work" >&5
8807 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8808                 cf_have_ncuconfig=unknown
8809
8810                 cf_save_CFLAGS="$CFLAGS"
8811                 cf_save_CPPFLAGS="$CPPFLAGS"
8812                 cf_save_LIBS="$LIBS"
8813
8814                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8815                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8816
8817                 # while -W for passing linker flags is prevalent, it is not "standard".
8818                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8819                 # incompatible _and_ non-standard -W option which gives an error.  Work
8820                 # around that pitfall.
8821                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8822                 (x*c[89]9@@*-W*)
8823
8824 cf_fix_cppflags=no
8825 cf_new_cflags=
8826 cf_new_cppflags=
8827 cf_new_extra_cppflags=
8828
8829 for cf_add_cflags in $cf_pkg_cflags
8830 do
8831 case $cf_fix_cppflags in
8832 (no)
8833         case $cf_add_cflags in
8834         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8835                 case $cf_add_cflags in
8836                 (-D*)
8837                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8838
8839                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8840                                 && test -z "${cf_tst_cflags}" \
8841                                 && cf_fix_cppflags=yes
8842
8843                         if test $cf_fix_cppflags = yes ; then
8844
8845         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8846         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8847
8848                                 continue
8849                         elif test "${cf_tst_cflags}" = "\"'" ; then
8850
8851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8853
8854                                 continue
8855                         fi
8856                         ;;
8857                 esac
8858                 case "$CPPFLAGS" in
8859                 (*$cf_add_cflags)
8860                         ;;
8861                 (*)
8862                         case $cf_add_cflags in
8863                         (-D*)
8864                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8865
8866 CPPFLAGS=`echo "$CPPFLAGS" | \
8867         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8868                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8869
8870                                 ;;
8871                         esac
8872
8873         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8874         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8875
8876                         ;;
8877                 esac
8878                 ;;
8879         (*)
8880
8881         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8882         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8883
8884                 ;;
8885         esac
8886         ;;
8887 (yes)
8888
8889         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8890         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8891
8892         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8893
8894         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8895                 && test -z "${cf_tst_cflags}" \
8896                 && cf_fix_cppflags=no
8897         ;;
8898 esac
8899 done
8900
8901 if test -n "$cf_new_cflags" ; then
8902
8903         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8904         CFLAGS="${CFLAGS}$cf_new_cflags"
8905
8906 fi
8907
8908 if test -n "$cf_new_cppflags" ; then
8909
8910         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8911         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8912
8913 fi
8914
8915 if test -n "$cf_new_extra_cppflags" ; then
8916
8917         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8918         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8919
8920 fi
8921
8922 cf_add_libs="$LIBS"
8923 # reverse order
8924 cf_add_0lib=
8925 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8926 # filter duplicates
8927 for cf_add_1lib in $cf_add_0lib; do
8928         for cf_add_2lib in $cf_add_libs; do
8929                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8930                         cf_add_1lib=
8931                         break
8932                 fi
8933         done
8934         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8935 done
8936 LIBS="$cf_add_libs"
8937
8938                         cat >conftest.$ac_ext <<_ACEOF
8939 #line 8939 "configure"
8940 #include "confdefs.h"
8941 #include <${cf_cv_ncurses_header:-curses.h}>
8942 int
8943 main (void)
8944 {
8945 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8946   ;
8947   return 0;
8948 }
8949 _ACEOF
8950 rm -f conftest.$ac_objext conftest$ac_exeext
8951 if { (eval echo "$as_me:8951: \"$ac_link\"") >&5
8952   (eval $ac_link) 2>&5
8953   ac_status=$?
8954   echo "$as_me:8954: \$? = $ac_status" >&5
8955   (exit $ac_status); } &&
8956          { ac_try='test -s conftest$ac_exeext'
8957   { (eval echo "$as_me:8957: \"$ac_try\"") >&5
8958   (eval $ac_try) 2>&5
8959   ac_status=$?
8960   echo "$as_me:8960: \$? = $ac_status" >&5
8961   (exit $ac_status); }; }; then
8962   if test "$cross_compiling" = yes; then
8963   cf_test_ncuconfig=maybe
8964 else
8965   cat >conftest.$ac_ext <<_ACEOF
8966 #line 8966 "configure"
8967 #include "confdefs.h"
8968 #include <${cf_cv_ncurses_header:-curses.h}>
8969                                         int main(void)
8970                                         { char *xx = curses_version(); return (xx == 0); }
8971 _ACEOF
8972 rm -f conftest$ac_exeext
8973 if { (eval echo "$as_me:8973: \"$ac_link\"") >&5
8974   (eval $ac_link) 2>&5
8975   ac_status=$?
8976   echo "$as_me:8976: \$? = $ac_status" >&5
8977   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8978   { (eval echo "$as_me:8978: \"$ac_try\"") >&5
8979   (eval $ac_try) 2>&5
8980   ac_status=$?
8981   echo "$as_me:8981: \$? = $ac_status" >&5
8982   (exit $ac_status); }; }; then
8983   cf_test_ncuconfig=yes
8984 else
8985   echo "$as_me: program exited with status $ac_status" >&5
8986 echo "$as_me: failed program was:" >&5
8987 cat conftest.$ac_ext >&5
8988 cf_test_ncuconfig=no
8989 fi
8990 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8991 fi
8992 else
8993   echo "$as_me: failed program was:" >&5
8994 cat conftest.$ac_ext >&5
8995 cf_test_ncuconfig=no
8996 fi
8997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8998
8999                         CFLAGS="$cf_save_CFLAGS"
9000                         CPPFLAGS="$cf_save_CPPFLAGS"
9001                         LIBS="$cf_save_LIBS"
9002
9003                         if test "x$cf_test_ncuconfig" != xyes; then
9004                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9005                                 cf_pkg_cflags="$cf_temp"
9006                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9007                                 cf_pkg_libs="$cf_temp"
9008                         fi
9009                         ;;
9010                 esac
9011
9012 cf_fix_cppflags=no
9013 cf_new_cflags=
9014 cf_new_cppflags=
9015 cf_new_extra_cppflags=
9016
9017 for cf_add_cflags in $cf_pkg_cflags
9018 do
9019 case $cf_fix_cppflags in
9020 (no)
9021         case $cf_add_cflags in
9022         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9023                 case $cf_add_cflags in
9024                 (-D*)
9025                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9026
9027                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9028                                 && test -z "${cf_tst_cflags}" \
9029                                 && cf_fix_cppflags=yes
9030
9031                         if test $cf_fix_cppflags = yes ; then
9032
9033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9035
9036                                 continue
9037                         elif test "${cf_tst_cflags}" = "\"'" ; then
9038
9039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9041
9042                                 continue
9043                         fi
9044                         ;;
9045                 esac
9046                 case "$CPPFLAGS" in
9047                 (*$cf_add_cflags)
9048                         ;;
9049                 (*)
9050                         case $cf_add_cflags in
9051                         (-D*)
9052                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9053
9054 CPPFLAGS=`echo "$CPPFLAGS" | \
9055         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9056                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9057
9058                                 ;;
9059                         esac
9060
9061         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9062         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9063
9064                         ;;
9065                 esac
9066                 ;;
9067         (*)
9068
9069         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9070         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9071
9072                 ;;
9073         esac
9074         ;;
9075 (yes)
9076
9077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9079
9080         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9081
9082         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9083                 && test -z "${cf_tst_cflags}" \
9084                 && cf_fix_cppflags=no
9085         ;;
9086 esac
9087 done
9088
9089 if test -n "$cf_new_cflags" ; then
9090
9091         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9092         CFLAGS="${CFLAGS}$cf_new_cflags"
9093
9094 fi
9095
9096 if test -n "$cf_new_cppflags" ; then
9097
9098         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9099         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9100
9101 fi
9102
9103 if test -n "$cf_new_extra_cppflags" ; then
9104
9105         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9106         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9107
9108 fi
9109
9110 cf_add_libs="$LIBS"
9111 # reverse order
9112 cf_add_0lib=
9113 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9114 # filter duplicates
9115 for cf_add_1lib in $cf_add_0lib; do
9116         for cf_add_2lib in $cf_add_libs; do
9117                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9118                         cf_add_1lib=
9119                         break
9120                 fi
9121         done
9122         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9123 done
9124 LIBS="$cf_add_libs"
9125
9126                 cat >conftest.$ac_ext <<_ACEOF
9127 #line 9127 "configure"
9128 #include "confdefs.h"
9129 #include <${cf_cv_ncurses_header:-curses.h}>
9130 int
9131 main (void)
9132 {
9133 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9134   ;
9135   return 0;
9136 }
9137 _ACEOF
9138 rm -f conftest.$ac_objext conftest$ac_exeext
9139 if { (eval echo "$as_me:9139: \"$ac_link\"") >&5
9140   (eval $ac_link) 2>&5
9141   ac_status=$?
9142   echo "$as_me:9142: \$? = $ac_status" >&5
9143   (exit $ac_status); } &&
9144          { ac_try='test -s conftest$ac_exeext'
9145   { (eval echo "$as_me:9145: \"$ac_try\"") >&5
9146   (eval $ac_try) 2>&5
9147   ac_status=$?
9148   echo "$as_me:9148: \$? = $ac_status" >&5
9149   (exit $ac_status); }; }; then
9150   if test "$cross_compiling" = yes; then
9151   cf_have_ncuconfig=maybe
9152 else
9153   cat >conftest.$ac_ext <<_ACEOF
9154 #line 9154 "configure"
9155 #include "confdefs.h"
9156 #include <${cf_cv_ncurses_header:-curses.h}>
9157                                 int main(void)
9158                                 { char *xx = curses_version(); return (xx == 0); }
9159 _ACEOF
9160 rm -f conftest$ac_exeext
9161 if { (eval echo "$as_me:9161: \"$ac_link\"") >&5
9162   (eval $ac_link) 2>&5
9163   ac_status=$?
9164   echo "$as_me:9164: \$? = $ac_status" >&5
9165   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit $ac_status); }; }; then
9171   cf_have_ncuconfig=yes
9172 else
9173   echo "$as_me: program exited with status $ac_status" >&5
9174 echo "$as_me: failed program was:" >&5
9175 cat conftest.$ac_ext >&5
9176 cf_have_ncuconfig=no
9177 fi
9178 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9179 fi
9180 else
9181   echo "$as_me: failed program was:" >&5
9182 cat conftest.$ac_ext >&5
9183 cf_have_ncuconfig=no
9184 fi
9185 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9186                 echo "$as_me:9186: result: $cf_have_ncuconfig" >&5
9187 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9188                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9189                 if test "$cf_have_ncuconfig" != "yes"
9190                 then
9191                         CPPFLAGS="$cf_save_CPPFLAGS"
9192                         LIBS="$cf_save_LIBS"
9193                         NCURSES_CONFIG_PKG=none
9194                 else
9195
9196 cat >>confdefs.h <<\EOF
9197 #define NCURSES 1
9198 EOF
9199
9200                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9201
9202 echo "$as_me:9202: checking for terminfo header" >&5
9203 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9204 if test "${cf_cv_term_header+set}" = set; then
9205   echo $ECHO_N "(cached) $ECHO_C" >&6
9206 else
9207
9208 case ${cf_cv_ncurses_header} in
9209 (*/ncurses.h|*/ncursesw.h)
9210         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9211         ;;
9212 (*)
9213         cf_term_header=term.h
9214         ;;
9215 esac
9216
9217 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9218 do
9219 cat >conftest.$ac_ext <<_ACEOF
9220 #line 9220 "configure"
9221 #include "confdefs.h"
9222 #include <stdio.h>
9223 #include <${cf_cv_ncurses_header:-curses.h}>
9224 #include <$cf_test>
9225
9226 int
9227 main (void)
9228 {
9229 int x = auto_left_margin; (void)x
9230   ;
9231   return 0;
9232 }
9233 _ACEOF
9234 rm -f conftest.$ac_objext
9235 if { (eval echo "$as_me:9235: \"$ac_compile\"") >&5
9236   (eval $ac_compile) 2>&5
9237   ac_status=$?
9238   echo "$as_me:9238: \$? = $ac_status" >&5
9239   (exit $ac_status); } &&
9240          { ac_try='test -s conftest.$ac_objext'
9241   { (eval echo "$as_me:9241: \"$ac_try\"") >&5
9242   (eval $ac_try) 2>&5
9243   ac_status=$?
9244   echo "$as_me:9244: \$? = $ac_status" >&5
9245   (exit $ac_status); }; }; then
9246
9247         cf_cv_term_header="$cf_test"
9248 else
9249   echo "$as_me: failed program was:" >&5
9250 cat conftest.$ac_ext >&5
9251
9252         cf_cv_term_header=unknown
9253
9254 fi
9255 rm -f conftest.$ac_objext conftest.$ac_ext
9256         test "$cf_cv_term_header" != unknown && break
9257 done
9258
9259 fi
9260 echo "$as_me:9260: result: $cf_cv_term_header" >&5
9261 echo "${ECHO_T}$cf_cv_term_header" >&6
9262
9263 # Set definitions to allow ifdef'ing to accommodate subdirectories
9264
9265 case $cf_cv_term_header in
9266 (*term.h)
9267
9268 cat >>confdefs.h <<\EOF
9269 #define HAVE_TERM_H 1
9270 EOF
9271
9272         ;;
9273 esac
9274
9275 case $cf_cv_term_header in
9276 (ncurses/term.h)
9277
9278 cat >>confdefs.h <<\EOF
9279 #define HAVE_NCURSES_TERM_H 1
9280 EOF
9281
9282         ;;
9283 (ncursesw/term.h)
9284
9285 cat >>confdefs.h <<\EOF
9286 #define HAVE_NCURSESW_TERM_H 1
9287 EOF
9288
9289         ;;
9290 esac
9291
9292                 fi
9293
9294         else
9295                 echo "$as_me:9295: result: no" >&5
9296 echo "${ECHO_T}no" >&6
9297                 NCURSES_CONFIG_PKG=none
9298         fi
9299 else
9300         NCURSES_CONFIG_PKG=none
9301 fi
9302
9303 if test "x$cf_have_ncuconfig" = "xno"; then
9304         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9305
9306 if test -n "$ac_tool_prefix"; then
9307   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9308   do
9309     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9310 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9311 echo "$as_me:9311: checking for $ac_word" >&5
9312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9313 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9314   echo $ECHO_N "(cached) $ECHO_C" >&6
9315 else
9316   if test -n "$NCURSES_CONFIG"; then
9317   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9318 else
9319   ac_save_IFS=$IFS; IFS=$ac_path_separator
9320 ac_dummy="$PATH"
9321 for ac_dir in $ac_dummy; do
9322   IFS=$ac_save_IFS
9323   test -z "$ac_dir" && ac_dir=.
9324   $as_executable_p "$ac_dir/$ac_word" || continue
9325 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9326 echo "$as_me:9326: found $ac_dir/$ac_word" >&5
9327 break
9328 done
9329
9330 fi
9331 fi
9332 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9333 if test -n "$NCURSES_CONFIG"; then
9334   echo "$as_me:9334: result: $NCURSES_CONFIG" >&5
9335 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9336 else
9337   echo "$as_me:9337: result: no" >&5
9338 echo "${ECHO_T}no" >&6
9339 fi
9340
9341     test -n "$NCURSES_CONFIG" && break
9342   done
9343 fi
9344 if test -z "$NCURSES_CONFIG"; then
9345   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9346   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9347 do
9348   # Extract the first word of "$ac_prog", so it can be a program name with args.
9349 set dummy $ac_prog; ac_word=$2
9350 echo "$as_me:9350: checking for $ac_word" >&5
9351 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9352 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9353   echo $ECHO_N "(cached) $ECHO_C" >&6
9354 else
9355   if test -n "$ac_ct_NCURSES_CONFIG"; then
9356   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9357 else
9358   ac_save_IFS=$IFS; IFS=$ac_path_separator
9359 ac_dummy="$PATH"
9360 for ac_dir in $ac_dummy; do
9361   IFS=$ac_save_IFS
9362   test -z "$ac_dir" && ac_dir=.
9363   $as_executable_p "$ac_dir/$ac_word" || continue
9364 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9365 echo "$as_me:9365: found $ac_dir/$ac_word" >&5
9366 break
9367 done
9368
9369 fi
9370 fi
9371 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9372 if test -n "$ac_ct_NCURSES_CONFIG"; then
9373   echo "$as_me:9373: result: $ac_ct_NCURSES_CONFIG" >&5
9374 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9375 else
9376   echo "$as_me:9376: result: no" >&5
9377 echo "${ECHO_T}no" >&6
9378 fi
9379
9380   test -n "$ac_ct_NCURSES_CONFIG" && break
9381 done
9382 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9383
9384   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9385 fi
9386
9387         if test "$NCURSES_CONFIG" != none ; then
9388
9389 cf_fix_cppflags=no
9390 cf_new_cflags=
9391 cf_new_cppflags=
9392 cf_new_extra_cppflags=
9393
9394 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9395 do
9396 case $cf_fix_cppflags in
9397 (no)
9398         case $cf_add_cflags in
9399         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9400                 case $cf_add_cflags in
9401                 (-D*)
9402                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9403
9404                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9405                                 && test -z "${cf_tst_cflags}" \
9406                                 && cf_fix_cppflags=yes
9407
9408                         if test $cf_fix_cppflags = yes ; then
9409
9410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9412
9413                                 continue
9414                         elif test "${cf_tst_cflags}" = "\"'" ; then
9415
9416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9418
9419                                 continue
9420                         fi
9421                         ;;
9422                 esac
9423                 case "$CPPFLAGS" in
9424                 (*$cf_add_cflags)
9425                         ;;
9426                 (*)
9427                         case $cf_add_cflags in
9428                         (-D*)
9429                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9430
9431 CPPFLAGS=`echo "$CPPFLAGS" | \
9432         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9433                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9434
9435                                 ;;
9436                         esac
9437
9438         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9439         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9440
9441                         ;;
9442                 esac
9443                 ;;
9444         (*)
9445
9446         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9447         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9448
9449                 ;;
9450         esac
9451         ;;
9452 (yes)
9453
9454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9456
9457         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9458
9459         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9460                 && test -z "${cf_tst_cflags}" \
9461                 && cf_fix_cppflags=no
9462         ;;
9463 esac
9464 done
9465
9466 if test -n "$cf_new_cflags" ; then
9467
9468         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9469         CFLAGS="${CFLAGS}$cf_new_cflags"
9470
9471 fi
9472
9473 if test -n "$cf_new_cppflags" ; then
9474
9475         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9476         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9477
9478 fi
9479
9480 if test -n "$cf_new_extra_cppflags" ; then
9481
9482         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9483         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9484
9485 fi
9486
9487 cf_add_libs="$LIBS"
9488 # reverse order
9489 cf_add_0lib=
9490 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9491 # filter duplicates
9492 for cf_add_1lib in $cf_add_0lib; do
9493         for cf_add_2lib in $cf_add_libs; do
9494                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9495                         cf_add_1lib=
9496                         break
9497                 fi
9498         done
9499         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9500 done
9501 LIBS="$cf_add_libs"
9502
9503                 # even with config script, some packages use no-override for curses.h
9504
9505 echo "$as_me:9505: checking if we have identified curses headers" >&5
9506 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9507 if test "${cf_cv_ncurses_header+set}" = set; then
9508   echo $ECHO_N "(cached) $ECHO_C" >&6
9509 else
9510
9511 cf_cv_ncurses_header=none
9512 for cf_header in \
9513         ncurses.h ncurses/ncurses.h \
9514         curses.h ncurses/curses.h
9515 do
9516 cat >conftest.$ac_ext <<_ACEOF
9517 #line 9517 "configure"
9518 #include "confdefs.h"
9519 #include <${cf_header}>
9520 int
9521 main (void)
9522 {
9523 initscr(); tgoto("?", 0,0)
9524   ;
9525   return 0;
9526 }
9527 _ACEOF
9528 rm -f conftest.$ac_objext
9529 if { (eval echo "$as_me:9529: \"$ac_compile\"") >&5
9530   (eval $ac_compile) 2>&5
9531   ac_status=$?
9532   echo "$as_me:9532: \$? = $ac_status" >&5
9533   (exit $ac_status); } &&
9534          { ac_try='test -s conftest.$ac_objext'
9535   { (eval echo "$as_me:9535: \"$ac_try\"") >&5
9536   (eval $ac_try) 2>&5
9537   ac_status=$?
9538   echo "$as_me:9538: \$? = $ac_status" >&5
9539   (exit $ac_status); }; }; then
9540   cf_cv_ncurses_header=$cf_header; break
9541 else
9542   echo "$as_me: failed program was:" >&5
9543 cat conftest.$ac_ext >&5
9544 fi
9545 rm -f conftest.$ac_objext conftest.$ac_ext
9546 done
9547
9548 fi
9549 echo "$as_me:9549: result: $cf_cv_ncurses_header" >&5
9550 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9551
9552 if test "$cf_cv_ncurses_header" = none ; then
9553         { { echo "$as_me:9553: error: No curses header-files found" >&5
9554 echo "$as_me: error: No curses header-files found" >&2;}
9555    { (exit 1); exit 1; }; }
9556 fi
9557
9558 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9559
9560 for ac_header in $cf_cv_ncurses_header
9561 do
9562 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9563 echo "$as_me:9563: checking for $ac_header" >&5
9564 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9565 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9566   echo $ECHO_N "(cached) $ECHO_C" >&6
9567 else
9568   cat >conftest.$ac_ext <<_ACEOF
9569 #line 9569 "configure"
9570 #include "confdefs.h"
9571 #include <$ac_header>
9572 _ACEOF
9573 if { (eval echo "$as_me:9573: \"$ac_cpp conftest.$ac_ext\"") >&5
9574   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9575   ac_status=$?
9576   egrep -v '^ *\+' conftest.er1 >conftest.err
9577   rm -f conftest.er1
9578   cat conftest.err >&5
9579   echo "$as_me:9579: \$? = $ac_status" >&5
9580   (exit $ac_status); } >/dev/null; then
9581   if test -s conftest.err; then
9582     ac_cpp_err=$ac_c_preproc_warn_flag
9583   else
9584     ac_cpp_err=
9585   fi
9586 else
9587   ac_cpp_err=yes
9588 fi
9589 if test -z "$ac_cpp_err"; then
9590   eval "$as_ac_Header=yes"
9591 else
9592   echo "$as_me: failed program was:" >&5
9593   cat conftest.$ac_ext >&5
9594   eval "$as_ac_Header=no"
9595 fi
9596 rm -f conftest.err conftest.$ac_ext
9597 fi
9598 echo "$as_me:9598: result: `eval echo '${'$as_ac_Header'}'`" >&5
9599 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9600 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9601   cat >>confdefs.h <<EOF
9602 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9603 EOF
9604
9605 fi
9606 done
9607
9608 cat >>confdefs.h <<\EOF
9609 #define NCURSES 1
9610 EOF
9611
9612 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9613
9614                 cat >>confdefs.h <<EOF
9615 #define $cf_nculib_ROOT 1
9616 EOF
9617
9618                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9619
9620         else
9621
9622 cf_ncuhdr_root=ncurses
9623
9624 test -n "$cf_cv_curses_dir" && \
9625 test "$cf_cv_curses_dir" != "no" && { \
9626
9627 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9628   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9629   do
9630         while test $cf_add_incdir != /usr/include
9631         do
9632           if test -d $cf_add_incdir
9633           then
9634                 cf_have_incdir=no
9635                 if test -n "$CFLAGS$CPPFLAGS" ; then
9636                   # a loop is needed to ensure we can add subdirs of existing dirs
9637                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9638                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9639                           cf_have_incdir=yes; break
9640                         fi
9641                   done
9642                 fi
9643
9644                 if test "$cf_have_incdir" = no ; then
9645                   if test "$cf_add_incdir" = /usr/local/include ; then
9646                         if test "$GCC" = yes
9647                         then
9648                           cf_save_CPPFLAGS=$CPPFLAGS
9649
9650         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9651         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9652
9653                           cat >conftest.$ac_ext <<_ACEOF
9654 #line 9654 "configure"
9655 #include "confdefs.h"
9656 #include <stdio.h>
9657 int
9658 main (void)
9659 {
9660 printf("Hello")
9661   ;
9662   return 0;
9663 }
9664 _ACEOF
9665 rm -f conftest.$ac_objext
9666 if { (eval echo "$as_me:9666: \"$ac_compile\"") >&5
9667   (eval $ac_compile) 2>&5
9668   ac_status=$?
9669   echo "$as_me:9669: \$? = $ac_status" >&5
9670   (exit $ac_status); } &&
9671          { ac_try='test -s conftest.$ac_objext'
9672   { (eval echo "$as_me:9672: \"$ac_try\"") >&5
9673   (eval $ac_try) 2>&5
9674   ac_status=$?
9675   echo "$as_me:9675: \$? = $ac_status" >&5
9676   (exit $ac_status); }; }; then
9677   :
9678 else
9679   echo "$as_me: failed program was:" >&5
9680 cat conftest.$ac_ext >&5
9681 cf_have_incdir=yes
9682 fi
9683 rm -f conftest.$ac_objext conftest.$ac_ext
9684                           CPPFLAGS=$cf_save_CPPFLAGS
9685                         fi
9686                   fi
9687                 fi
9688
9689                 if test "$cf_have_incdir" = no ; then
9690                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9691
9692 echo "${as_me:-configure}:9692: testing adding $cf_add_incdir to include-path ..." 1>&5
9693
9694                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9695
9696                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9697                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9698                   cf_add_incdir="$cf_top_incdir"
9699                 else
9700                   break
9701                 fi
9702           else
9703                 break
9704           fi
9705         done
9706   done
9707 fi
9708
9709 }
9710
9711 echo "$as_me:9711: checking for $cf_ncuhdr_root header in include-path" >&5
9712 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9713 if test "${cf_cv_ncurses_h+set}" = set; then
9714   echo $ECHO_N "(cached) $ECHO_C" >&6
9715 else
9716
9717         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9718         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9719         for cf_header in $cf_header_list
9720         do
9721
9722         cat >conftest.$ac_ext <<_ACEOF
9723 #line 9723 "configure"
9724 #include "confdefs.h"
9725
9726 #include <$cf_header>
9727 int
9728 main (void)
9729 {
9730
9731 #ifdef NCURSES_VERSION
9732
9733 printf("%s\n", NCURSES_VERSION);
9734 #else
9735 #ifdef __NCURSES_H
9736 printf("old\n");
9737 #else
9738         make an error
9739 #endif
9740 #endif
9741
9742   ;
9743   return 0;
9744 }
9745 _ACEOF
9746 rm -f conftest.$ac_objext
9747 if { (eval echo "$as_me:9747: \"$ac_compile\"") >&5
9748   (eval $ac_compile) 2>&5
9749   ac_status=$?
9750   echo "$as_me:9750: \$? = $ac_status" >&5
9751   (exit $ac_status); } &&
9752          { ac_try='test -s conftest.$ac_objext'
9753   { (eval echo "$as_me:9753: \"$ac_try\"") >&5
9754   (eval $ac_try) 2>&5
9755   ac_status=$?
9756   echo "$as_me:9756: \$? = $ac_status" >&5
9757   (exit $ac_status); }; }; then
9758   cf_cv_ncurses_h=$cf_header
9759
9760 else
9761   echo "$as_me: failed program was:" >&5
9762 cat conftest.$ac_ext >&5
9763 cf_cv_ncurses_h=no
9764 fi
9765 rm -f conftest.$ac_objext conftest.$ac_ext
9766
9767                 test "$cf_cv_ncurses_h" != no && break
9768         done
9769
9770 fi
9771 echo "$as_me:9771: result: $cf_cv_ncurses_h" >&5
9772 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9773
9774 if test "$cf_cv_ncurses_h" != no ; then
9775         cf_cv_ncurses_header=$cf_cv_ncurses_h
9776 else
9777
9778 echo "$as_me:9778: checking for $cf_ncuhdr_root include-path" >&5
9779 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9780 if test "${cf_cv_ncurses_h2+set}" = set; then
9781   echo $ECHO_N "(cached) $ECHO_C" >&6
9782 else
9783
9784         test -n "$verbose" && echo
9785
9786 cf_search=
9787
9788 # collect the current set of include-directories from compiler flags
9789 cf_header_path_list=""
9790 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9791         for cf_header_path in $CPPFLAGS $CFLAGS
9792         do
9793                 case $cf_header_path in
9794                 (-I*)
9795                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9796
9797 test "x$cf_header_path" != "xNONE" && \
9798 test -d "$cf_header_path" && \
9799  {
9800         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9801         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9802         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9803         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9804         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9805         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"
9806 }
9807
9808                         cf_header_path_list="$cf_header_path_list $cf_search"
9809                         ;;
9810                 esac
9811         done
9812 fi
9813
9814 # add the variations for the package we are looking for
9815
9816 cf_search=
9817
9818 test "x$prefix" != "xNONE" && \
9819 test -d "$prefix" && \
9820  {
9821         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9822         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9823         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9824         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9825         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9826         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9827 }
9828
9829 for cf_subdir_prefix in \
9830         /usr \
9831         /usr/local \
9832         /usr/pkg \
9833         /opt \
9834         /opt/local \
9835         $HOME
9836 do
9837
9838 test "x$cf_subdir_prefix" != "x$prefix" && \
9839 test -d "$cf_subdir_prefix" && \
9840 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9841         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9842         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9843         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9844         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9845         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9846         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"
9847 }
9848
9849 done
9850
9851 test "$includedir" != NONE && \
9852 test "$includedir" != "/usr/include" && \
9853 test -d "$includedir" && {
9854         test -d $includedir &&    cf_search="$cf_search $includedir"
9855         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9856 }
9857
9858 test "$oldincludedir" != NONE && \
9859 test "$oldincludedir" != "/usr/include" && \
9860 test -d "$oldincludedir" && {
9861         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9862         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9863 }
9864
9865 cf_search="$cf_search $cf_header_path_list"
9866
9867         test -n "$verbose" && echo search path $cf_search
9868         cf_save2_CPPFLAGS="$CPPFLAGS"
9869         for cf_incdir in $cf_search
9870         do
9871
9872 if test -n "$cf_incdir" ; then
9873   for cf_add_incdir in $cf_incdir
9874   do
9875         while test $cf_add_incdir != /usr/include
9876         do
9877           if test -d $cf_add_incdir
9878           then
9879                 cf_have_incdir=no
9880                 if test -n "$CFLAGS$CPPFLAGS" ; then
9881                   # a loop is needed to ensure we can add subdirs of existing dirs
9882                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9883                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9884                           cf_have_incdir=yes; break
9885                         fi
9886                   done
9887                 fi
9888
9889                 if test "$cf_have_incdir" = no ; then
9890                   if test "$cf_add_incdir" = /usr/local/include ; then
9891                         if test "$GCC" = yes
9892                         then
9893                           cf_save_CPPFLAGS=$CPPFLAGS
9894
9895         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9896         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9897
9898                           cat >conftest.$ac_ext <<_ACEOF
9899 #line 9899 "configure"
9900 #include "confdefs.h"
9901 #include <stdio.h>
9902 int
9903 main (void)
9904 {
9905 printf("Hello")
9906   ;
9907   return 0;
9908 }
9909 _ACEOF
9910 rm -f conftest.$ac_objext
9911 if { (eval echo "$as_me:9911: \"$ac_compile\"") >&5
9912   (eval $ac_compile) 2>&5
9913   ac_status=$?
9914   echo "$as_me:9914: \$? = $ac_status" >&5
9915   (exit $ac_status); } &&
9916          { ac_try='test -s conftest.$ac_objext'
9917   { (eval echo "$as_me:9917: \"$ac_try\"") >&5
9918   (eval $ac_try) 2>&5
9919   ac_status=$?
9920   echo "$as_me:9920: \$? = $ac_status" >&5
9921   (exit $ac_status); }; }; then
9922   :
9923 else
9924   echo "$as_me: failed program was:" >&5
9925 cat conftest.$ac_ext >&5
9926 cf_have_incdir=yes
9927 fi
9928 rm -f conftest.$ac_objext conftest.$ac_ext
9929                           CPPFLAGS=$cf_save_CPPFLAGS
9930                         fi
9931                   fi
9932                 fi
9933
9934                 if test "$cf_have_incdir" = no ; then
9935                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9936
9937 echo "${as_me:-configure}:9937: testing adding $cf_add_incdir to include-path ..." 1>&5
9938
9939                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9940
9941                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9942                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9943                   cf_add_incdir="$cf_top_incdir"
9944                 else
9945                   break
9946                 fi
9947           else
9948                 break
9949           fi
9950         done
9951   done
9952 fi
9953
9954                 for cf_header in \
9955                         ncurses.h \
9956                         curses.h
9957                 do
9958
9959         cat >conftest.$ac_ext <<_ACEOF
9960 #line 9960 "configure"
9961 #include "confdefs.h"
9962
9963 #include <$cf_header>
9964 int
9965 main (void)
9966 {
9967
9968 #ifdef NCURSES_VERSION
9969
9970 printf("%s\n", NCURSES_VERSION);
9971 #else
9972 #ifdef __NCURSES_H
9973 printf("old\n");
9974 #else
9975         make an error
9976 #endif
9977 #endif
9978
9979   ;
9980   return 0;
9981 }
9982 _ACEOF
9983 rm -f conftest.$ac_objext
9984 if { (eval echo "$as_me:9984: \"$ac_compile\"") >&5
9985   (eval $ac_compile) 2>&5
9986   ac_status=$?
9987   echo "$as_me:9987: \$? = $ac_status" >&5
9988   (exit $ac_status); } &&
9989          { ac_try='test -s conftest.$ac_objext'
9990   { (eval echo "$as_me:9990: \"$ac_try\"") >&5
9991   (eval $ac_try) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); }; }; then
9995   cf_cv_ncurses_h2=$cf_header
9996
9997 else
9998   echo "$as_me: failed program was:" >&5
9999 cat conftest.$ac_ext >&5
10000 cf_cv_ncurses_h2=no
10001 fi
10002 rm -f conftest.$ac_objext conftest.$ac_ext
10003
10004                         if test "$cf_cv_ncurses_h2" != no ; then
10005                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10006                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10007                                 break
10008                         fi
10009                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10010                 done
10011                 CPPFLAGS="$cf_save2_CPPFLAGS"
10012                 test "$cf_cv_ncurses_h2" != no && break
10013         done
10014         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10014: error: not found" >&5
10015 echo "$as_me: error: not found" >&2;}
10016    { (exit 1); exit 1; }; }
10017
10018 fi
10019 echo "$as_me:10019: result: $cf_cv_ncurses_h2" >&5
10020 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10021
10022         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10023         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10024         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10025                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10026         fi
10027
10028 if test -n "$cf_1st_incdir" ; then
10029   for cf_add_incdir in $cf_1st_incdir
10030   do
10031         while test $cf_add_incdir != /usr/include
10032         do
10033           if test -d $cf_add_incdir
10034           then
10035                 cf_have_incdir=no
10036                 if test -n "$CFLAGS$CPPFLAGS" ; then
10037                   # a loop is needed to ensure we can add subdirs of existing dirs
10038                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10039                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10040                           cf_have_incdir=yes; break
10041                         fi
10042                   done
10043                 fi
10044
10045                 if test "$cf_have_incdir" = no ; then
10046                   if test "$cf_add_incdir" = /usr/local/include ; then
10047                         if test "$GCC" = yes
10048                         then
10049                           cf_save_CPPFLAGS=$CPPFLAGS
10050
10051         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10052         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10053
10054                           cat >conftest.$ac_ext <<_ACEOF
10055 #line 10055 "configure"
10056 #include "confdefs.h"
10057 #include <stdio.h>
10058 int
10059 main (void)
10060 {
10061 printf("Hello")
10062   ;
10063   return 0;
10064 }
10065 _ACEOF
10066 rm -f conftest.$ac_objext
10067 if { (eval echo "$as_me:10067: \"$ac_compile\"") >&5
10068   (eval $ac_compile) 2>&5
10069   ac_status=$?
10070   echo "$as_me:10070: \$? = $ac_status" >&5
10071   (exit $ac_status); } &&
10072          { ac_try='test -s conftest.$ac_objext'
10073   { (eval echo "$as_me:10073: \"$ac_try\"") >&5
10074   (eval $ac_try) 2>&5
10075   ac_status=$?
10076   echo "$as_me:10076: \$? = $ac_status" >&5
10077   (exit $ac_status); }; }; then
10078   :
10079 else
10080   echo "$as_me: failed program was:" >&5
10081 cat conftest.$ac_ext >&5
10082 cf_have_incdir=yes
10083 fi
10084 rm -f conftest.$ac_objext conftest.$ac_ext
10085                           CPPFLAGS=$cf_save_CPPFLAGS
10086                         fi
10087                   fi
10088                 fi
10089
10090                 if test "$cf_have_incdir" = no ; then
10091                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10092
10093 echo "${as_me:-configure}:10093: testing adding $cf_add_incdir to include-path ..." 1>&5
10094
10095                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10096
10097                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10098                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10099                   cf_add_incdir="$cf_top_incdir"
10100                 else
10101                   break
10102                 fi
10103           else
10104                 break
10105           fi
10106         done
10107   done
10108 fi
10109
10110 fi
10111
10112 # Set definitions to allow ifdef'ing for ncurses.h
10113
10114 case $cf_cv_ncurses_header in
10115 (*ncurses.h)
10116
10117 cat >>confdefs.h <<\EOF
10118 #define HAVE_NCURSES_H 1
10119 EOF
10120
10121         ;;
10122 esac
10123
10124 case $cf_cv_ncurses_header in
10125 (ncurses/curses.h|ncurses/ncurses.h)
10126
10127 cat >>confdefs.h <<\EOF
10128 #define HAVE_NCURSES_NCURSES_H 1
10129 EOF
10130
10131         ;;
10132 (ncursesw/curses.h|ncursesw/ncurses.h)
10133
10134 cat >>confdefs.h <<\EOF
10135 #define HAVE_NCURSESW_NCURSES_H 1
10136 EOF
10137
10138         ;;
10139 esac
10140
10141 echo "$as_me:10141: checking for terminfo header" >&5
10142 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10143 if test "${cf_cv_term_header+set}" = set; then
10144   echo $ECHO_N "(cached) $ECHO_C" >&6
10145 else
10146
10147 case ${cf_cv_ncurses_header} in
10148 (*/ncurses.h|*/ncursesw.h)
10149         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10150         ;;
10151 (*)
10152         cf_term_header=term.h
10153         ;;
10154 esac
10155
10156 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10157 do
10158 cat >conftest.$ac_ext <<_ACEOF
10159 #line 10159 "configure"
10160 #include "confdefs.h"
10161 #include <stdio.h>
10162 #include <${cf_cv_ncurses_header:-curses.h}>
10163 #include <$cf_test>
10164
10165 int
10166 main (void)
10167 {
10168 int x = auto_left_margin; (void)x
10169   ;
10170   return 0;
10171 }
10172 _ACEOF
10173 rm -f conftest.$ac_objext
10174 if { (eval echo "$as_me:10174: \"$ac_compile\"") >&5
10175   (eval $ac_compile) 2>&5
10176   ac_status=$?
10177   echo "$as_me:10177: \$? = $ac_status" >&5
10178   (exit $ac_status); } &&
10179          { ac_try='test -s conftest.$ac_objext'
10180   { (eval echo "$as_me:10180: \"$ac_try\"") >&5
10181   (eval $ac_try) 2>&5
10182   ac_status=$?
10183   echo "$as_me:10183: \$? = $ac_status" >&5
10184   (exit $ac_status); }; }; then
10185
10186         cf_cv_term_header="$cf_test"
10187 else
10188   echo "$as_me: failed program was:" >&5
10189 cat conftest.$ac_ext >&5
10190
10191         cf_cv_term_header=unknown
10192
10193 fi
10194 rm -f conftest.$ac_objext conftest.$ac_ext
10195         test "$cf_cv_term_header" != unknown && break
10196 done
10197
10198 fi
10199 echo "$as_me:10199: result: $cf_cv_term_header" >&5
10200 echo "${ECHO_T}$cf_cv_term_header" >&6
10201
10202 # Set definitions to allow ifdef'ing to accommodate subdirectories
10203
10204 case $cf_cv_term_header in
10205 (*term.h)
10206
10207 cat >>confdefs.h <<\EOF
10208 #define HAVE_TERM_H 1
10209 EOF
10210
10211         ;;
10212 esac
10213
10214 case $cf_cv_term_header in
10215 (ncurses/term.h)
10216
10217 cat >>confdefs.h <<\EOF
10218 #define HAVE_NCURSES_TERM_H 1
10219 EOF
10220
10221         ;;
10222 (ncursesw/term.h)
10223
10224 cat >>confdefs.h <<\EOF
10225 #define HAVE_NCURSESW_TERM_H 1
10226 EOF
10227
10228         ;;
10229 esac
10230
10231 # some applications need this, but should check for NCURSES_VERSION
10232
10233 cat >>confdefs.h <<\EOF
10234 #define NCURSES 1
10235 EOF
10236
10237 echo "$as_me:10237: checking for ncurses version" >&5
10238 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10239 if test "${cf_cv_ncurses_version+set}" = set; then
10240   echo $ECHO_N "(cached) $ECHO_C" >&6
10241 else
10242
10243         cf_cv_ncurses_version=no
10244         cf_tempfile=out$$
10245         rm -f $cf_tempfile
10246         if test "$cross_compiling" = yes; then
10247
10248         # This will not work if the preprocessor splits the line after the
10249         # Autoconf token.  The 'unproto' program does that.
10250         cat > conftest.$ac_ext <<EOF
10251 #include <${cf_cv_ncurses_header:-curses.h}>
10252 #undef Autoconf
10253 #ifdef NCURSES_VERSION
10254 Autoconf NCURSES_VERSION
10255 #else
10256 #ifdef __NCURSES_H
10257 Autoconf "old"
10258 #endif
10259 ;
10260 #endif
10261 EOF
10262         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10263         { (eval echo "$as_me:10263: \"$cf_try\"") >&5
10264   (eval $cf_try) 2>&5
10265   ac_status=$?
10266   echo "$as_me:10266: \$? = $ac_status" >&5
10267   (exit $ac_status); }
10268         if test -f conftest.out ; then
10269                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10270                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10271                 rm -f conftest.out
10272         fi
10273
10274 else
10275   cat >conftest.$ac_ext <<_ACEOF
10276 #line 10276 "configure"
10277 #include "confdefs.h"
10278
10279 #include <${cf_cv_ncurses_header:-curses.h}>
10280 #include <stdio.h>
10281 int main(void)
10282 {
10283         FILE *fp = fopen("$cf_tempfile", "w");
10284 #ifdef NCURSES_VERSION
10285 # ifdef NCURSES_VERSION_PATCH
10286         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10287 # else
10288         fprintf(fp, "%s\n", NCURSES_VERSION);
10289 # endif
10290 #else
10291 # ifdef __NCURSES_H
10292         fprintf(fp, "old\n");
10293 # else
10294         make an error
10295 # endif
10296 #endif
10297         ${cf_cv_main_return:-return}(0);
10298 }
10299 _ACEOF
10300 rm -f conftest$ac_exeext
10301 if { (eval echo "$as_me:10301: \"$ac_link\"") >&5
10302   (eval $ac_link) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10306   { (eval echo "$as_me:10306: \"$ac_try\"") >&5
10307   (eval $ac_try) 2>&5
10308   ac_status=$?
10309   echo "$as_me:10309: \$? = $ac_status" >&5
10310   (exit $ac_status); }; }; then
10311
10312         cf_cv_ncurses_version=`cat $cf_tempfile`
10313 else
10314   echo "$as_me: program exited with status $ac_status" >&5
10315 echo "$as_me: failed program was:" >&5
10316 cat conftest.$ac_ext >&5
10317 fi
10318 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10319 fi
10320         rm -f $cf_tempfile
10321
10322 fi
10323 echo "$as_me:10323: result: $cf_cv_ncurses_version" >&5
10324 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10325 test "$cf_cv_ncurses_version" = no ||
10326 cat >>confdefs.h <<\EOF
10327 #define NCURSES 1
10328 EOF
10329
10330 cf_nculib_root=ncurses
10331         # This works, except for the special case where we find gpm, but
10332         # ncurses is in a nonstandard location via $LIBS, and we really want
10333         # to link gpm.
10334 cf_ncurses_LIBS=""
10335 cf_ncurses_SAVE="$LIBS"
10336 echo "$as_me:10336: checking for Gpm_Open in -lgpm" >&5
10337 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10338 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10339   echo $ECHO_N "(cached) $ECHO_C" >&6
10340 else
10341   ac_check_lib_save_LIBS=$LIBS
10342 LIBS="-lgpm  $LIBS"
10343 cat >conftest.$ac_ext <<_ACEOF
10344 #line 10344 "configure"
10345 #include "confdefs.h"
10346
10347 /* Override any gcc2 internal prototype to avoid an error.  */
10348 #ifdef __cplusplus
10349 extern "C"
10350 #endif
10351 /* We use char because int might match the return type of a gcc2
10352    builtin and then its argument prototype would still apply.  */
10353 char Gpm_Open ();
10354 int
10355 main (void)
10356 {
10357 Gpm_Open ();
10358   ;
10359   return 0;
10360 }
10361 _ACEOF
10362 rm -f conftest.$ac_objext conftest$ac_exeext
10363 if { (eval echo "$as_me:10363: \"$ac_link\"") >&5
10364   (eval $ac_link) 2>&5
10365   ac_status=$?
10366   echo "$as_me:10366: \$? = $ac_status" >&5
10367   (exit $ac_status); } &&
10368          { ac_try='test -s conftest$ac_exeext'
10369   { (eval echo "$as_me:10369: \"$ac_try\"") >&5
10370   (eval $ac_try) 2>&5
10371   ac_status=$?
10372   echo "$as_me:10372: \$? = $ac_status" >&5
10373   (exit $ac_status); }; }; then
10374   ac_cv_lib_gpm_Gpm_Open=yes
10375 else
10376   echo "$as_me: failed program was:" >&5
10377 cat conftest.$ac_ext >&5
10378 ac_cv_lib_gpm_Gpm_Open=no
10379 fi
10380 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10381 LIBS=$ac_check_lib_save_LIBS
10382 fi
10383 echo "$as_me:10383: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10384 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10385 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10386   echo "$as_me:10386: checking for initscr in -lgpm" >&5
10387 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10388 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10389   echo $ECHO_N "(cached) $ECHO_C" >&6
10390 else
10391   ac_check_lib_save_LIBS=$LIBS
10392 LIBS="-lgpm  $LIBS"
10393 cat >conftest.$ac_ext <<_ACEOF
10394 #line 10394 "configure"
10395 #include "confdefs.h"
10396
10397 /* Override any gcc2 internal prototype to avoid an error.  */
10398 #ifdef __cplusplus
10399 extern "C"
10400 #endif
10401 /* We use char because int might match the return type of a gcc2
10402    builtin and then its argument prototype would still apply.  */
10403 char initscr ();
10404 int
10405 main (void)
10406 {
10407 initscr ();
10408   ;
10409   return 0;
10410 }
10411 _ACEOF
10412 rm -f conftest.$ac_objext conftest$ac_exeext
10413 if { (eval echo "$as_me:10413: \"$ac_link\"") >&5
10414   (eval $ac_link) 2>&5
10415   ac_status=$?
10416   echo "$as_me:10416: \$? = $ac_status" >&5
10417   (exit $ac_status); } &&
10418          { ac_try='test -s conftest$ac_exeext'
10419   { (eval echo "$as_me:10419: \"$ac_try\"") >&5
10420   (eval $ac_try) 2>&5
10421   ac_status=$?
10422   echo "$as_me:10422: \$? = $ac_status" >&5
10423   (exit $ac_status); }; }; then
10424   ac_cv_lib_gpm_initscr=yes
10425 else
10426   echo "$as_me: failed program was:" >&5
10427 cat conftest.$ac_ext >&5
10428 ac_cv_lib_gpm_initscr=no
10429 fi
10430 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10431 LIBS=$ac_check_lib_save_LIBS
10432 fi
10433 echo "$as_me:10433: result: $ac_cv_lib_gpm_initscr" >&5
10434 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10435 if test $ac_cv_lib_gpm_initscr = yes; then
10436   LIBS="$cf_ncurses_SAVE"
10437 else
10438   cf_ncurses_LIBS="-lgpm"
10439 fi
10440
10441 fi
10442
10443 case $host_os in
10444 (freebsd*)
10445         # This is only necessary if you are linking against an obsolete
10446         # version of ncurses (but it should do no harm, since it's static).
10447         if test "$cf_nculib_root" = ncurses ; then
10448                 echo "$as_me:10448: checking for tgoto in -lmytinfo" >&5
10449 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10450 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10451   echo $ECHO_N "(cached) $ECHO_C" >&6
10452 else
10453   ac_check_lib_save_LIBS=$LIBS
10454 LIBS="-lmytinfo  $LIBS"
10455 cat >conftest.$ac_ext <<_ACEOF
10456 #line 10456 "configure"
10457 #include "confdefs.h"
10458
10459 /* Override any gcc2 internal prototype to avoid an error.  */
10460 #ifdef __cplusplus
10461 extern "C"
10462 #endif
10463 /* We use char because int might match the return type of a gcc2
10464    builtin and then its argument prototype would still apply.  */
10465 char tgoto ();
10466 int
10467 main (void)
10468 {
10469 tgoto ();
10470   ;
10471   return 0;
10472 }
10473 _ACEOF
10474 rm -f conftest.$ac_objext conftest$ac_exeext
10475 if { (eval echo "$as_me:10475: \"$ac_link\"") >&5
10476   (eval $ac_link) 2>&5
10477   ac_status=$?
10478   echo "$as_me:10478: \$? = $ac_status" >&5
10479   (exit $ac_status); } &&
10480          { ac_try='test -s conftest$ac_exeext'
10481   { (eval echo "$as_me:10481: \"$ac_try\"") >&5
10482   (eval $ac_try) 2>&5
10483   ac_status=$?
10484   echo "$as_me:10484: \$? = $ac_status" >&5
10485   (exit $ac_status); }; }; then
10486   ac_cv_lib_mytinfo_tgoto=yes
10487 else
10488   echo "$as_me: failed program was:" >&5
10489 cat conftest.$ac_ext >&5
10490 ac_cv_lib_mytinfo_tgoto=no
10491 fi
10492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10493 LIBS=$ac_check_lib_save_LIBS
10494 fi
10495 echo "$as_me:10495: result: $ac_cv_lib_mytinfo_tgoto" >&5
10496 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10497 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10498   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10499 fi
10500
10501         fi
10502         ;;
10503 esac
10504
10505 cf_add_libs="$LIBS"
10506 # reverse order
10507 cf_add_0lib=
10508 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10509 # filter duplicates
10510 for cf_add_1lib in $cf_add_0lib; do
10511         for cf_add_2lib in $cf_add_libs; do
10512                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10513                         cf_add_1lib=
10514                         break
10515                 fi
10516         done
10517         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10518 done
10519 LIBS="$cf_add_libs"
10520
10521 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10522 then
10523
10524 cf_add_libs="$LIBS"
10525 # reverse order
10526 cf_add_0lib=
10527 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10528 # filter duplicates
10529 for cf_add_1lib in $cf_add_0lib; do
10530         for cf_add_2lib in $cf_add_libs; do
10531                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10532                         cf_add_1lib=
10533                         break
10534                 fi
10535         done
10536         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10537 done
10538 LIBS="$cf_add_libs"
10539
10540 else
10541
10542         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10543         cf_libdir=""
10544         echo "$as_me:10544: checking for initscr" >&5
10545 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10546 if test "${ac_cv_func_initscr+set}" = set; then
10547   echo $ECHO_N "(cached) $ECHO_C" >&6
10548 else
10549   cat >conftest.$ac_ext <<_ACEOF
10550 #line 10550 "configure"
10551 #include "confdefs.h"
10552 #define initscr autoconf_temporary
10553 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10554 #undef initscr
10555
10556 #ifdef __cplusplus
10557 extern "C"
10558 #endif
10559
10560 /* We use char because int might match the return type of a gcc2
10561    builtin and then its argument prototype would still apply.  */
10562 char initscr (void);
10563
10564 int
10565 main (void)
10566 {
10567
10568 /* The GNU C library defines stubs for functions which it implements
10569     to always fail with ENOSYS.  Some functions are actually named
10570     something starting with __ and the normal name is an alias.  */
10571 #if defined (__stub_initscr) || defined (__stub___initscr)
10572 #error found stub for initscr
10573 #endif
10574
10575         return initscr ();
10576   ;
10577   return 0;
10578 }
10579 _ACEOF
10580 rm -f conftest.$ac_objext conftest$ac_exeext
10581 if { (eval echo "$as_me:10581: \"$ac_link\"") >&5
10582   (eval $ac_link) 2>&5
10583   ac_status=$?
10584   echo "$as_me:10584: \$? = $ac_status" >&5
10585   (exit $ac_status); } &&
10586          { ac_try='test -s conftest$ac_exeext'
10587   { (eval echo "$as_me:10587: \"$ac_try\"") >&5
10588   (eval $ac_try) 2>&5
10589   ac_status=$?
10590   echo "$as_me:10590: \$? = $ac_status" >&5
10591   (exit $ac_status); }; }; then
10592   ac_cv_func_initscr=yes
10593 else
10594   echo "$as_me: failed program was:" >&5
10595 cat conftest.$ac_ext >&5
10596 ac_cv_func_initscr=no
10597 fi
10598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10599 fi
10600 echo "$as_me:10600: result: $ac_cv_func_initscr" >&5
10601 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10602 if test $ac_cv_func_initscr = yes; then
10603   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10604 else
10605
10606                 cf_save_LIBS="$LIBS"
10607                 echo "$as_me:10607: checking for initscr in -l$cf_nculib_root" >&5
10608 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10609                 LIBS="-l$cf_nculib_root $LIBS"
10610                 cat >conftest.$ac_ext <<_ACEOF
10611 #line 10611 "configure"
10612 #include "confdefs.h"
10613 #include <${cf_cv_ncurses_header:-curses.h}>
10614 int
10615 main (void)
10616 {
10617 initscr()
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext conftest$ac_exeext
10623 if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
10624   (eval $ac_link) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest$ac_exeext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   echo "$as_me:10634: result: yes" >&5
10635 echo "${ECHO_T}yes" >&6
10636                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10637
10638 else
10639   echo "$as_me: failed program was:" >&5
10640 cat conftest.$ac_ext >&5
10641 echo "$as_me:10641: result: no" >&5
10642 echo "${ECHO_T}no" >&6
10643
10644 cf_search=
10645 cf_library_path_list=""
10646 if test -n "${LDFLAGS}${LIBS}" ; then
10647         for cf_library_path in $LDFLAGS $LIBS
10648         do
10649                 case $cf_library_path in
10650                 (-L*)
10651                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10652
10653 test "x$cf_library_path" != "xNONE" && \
10654 test -d "$cf_library_path" && \
10655  {
10656         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10657         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10658         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10659         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10660         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10661         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"
10662 }
10663
10664                         cf_library_path_list="$cf_library_path_list $cf_search"
10665                         ;;
10666                 esac
10667         done
10668 fi
10669
10670 cf_search=
10671
10672 test "x$prefix" != "xNONE" && \
10673 test -d "$prefix" && \
10674  {
10675         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10676         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10677         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10678         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10679         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10680         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10681 }
10682
10683 for cf_subdir_prefix in \
10684         /usr \
10685         /usr/local \
10686         /usr/pkg \
10687         /opt \
10688         /opt/local \
10689         $HOME
10690 do
10691
10692 test "x$cf_subdir_prefix" != "x$prefix" && \
10693 test -d "$cf_subdir_prefix" && \
10694 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10695         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10696         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10697         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10698         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10699         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10700         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"
10701 }
10702
10703 done
10704
10705 cf_search="$cf_library_path_list $cf_search"
10706
10707                         for cf_libdir in $cf_search
10708                         do
10709                                 echo "$as_me:10709: checking for -l$cf_nculib_root in $cf_libdir" >&5
10710 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10711                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10712                                 cat >conftest.$ac_ext <<_ACEOF
10713 #line 10713 "configure"
10714 #include "confdefs.h"
10715 #include <${cf_cv_ncurses_header:-curses.h}>
10716 int
10717 main (void)
10718 {
10719 initscr()
10720   ;
10721   return 0;
10722 }
10723 _ACEOF
10724 rm -f conftest.$ac_objext conftest$ac_exeext
10725 if { (eval echo "$as_me:10725: \"$ac_link\"") >&5
10726   (eval $ac_link) 2>&5
10727   ac_status=$?
10728   echo "$as_me:10728: \$? = $ac_status" >&5
10729   (exit $ac_status); } &&
10730          { ac_try='test -s conftest$ac_exeext'
10731   { (eval echo "$as_me:10731: \"$ac_try\"") >&5
10732   (eval $ac_try) 2>&5
10733   ac_status=$?
10734   echo "$as_me:10734: \$? = $ac_status" >&5
10735   (exit $ac_status); }; }; then
10736   echo "$as_me:10736: result: yes" >&5
10737 echo "${ECHO_T}yes" >&6
10738                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10739                                          break
10740 else
10741   echo "$as_me: failed program was:" >&5
10742 cat conftest.$ac_ext >&5
10743 echo "$as_me:10743: result: no" >&5
10744 echo "${ECHO_T}no" >&6
10745                                          LIBS="$cf_save_LIBS"
10746 fi
10747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10748                         done
10749
10750 fi
10751 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10752
10753 fi
10754
10755 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10756
10757 if test $cf_found_library = no ; then
10758         { { echo "$as_me:10758: error: Cannot link $cf_nculib_root library" >&5
10759 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10760    { (exit 1); exit 1; }; }
10761 fi
10762
10763 fi
10764
10765 if test -n "$cf_ncurses_LIBS" ; then
10766         echo "$as_me:10766: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10767 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10768         cf_ncurses_SAVE="$LIBS"
10769         for p in $cf_ncurses_LIBS ; do
10770                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10771                 if test "$q" != "$LIBS" ; then
10772                         LIBS="$q"
10773                 fi
10774         done
10775         cat >conftest.$ac_ext <<_ACEOF
10776 #line 10776 "configure"
10777 #include "confdefs.h"
10778 #include <${cf_cv_ncurses_header:-curses.h}>
10779 int
10780 main (void)
10781 {
10782 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10783   ;
10784   return 0;
10785 }
10786 _ACEOF
10787 rm -f conftest.$ac_objext conftest$ac_exeext
10788 if { (eval echo "$as_me:10788: \"$ac_link\"") >&5
10789   (eval $ac_link) 2>&5
10790   ac_status=$?
10791   echo "$as_me:10791: \$? = $ac_status" >&5
10792   (exit $ac_status); } &&
10793          { ac_try='test -s conftest$ac_exeext'
10794   { (eval echo "$as_me:10794: \"$ac_try\"") >&5
10795   (eval $ac_try) 2>&5
10796   ac_status=$?
10797   echo "$as_me:10797: \$? = $ac_status" >&5
10798   (exit $ac_status); }; }; then
10799   echo "$as_me:10799: result: yes" >&5
10800 echo "${ECHO_T}yes" >&6
10801 else
10802   echo "$as_me: failed program was:" >&5
10803 cat conftest.$ac_ext >&5
10804 echo "$as_me:10804: result: no" >&5
10805 echo "${ECHO_T}no" >&6
10806                  LIBS="$cf_ncurses_SAVE"
10807 fi
10808 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10809 fi
10810
10811 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10812
10813 cat >>confdefs.h <<EOF
10814 #define $cf_nculib_ROOT 1
10815 EOF
10816
10817         fi
10818 else
10819         NCURSES_CONFIG=none
10820 fi
10821
10822 fi
10823
10824 if test "$NCURSES_CONFIG_PKG" != none ; then
10825         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10826
10827         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10828         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10829         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10830
10831         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10832         if test -z "$cf_cv_abi_version"
10833         then
10834                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10835         fi
10836
10837 elif test "$NCURSES_CONFIG" != none ; then
10838
10839         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10840
10841         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10842         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10843         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10844
10845         # ABI version is not available from headers
10846         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10847
10848 else
10849
10850         for cf_name in MAJOR MINOR PATCH
10851         do
10852         cat >conftest.$ac_ext <<CF_EOF
10853         #include <${cf_cv_ncurses_header:-curses.h}>
10854         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10855 CF_EOF
10856                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10857                 { (eval echo "$as_me:10857: \"$cf_try\"") >&5
10858   (eval $cf_try) 2>&5
10859   ac_status=$?
10860   echo "$as_me:10860: \$? = $ac_status" >&5
10861   (exit $ac_status); }
10862                 if test -f conftest.out ; then
10863                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10864                         eval NCURSES_$cf_name=\"$cf_result\"
10865                         # cat conftest.$ac_ext
10866                         # cat conftest.out
10867                 fi
10868         done
10869
10870         cf_cv_abi_version=${NCURSES_MAJOR}
10871
10872 fi
10873
10874 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10875
10876 cf_cv_timestamp=`date`
10877
10878 echo "$as_me:10878: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10879 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10880
10881 echo "$as_me:10881: checking if you want to have a library-prefix" >&5
10882 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10883
10884 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10885 if test "${with_lib_prefix+set}" = set; then
10886   withval="$with_lib_prefix"
10887   with_lib_prefix=$withval
10888 else
10889   with_lib_prefix=auto
10890 fi;
10891 echo "$as_me:10891: result: $with_lib_prefix" >&5
10892 echo "${ECHO_T}$with_lib_prefix" >&6
10893
10894 if test $with_lib_prefix = auto
10895 then
10896
10897         case $cf_cv_system_name in
10898         (OS/2*|os2*)
10899                 if test "$DFT_LWR_MODEL" = libtool; then
10900                         LIB_PREFIX='lib'
10901                 else
10902                         LIB_PREFIX=''
10903                 fi
10904                 ;;
10905         (*-msvc*)
10906                 LIB_PREFIX=''
10907                 ;;
10908         (*)     LIB_PREFIX='lib'
10909                 ;;
10910         esac
10911 cf_prefix=$LIB_PREFIX
10912
10913 elif test $with_lib_prefix = no
10914 then
10915         LIB_PREFIX=
10916 else
10917         LIB_PREFIX=$with_lib_prefix
10918 fi
10919
10920 LIB_SUFFIX=
10921
10922 ###############################################################################
10923
10924 if test X"$CC_G_OPT" = X"" ; then
10925         CC_G_OPT='-g'
10926         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10927 fi
10928
10929 echo "$as_me:10929: checking for default loader flags" >&5
10930 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10931 case $DFT_LWR_MODEL in
10932 (normal)  LD_MODEL=''   ;;
10933 (debug)   LD_MODEL=$CC_G_OPT ;;
10934 (profile) LD_MODEL='-pg';;
10935 (shared)  LD_MODEL=''   ;;
10936 esac
10937 echo "$as_me:10937: result: $LD_MODEL" >&5
10938 echo "${ECHO_T}$LD_MODEL" >&6
10939
10940 LD_RPATH_OPT=
10941 if test "x$cf_cv_enable_rpath" != xno
10942 then
10943         echo "$as_me:10943: checking for an rpath option" >&5
10944 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10945         case $cf_cv_system_name in
10946         (irix*)
10947                 if test "$GCC" = yes; then
10948                         LD_RPATH_OPT="-Wl,-rpath,"
10949                 else
10950                         LD_RPATH_OPT="-rpath "
10951                 fi
10952                 ;;
10953         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10954                 LD_RPATH_OPT="-Wl,-rpath,"
10955                 ;;
10956         (openbsd[2-9].*|mirbsd*)
10957                 LD_RPATH_OPT="-Wl,-rpath,"
10958                 ;;
10959         (dragonfly*)
10960                 LD_RPATH_OPT="-rpath "
10961                 ;;
10962         (netbsd*)
10963                 LD_RPATH_OPT="-Wl,-rpath,"
10964                 ;;
10965         (osf*|mls+*)
10966                 LD_RPATH_OPT="-rpath "
10967                 ;;
10968         (solaris2*)
10969                 LD_RPATH_OPT="-R"
10970                 ;;
10971         (*)
10972                 ;;
10973         esac
10974         echo "$as_me:10974: result: $LD_RPATH_OPT" >&5
10975 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10976
10977         case "x$LD_RPATH_OPT" in
10978         (x-R*)
10979                 echo "$as_me:10979: checking if we need a space after rpath option" >&5
10980 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10981                 cf_save_LIBS="$LIBS"
10982
10983 cf_add_libs="$LIBS"
10984 # reverse order
10985 cf_add_0lib=
10986 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10987 # filter duplicates
10988 for cf_add_1lib in $cf_add_0lib; do
10989         for cf_add_2lib in $cf_add_libs; do
10990                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10991                         cf_add_1lib=
10992                         break
10993                 fi
10994         done
10995         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10996 done
10997 LIBS="$cf_add_libs"
10998
10999                 cat >conftest.$ac_ext <<_ACEOF
11000 #line 11000 "configure"
11001 #include "confdefs.h"
11002
11003 int
11004 main (void)
11005 {
11006
11007   ;
11008   return 0;
11009 }
11010 _ACEOF
11011 rm -f conftest.$ac_objext conftest$ac_exeext
11012 if { (eval echo "$as_me:11012: \"$ac_link\"") >&5
11013   (eval $ac_link) 2>&5
11014   ac_status=$?
11015   echo "$as_me:11015: \$? = $ac_status" >&5
11016   (exit $ac_status); } &&
11017          { ac_try='test -s conftest$ac_exeext'
11018   { (eval echo "$as_me:11018: \"$ac_try\"") >&5
11019   (eval $ac_try) 2>&5
11020   ac_status=$?
11021   echo "$as_me:11021: \$? = $ac_status" >&5
11022   (exit $ac_status); }; }; then
11023   cf_rpath_space=no
11024 else
11025   echo "$as_me: failed program was:" >&5
11026 cat conftest.$ac_ext >&5
11027 cf_rpath_space=yes
11028 fi
11029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11030                 LIBS="$cf_save_LIBS"
11031                 echo "$as_me:11031: result: $cf_rpath_space" >&5
11032 echo "${ECHO_T}$cf_rpath_space" >&6
11033                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11034                 ;;
11035         esac
11036 fi
11037
11038         RM_SHARED_OPTS=
11039         LOCAL_LDFLAGS=
11040         LOCAL_LDFLAGS2=
11041         LD_SHARED_OPTS=
11042         INSTALL_LIB="-m 644"
11043         : ${rel_builddir:=.}
11044
11045         shlibdir=$libdir
11046
11047         MAKE_DLLS="#"
11048
11049         cf_cv_do_symlinks=no
11050         cf_ld_rpath_opt=
11051         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11052
11053         echo "$as_me:11053: checking if release/abi version should be used for shared libs" >&5
11054 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11055
11056 # Check whether --with-shlib-version or --without-shlib-version was given.
11057 if test "${with_shlib_version+set}" = set; then
11058   withval="$with_shlib_version"
11059   test -z "$withval" && withval=auto
11060         case $withval in
11061         (yes)
11062                 cf_cv_shlib_version=auto
11063                 ;;
11064         (rel|abi|auto)
11065                 cf_cv_shlib_version=$withval
11066                 ;;
11067         (*)
11068                 echo "$as_me:11068: result: $withval" >&5
11069 echo "${ECHO_T}$withval" >&6
11070                 { { echo "$as_me:11070: error: option value must be one of: rel, abi, or auto" >&5
11071 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11072    { (exit 1); exit 1; }; }
11073                 ;;
11074         esac
11075
11076 else
11077   cf_cv_shlib_version=auto
11078 fi;
11079         echo "$as_me:11079: result: $cf_cv_shlib_version" >&5
11080 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11081
11082         cf_cv_rm_so_locs=no
11083         cf_try_cflags=
11084
11085         # Some less-capable ports of gcc support only -fpic
11086         CC_SHARED_OPTS=
11087
11088         cf_try_fPIC=no
11089         if test "$GCC" = yes
11090         then
11091                 cf_try_fPIC=yes
11092         else
11093                 case $cf_cv_system_name in
11094                 (*linux*)       # e.g., PGI compiler
11095                         cf_try_fPIC=yes
11096                         ;;
11097                 esac
11098         fi
11099
11100         if test "$cf_try_fPIC" = yes
11101         then
11102                 echo "$as_me:11102: checking which $CC option to use" >&5
11103 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11104                 cf_save_CFLAGS="$CFLAGS"
11105                 for CC_SHARED_OPTS in -fPIC -fpic ''
11106                 do
11107                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11108                         cat >conftest.$ac_ext <<_ACEOF
11109 #line 11109 "configure"
11110 #include "confdefs.h"
11111 #include <stdio.h>
11112 int
11113 main (void)
11114 {
11115 int x = 1
11116   ;
11117   return 0;
11118 }
11119 _ACEOF
11120 rm -f conftest.$ac_objext
11121 if { (eval echo "$as_me:11121: \"$ac_compile\"") >&5
11122   (eval $ac_compile) 2>&5
11123   ac_status=$?
11124   echo "$as_me:11124: \$? = $ac_status" >&5
11125   (exit $ac_status); } &&
11126          { ac_try='test -s conftest.$ac_objext'
11127   { (eval echo "$as_me:11127: \"$ac_try\"") >&5
11128   (eval $ac_try) 2>&5
11129   ac_status=$?
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit $ac_status); }; }; then
11132   break
11133 else
11134   echo "$as_me: failed program was:" >&5
11135 cat conftest.$ac_ext >&5
11136 fi
11137 rm -f conftest.$ac_objext conftest.$ac_ext
11138                 done
11139                 echo "$as_me:11139: result: $CC_SHARED_OPTS" >&5
11140 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11141                 CFLAGS="$cf_save_CFLAGS"
11142         fi
11143
11144         cf_cv_shlib_version_infix=no
11145
11146         case $cf_cv_system_name in
11147         (aix4.3-9*|aix[5-7]*)
11148                 if test "$GCC" = yes; then
11149                         CC_SHARED_OPTS='-Wl,-brtl'
11150                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11151                 else
11152                         CC_SHARED_OPTS='-brtl'
11153                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11154                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11155                 fi
11156                 ;;
11157         (beos*)
11158                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11159                 ;;
11160         (cygwin*)
11161                 CC_SHARED_OPTS=
11162                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11163                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11164                 cf_cv_shlib_version=cygdll
11165                 cf_cv_shlib_version_infix=cygdll
11166                 shlibdir=$bindir
11167                 MAKE_DLLS=
11168                 cat >mk_shared_lib.sh <<-CF_EOF
11169                 #!$SHELL
11170                 SHARED_LIB=\$1
11171                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11172                 shift
11173                 cat <<-EOF
11174                 Linking shared library
11175                 ** SHARED_LIB \$SHARED_LIB
11176                 ** IMPORT_LIB \$IMPORT_LIB
11177 EOF
11178                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11179 CF_EOF
11180                 chmod +x mk_shared_lib.sh
11181                 ;;
11182         (msys*)
11183                 CC_SHARED_OPTS=
11184                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11185                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11186                 cf_cv_shlib_version=msysdll
11187                 cf_cv_shlib_version_infix=msysdll
11188                 shlibdir=$bindir
11189                 MAKE_DLLS=
11190                 cat >mk_shared_lib.sh <<-CF_EOF
11191                 #!$SHELL
11192                 SHARED_LIB=\$1
11193                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11194                 shift
11195                 cat <<-EOF
11196                 Linking shared library
11197                 ** SHARED_LIB \$SHARED_LIB
11198                 ** IMPORT_LIB \$IMPORT_LIB
11199 EOF
11200                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11201 CF_EOF
11202                 chmod +x mk_shared_lib.sh
11203                 ;;
11204         (darwin*)
11205                 cf_try_cflags="no-cpp-precomp"
11206                 CC_SHARED_OPTS="-dynamic"
11207                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11208                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11209                 cf_cv_shlib_version_infix=yes
11210                 echo "$as_me:11210: checking if ld -search_paths_first works" >&5
11211 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11212 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11213   echo $ECHO_N "(cached) $ECHO_C" >&6
11214 else
11215
11216                         cf_save_LDFLAGS=$LDFLAGS
11217                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11218                         cat >conftest.$ac_ext <<_ACEOF
11219 #line 11219 "configure"
11220 #include "confdefs.h"
11221
11222 int
11223 main (void)
11224 {
11225 int i;
11226   ;
11227   return 0;
11228 }
11229 _ACEOF
11230 rm -f conftest.$ac_objext conftest$ac_exeext
11231 if { (eval echo "$as_me:11231: \"$ac_link\"") >&5
11232   (eval $ac_link) 2>&5
11233   ac_status=$?
11234   echo "$as_me:11234: \$? = $ac_status" >&5
11235   (exit $ac_status); } &&
11236          { ac_try='test -s conftest$ac_exeext'
11237   { (eval echo "$as_me:11237: \"$ac_try\"") >&5
11238   (eval $ac_try) 2>&5
11239   ac_status=$?
11240   echo "$as_me:11240: \$? = $ac_status" >&5
11241   (exit $ac_status); }; }; then
11242   cf_cv_ldflags_search_paths_first=yes
11243 else
11244   echo "$as_me: failed program was:" >&5
11245 cat conftest.$ac_ext >&5
11246 cf_cv_ldflags_search_paths_first=no
11247 fi
11248 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11249                                 LDFLAGS=$cf_save_LDFLAGS
11250 fi
11251 echo "$as_me:11251: result: $cf_cv_ldflags_search_paths_first" >&5
11252 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11253                 if test $cf_cv_ldflags_search_paths_first = yes; then
11254                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11255                 fi
11256                 ;;
11257         (hpux[7-8]*)
11258                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11259                 if test "$GCC" != yes; then
11260                         CC_SHARED_OPTS='+Z'
11261                 fi
11262                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11263                 INSTALL_LIB="-m 555"
11264                 ;;
11265         (hpux*)
11266                 # (tested with gcc 2.7.2 -- I don't have c89)
11267                 if test "$GCC" = yes; then
11268                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11269                 else
11270                         CC_SHARED_OPTS='+Z'
11271                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11272                 fi
11273                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11274                 # HP-UX shared libraries must be executable, and should be
11275                 # readonly to exploit a quirk in the memory manager.
11276                 INSTALL_LIB="-m 555"
11277                 ;;
11278         (interix*)
11279                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11280                 if test "$cf_cv_shlib_version" = rel; then
11281                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11282                 else
11283                         cf_shared_soname='`basename $@`'
11284                 fi
11285                 CC_SHARED_OPTS=
11286                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11287                 ;;
11288         (irix*)
11289                 if test "$cf_cv_enable_rpath" = yes ; then
11290                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11291                 fi
11292                 # tested with IRIX 5.2 and 'cc'.
11293                 if test "$GCC" != yes; then
11294                         CC_SHARED_OPTS='-KPIC'
11295                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11296                 else
11297                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11298                 fi
11299                 cf_cv_rm_so_locs=yes
11300                 ;;
11301         (linux*|gnu*|k*bsd*-gnu)
11302                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11303                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11304                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11305                 fi
11306                 if test "$cf_cv_enable_rpath" = yes ; then
11307                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11308                 fi
11309
11310         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11311         if test "$cf_cv_shlib_version" = rel; then
11312                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11313         else
11314                 cf_cv_shared_soname='`basename $@`'
11315         fi
11316
11317                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11318                 ;;
11319         (mingw*msvc*)
11320                 cf_cv_shlib_version=msvcdll
11321                 cf_cv_shlib_version_infix=msvcdll
11322                 shlibdir=$bindir
11323                 MAKE_DLLS=
11324                 if test "$DFT_LWR_MODEL" = "shared" ; then
11325                         LOCAL_LDFLAGS="-link -dll"
11326                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11327                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11328                 fi
11329                 CC_SHARED_OPTS=
11330                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11331                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11332                 cat >mk_shared_lib.sh <<-CF_EOF
11333                 #!$SHELL
11334                 SHARED_LIB=\$1
11335                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11336                 shift
11337                 my_ld=\$1
11338                 shift
11339                 cat <<-EOF
11340                 Linking shared library
11341                 ** SHARED LIB \$SHARED_LIB
11342                 ** IMPORT_LIB \$IMPORT_LIB
11343 EOF
11344                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11345                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11346                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11347 CF_EOF
11348                 chmod +x mk_shared_lib.sh
11349                 cat >mk_prog.sh <<-CF_EOF
11350                 #!$SHELL
11351                 shift
11352                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11353                 LD="$LD"
11354                 clopts=()
11355                 ldopts=("/subsystem:console")
11356                 libs=()
11357                 isdll=0
11358                 while test \$# -gt 0; do
11359                         case "\$1" in
11360                                 -link)
11361                                         # ignore -link argument
11362                                         ;;
11363                                 -M[TD] | -M[TD]d)
11364                                         # ignore runtime-library option
11365                                         ;;
11366                                 -dll)
11367                                         isdll=1
11368                                         ;;
11369                                 -W* | -w*)
11370                                         # ignore warnings
11371                                         ;;
11372                                 -D*)
11373                                         clopts+=("\$1")
11374                                         ;;
11375                                 -I*)
11376                                         clopts+=("\$1")
11377                                         ;;
11378                                 -l*)
11379                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11380                                         ;;
11381                                 -L*)
11382                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11383                                         ;;
11384                                 *.obj | *.o)
11385                                         ldopts+=("\$1")
11386                                         ;;
11387                                 -Wl,*)
11388                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11389                                                 ldopts+=("\${linkarg}")
11390                                         done
11391                                         ;;
11392                                 *.lib)
11393                                         ldopts+=("\$1")
11394                                         ;;
11395                                 -o)
11396                                         shift
11397                                         ldopts+=("-out:\$1")
11398                                         ;;
11399                                 *)
11400                                         clopts+=("\$1")
11401                                         ldopts+=("\$1")
11402                                         ;;
11403                         esac
11404                         shift
11405                 done
11406                 if [ "\$isdll" -ne 0 ]; then
11407                         for lib in \${libs[*]}; do
11408                                 ldopts+=("\$lib.dll.lib")
11409                         done
11410                 else
11411                         for lib in \${libs[*]}; do
11412                                 ldopts+=("\$lib.lib")
11413                         done
11414                 fi
11415                 cat <<-EOF
11416                 Creating program
11417                 ** ld options:   "\${ldopts[@]}"
11418 EOF
11419                 exec \$LD \${ldopts[@]}
11420 CF_EOF
11421                 chmod +x mk_prog.sh
11422                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11423                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11424                 ;;
11425         (mingw*)
11426                 cf_cv_shlib_version=mingw
11427                 cf_cv_shlib_version_infix=mingw
11428                 shlibdir=$bindir
11429                 MAKE_DLLS=
11430                 if test "$DFT_LWR_MODEL" = "shared" ; then
11431                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11432                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11433                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11434                 fi
11435                 CC_SHARED_OPTS=
11436                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11437                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11438                 cat >mk_shared_lib.sh <<-CF_EOF
11439                 #!$SHELL
11440                 SHARED_LIB=\$1
11441                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11442                 shift
11443                 cat <<-EOF
11444                 Linking shared library
11445                 ** SHARED_LIB \$SHARED_LIB
11446                 ** IMPORT_LIB \$IMPORT_LIB
11447 EOF
11448                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11449 CF_EOF
11450                 chmod +x mk_shared_lib.sh
11451                 ;;
11452         (openbsd[2-9].*|mirbsd*)
11453                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11454                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11455                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11456                 fi
11457                 if test "$cf_cv_enable_rpath" = yes ; then
11458                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11459                 fi
11460                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11461
11462         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11463         if test "$cf_cv_shlib_version" = rel; then
11464                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11465         else
11466                 cf_cv_shared_soname='`basename $@`'
11467         fi
11468
11469                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11470                 ;;
11471         (nskJ*)
11472                 CC_SHARED_OPTS=
11473                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11474                 ;;
11475         (nskL*)
11476                 CC_SHARED_OPTS=
11477                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11478                 ;;
11479         (nto-qnx*|openbsd*|freebsd[12].*)
11480                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11481                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11482                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11483                 ;;
11484         (dragonfly*|freebsd*)
11485                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11486                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11487                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11488                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11489                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11490                 fi
11491
11492         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11493         if test "$cf_cv_shlib_version" = rel; then
11494                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11495         else
11496                 cf_cv_shared_soname='`basename $@`'
11497         fi
11498
11499                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11500                 ;;
11501         (netbsd*)
11502                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11503                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11504                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11505                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11506                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11507                         if test "$cf_cv_shlib_version" = auto; then
11508                         if test -f /usr/libexec/ld.elf_so; then
11509                                 cf_cv_shlib_version=abi
11510                         else
11511                                 cf_cv_shlib_version=rel
11512                         fi
11513                         fi
11514
11515         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11516         if test "$cf_cv_shlib_version" = rel; then
11517                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11518         else
11519                 cf_cv_shared_soname='`basename $@`'
11520         fi
11521
11522                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11523                 else
11524                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11525                 fi
11526                 ;;
11527         (osf*|mls+*)
11528                 # tested with OSF/1 V3.2 and 'cc'
11529                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11530                 # link with shared libs).
11531                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11532                 case $host_os in
11533                 (osf4*)
11534                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11535                         ;;
11536                 esac
11537                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11538                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11539                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11540                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11541                 fi
11542                 cf_cv_rm_so_locs=yes
11543                 ;;
11544         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11545                 # tested with osr5.0.5
11546                 if test "$GCC" != yes; then
11547                         CC_SHARED_OPTS='-belf -KPIC'
11548                 fi
11549                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11550                 if test "$cf_cv_enable_rpath" = yes ; then
11551                         # only way is to set LD_RUN_PATH but no switch for it
11552                         RUN_PATH=$libdir
11553                 fi
11554                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11555                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11556                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11557                 ;;
11558         (sunos4*)
11559                 # tested with SunOS 4.1.1 and gcc 2.7.0
11560                 if test "$GCC" != yes; then
11561                         CC_SHARED_OPTS='-KPIC'
11562                 fi
11563                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11564                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11565                 ;;
11566         (solaris2*)
11567                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11568                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11569                 if test "$DFT_LWR_MODEL" = "shared" ; then
11570                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11571                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11572                 fi
11573                 if test "$cf_cv_enable_rpath" = yes ; then
11574                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11575                 fi
11576
11577         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11578         if test "$cf_cv_shlib_version" = rel; then
11579                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11580         else
11581                 cf_cv_shared_soname='`basename $@`'
11582         fi
11583
11584                 if test "$GCC" != yes; then
11585                         cf_save_CFLAGS="$CFLAGS"
11586                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11587                         do
11588                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11589                                 cat >conftest.$ac_ext <<_ACEOF
11590 #line 11590 "configure"
11591 #include "confdefs.h"
11592 #include <stdio.h>
11593 int
11594 main (void)
11595 {
11596 printf("Hello\n");
11597   ;
11598   return 0;
11599 }
11600 _ACEOF
11601 rm -f conftest.$ac_objext
11602 if { (eval echo "$as_me:11602: \"$ac_compile\"") >&5
11603   (eval $ac_compile) 2>&5
11604   ac_status=$?
11605   echo "$as_me:11605: \$? = $ac_status" >&5
11606   (exit $ac_status); } &&
11607          { ac_try='test -s conftest.$ac_objext'
11608   { (eval echo "$as_me:11608: \"$ac_try\"") >&5
11609   (eval $ac_try) 2>&5
11610   ac_status=$?
11611   echo "$as_me:11611: \$? = $ac_status" >&5
11612   (exit $ac_status); }; }; then
11613   break
11614 else
11615   echo "$as_me: failed program was:" >&5
11616 cat conftest.$ac_ext >&5
11617 fi
11618 rm -f conftest.$ac_objext conftest.$ac_ext
11619                         done
11620                         CFLAGS="$cf_save_CFLAGS"
11621                         CC_SHARED_OPTS=$cf_shared_opts
11622                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11623                 else
11624                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11625                 fi
11626                 ;;
11627         (sysv5uw7*|unix_sv*)
11628                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11629                 if test "$GCC" != yes; then
11630                         CC_SHARED_OPTS='-KPIC'
11631                 fi
11632                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11633                 ;;
11634         (*)
11635                 CC_SHARED_OPTS='unknown'
11636                 MK_SHARED_LIB='echo unknown'
11637                 ;;
11638         esac
11639
11640         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11641         case "$cf_cv_shlib_version" in
11642         (rel|abi)
11643                 case "$MK_SHARED_LIB" in
11644                 (*'-o $@')
11645                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11646                         ;;
11647                 (*)
11648                         { echo "$as_me:11648: WARNING: ignored --with-shlib-version" >&5
11649 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11650                         ;;
11651                 esac
11652                 ;;
11653         esac
11654
11655         if test -n "$cf_try_cflags"
11656         then
11657 cat > conftest.$ac_ext <<EOF
11658 #line 11658 "${as_me:-configure}"
11659 #include <stdio.h>
11660 int main(int argc, char *argv[])
11661 {
11662         printf("hello\n");
11663         return (argv[argc-1] == 0) ;
11664 }
11665 EOF
11666                 cf_save_CFLAGS="$CFLAGS"
11667                 for cf_opt in $cf_try_cflags
11668                 do
11669                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11670                         echo "$as_me:11670: checking if CFLAGS option -$cf_opt works" >&5
11671 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11672                         if { (eval echo "$as_me:11672: \"$ac_compile\"") >&5
11673   (eval $ac_compile) 2>&5
11674   ac_status=$?
11675   echo "$as_me:11675: \$? = $ac_status" >&5
11676   (exit $ac_status); }; then
11677                                 echo "$as_me:11677: result: yes" >&5
11678 echo "${ECHO_T}yes" >&6
11679                                 cf_save_CFLAGS="$CFLAGS"
11680                         else
11681                                 echo "$as_me:11681: result: no" >&5
11682 echo "${ECHO_T}no" >&6
11683                         fi
11684                 done
11685                 CFLAGS="$cf_save_CFLAGS"
11686         fi
11687
11688         # RPATH_LIST is a colon-separated list of directories
11689         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11690         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11691
11692         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11693
11694         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11695
11696 echo "${as_me:-configure}:11696: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11697
11698         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11699
11700 echo "${as_me:-configure}:11700: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11701
11702 # The test/sample programs in the original tree link using rpath option.
11703 # Make it optional for packagers.
11704 if test -n "$LOCAL_LDFLAGS"
11705 then
11706         echo "$as_me:11706: checking if you want to link sample programs with rpath option" >&5
11707 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11708
11709 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11710 if test "${enable_rpath_link+set}" = set; then
11711   enableval="$enable_rpath_link"
11712   with_rpath_link=$enableval
11713 else
11714   with_rpath_link=yes
11715 fi;
11716         echo "$as_me:11716: result: $with_rpath_link" >&5
11717 echo "${ECHO_T}$with_rpath_link" >&6
11718         if test "$with_rpath_link" = no
11719         then
11720                 LOCAL_LDFLAGS=
11721                 LOCAL_LDFLAGS2=
11722         fi
11723 fi
11724
11725 ###############################################################################
11726
11727 ###   use option --enable-broken-linker to force on use of broken-linker support
11728
11729 echo "$as_me:11729: checking if you want broken-linker support code" >&5
11730 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11731
11732 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11733 if test "${enable_broken_linker+set}" = set; then
11734   enableval="$enable_broken_linker"
11735   with_broken_linker=$enableval
11736 else
11737   with_broken_linker=no
11738 fi;
11739 echo "$as_me:11739: result: $with_broken_linker" >&5
11740 echo "${ECHO_T}$with_broken_linker" >&6
11741
11742 : ${BROKEN_LINKER:=0}
11743 if test "x$with_broken_linker" = xyes ; then
11744
11745 cat >>confdefs.h <<\EOF
11746 #define BROKEN_LINKER 1
11747 EOF
11748
11749         BROKEN_LINKER=1
11750 fi
11751
11752 # Check to define _XOPEN_SOURCE "automatically"
11753
11754 echo "$as_me:11754: checking if the POSIX test-macros are already defined" >&5
11755 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11756 if test "${cf_cv_posix_visible+set}" = set; then
11757   echo $ECHO_N "(cached) $ECHO_C" >&6
11758 else
11759
11760 cat >conftest.$ac_ext <<_ACEOF
11761 #line 11761 "configure"
11762 #include "confdefs.h"
11763 #include <stdio.h>
11764 int
11765 main (void)
11766 {
11767
11768 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11769         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11770         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11771         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11772 #error conflicting symbols found
11773 #endif
11774
11775   ;
11776   return 0;
11777 }
11778 _ACEOF
11779 rm -f conftest.$ac_objext
11780 if { (eval echo "$as_me:11780: \"$ac_compile\"") >&5
11781   (eval $ac_compile) 2>&5
11782   ac_status=$?
11783   echo "$as_me:11783: \$? = $ac_status" >&5
11784   (exit $ac_status); } &&
11785          { ac_try='test -s conftest.$ac_objext'
11786   { (eval echo "$as_me:11786: \"$ac_try\"") >&5
11787   (eval $ac_try) 2>&5
11788   ac_status=$?
11789   echo "$as_me:11789: \$? = $ac_status" >&5
11790   (exit $ac_status); }; }; then
11791   cf_cv_posix_visible=no
11792 else
11793   echo "$as_me: failed program was:" >&5
11794 cat conftest.$ac_ext >&5
11795 cf_cv_posix_visible=yes
11796 fi
11797 rm -f conftest.$ac_objext conftest.$ac_ext
11798
11799 fi
11800 echo "$as_me:11800: result: $cf_cv_posix_visible" >&5
11801 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11802
11803 if test "$cf_cv_posix_visible" = no; then
11804
11805 cf_XOPEN_SOURCE=600
11806 cf_POSIX_C_SOURCE=199506L
11807 cf_xopen_source=
11808
11809 case $host_os in
11810 (aix[4-7]*)
11811         cf_xopen_source="-D_ALL_SOURCE"
11812         ;;
11813 (msys)
11814         cf_XOPEN_SOURCE=600
11815         ;;
11816 (darwin[0-8].*)
11817         cf_xopen_source="-D_APPLE_C_SOURCE"
11818         ;;
11819 (darwin*)
11820         cf_xopen_source="-D_DARWIN_C_SOURCE"
11821         cf_XOPEN_SOURCE=
11822         ;;
11823 (freebsd*|dragonfly*|midnightbsd*)
11824         # 5.x headers associate
11825         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11826         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11827         cf_POSIX_C_SOURCE=200112L
11828         cf_XOPEN_SOURCE=600
11829         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11830         ;;
11831 (hpux11*)
11832         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11833         ;;
11834 (hpux*)
11835         cf_xopen_source="-D_HPUX_SOURCE"
11836         ;;
11837 (irix[56].*)
11838         cf_xopen_source="-D_SGI_SOURCE"
11839         cf_XOPEN_SOURCE=
11840         ;;
11841 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11842
11843 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11844
11845 echo "$as_me:11845: checking if this is the GNU C library" >&5
11846 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11847 if test "${cf_cv_gnu_library+set}" = set; then
11848   echo $ECHO_N "(cached) $ECHO_C" >&6
11849 else
11850
11851 cat >conftest.$ac_ext <<_ACEOF
11852 #line 11852 "configure"
11853 #include "confdefs.h"
11854 #include <sys/types.h>
11855 int
11856 main (void)
11857 {
11858
11859         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11860                 return 0;
11861         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11862                 return 0;
11863         #else
11864         #       error not GNU C library
11865         #endif
11866   ;
11867   return 0;
11868 }
11869 _ACEOF
11870 rm -f conftest.$ac_objext
11871 if { (eval echo "$as_me:11871: \"$ac_compile\"") >&5
11872   (eval $ac_compile) 2>&5
11873   ac_status=$?
11874   echo "$as_me:11874: \$? = $ac_status" >&5
11875   (exit $ac_status); } &&
11876          { ac_try='test -s conftest.$ac_objext'
11877   { (eval echo "$as_me:11877: \"$ac_try\"") >&5
11878   (eval $ac_try) 2>&5
11879   ac_status=$?
11880   echo "$as_me:11880: \$? = $ac_status" >&5
11881   (exit $ac_status); }; }; then
11882   cf_cv_gnu_library=yes
11883 else
11884   echo "$as_me: failed program was:" >&5
11885 cat conftest.$ac_ext >&5
11886 cf_cv_gnu_library=no
11887 fi
11888 rm -f conftest.$ac_objext conftest.$ac_ext
11889
11890 fi
11891 echo "$as_me:11891: result: $cf_cv_gnu_library" >&5
11892 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11893
11894 if test x$cf_cv_gnu_library = xyes; then
11895
11896         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11897         # was changed to help a little.  newlib incorporated the change about 4
11898         # years later.
11899         echo "$as_me:11899: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11900 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11901 if test "${cf_cv_gnu_library_219+set}" = set; then
11902   echo $ECHO_N "(cached) $ECHO_C" >&6
11903 else
11904
11905                 cf_save="$CPPFLAGS"
11906
11907         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11908         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11909
11910                 cat >conftest.$ac_ext <<_ACEOF
11911 #line 11911 "configure"
11912 #include "confdefs.h"
11913 #include <sys/types.h>
11914 int
11915 main (void)
11916 {
11917
11918                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11919                                 return 0;
11920                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11921                                 return 0;
11922                         #else
11923                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11924                         #endif
11925   ;
11926   return 0;
11927 }
11928 _ACEOF
11929 rm -f conftest.$ac_objext
11930 if { (eval echo "$as_me:11930: \"$ac_compile\"") >&5
11931   (eval $ac_compile) 2>&5
11932   ac_status=$?
11933   echo "$as_me:11933: \$? = $ac_status" >&5
11934   (exit $ac_status); } &&
11935          { ac_try='test -s conftest.$ac_objext'
11936   { (eval echo "$as_me:11936: \"$ac_try\"") >&5
11937   (eval $ac_try) 2>&5
11938   ac_status=$?
11939   echo "$as_me:11939: \$? = $ac_status" >&5
11940   (exit $ac_status); }; }; then
11941   cf_cv_gnu_library_219=yes
11942 else
11943   echo "$as_me: failed program was:" >&5
11944 cat conftest.$ac_ext >&5
11945 cf_cv_gnu_library_219=no
11946 fi
11947 rm -f conftest.$ac_objext conftest.$ac_ext
11948                 CPPFLAGS="$cf_save"
11949
11950 fi
11951 echo "$as_me:11951: result: $cf_cv_gnu_library_219" >&5
11952 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11953
11954         if test "x$cf_cv_gnu_library_219" = xyes; then
11955                 cf_save="$CPPFLAGS"
11956                 echo "$as_me:11956: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11957 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11958 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11959   echo $ECHO_N "(cached) $ECHO_C" >&6
11960 else
11961
11962 cf_fix_cppflags=no
11963 cf_new_cflags=
11964 cf_new_cppflags=
11965 cf_new_extra_cppflags=
11966
11967 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11968 do
11969 case $cf_fix_cppflags in
11970 (no)
11971         case $cf_add_cflags in
11972         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11973                 case $cf_add_cflags in
11974                 (-D*)
11975                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11976
11977                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11978                                 && test -z "${cf_tst_cflags}" \
11979                                 && cf_fix_cppflags=yes
11980
11981                         if test $cf_fix_cppflags = yes ; then
11982
11983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11985
11986                                 continue
11987                         elif test "${cf_tst_cflags}" = "\"'" ; then
11988
11989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11991
11992                                 continue
11993                         fi
11994                         ;;
11995                 esac
11996                 case "$CPPFLAGS" in
11997                 (*$cf_add_cflags)
11998                         ;;
11999                 (*)
12000                         case $cf_add_cflags in
12001                         (-D*)
12002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12003
12004 CPPFLAGS=`echo "$CPPFLAGS" | \
12005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12007
12008                                 ;;
12009                         esac
12010
12011         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12012         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12013
12014                         ;;
12015                 esac
12016                 ;;
12017         (*)
12018
12019         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12020         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12021
12022                 ;;
12023         esac
12024         ;;
12025 (yes)
12026
12027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12029
12030         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12031
12032         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12033                 && test -z "${cf_tst_cflags}" \
12034                 && cf_fix_cppflags=no
12035         ;;
12036 esac
12037 done
12038
12039 if test -n "$cf_new_cflags" ; then
12040
12041         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12042         CFLAGS="${CFLAGS}$cf_new_cflags"
12043
12044 fi
12045
12046 if test -n "$cf_new_cppflags" ; then
12047
12048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12049         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12050
12051 fi
12052
12053 if test -n "$cf_new_extra_cppflags" ; then
12054
12055         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12056         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12057
12058 fi
12059
12060                         cat >conftest.$ac_ext <<_ACEOF
12061 #line 12061 "configure"
12062 #include "confdefs.h"
12063
12064                                 #include <limits.h>
12065                                 #include <sys/types.h>
12066
12067 int
12068 main (void)
12069 {
12070
12071                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12072                                         return 0;
12073                                 #else
12074                                 #       error GNU C library is too old
12075                                 #endif
12076   ;
12077   return 0;
12078 }
12079 _ACEOF
12080 rm -f conftest.$ac_objext
12081 if { (eval echo "$as_me:12081: \"$ac_compile\"") >&5
12082   (eval $ac_compile) 2>&5
12083   ac_status=$?
12084   echo "$as_me:12084: \$? = $ac_status" >&5
12085   (exit $ac_status); } &&
12086          { ac_try='test -s conftest.$ac_objext'
12087   { (eval echo "$as_me:12087: \"$ac_try\"") >&5
12088   (eval $ac_try) 2>&5
12089   ac_status=$?
12090   echo "$as_me:12090: \$? = $ac_status" >&5
12091   (exit $ac_status); }; }; then
12092   cf_cv_gnu_dftsrc_219=yes
12093 else
12094   echo "$as_me: failed program was:" >&5
12095 cat conftest.$ac_ext >&5
12096 cf_cv_gnu_dftsrc_219=no
12097 fi
12098 rm -f conftest.$ac_objext conftest.$ac_ext
12099
12100 fi
12101 echo "$as_me:12101: result: $cf_cv_gnu_dftsrc_219" >&5
12102 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12103                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12104         else
12105                 cf_cv_gnu_dftsrc_219=maybe
12106         fi
12107
12108         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12109
12110                 echo "$as_me:12110: checking if we must define _GNU_SOURCE" >&5
12111 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12112 if test "${cf_cv_gnu_source+set}" = set; then
12113   echo $ECHO_N "(cached) $ECHO_C" >&6
12114 else
12115
12116                 cat >conftest.$ac_ext <<_ACEOF
12117 #line 12117 "configure"
12118 #include "confdefs.h"
12119 #include <sys/types.h>
12120 int
12121 main (void)
12122 {
12123
12124                         #ifndef _XOPEN_SOURCE
12125                         #error  expected _XOPEN_SOURCE to be defined
12126                         #endif
12127   ;
12128   return 0;
12129 }
12130 _ACEOF
12131 rm -f conftest.$ac_objext
12132 if { (eval echo "$as_me:12132: \"$ac_compile\"") >&5
12133   (eval $ac_compile) 2>&5
12134   ac_status=$?
12135   echo "$as_me:12135: \$? = $ac_status" >&5
12136   (exit $ac_status); } &&
12137          { ac_try='test -s conftest.$ac_objext'
12138   { (eval echo "$as_me:12138: \"$ac_try\"") >&5
12139   (eval $ac_try) 2>&5
12140   ac_status=$?
12141   echo "$as_me:12141: \$? = $ac_status" >&5
12142   (exit $ac_status); }; }; then
12143   cf_cv_gnu_source=no
12144 else
12145   echo "$as_me: failed program was:" >&5
12146 cat conftest.$ac_ext >&5
12147 cf_save="$CPPFLAGS"
12148
12149 cf_fix_cppflags=no
12150 cf_new_cflags=
12151 cf_new_cppflags=
12152 cf_new_extra_cppflags=
12153
12154 for cf_add_cflags in -D_GNU_SOURCE
12155 do
12156 case $cf_fix_cppflags in
12157 (no)
12158         case $cf_add_cflags in
12159         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12160                 case $cf_add_cflags in
12161                 (-D*)
12162                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12163
12164                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12165                                 && test -z "${cf_tst_cflags}" \
12166                                 && cf_fix_cppflags=yes
12167
12168                         if test $cf_fix_cppflags = yes ; then
12169
12170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12172
12173                                 continue
12174                         elif test "${cf_tst_cflags}" = "\"'" ; then
12175
12176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12178
12179                                 continue
12180                         fi
12181                         ;;
12182                 esac
12183                 case "$CPPFLAGS" in
12184                 (*$cf_add_cflags)
12185                         ;;
12186                 (*)
12187                         case $cf_add_cflags in
12188                         (-D*)
12189                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12190
12191 CPPFLAGS=`echo "$CPPFLAGS" | \
12192         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12193                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12194
12195                                 ;;
12196                         esac
12197
12198         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12199         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12200
12201                         ;;
12202                 esac
12203                 ;;
12204         (*)
12205
12206         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12207         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12208
12209                 ;;
12210         esac
12211         ;;
12212 (yes)
12213
12214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12216
12217         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12218
12219         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12220                 && test -z "${cf_tst_cflags}" \
12221                 && cf_fix_cppflags=no
12222         ;;
12223 esac
12224 done
12225
12226 if test -n "$cf_new_cflags" ; then
12227
12228         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12229         CFLAGS="${CFLAGS}$cf_new_cflags"
12230
12231 fi
12232
12233 if test -n "$cf_new_cppflags" ; then
12234
12235         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12236         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12237
12238 fi
12239
12240 if test -n "$cf_new_extra_cppflags" ; then
12241
12242         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12243         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12244
12245 fi
12246
12247                          cat >conftest.$ac_ext <<_ACEOF
12248 #line 12248 "configure"
12249 #include "confdefs.h"
12250 #include <sys/types.h>
12251 int
12252 main (void)
12253 {
12254
12255                                 #ifdef _XOPEN_SOURCE
12256                                 #error  expected _XOPEN_SOURCE to be undefined
12257                                 #endif
12258   ;
12259   return 0;
12260 }
12261 _ACEOF
12262 rm -f conftest.$ac_objext
12263 if { (eval echo "$as_me:12263: \"$ac_compile\"") >&5
12264   (eval $ac_compile) 2>&5
12265   ac_status=$?
12266   echo "$as_me:12266: \$? = $ac_status" >&5
12267   (exit $ac_status); } &&
12268          { ac_try='test -s conftest.$ac_objext'
12269   { (eval echo "$as_me:12269: \"$ac_try\"") >&5
12270   (eval $ac_try) 2>&5
12271   ac_status=$?
12272   echo "$as_me:12272: \$? = $ac_status" >&5
12273   (exit $ac_status); }; }; then
12274   cf_cv_gnu_source=no
12275 else
12276   echo "$as_me: failed program was:" >&5
12277 cat conftest.$ac_ext >&5
12278 cf_cv_gnu_source=yes
12279 fi
12280 rm -f conftest.$ac_objext conftest.$ac_ext
12281                         CPPFLAGS="$cf_save"
12282
12283 fi
12284 rm -f conftest.$ac_objext conftest.$ac_ext
12285
12286 fi
12287 echo "$as_me:12287: result: $cf_cv_gnu_source" >&5
12288 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12289
12290                 if test "$cf_cv_gnu_source" = yes
12291                 then
12292                 echo "$as_me:12292: checking if we should also define _DEFAULT_SOURCE" >&5
12293 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12294 if test "${cf_cv_default_source+set}" = set; then
12295   echo $ECHO_N "(cached) $ECHO_C" >&6
12296 else
12297
12298         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12299         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12300
12301                         cat >conftest.$ac_ext <<_ACEOF
12302 #line 12302 "configure"
12303 #include "confdefs.h"
12304 #include <sys/types.h>
12305 int
12306 main (void)
12307 {
12308
12309                                 #ifdef _DEFAULT_SOURCE
12310                                 #error  expected _DEFAULT_SOURCE to be undefined
12311                                 #endif
12312   ;
12313   return 0;
12314 }
12315 _ACEOF
12316 rm -f conftest.$ac_objext
12317 if { (eval echo "$as_me:12317: \"$ac_compile\"") >&5
12318   (eval $ac_compile) 2>&5
12319   ac_status=$?
12320   echo "$as_me:12320: \$? = $ac_status" >&5
12321   (exit $ac_status); } &&
12322          { ac_try='test -s conftest.$ac_objext'
12323   { (eval echo "$as_me:12323: \"$ac_try\"") >&5
12324   (eval $ac_try) 2>&5
12325   ac_status=$?
12326   echo "$as_me:12326: \$? = $ac_status" >&5
12327   (exit $ac_status); }; }; then
12328   cf_cv_default_source=no
12329 else
12330   echo "$as_me: failed program was:" >&5
12331 cat conftest.$ac_ext >&5
12332 cf_cv_default_source=yes
12333 fi
12334 rm -f conftest.$ac_objext conftest.$ac_ext
12335
12336 fi
12337 echo "$as_me:12337: result: $cf_cv_default_source" >&5
12338 echo "${ECHO_T}$cf_cv_default_source" >&6
12339                         if test "$cf_cv_default_source" = yes
12340                         then
12341
12342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12343         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12344
12345                         fi
12346                 fi
12347         fi
12348
12349 fi
12350
12351         ;;
12352 (minix*)
12353         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12354         ;;
12355 (mirbsd*)
12356         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12357         cf_XOPEN_SOURCE=
12358
12359 if test "$cf_cv_posix_visible" = no; then
12360
12361 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12362
12363 cf_save_CFLAGS="$CFLAGS"
12364 cf_save_CPPFLAGS="$CPPFLAGS"
12365
12366 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12367         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12368                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12369
12370 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12371         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12372                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12373
12374 echo "$as_me:12374: checking if we should define _POSIX_C_SOURCE" >&5
12375 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12376 if test "${cf_cv_posix_c_source+set}" = set; then
12377   echo $ECHO_N "(cached) $ECHO_C" >&6
12378 else
12379
12380 echo "${as_me:-configure}:12380: testing if the symbol is already defined go no further ..." 1>&5
12381
12382         cat >conftest.$ac_ext <<_ACEOF
12383 #line 12383 "configure"
12384 #include "confdefs.h"
12385 #include <sys/types.h>
12386 int
12387 main (void)
12388 {
12389
12390 #ifndef _POSIX_C_SOURCE
12391 make an error
12392 #endif
12393   ;
12394   return 0;
12395 }
12396 _ACEOF
12397 rm -f conftest.$ac_objext
12398 if { (eval echo "$as_me:12398: \"$ac_compile\"") >&5
12399   (eval $ac_compile) 2>&5
12400   ac_status=$?
12401   echo "$as_me:12401: \$? = $ac_status" >&5
12402   (exit $ac_status); } &&
12403          { ac_try='test -s conftest.$ac_objext'
12404   { (eval echo "$as_me:12404: \"$ac_try\"") >&5
12405   (eval $ac_try) 2>&5
12406   ac_status=$?
12407   echo "$as_me:12407: \$? = $ac_status" >&5
12408   (exit $ac_status); }; }; then
12409   cf_cv_posix_c_source=no
12410 else
12411   echo "$as_me: failed program was:" >&5
12412 cat conftest.$ac_ext >&5
12413 cf_want_posix_source=no
12414          case .$cf_POSIX_C_SOURCE in
12415          (.[12]??*)
12416                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12417                 ;;
12418          (.2)
12419                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12420                 cf_want_posix_source=yes
12421                 ;;
12422          (.*)
12423                 cf_want_posix_source=yes
12424                 ;;
12425          esac
12426          if test "$cf_want_posix_source" = yes ; then
12427                 cat >conftest.$ac_ext <<_ACEOF
12428 #line 12428 "configure"
12429 #include "confdefs.h"
12430 #include <sys/types.h>
12431 int
12432 main (void)
12433 {
12434
12435 #ifdef _POSIX_SOURCE
12436 make an error
12437 #endif
12438   ;
12439   return 0;
12440 }
12441 _ACEOF
12442 rm -f conftest.$ac_objext
12443 if { (eval echo "$as_me:12443: \"$ac_compile\"") >&5
12444   (eval $ac_compile) 2>&5
12445   ac_status=$?
12446   echo "$as_me:12446: \$? = $ac_status" >&5
12447   (exit $ac_status); } &&
12448          { ac_try='test -s conftest.$ac_objext'
12449   { (eval echo "$as_me:12449: \"$ac_try\"") >&5
12450   (eval $ac_try) 2>&5
12451   ac_status=$?
12452   echo "$as_me:12452: \$? = $ac_status" >&5
12453   (exit $ac_status); }; }; then
12454   :
12455 else
12456   echo "$as_me: failed program was:" >&5
12457 cat conftest.$ac_ext >&5
12458 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12459 fi
12460 rm -f conftest.$ac_objext conftest.$ac_ext
12461          fi
12462
12463 echo "${as_me:-configure}:12463: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12464
12465          CFLAGS="$cf_trim_CFLAGS"
12466          CPPFLAGS="$cf_trim_CPPFLAGS"
12467
12468         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12469         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12470
12471 echo "${as_me:-configure}:12471: testing if the second compile does not leave our definition intact error ..." 1>&5
12472
12473          cat >conftest.$ac_ext <<_ACEOF
12474 #line 12474 "configure"
12475 #include "confdefs.h"
12476 #include <sys/types.h>
12477 int
12478 main (void)
12479 {
12480
12481 #ifndef _POSIX_C_SOURCE
12482 make an error
12483 #endif
12484   ;
12485   return 0;
12486 }
12487 _ACEOF
12488 rm -f conftest.$ac_objext
12489 if { (eval echo "$as_me:12489: \"$ac_compile\"") >&5
12490   (eval $ac_compile) 2>&5
12491   ac_status=$?
12492   echo "$as_me:12492: \$? = $ac_status" >&5
12493   (exit $ac_status); } &&
12494          { ac_try='test -s conftest.$ac_objext'
12495   { (eval echo "$as_me:12495: \"$ac_try\"") >&5
12496   (eval $ac_try) 2>&5
12497   ac_status=$?
12498   echo "$as_me:12498: \$? = $ac_status" >&5
12499   (exit $ac_status); }; }; then
12500   :
12501 else
12502   echo "$as_me: failed program was:" >&5
12503 cat conftest.$ac_ext >&5
12504 cf_cv_posix_c_source=no
12505 fi
12506 rm -f conftest.$ac_objext conftest.$ac_ext
12507          CFLAGS="$cf_save_CFLAGS"
12508          CPPFLAGS="$cf_save_CPPFLAGS"
12509
12510 fi
12511 rm -f conftest.$ac_objext conftest.$ac_ext
12512
12513 fi
12514 echo "$as_me:12514: result: $cf_cv_posix_c_source" >&5
12515 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12516
12517 if test "$cf_cv_posix_c_source" != no ; then
12518         CFLAGS="$cf_trim_CFLAGS"
12519         CPPFLAGS="$cf_trim_CPPFLAGS"
12520
12521 cf_fix_cppflags=no
12522 cf_new_cflags=
12523 cf_new_cppflags=
12524 cf_new_extra_cppflags=
12525
12526 for cf_add_cflags in $cf_cv_posix_c_source
12527 do
12528 case $cf_fix_cppflags in
12529 (no)
12530         case $cf_add_cflags in
12531         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12532                 case $cf_add_cflags in
12533                 (-D*)
12534                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12535
12536                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12537                                 && test -z "${cf_tst_cflags}" \
12538                                 && cf_fix_cppflags=yes
12539
12540                         if test $cf_fix_cppflags = yes ; then
12541
12542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12544
12545                                 continue
12546                         elif test "${cf_tst_cflags}" = "\"'" ; then
12547
12548         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12549         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12550
12551                                 continue
12552                         fi
12553                         ;;
12554                 esac
12555                 case "$CPPFLAGS" in
12556                 (*$cf_add_cflags)
12557                         ;;
12558                 (*)
12559                         case $cf_add_cflags in
12560                         (-D*)
12561                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12562
12563 CPPFLAGS=`echo "$CPPFLAGS" | \
12564         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12565                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12566
12567                                 ;;
12568                         esac
12569
12570         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12571         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12572
12573                         ;;
12574                 esac
12575                 ;;
12576         (*)
12577
12578         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12579         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12580
12581                 ;;
12582         esac
12583         ;;
12584 (yes)
12585
12586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12588
12589         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12590
12591         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12592                 && test -z "${cf_tst_cflags}" \
12593                 && cf_fix_cppflags=no
12594         ;;
12595 esac
12596 done
12597
12598 if test -n "$cf_new_cflags" ; then
12599
12600         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12601         CFLAGS="${CFLAGS}$cf_new_cflags"
12602
12603 fi
12604
12605 if test -n "$cf_new_cppflags" ; then
12606
12607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12608         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12609
12610 fi
12611
12612 if test -n "$cf_new_extra_cppflags" ; then
12613
12614         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12615         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12616
12617 fi
12618
12619 fi
12620
12621 fi # cf_cv_posix_visible
12622
12623         ;;
12624 (netbsd*)
12625         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12626         ;;
12627 (openbsd[4-9]*)
12628         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12629         cf_xopen_source="-D_BSD_SOURCE"
12630         cf_XOPEN_SOURCE=600
12631         ;;
12632 (openbsd*)
12633         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12634         ;;
12635 (osf[45]*)
12636         cf_xopen_source="-D_OSF_SOURCE"
12637         ;;
12638 (nto-qnx*)
12639         cf_xopen_source="-D_QNX_SOURCE"
12640         ;;
12641 (sco*)
12642         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12643         ;;
12644 (solaris2.*)
12645         cf_xopen_source="-D__EXTENSIONS__"
12646         cf_cv_xopen_source=broken
12647         ;;
12648 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12649         cf_XOPEN_SOURCE=
12650         cf_POSIX_C_SOURCE=
12651         ;;
12652 (*)
12653
12654 echo "$as_me:12654: checking if we should define _XOPEN_SOURCE" >&5
12655 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12656 if test "${cf_cv_xopen_source+set}" = set; then
12657   echo $ECHO_N "(cached) $ECHO_C" >&6
12658 else
12659
12660         cat >conftest.$ac_ext <<_ACEOF
12661 #line 12661 "configure"
12662 #include "confdefs.h"
12663
12664 #include <stdlib.h>
12665 #include <string.h>
12666 #include <sys/types.h>
12667
12668 int
12669 main (void)
12670 {
12671
12672 #ifndef _XOPEN_SOURCE
12673 make an error
12674 #endif
12675   ;
12676   return 0;
12677 }
12678 _ACEOF
12679 rm -f conftest.$ac_objext
12680 if { (eval echo "$as_me:12680: \"$ac_compile\"") >&5
12681   (eval $ac_compile) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit $ac_status); } &&
12685          { ac_try='test -s conftest.$ac_objext'
12686   { (eval echo "$as_me:12686: \"$ac_try\"") >&5
12687   (eval $ac_try) 2>&5
12688   ac_status=$?
12689   echo "$as_me:12689: \$? = $ac_status" >&5
12690   (exit $ac_status); }; }; then
12691   cf_cv_xopen_source=no
12692 else
12693   echo "$as_me: failed program was:" >&5
12694 cat conftest.$ac_ext >&5
12695 cf_save="$CPPFLAGS"
12696
12697         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12698         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12699
12700          cat >conftest.$ac_ext <<_ACEOF
12701 #line 12701 "configure"
12702 #include "confdefs.h"
12703
12704 #include <stdlib.h>
12705 #include <string.h>
12706 #include <sys/types.h>
12707
12708 int
12709 main (void)
12710 {
12711
12712 #ifdef _XOPEN_SOURCE
12713 make an error
12714 #endif
12715   ;
12716   return 0;
12717 }
12718 _ACEOF
12719 rm -f conftest.$ac_objext
12720 if { (eval echo "$as_me:12720: \"$ac_compile\"") >&5
12721   (eval $ac_compile) 2>&5
12722   ac_status=$?
12723   echo "$as_me:12723: \$? = $ac_status" >&5
12724   (exit $ac_status); } &&
12725          { ac_try='test -s conftest.$ac_objext'
12726   { (eval echo "$as_me:12726: \"$ac_try\"") >&5
12727   (eval $ac_try) 2>&5
12728   ac_status=$?
12729   echo "$as_me:12729: \$? = $ac_status" >&5
12730   (exit $ac_status); }; }; then
12731   cf_cv_xopen_source=no
12732 else
12733   echo "$as_me: failed program was:" >&5
12734 cat conftest.$ac_ext >&5
12735 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12736 fi
12737 rm -f conftest.$ac_objext conftest.$ac_ext
12738         CPPFLAGS="$cf_save"
12739
12740 fi
12741 rm -f conftest.$ac_objext conftest.$ac_ext
12742
12743 fi
12744 echo "$as_me:12744: result: $cf_cv_xopen_source" >&5
12745 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12746
12747 if test "$cf_cv_xopen_source" != no ; then
12748
12749 CFLAGS=`echo "$CFLAGS" | \
12750         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12751                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12752
12753 CPPFLAGS=`echo "$CPPFLAGS" | \
12754         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12755                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12756
12757         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12758
12759 cf_fix_cppflags=no
12760 cf_new_cflags=
12761 cf_new_cppflags=
12762 cf_new_extra_cppflags=
12763
12764 for cf_add_cflags in $cf_temp_xopen_source
12765 do
12766 case $cf_fix_cppflags in
12767 (no)
12768         case $cf_add_cflags in
12769         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12770                 case $cf_add_cflags in
12771                 (-D*)
12772                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12773
12774                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12775                                 && test -z "${cf_tst_cflags}" \
12776                                 && cf_fix_cppflags=yes
12777
12778                         if test $cf_fix_cppflags = yes ; then
12779
12780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12782
12783                                 continue
12784                         elif test "${cf_tst_cflags}" = "\"'" ; then
12785
12786         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12787         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12788
12789                                 continue
12790                         fi
12791                         ;;
12792                 esac
12793                 case "$CPPFLAGS" in
12794                 (*$cf_add_cflags)
12795                         ;;
12796                 (*)
12797                         case $cf_add_cflags in
12798                         (-D*)
12799                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12800
12801 CPPFLAGS=`echo "$CPPFLAGS" | \
12802         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12803                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12804
12805                                 ;;
12806                         esac
12807
12808         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12809         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12810
12811                         ;;
12812                 esac
12813                 ;;
12814         (*)
12815
12816         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12817         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12818
12819                 ;;
12820         esac
12821         ;;
12822 (yes)
12823
12824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12826
12827         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12828
12829         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12830                 && test -z "${cf_tst_cflags}" \
12831                 && cf_fix_cppflags=no
12832         ;;
12833 esac
12834 done
12835
12836 if test -n "$cf_new_cflags" ; then
12837
12838         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12839         CFLAGS="${CFLAGS}$cf_new_cflags"
12840
12841 fi
12842
12843 if test -n "$cf_new_cppflags" ; then
12844
12845         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12846         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12847
12848 fi
12849
12850 if test -n "$cf_new_extra_cppflags" ; then
12851
12852         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12853         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12854
12855 fi
12856
12857 fi
12858
12859 if test "$cf_cv_posix_visible" = no; then
12860
12861 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12862
12863 cf_save_CFLAGS="$CFLAGS"
12864 cf_save_CPPFLAGS="$CPPFLAGS"
12865
12866 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12867         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12868                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12869
12870 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12871         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12872                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12873
12874 echo "$as_me:12874: checking if we should define _POSIX_C_SOURCE" >&5
12875 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12876 if test "${cf_cv_posix_c_source+set}" = set; then
12877   echo $ECHO_N "(cached) $ECHO_C" >&6
12878 else
12879
12880 echo "${as_me:-configure}:12880: testing if the symbol is already defined go no further ..." 1>&5
12881
12882         cat >conftest.$ac_ext <<_ACEOF
12883 #line 12883 "configure"
12884 #include "confdefs.h"
12885 #include <sys/types.h>
12886 int
12887 main (void)
12888 {
12889
12890 #ifndef _POSIX_C_SOURCE
12891 make an error
12892 #endif
12893   ;
12894   return 0;
12895 }
12896 _ACEOF
12897 rm -f conftest.$ac_objext
12898 if { (eval echo "$as_me:12898: \"$ac_compile\"") >&5
12899   (eval $ac_compile) 2>&5
12900   ac_status=$?
12901   echo "$as_me:12901: \$? = $ac_status" >&5
12902   (exit $ac_status); } &&
12903          { ac_try='test -s conftest.$ac_objext'
12904   { (eval echo "$as_me:12904: \"$ac_try\"") >&5
12905   (eval $ac_try) 2>&5
12906   ac_status=$?
12907   echo "$as_me:12907: \$? = $ac_status" >&5
12908   (exit $ac_status); }; }; then
12909   cf_cv_posix_c_source=no
12910 else
12911   echo "$as_me: failed program was:" >&5
12912 cat conftest.$ac_ext >&5
12913 cf_want_posix_source=no
12914          case .$cf_POSIX_C_SOURCE in
12915          (.[12]??*)
12916                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12917                 ;;
12918          (.2)
12919                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12920                 cf_want_posix_source=yes
12921                 ;;
12922          (.*)
12923                 cf_want_posix_source=yes
12924                 ;;
12925          esac
12926          if test "$cf_want_posix_source" = yes ; then
12927                 cat >conftest.$ac_ext <<_ACEOF
12928 #line 12928 "configure"
12929 #include "confdefs.h"
12930 #include <sys/types.h>
12931 int
12932 main (void)
12933 {
12934
12935 #ifdef _POSIX_SOURCE
12936 make an error
12937 #endif
12938   ;
12939   return 0;
12940 }
12941 _ACEOF
12942 rm -f conftest.$ac_objext
12943 if { (eval echo "$as_me:12943: \"$ac_compile\"") >&5
12944   (eval $ac_compile) 2>&5
12945   ac_status=$?
12946   echo "$as_me:12946: \$? = $ac_status" >&5
12947   (exit $ac_status); } &&
12948          { ac_try='test -s conftest.$ac_objext'
12949   { (eval echo "$as_me:12949: \"$ac_try\"") >&5
12950   (eval $ac_try) 2>&5
12951   ac_status=$?
12952   echo "$as_me:12952: \$? = $ac_status" >&5
12953   (exit $ac_status); }; }; then
12954   :
12955 else
12956   echo "$as_me: failed program was:" >&5
12957 cat conftest.$ac_ext >&5
12958 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12959 fi
12960 rm -f conftest.$ac_objext conftest.$ac_ext
12961          fi
12962
12963 echo "${as_me:-configure}:12963: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12964
12965          CFLAGS="$cf_trim_CFLAGS"
12966          CPPFLAGS="$cf_trim_CPPFLAGS"
12967
12968         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12969         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12970
12971 echo "${as_me:-configure}:12971: testing if the second compile does not leave our definition intact error ..." 1>&5
12972
12973          cat >conftest.$ac_ext <<_ACEOF
12974 #line 12974 "configure"
12975 #include "confdefs.h"
12976 #include <sys/types.h>
12977 int
12978 main (void)
12979 {
12980
12981 #ifndef _POSIX_C_SOURCE
12982 make an error
12983 #endif
12984   ;
12985   return 0;
12986 }
12987 _ACEOF
12988 rm -f conftest.$ac_objext
12989 if { (eval echo "$as_me:12989: \"$ac_compile\"") >&5
12990   (eval $ac_compile) 2>&5
12991   ac_status=$?
12992   echo "$as_me:12992: \$? = $ac_status" >&5
12993   (exit $ac_status); } &&
12994          { ac_try='test -s conftest.$ac_objext'
12995   { (eval echo "$as_me:12995: \"$ac_try\"") >&5
12996   (eval $ac_try) 2>&5
12997   ac_status=$?
12998   echo "$as_me:12998: \$? = $ac_status" >&5
12999   (exit $ac_status); }; }; then
13000   :
13001 else
13002   echo "$as_me: failed program was:" >&5
13003 cat conftest.$ac_ext >&5
13004 cf_cv_posix_c_source=no
13005 fi
13006 rm -f conftest.$ac_objext conftest.$ac_ext
13007          CFLAGS="$cf_save_CFLAGS"
13008          CPPFLAGS="$cf_save_CPPFLAGS"
13009
13010 fi
13011 rm -f conftest.$ac_objext conftest.$ac_ext
13012
13013 fi
13014 echo "$as_me:13014: result: $cf_cv_posix_c_source" >&5
13015 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13016
13017 if test "$cf_cv_posix_c_source" != no ; then
13018         CFLAGS="$cf_trim_CFLAGS"
13019         CPPFLAGS="$cf_trim_CPPFLAGS"
13020
13021 cf_fix_cppflags=no
13022 cf_new_cflags=
13023 cf_new_cppflags=
13024 cf_new_extra_cppflags=
13025
13026 for cf_add_cflags in $cf_cv_posix_c_source
13027 do
13028 case $cf_fix_cppflags in
13029 (no)
13030         case $cf_add_cflags in
13031         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13032                 case $cf_add_cflags in
13033                 (-D*)
13034                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13035
13036                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13037                                 && test -z "${cf_tst_cflags}" \
13038                                 && cf_fix_cppflags=yes
13039
13040                         if test $cf_fix_cppflags = yes ; then
13041
13042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13044
13045                                 continue
13046                         elif test "${cf_tst_cflags}" = "\"'" ; then
13047
13048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13050
13051                                 continue
13052                         fi
13053                         ;;
13054                 esac
13055                 case "$CPPFLAGS" in
13056                 (*$cf_add_cflags)
13057                         ;;
13058                 (*)
13059                         case $cf_add_cflags in
13060                         (-D*)
13061                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13062
13063 CPPFLAGS=`echo "$CPPFLAGS" | \
13064         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13065                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13066
13067                                 ;;
13068                         esac
13069
13070         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13071         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13072
13073                         ;;
13074                 esac
13075                 ;;
13076         (*)
13077
13078         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13079         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13080
13081                 ;;
13082         esac
13083         ;;
13084 (yes)
13085
13086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13088
13089         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13090
13091         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13092                 && test -z "${cf_tst_cflags}" \
13093                 && cf_fix_cppflags=no
13094         ;;
13095 esac
13096 done
13097
13098 if test -n "$cf_new_cflags" ; then
13099
13100         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13101         CFLAGS="${CFLAGS}$cf_new_cflags"
13102
13103 fi
13104
13105 if test -n "$cf_new_cppflags" ; then
13106
13107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13108         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13109
13110 fi
13111
13112 if test -n "$cf_new_extra_cppflags" ; then
13113
13114         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13115         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13116
13117 fi
13118
13119 fi
13120
13121 fi # cf_cv_posix_visible
13122
13123         ;;
13124 esac
13125
13126 if test -n "$cf_xopen_source" ; then
13127
13128 cf_fix_cppflags=no
13129 cf_new_cflags=
13130 cf_new_cppflags=
13131 cf_new_extra_cppflags=
13132
13133 for cf_add_cflags in $cf_xopen_source
13134 do
13135 case $cf_fix_cppflags in
13136 (no)
13137         case $cf_add_cflags in
13138         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13139                 case $cf_add_cflags in
13140                 (-D*)
13141                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13142
13143                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13144                                 && test -z "${cf_tst_cflags}" \
13145                                 && cf_fix_cppflags=yes
13146
13147                         if test $cf_fix_cppflags = yes ; then
13148
13149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13151
13152                                 continue
13153                         elif test "${cf_tst_cflags}" = "\"'" ; then
13154
13155         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13156         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13157
13158                                 continue
13159                         fi
13160                         ;;
13161                 esac
13162                 case "$CPPFLAGS" in
13163                 (*$cf_add_cflags)
13164                         ;;
13165                 (*)
13166                         case $cf_add_cflags in
13167                         (-D*)
13168                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13169
13170 CPPFLAGS=`echo "$CPPFLAGS" | \
13171         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13172                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13173
13174                                 ;;
13175                         esac
13176
13177         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13178         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13179
13180                         ;;
13181                 esac
13182                 ;;
13183         (*)
13184
13185         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13186         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13187
13188                 ;;
13189         esac
13190         ;;
13191 (yes)
13192
13193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13195
13196         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13197
13198         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13199                 && test -z "${cf_tst_cflags}" \
13200                 && cf_fix_cppflags=no
13201         ;;
13202 esac
13203 done
13204
13205 if test -n "$cf_new_cflags" ; then
13206         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13207
13208 echo "${as_me:-configure}:13208: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13209
13210         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13211         CFLAGS="${CFLAGS}$cf_new_cflags"
13212
13213 fi
13214
13215 if test -n "$cf_new_cppflags" ; then
13216         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13217
13218 echo "${as_me:-configure}:13218: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13219
13220         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13221         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13222
13223 fi
13224
13225 if test -n "$cf_new_extra_cppflags" ; then
13226         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13227
13228 echo "${as_me:-configure}:13228: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13229
13230         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13231         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13232
13233 fi
13234
13235 fi
13236
13237 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13238         echo "$as_me:13238: checking if _XOPEN_SOURCE really is set" >&5
13239 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13240         cat >conftest.$ac_ext <<_ACEOF
13241 #line 13241 "configure"
13242 #include "confdefs.h"
13243 #include <stdlib.h>
13244 int
13245 main (void)
13246 {
13247
13248 #ifndef _XOPEN_SOURCE
13249 make an error
13250 #endif
13251   ;
13252   return 0;
13253 }
13254 _ACEOF
13255 rm -f conftest.$ac_objext
13256 if { (eval echo "$as_me:13256: \"$ac_compile\"") >&5
13257   (eval $ac_compile) 2>&5
13258   ac_status=$?
13259   echo "$as_me:13259: \$? = $ac_status" >&5
13260   (exit $ac_status); } &&
13261          { ac_try='test -s conftest.$ac_objext'
13262   { (eval echo "$as_me:13262: \"$ac_try\"") >&5
13263   (eval $ac_try) 2>&5
13264   ac_status=$?
13265   echo "$as_me:13265: \$? = $ac_status" >&5
13266   (exit $ac_status); }; }; then
13267   cf_XOPEN_SOURCE_set=yes
13268 else
13269   echo "$as_me: failed program was:" >&5
13270 cat conftest.$ac_ext >&5
13271 cf_XOPEN_SOURCE_set=no
13272 fi
13273 rm -f conftest.$ac_objext conftest.$ac_ext
13274         echo "$as_me:13274: result: $cf_XOPEN_SOURCE_set" >&5
13275 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13276         if test $cf_XOPEN_SOURCE_set = yes
13277         then
13278                 cat >conftest.$ac_ext <<_ACEOF
13279 #line 13279 "configure"
13280 #include "confdefs.h"
13281 #include <stdlib.h>
13282 int
13283 main (void)
13284 {
13285
13286 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13287 make an error
13288 #endif
13289   ;
13290   return 0;
13291 }
13292 _ACEOF
13293 rm -f conftest.$ac_objext
13294 if { (eval echo "$as_me:13294: \"$ac_compile\"") >&5
13295   (eval $ac_compile) 2>&5
13296   ac_status=$?
13297   echo "$as_me:13297: \$? = $ac_status" >&5
13298   (exit $ac_status); } &&
13299          { ac_try='test -s conftest.$ac_objext'
13300   { (eval echo "$as_me:13300: \"$ac_try\"") >&5
13301   (eval $ac_try) 2>&5
13302   ac_status=$?
13303   echo "$as_me:13303: \$? = $ac_status" >&5
13304   (exit $ac_status); }; }; then
13305   cf_XOPEN_SOURCE_set_ok=yes
13306 else
13307   echo "$as_me: failed program was:" >&5
13308 cat conftest.$ac_ext >&5
13309 cf_XOPEN_SOURCE_set_ok=no
13310 fi
13311 rm -f conftest.$ac_objext conftest.$ac_ext
13312                 if test $cf_XOPEN_SOURCE_set_ok = no
13313                 then
13314                         { echo "$as_me:13314: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13315 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13316                 fi
13317         else
13318
13319 echo "$as_me:13319: checking if we should define _XOPEN_SOURCE" >&5
13320 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13321 if test "${cf_cv_xopen_source+set}" = set; then
13322   echo $ECHO_N "(cached) $ECHO_C" >&6
13323 else
13324
13325         cat >conftest.$ac_ext <<_ACEOF
13326 #line 13326 "configure"
13327 #include "confdefs.h"
13328
13329 #include <stdlib.h>
13330 #include <string.h>
13331 #include <sys/types.h>
13332
13333 int
13334 main (void)
13335 {
13336
13337 #ifndef _XOPEN_SOURCE
13338 make an error
13339 #endif
13340   ;
13341   return 0;
13342 }
13343 _ACEOF
13344 rm -f conftest.$ac_objext
13345 if { (eval echo "$as_me:13345: \"$ac_compile\"") >&5
13346   (eval $ac_compile) 2>&5
13347   ac_status=$?
13348   echo "$as_me:13348: \$? = $ac_status" >&5
13349   (exit $ac_status); } &&
13350          { ac_try='test -s conftest.$ac_objext'
13351   { (eval echo "$as_me:13351: \"$ac_try\"") >&5
13352   (eval $ac_try) 2>&5
13353   ac_status=$?
13354   echo "$as_me:13354: \$? = $ac_status" >&5
13355   (exit $ac_status); }; }; then
13356   cf_cv_xopen_source=no
13357 else
13358   echo "$as_me: failed program was:" >&5
13359 cat conftest.$ac_ext >&5
13360 cf_save="$CPPFLAGS"
13361
13362         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13363         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13364
13365          cat >conftest.$ac_ext <<_ACEOF
13366 #line 13366 "configure"
13367 #include "confdefs.h"
13368
13369 #include <stdlib.h>
13370 #include <string.h>
13371 #include <sys/types.h>
13372
13373 int
13374 main (void)
13375 {
13376
13377 #ifdef _XOPEN_SOURCE
13378 make an error
13379 #endif
13380   ;
13381   return 0;
13382 }
13383 _ACEOF
13384 rm -f conftest.$ac_objext
13385 if { (eval echo "$as_me:13385: \"$ac_compile\"") >&5
13386   (eval $ac_compile) 2>&5
13387   ac_status=$?
13388   echo "$as_me:13388: \$? = $ac_status" >&5
13389   (exit $ac_status); } &&
13390          { ac_try='test -s conftest.$ac_objext'
13391   { (eval echo "$as_me:13391: \"$ac_try\"") >&5
13392   (eval $ac_try) 2>&5
13393   ac_status=$?
13394   echo "$as_me:13394: \$? = $ac_status" >&5
13395   (exit $ac_status); }; }; then
13396   cf_cv_xopen_source=no
13397 else
13398   echo "$as_me: failed program was:" >&5
13399 cat conftest.$ac_ext >&5
13400 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13401 fi
13402 rm -f conftest.$ac_objext conftest.$ac_ext
13403         CPPFLAGS="$cf_save"
13404
13405 fi
13406 rm -f conftest.$ac_objext conftest.$ac_ext
13407
13408 fi
13409 echo "$as_me:13409: result: $cf_cv_xopen_source" >&5
13410 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13411
13412 if test "$cf_cv_xopen_source" != no ; then
13413
13414 CFLAGS=`echo "$CFLAGS" | \
13415         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13416                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13417
13418 CPPFLAGS=`echo "$CPPFLAGS" | \
13419         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13420                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13421
13422         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13423
13424 cf_fix_cppflags=no
13425 cf_new_cflags=
13426 cf_new_cppflags=
13427 cf_new_extra_cppflags=
13428
13429 for cf_add_cflags in $cf_temp_xopen_source
13430 do
13431 case $cf_fix_cppflags in
13432 (no)
13433         case $cf_add_cflags in
13434         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13435                 case $cf_add_cflags in
13436                 (-D*)
13437                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13438
13439                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13440                                 && test -z "${cf_tst_cflags}" \
13441                                 && cf_fix_cppflags=yes
13442
13443                         if test $cf_fix_cppflags = yes ; then
13444
13445         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13446         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13447
13448                                 continue
13449                         elif test "${cf_tst_cflags}" = "\"'" ; then
13450
13451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13453
13454                                 continue
13455                         fi
13456                         ;;
13457                 esac
13458                 case "$CPPFLAGS" in
13459                 (*$cf_add_cflags)
13460                         ;;
13461                 (*)
13462                         case $cf_add_cflags in
13463                         (-D*)
13464                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13465
13466 CPPFLAGS=`echo "$CPPFLAGS" | \
13467         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13468                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13469
13470                                 ;;
13471                         esac
13472
13473         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13474         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13475
13476                         ;;
13477                 esac
13478                 ;;
13479         (*)
13480
13481         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13482         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13483
13484                 ;;
13485         esac
13486         ;;
13487 (yes)
13488
13489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13491
13492         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13493
13494         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13495                 && test -z "${cf_tst_cflags}" \
13496                 && cf_fix_cppflags=no
13497         ;;
13498 esac
13499 done
13500
13501 if test -n "$cf_new_cflags" ; then
13502
13503         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13504         CFLAGS="${CFLAGS}$cf_new_cflags"
13505
13506 fi
13507
13508 if test -n "$cf_new_cppflags" ; then
13509
13510         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13511         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13512
13513 fi
13514
13515 if test -n "$cf_new_extra_cppflags" ; then
13516
13517         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13518         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13519
13520 fi
13521
13522 fi
13523
13524         fi
13525 fi
13526 fi # cf_cv_posix_visible
13527
13528 # Check whether --enable-largefile or --disable-largefile was given.
13529 if test "${enable_largefile+set}" = set; then
13530   enableval="$enable_largefile"
13531
13532 fi;
13533 if test "$enable_largefile" != no; then
13534
13535   echo "$as_me:13535: checking for special C compiler options needed for large files" >&5
13536 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13537 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13538   echo $ECHO_N "(cached) $ECHO_C" >&6
13539 else
13540   ac_cv_sys_largefile_CC=no
13541      if test "$GCC" != yes; then
13542        ac_save_CC=$CC
13543        while :; do
13544          # IRIX 6.2 and later do not support large files by default,
13545          # so use the C compiler's -n32 option if that helps.
13546          cat >conftest.$ac_ext <<_ACEOF
13547 #line 13547 "configure"
13548 #include "confdefs.h"
13549 #include <sys/types.h>
13550  /* Check that off_t can represent 2**63 - 1 correctly.
13551     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13552     since some C++ compilers masquerading as C compilers
13553     incorrectly reject 9223372036854775807.  */
13554 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13555   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13556                        && LARGE_OFF_T % 2147483647 == 1)
13557                       ? 1 : -1];
13558 int
13559 main (void)
13560 {
13561
13562   ;
13563   return 0;
13564 }
13565 _ACEOF
13566          rm -f conftest.$ac_objext
13567 if { (eval echo "$as_me:13567: \"$ac_compile\"") >&5
13568   (eval $ac_compile) 2>&5
13569   ac_status=$?
13570   echo "$as_me:13570: \$? = $ac_status" >&5
13571   (exit $ac_status); } &&
13572          { ac_try='test -s conftest.$ac_objext'
13573   { (eval echo "$as_me:13573: \"$ac_try\"") >&5
13574   (eval $ac_try) 2>&5
13575   ac_status=$?
13576   echo "$as_me:13576: \$? = $ac_status" >&5
13577   (exit $ac_status); }; }; then
13578   break
13579 else
13580   echo "$as_me: failed program was:" >&5
13581 cat conftest.$ac_ext >&5
13582 fi
13583 rm -f conftest.$ac_objext
13584          CC="$CC -n32"
13585          rm -f conftest.$ac_objext
13586 if { (eval echo "$as_me:13586: \"$ac_compile\"") >&5
13587   (eval $ac_compile) 2>&5
13588   ac_status=$?
13589   echo "$as_me:13589: \$? = $ac_status" >&5
13590   (exit $ac_status); } &&
13591          { ac_try='test -s conftest.$ac_objext'
13592   { (eval echo "$as_me:13592: \"$ac_try\"") >&5
13593   (eval $ac_try) 2>&5
13594   ac_status=$?
13595   echo "$as_me:13595: \$? = $ac_status" >&5
13596   (exit $ac_status); }; }; then
13597   ac_cv_sys_largefile_CC=' -n32'; break
13598 else
13599   echo "$as_me: failed program was:" >&5
13600 cat conftest.$ac_ext >&5
13601 fi
13602 rm -f conftest.$ac_objext
13603          break
13604        done
13605        CC=$ac_save_CC
13606        rm -f conftest.$ac_ext
13607     fi
13608 fi
13609 echo "$as_me:13609: result: $ac_cv_sys_largefile_CC" >&5
13610 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13611   if test "$ac_cv_sys_largefile_CC" != no; then
13612     CC=$CC$ac_cv_sys_largefile_CC
13613   fi
13614
13615   echo "$as_me:13615: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13616 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13617 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13618   echo $ECHO_N "(cached) $ECHO_C" >&6
13619 else
13620   while :; do
13621   ac_cv_sys_file_offset_bits=no
13622   cat >conftest.$ac_ext <<_ACEOF
13623 #line 13623 "configure"
13624 #include "confdefs.h"
13625 #include <sys/types.h>
13626  /* Check that off_t can represent 2**63 - 1 correctly.
13627     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13628     since some C++ compilers masquerading as C compilers
13629     incorrectly reject 9223372036854775807.  */
13630 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13631   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13632                        && LARGE_OFF_T % 2147483647 == 1)
13633                       ? 1 : -1];
13634 int
13635 main (void)
13636 {
13637
13638   ;
13639   return 0;
13640 }
13641 _ACEOF
13642 rm -f conftest.$ac_objext
13643 if { (eval echo "$as_me:13643: \"$ac_compile\"") >&5
13644   (eval $ac_compile) 2>&5
13645   ac_status=$?
13646   echo "$as_me:13646: \$? = $ac_status" >&5
13647   (exit $ac_status); } &&
13648          { ac_try='test -s conftest.$ac_objext'
13649   { (eval echo "$as_me:13649: \"$ac_try\"") >&5
13650   (eval $ac_try) 2>&5
13651   ac_status=$?
13652   echo "$as_me:13652: \$? = $ac_status" >&5
13653   (exit $ac_status); }; }; then
13654   break
13655 else
13656   echo "$as_me: failed program was:" >&5
13657 cat conftest.$ac_ext >&5
13658 fi
13659 rm -f conftest.$ac_objext conftest.$ac_ext
13660   cat >conftest.$ac_ext <<_ACEOF
13661 #line 13661 "configure"
13662 #include "confdefs.h"
13663 #define _FILE_OFFSET_BITS 64
13664 #include <sys/types.h>
13665  /* Check that off_t can represent 2**63 - 1 correctly.
13666     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13667     since some C++ compilers masquerading as C compilers
13668     incorrectly reject 9223372036854775807.  */
13669 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13670   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13671                        && LARGE_OFF_T % 2147483647 == 1)
13672                       ? 1 : -1];
13673 int
13674 main (void)
13675 {
13676
13677   ;
13678   return 0;
13679 }
13680 _ACEOF
13681 rm -f conftest.$ac_objext
13682 if { (eval echo "$as_me:13682: \"$ac_compile\"") >&5
13683   (eval $ac_compile) 2>&5
13684   ac_status=$?
13685   echo "$as_me:13685: \$? = $ac_status" >&5
13686   (exit $ac_status); } &&
13687          { ac_try='test -s conftest.$ac_objext'
13688   { (eval echo "$as_me:13688: \"$ac_try\"") >&5
13689   (eval $ac_try) 2>&5
13690   ac_status=$?
13691   echo "$as_me:13691: \$? = $ac_status" >&5
13692   (exit $ac_status); }; }; then
13693   ac_cv_sys_file_offset_bits=64; break
13694 else
13695   echo "$as_me: failed program was:" >&5
13696 cat conftest.$ac_ext >&5
13697 fi
13698 rm -f conftest.$ac_objext conftest.$ac_ext
13699   break
13700 done
13701 fi
13702 echo "$as_me:13702: result: $ac_cv_sys_file_offset_bits" >&5
13703 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13704 if test "$ac_cv_sys_file_offset_bits" != no; then
13705
13706 cat >>confdefs.h <<EOF
13707 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13708 EOF
13709
13710 fi
13711 rm -rf conftest*
13712   echo "$as_me:13712: checking for _LARGE_FILES value needed for large files" >&5
13713 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13714 if test "${ac_cv_sys_large_files+set}" = set; then
13715   echo $ECHO_N "(cached) $ECHO_C" >&6
13716 else
13717   while :; do
13718   ac_cv_sys_large_files=no
13719   cat >conftest.$ac_ext <<_ACEOF
13720 #line 13720 "configure"
13721 #include "confdefs.h"
13722 #include <sys/types.h>
13723  /* Check that off_t can represent 2**63 - 1 correctly.
13724     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13725     since some C++ compilers masquerading as C compilers
13726     incorrectly reject 9223372036854775807.  */
13727 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13728   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13729                        && LARGE_OFF_T % 2147483647 == 1)
13730                       ? 1 : -1];
13731 int
13732 main (void)
13733 {
13734
13735   ;
13736   return 0;
13737 }
13738 _ACEOF
13739 rm -f conftest.$ac_objext
13740 if { (eval echo "$as_me:13740: \"$ac_compile\"") >&5
13741   (eval $ac_compile) 2>&5
13742   ac_status=$?
13743   echo "$as_me:13743: \$? = $ac_status" >&5
13744   (exit $ac_status); } &&
13745          { ac_try='test -s conftest.$ac_objext'
13746   { (eval echo "$as_me:13746: \"$ac_try\"") >&5
13747   (eval $ac_try) 2>&5
13748   ac_status=$?
13749   echo "$as_me:13749: \$? = $ac_status" >&5
13750   (exit $ac_status); }; }; then
13751   break
13752 else
13753   echo "$as_me: failed program was:" >&5
13754 cat conftest.$ac_ext >&5
13755 fi
13756 rm -f conftest.$ac_objext conftest.$ac_ext
13757   cat >conftest.$ac_ext <<_ACEOF
13758 #line 13758 "configure"
13759 #include "confdefs.h"
13760 #define _LARGE_FILES 1
13761 #include <sys/types.h>
13762  /* Check that off_t can represent 2**63 - 1 correctly.
13763     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13764     since some C++ compilers masquerading as C compilers
13765     incorrectly reject 9223372036854775807.  */
13766 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13767   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13768                        && LARGE_OFF_T % 2147483647 == 1)
13769                       ? 1 : -1];
13770 int
13771 main (void)
13772 {
13773
13774   ;
13775   return 0;
13776 }
13777 _ACEOF
13778 rm -f conftest.$ac_objext
13779 if { (eval echo "$as_me:13779: \"$ac_compile\"") >&5
13780   (eval $ac_compile) 2>&5
13781   ac_status=$?
13782   echo "$as_me:13782: \$? = $ac_status" >&5
13783   (exit $ac_status); } &&
13784          { ac_try='test -s conftest.$ac_objext'
13785   { (eval echo "$as_me:13785: \"$ac_try\"") >&5
13786   (eval $ac_try) 2>&5
13787   ac_status=$?
13788   echo "$as_me:13788: \$? = $ac_status" >&5
13789   (exit $ac_status); }; }; then
13790   ac_cv_sys_large_files=1; break
13791 else
13792   echo "$as_me: failed program was:" >&5
13793 cat conftest.$ac_ext >&5
13794 fi
13795 rm -f conftest.$ac_objext conftest.$ac_ext
13796   break
13797 done
13798 fi
13799 echo "$as_me:13799: result: $ac_cv_sys_large_files" >&5
13800 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13801 if test "$ac_cv_sys_large_files" != no; then
13802
13803 cat >>confdefs.h <<EOF
13804 #define _LARGE_FILES $ac_cv_sys_large_files
13805 EOF
13806
13807 fi
13808 rm -rf conftest*
13809 fi
13810
13811         if test "$enable_largefile" != no ; then
13812         echo "$as_me:13812: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13813 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13814 if test "${ac_cv_sys_largefile_source+set}" = set; then
13815   echo $ECHO_N "(cached) $ECHO_C" >&6
13816 else
13817   while :; do
13818   ac_cv_sys_largefile_source=no
13819   cat >conftest.$ac_ext <<_ACEOF
13820 #line 13820 "configure"
13821 #include "confdefs.h"
13822 #include <stdio.h>
13823 int
13824 main (void)
13825 {
13826 return !fseeko;
13827   ;
13828   return 0;
13829 }
13830 _ACEOF
13831 rm -f conftest.$ac_objext
13832 if { (eval echo "$as_me:13832: \"$ac_compile\"") >&5
13833   (eval $ac_compile) 2>&5
13834   ac_status=$?
13835   echo "$as_me:13835: \$? = $ac_status" >&5
13836   (exit $ac_status); } &&
13837          { ac_try='test -s conftest.$ac_objext'
13838   { (eval echo "$as_me:13838: \"$ac_try\"") >&5
13839   (eval $ac_try) 2>&5
13840   ac_status=$?
13841   echo "$as_me:13841: \$? = $ac_status" >&5
13842   (exit $ac_status); }; }; then
13843   break
13844 else
13845   echo "$as_me: failed program was:" >&5
13846 cat conftest.$ac_ext >&5
13847 fi
13848 rm -f conftest.$ac_objext conftest.$ac_ext
13849   cat >conftest.$ac_ext <<_ACEOF
13850 #line 13850 "configure"
13851 #include "confdefs.h"
13852 #define _LARGEFILE_SOURCE 1
13853 #include <stdio.h>
13854 int
13855 main (void)
13856 {
13857 return !fseeko;
13858   ;
13859   return 0;
13860 }
13861 _ACEOF
13862 rm -f conftest.$ac_objext
13863 if { (eval echo "$as_me:13863: \"$ac_compile\"") >&5
13864   (eval $ac_compile) 2>&5
13865   ac_status=$?
13866   echo "$as_me:13866: \$? = $ac_status" >&5
13867   (exit $ac_status); } &&
13868          { ac_try='test -s conftest.$ac_objext'
13869   { (eval echo "$as_me:13869: \"$ac_try\"") >&5
13870   (eval $ac_try) 2>&5
13871   ac_status=$?
13872   echo "$as_me:13872: \$? = $ac_status" >&5
13873   (exit $ac_status); }; }; then
13874   ac_cv_sys_largefile_source=1; break
13875 else
13876   echo "$as_me: failed program was:" >&5
13877 cat conftest.$ac_ext >&5
13878 fi
13879 rm -f conftest.$ac_objext conftest.$ac_ext
13880   break
13881 done
13882 fi
13883 echo "$as_me:13883: result: $ac_cv_sys_largefile_source" >&5
13884 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13885 if test "$ac_cv_sys_largefile_source" != no; then
13886
13887 cat >>confdefs.h <<EOF
13888 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13889 EOF
13890
13891 fi
13892 rm -rf conftest*
13893
13894 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13895 # in glibc 2.1.3, but that breaks too many other things.
13896 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13897 echo "$as_me:13897: checking for fseeko" >&5
13898 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13899 if test "${ac_cv_func_fseeko+set}" = set; then
13900   echo $ECHO_N "(cached) $ECHO_C" >&6
13901 else
13902   cat >conftest.$ac_ext <<_ACEOF
13903 #line 13903 "configure"
13904 #include "confdefs.h"
13905 #include <stdio.h>
13906 int
13907 main (void)
13908 {
13909 return fseeko && fseeko (stdin, 0, 0);
13910   ;
13911   return 0;
13912 }
13913 _ACEOF
13914 rm -f conftest.$ac_objext conftest$ac_exeext
13915 if { (eval echo "$as_me:13915: \"$ac_link\"") >&5
13916   (eval $ac_link) 2>&5
13917   ac_status=$?
13918   echo "$as_me:13918: \$? = $ac_status" >&5
13919   (exit $ac_status); } &&
13920          { ac_try='test -s conftest$ac_exeext'
13921   { (eval echo "$as_me:13921: \"$ac_try\"") >&5
13922   (eval $ac_try) 2>&5
13923   ac_status=$?
13924   echo "$as_me:13924: \$? = $ac_status" >&5
13925   (exit $ac_status); }; }; then
13926   ac_cv_func_fseeko=yes
13927 else
13928   echo "$as_me: failed program was:" >&5
13929 cat conftest.$ac_ext >&5
13930 ac_cv_func_fseeko=no
13931 fi
13932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13933 fi
13934 echo "$as_me:13934: result: $ac_cv_func_fseeko" >&5
13935 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13936 if test $ac_cv_func_fseeko = yes; then
13937
13938 cat >>confdefs.h <<\EOF
13939 #define HAVE_FSEEKO 1
13940 EOF
13941
13942 fi
13943
13944         # Normally we would collect these definitions in the config.h,
13945         # but (like _XOPEN_SOURCE), some environments rely on having these
13946         # defined before any of the system headers are included.  Another
13947         # case comes up with C++, e.g., on AIX the compiler compiles the
13948         # header files by themselves before looking at the body files it is
13949         # told to compile.  For ncurses, those header files do not include
13950         # the config.h
13951         if test "$ac_cv_sys_large_files" != no
13952         then
13953
13954         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13955         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13956
13957         fi
13958         if test "$ac_cv_sys_largefile_source" != no
13959         then
13960
13961         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13962         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13963
13964         fi
13965         if test "$ac_cv_sys_file_offset_bits" != no
13966         then
13967
13968         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13969         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13970
13971         fi
13972
13973         echo "$as_me:13973: checking whether to use struct dirent64" >&5
13974 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13975 if test "${cf_cv_struct_dirent64+set}" = set; then
13976   echo $ECHO_N "(cached) $ECHO_C" >&6
13977 else
13978
13979                 cat >conftest.$ac_ext <<_ACEOF
13980 #line 13980 "configure"
13981 #include "confdefs.h"
13982
13983 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13984 #include <sys/types.h>
13985 #include <dirent.h>
13986
13987 int
13988 main (void)
13989 {
13990
13991                 /* if transitional largefile support is setup, this is true */
13992                 extern struct dirent64 * readdir(DIR *);
13993                 struct dirent64 *x = readdir((DIR *)0);
13994                 struct dirent *y = readdir((DIR *)0);
13995                 int z = x - y;
13996                 (void)z;
13997
13998   ;
13999   return 0;
14000 }
14001 _ACEOF
14002 rm -f conftest.$ac_objext
14003 if { (eval echo "$as_me:14003: \"$ac_compile\"") >&5
14004   (eval $ac_compile) 2>&5
14005   ac_status=$?
14006   echo "$as_me:14006: \$? = $ac_status" >&5
14007   (exit $ac_status); } &&
14008          { ac_try='test -s conftest.$ac_objext'
14009   { (eval echo "$as_me:14009: \"$ac_try\"") >&5
14010   (eval $ac_try) 2>&5
14011   ac_status=$?
14012   echo "$as_me:14012: \$? = $ac_status" >&5
14013   (exit $ac_status); }; }; then
14014   cf_cv_struct_dirent64=yes
14015 else
14016   echo "$as_me: failed program was:" >&5
14017 cat conftest.$ac_ext >&5
14018 cf_cv_struct_dirent64=no
14019 fi
14020 rm -f conftest.$ac_objext conftest.$ac_ext
14021
14022 fi
14023 echo "$as_me:14023: result: $cf_cv_struct_dirent64" >&5
14024 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14025         test "$cf_cv_struct_dirent64" = yes &&
14026 cat >>confdefs.h <<\EOF
14027 #define HAVE_STRUCT_DIRENT64 1
14028 EOF
14029
14030         fi
14031
14032 ### Enable compiling-in rcs id's
14033 echo "$as_me:14033: checking if RCS identifiers should be compiled-in" >&5
14034 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14035
14036 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14037 if test "${with_rcs_ids+set}" = set; then
14038   withval="$with_rcs_ids"
14039   with_rcs_ids=$withval
14040 else
14041   with_rcs_ids=no
14042 fi;
14043 echo "$as_me:14043: result: $with_rcs_ids" >&5
14044 echo "${ECHO_T}$with_rcs_ids" >&6
14045 test "$with_rcs_ids" = yes &&
14046 cat >>confdefs.h <<\EOF
14047 #define USE_RCS_IDS 1
14048 EOF
14049
14050 ###############################################################################
14051
14052 ### Note that some functions (such as const) are normally disabled anyway.
14053 echo "$as_me:14053: checking if you want to build with function extensions" >&5
14054 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14055
14056 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14057 if test "${enable_ext_funcs+set}" = set; then
14058   enableval="$enable_ext_funcs"
14059   with_ext_funcs=$enableval
14060 else
14061   with_ext_funcs=yes
14062 fi;
14063 echo "$as_me:14063: result: $with_ext_funcs" >&5
14064 echo "${ECHO_T}$with_ext_funcs" >&6
14065 if test "$with_ext_funcs" = yes ; then
14066         NCURSES_EXT_FUNCS=1
14067
14068 cat >>confdefs.h <<\EOF
14069 #define HAVE_USE_DEFAULT_COLORS 1
14070 EOF
14071
14072 cat >>confdefs.h <<\EOF
14073 #define NCURSES_EXT_FUNCS 1
14074 EOF
14075
14076 else
14077         NCURSES_EXT_FUNCS=0
14078 fi
14079
14080 ###   use option --enable-const to turn on use of const beyond that in XSI.
14081 echo "$as_me:14081: checking for extended use of const keyword" >&5
14082 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14083
14084 # Check whether --enable-const or --disable-const was given.
14085 if test "${enable_const+set}" = set; then
14086   enableval="$enable_const"
14087   with_ext_const=$enableval
14088 else
14089   with_ext_const=no
14090 fi;
14091 echo "$as_me:14091: result: $with_ext_const" >&5
14092 echo "${ECHO_T}$with_ext_const" >&6
14093 NCURSES_CONST='/*nothing*/'
14094 if test "$with_ext_const" = yes ; then
14095         NCURSES_CONST=const
14096 fi
14097
14098 ###############################################################################
14099 # These options are relatively safe to experiment with.
14100
14101 echo "$as_me:14101: checking if you want all development code" >&5
14102 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14103
14104 # Check whether --with-develop or --without-develop was given.
14105 if test "${with_develop+set}" = set; then
14106   withval="$with_develop"
14107   with_develop=$withval
14108 else
14109   with_develop=no
14110 fi;
14111 echo "$as_me:14111: result: $with_develop" >&5
14112 echo "${ECHO_T}$with_develop" >&6
14113
14114 ###############################################################################
14115 # These are just experimental, probably should not be in a package:
14116
14117 # This is still experimental (20080329), but should ultimately be moved to
14118 # the script-block --with-normal, etc.
14119
14120 echo "$as_me:14120: checking if you want to link with the pthread library" >&5
14121 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14122
14123 # Check whether --with-pthread or --without-pthread was given.
14124 if test "${with_pthread+set}" = set; then
14125   withval="$with_pthread"
14126   with_pthread=$withval
14127 else
14128   with_pthread=no
14129 fi;
14130 echo "$as_me:14130: result: $with_pthread" >&5
14131 echo "${ECHO_T}$with_pthread" >&6
14132
14133 if test "$with_pthread" != no ; then
14134         echo "$as_me:14134: checking for pthread.h" >&5
14135 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14136 if test "${ac_cv_header_pthread_h+set}" = set; then
14137   echo $ECHO_N "(cached) $ECHO_C" >&6
14138 else
14139   cat >conftest.$ac_ext <<_ACEOF
14140 #line 14140 "configure"
14141 #include "confdefs.h"
14142 #include <pthread.h>
14143 _ACEOF
14144 if { (eval echo "$as_me:14144: \"$ac_cpp conftest.$ac_ext\"") >&5
14145   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14146   ac_status=$?
14147   egrep -v '^ *\+' conftest.er1 >conftest.err
14148   rm -f conftest.er1
14149   cat conftest.err >&5
14150   echo "$as_me:14150: \$? = $ac_status" >&5
14151   (exit $ac_status); } >/dev/null; then
14152   if test -s conftest.err; then
14153     ac_cpp_err=$ac_c_preproc_warn_flag
14154   else
14155     ac_cpp_err=
14156   fi
14157 else
14158   ac_cpp_err=yes
14159 fi
14160 if test -z "$ac_cpp_err"; then
14161   ac_cv_header_pthread_h=yes
14162 else
14163   echo "$as_me: failed program was:" >&5
14164   cat conftest.$ac_ext >&5
14165   ac_cv_header_pthread_h=no
14166 fi
14167 rm -f conftest.err conftest.$ac_ext
14168 fi
14169 echo "$as_me:14169: result: $ac_cv_header_pthread_h" >&5
14170 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14171 if test $ac_cv_header_pthread_h = yes; then
14172
14173 cat >>confdefs.h <<\EOF
14174 #define HAVE_PTHREADS_H 1
14175 EOF
14176
14177         for cf_lib_pthread in pthread c_r
14178         do
14179             echo "$as_me:14179: checking if we can link with the $cf_lib_pthread library" >&5
14180 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14181             cf_save_LIBS="$LIBS"
14182
14183 cf_add_libs="$LIBS"
14184 # reverse order
14185 cf_add_0lib=
14186 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14187 # filter duplicates
14188 for cf_add_1lib in $cf_add_0lib; do
14189         for cf_add_2lib in $cf_add_libs; do
14190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14191                         cf_add_1lib=
14192                         break
14193                 fi
14194         done
14195         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14196 done
14197 LIBS="$cf_add_libs"
14198
14199             cat >conftest.$ac_ext <<_ACEOF
14200 #line 14200 "configure"
14201 #include "confdefs.h"
14202
14203 #include <pthread.h>
14204
14205 int
14206 main (void)
14207 {
14208
14209                 int rc = pthread_create(0,0,0,0);
14210                 int r2 = pthread_mutexattr_settype(0, 0);
14211
14212   ;
14213   return 0;
14214 }
14215 _ACEOF
14216 rm -f conftest.$ac_objext conftest$ac_exeext
14217 if { (eval echo "$as_me:14217: \"$ac_link\"") >&5
14218   (eval $ac_link) 2>&5
14219   ac_status=$?
14220   echo "$as_me:14220: \$? = $ac_status" >&5
14221   (exit $ac_status); } &&
14222          { ac_try='test -s conftest$ac_exeext'
14223   { (eval echo "$as_me:14223: \"$ac_try\"") >&5
14224   (eval $ac_try) 2>&5
14225   ac_status=$?
14226   echo "$as_me:14226: \$? = $ac_status" >&5
14227   (exit $ac_status); }; }; then
14228   with_pthread=yes
14229 else
14230   echo "$as_me: failed program was:" >&5
14231 cat conftest.$ac_ext >&5
14232 with_pthread=no
14233 fi
14234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14235             LIBS="$cf_save_LIBS"
14236             echo "$as_me:14236: result: $with_pthread" >&5
14237 echo "${ECHO_T}$with_pthread" >&6
14238             test "$with_pthread" = yes && break
14239         done
14240
14241         if test "$with_pthread" = yes ; then
14242
14243 cf_add_libs="$LIBS"
14244 # reverse order
14245 cf_add_0lib=
14246 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14247 # filter duplicates
14248 for cf_add_1lib in $cf_add_0lib; do
14249         for cf_add_2lib in $cf_add_libs; do
14250                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14251                         cf_add_1lib=
14252                         break
14253                 fi
14254         done
14255         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14256 done
14257 LIBS="$cf_add_libs"
14258
14259 cat >>confdefs.h <<\EOF
14260 #define HAVE_LIBPTHREADS 1
14261 EOF
14262
14263         else
14264             { { echo "$as_me:14264: error: Cannot link with pthread library" >&5
14265 echo "$as_me: error: Cannot link with pthread library" >&2;}
14266    { (exit 1); exit 1; }; }
14267         fi
14268
14269 fi
14270
14271 fi
14272
14273 echo "$as_me:14273: checking if you want to use weak-symbols for pthreads" >&5
14274 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14275
14276 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14277 if test "${enable_weak_symbols+set}" = set; then
14278   enableval="$enable_weak_symbols"
14279   use_weak_symbols=$withval
14280 else
14281   use_weak_symbols=no
14282 fi;
14283 echo "$as_me:14283: result: $use_weak_symbols" >&5
14284 echo "${ECHO_T}$use_weak_symbols" >&6
14285 if test "$use_weak_symbols" = yes ; then
14286
14287 echo "$as_me:14287: checking if $CC supports weak symbols" >&5
14288 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14289 if test "${cf_cv_weak_symbols+set}" = set; then
14290   echo $ECHO_N "(cached) $ECHO_C" >&6
14291 else
14292
14293 cat >conftest.$ac_ext <<_ACEOF
14294 #line 14294 "configure"
14295 #include "confdefs.h"
14296
14297 #include <stdio.h>
14298 int
14299 main (void)
14300 {
14301
14302 #if defined(__GNUC__)
14303 #  if defined __USE_ISOC99
14304 #    define _cat_pragma(exp)    _Pragma(#exp)
14305 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14306 #  else
14307 #    define _weak_pragma(exp)
14308 #  endif
14309 #  define _declare(name)        __extension__ extern __typeof__(name) name
14310 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14311 #endif
14312
14313 weak_symbol(fopen);
14314
14315   ;
14316   return 0;
14317 }
14318 _ACEOF
14319 rm -f conftest.$ac_objext
14320 if { (eval echo "$as_me:14320: \"$ac_compile\"") >&5
14321   (eval $ac_compile) 2>&5
14322   ac_status=$?
14323   echo "$as_me:14323: \$? = $ac_status" >&5
14324   (exit $ac_status); } &&
14325          { ac_try='test -s conftest.$ac_objext'
14326   { (eval echo "$as_me:14326: \"$ac_try\"") >&5
14327   (eval $ac_try) 2>&5
14328   ac_status=$?
14329   echo "$as_me:14329: \$? = $ac_status" >&5
14330   (exit $ac_status); }; }; then
14331   cf_cv_weak_symbols=yes
14332 else
14333   echo "$as_me: failed program was:" >&5
14334 cat conftest.$ac_ext >&5
14335 cf_cv_weak_symbols=no
14336 fi
14337 rm -f conftest.$ac_objext conftest.$ac_ext
14338
14339 fi
14340 echo "$as_me:14340: result: $cf_cv_weak_symbols" >&5
14341 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14342
14343 else
14344         cf_cv_weak_symbols=no
14345 fi
14346
14347 if test $cf_cv_weak_symbols = yes ; then
14348
14349 cat >>confdefs.h <<\EOF
14350 #define USE_WEAK_SYMBOLS 1
14351 EOF
14352
14353 fi
14354
14355 PTHREAD=
14356 if test "$with_pthread" = "yes" ; then
14357
14358 cat >>confdefs.h <<\EOF
14359 #define USE_PTHREADS 1
14360 EOF
14361
14362         enable_reentrant=yes
14363         if test $cf_cv_weak_symbols = yes ; then
14364                 PTHREAD=-lpthread
14365         fi
14366 fi
14367
14368 # OpenSUSE is installing ncurses6, using reentrant option.
14369 echo "$as_me:14369: checking for _nc_TABSIZE" >&5
14370 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14371 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14372   echo $ECHO_N "(cached) $ECHO_C" >&6
14373 else
14374   cat >conftest.$ac_ext <<_ACEOF
14375 #line 14375 "configure"
14376 #include "confdefs.h"
14377 #define _nc_TABSIZE autoconf_temporary
14378 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14379 #undef _nc_TABSIZE
14380
14381 #ifdef __cplusplus
14382 extern "C"
14383 #endif
14384
14385 /* We use char because int might match the return type of a gcc2
14386    builtin and then its argument prototype would still apply.  */
14387 char _nc_TABSIZE (void);
14388
14389 int
14390 main (void)
14391 {
14392
14393 /* The GNU C library defines stubs for functions which it implements
14394     to always fail with ENOSYS.  Some functions are actually named
14395     something starting with __ and the normal name is an alias.  */
14396 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14397 #error found stub for _nc_TABSIZE
14398 #endif
14399
14400         return _nc_TABSIZE ();
14401   ;
14402   return 0;
14403 }
14404 _ACEOF
14405 rm -f conftest.$ac_objext conftest$ac_exeext
14406 if { (eval echo "$as_me:14406: \"$ac_link\"") >&5
14407   (eval $ac_link) 2>&5
14408   ac_status=$?
14409   echo "$as_me:14409: \$? = $ac_status" >&5
14410   (exit $ac_status); } &&
14411          { ac_try='test -s conftest$ac_exeext'
14412   { (eval echo "$as_me:14412: \"$ac_try\"") >&5
14413   (eval $ac_try) 2>&5
14414   ac_status=$?
14415   echo "$as_me:14415: \$? = $ac_status" >&5
14416   (exit $ac_status); }; }; then
14417   ac_cv_func__nc_TABSIZE=yes
14418 else
14419   echo "$as_me: failed program was:" >&5
14420 cat conftest.$ac_ext >&5
14421 ac_cv_func__nc_TABSIZE=no
14422 fi
14423 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14424 fi
14425 echo "$as_me:14425: result: $ac_cv_func__nc_TABSIZE" >&5
14426 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14427 if test $ac_cv_func__nc_TABSIZE = yes; then
14428   assume_reentrant=yes
14429 else
14430   assume_reentrant=no
14431 fi
14432
14433 # Reentrant code has to be opaque; there's little advantage to making ncurses
14434 # opaque outside of that, so there is no --enable-opaque option.  We can use
14435 # this option without --with-pthreads, but this will be always set for
14436 # pthreads.
14437 echo "$as_me:14437: checking if you want experimental reentrant code" >&5
14438 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14439
14440 # Check whether --enable-reentrant or --disable-reentrant was given.
14441 if test "${enable_reentrant+set}" = set; then
14442   enableval="$enable_reentrant"
14443   with_reentrant=$enableval
14444 else
14445   with_reentrant=$assume_reentrant
14446 fi;
14447 echo "$as_me:14447: result: $with_reentrant" >&5
14448 echo "${ECHO_T}$with_reentrant" >&6
14449 if test "$with_reentrant" = yes ; then
14450         cf_cv_enable_reentrant=1
14451         if test $cf_cv_weak_symbols = yes ; then
14452
14453 # remove pthread library from $LIBS
14454 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14455
14456         elif test "$assume_reentrant" = no ; then
14457                 LIB_SUFFIX="t${LIB_SUFFIX}"
14458         fi
14459
14460 cat >>confdefs.h <<\EOF
14461 #define USE_REENTRANT 1
14462 EOF
14463
14464 else
14465         cf_cv_enable_reentrant=0
14466 fi
14467
14468 ### Allow using a different wrap-prefix
14469 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14470         echo "$as_me:14470: checking for prefix used to wrap public variables" >&5
14471 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14472
14473 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14474 if test "${with_wrap_prefix+set}" = set; then
14475   withval="$with_wrap_prefix"
14476   NCURSES_WRAP_PREFIX=$withval
14477 else
14478   NCURSES_WRAP_PREFIX=_nc_
14479 fi;
14480         echo "$as_me:14480: result: $NCURSES_WRAP_PREFIX" >&5
14481 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14482 else
14483         NCURSES_WRAP_PREFIX=_nc_
14484 fi
14485
14486 cat >>confdefs.h <<EOF
14487 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14488 EOF
14489
14490 ###############################################################################
14491
14492 ###     use option --disable-echo to suppress full display compiling commands
14493
14494 echo "$as_me:14494: checking if you want to see long compiling messages" >&5
14495 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14496
14497 # Check whether --enable-echo or --disable-echo was given.
14498 if test "${enable_echo+set}" = set; then
14499   enableval="$enable_echo"
14500   test "$enableval" != no && enableval=yes
14501         if test "$enableval" != "yes" ; then
14502
14503         ECHO_LT='--silent'
14504         ECHO_LD='@echo linking $@;'
14505         RULE_CC='@echo compiling $<'
14506         SHOW_CC='@echo compiling $@'
14507         ECHO_CC='@'
14508
14509         else
14510
14511         ECHO_LT=''
14512         ECHO_LD=''
14513         RULE_CC=''
14514         SHOW_CC=''
14515         ECHO_CC=''
14516
14517         fi
14518 else
14519   enableval=yes
14520
14521         ECHO_LT=''
14522         ECHO_LD=''
14523         RULE_CC=''
14524         SHOW_CC=''
14525         ECHO_CC=''
14526
14527 fi;
14528 echo "$as_me:14528: result: $enableval" >&5
14529 echo "${ECHO_T}$enableval" >&6
14530
14531 ###     use option --enable-warnings to turn on all gcc warnings
14532 echo "$as_me:14532: checking if you want to see compiler warnings" >&5
14533 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14534
14535 # Check whether --enable-warnings or --disable-warnings was given.
14536 if test "${enable_warnings+set}" = set; then
14537   enableval="$enable_warnings"
14538   with_warnings=$enableval
14539 fi;
14540 echo "$as_me:14540: result: $with_warnings" >&5
14541 echo "${ECHO_T}$with_warnings" >&6
14542
14543 if ( test "$GCC" = yes || test "$GXX" = yes )
14544 then
14545
14546 if ( test "$GCC" = yes || test "$GXX" = yes )
14547 then
14548         case $CFLAGS in
14549         (*-Werror=*)
14550                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14551
14552 echo "${as_me:-configure}:14552: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14553
14554                 cf_temp_flags=
14555                 for cf_temp_scan in $CFLAGS
14556                 do
14557                         case "x$cf_temp_scan" in
14558                         (x-Werror=*)
14559
14560         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14561         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14562
14563                                 ;;
14564                         (*)
14565
14566         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14567         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14568
14569                                 ;;
14570                         esac
14571                 done
14572                 CFLAGS="$cf_temp_flags"
14573                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14574
14575 echo "${as_me:-configure}:14575: testing ... fixed $CFLAGS ..." 1>&5
14576
14577                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14578
14579 echo "${as_me:-configure}:14579: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14580
14581                 ;;
14582         esac
14583 fi
14584
14585 if ( test "$GCC" = yes || test "$GXX" = yes )
14586 then
14587         case $CPPFLAGS in
14588         (*-Werror=*)
14589                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14590
14591 echo "${as_me:-configure}:14591: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14592
14593                 cf_temp_flags=
14594                 for cf_temp_scan in $CPPFLAGS
14595                 do
14596                         case "x$cf_temp_scan" in
14597                         (x-Werror=*)
14598
14599         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14600         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14601
14602                                 ;;
14603                         (*)
14604
14605         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14606         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14607
14608                                 ;;
14609                         esac
14610                 done
14611                 CPPFLAGS="$cf_temp_flags"
14612                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14613
14614 echo "${as_me:-configure}:14614: testing ... fixed $CPPFLAGS ..." 1>&5
14615
14616                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14617
14618 echo "${as_me:-configure}:14618: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14619
14620                 ;;
14621         esac
14622 fi
14623
14624 if ( test "$GCC" = yes || test "$GXX" = yes )
14625 then
14626         case $LDFLAGS in
14627         (*-Werror=*)
14628                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14629
14630 echo "${as_me:-configure}:14630: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14631
14632                 cf_temp_flags=
14633                 for cf_temp_scan in $LDFLAGS
14634                 do
14635                         case "x$cf_temp_scan" in
14636                         (x-Werror=*)
14637
14638         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14639         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14640
14641                                 ;;
14642                         (*)
14643
14644         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14645         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14646
14647                                 ;;
14648                         esac
14649                 done
14650                 LDFLAGS="$cf_temp_flags"
14651                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14652
14653 echo "${as_me:-configure}:14653: testing ... fixed $LDFLAGS ..." 1>&5
14654
14655                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14656
14657 echo "${as_me:-configure}:14657: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14658
14659                 ;;
14660         esac
14661 fi
14662
14663 echo "$as_me:14663: checking if you want to turn on gcc warnings" >&5
14664 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14665
14666 # Check whether --enable-warnings or --disable-warnings was given.
14667 if test "${enable_warnings+set}" = set; then
14668   enableval="$enable_warnings"
14669   test "$enableval" != yes && enableval=no
14670         if test "$enableval" != "no" ; then
14671     with_warnings=yes
14672         else
14673                 with_warnings=no
14674         fi
14675 else
14676   enableval=no
14677         with_warnings=no
14678
14679 fi;
14680 echo "$as_me:14680: result: $with_warnings" >&5
14681 echo "${ECHO_T}$with_warnings" >&6
14682 if test "$with_warnings" = "yes"
14683 then
14684
14685 if test "x$have_x" = xyes; then
14686
14687 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14688 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14689 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14690 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14691 for cf_X_CFLAGS in $X_CFLAGS
14692 do
14693         case "x$cf_X_CFLAGS" in
14694         x-[IUD]*)
14695                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14696                 ;;
14697         *)
14698                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14699                 ;;
14700         esac
14701 done
14702
14703 cat >conftest.$ac_ext <<_ACEOF
14704 #line 14704 "configure"
14705 #include "confdefs.h"
14706
14707 #include <stdlib.h>
14708 #include <X11/Intrinsic.h>
14709
14710 int
14711 main (void)
14712 {
14713 String foo = malloc(1); (void)foo
14714   ;
14715   return 0;
14716 }
14717 _ACEOF
14718 rm -f conftest.$ac_objext
14719 if { (eval echo "$as_me:14719: \"$ac_compile\"") >&5
14720   (eval $ac_compile) 2>&5
14721   ac_status=$?
14722   echo "$as_me:14722: \$? = $ac_status" >&5
14723   (exit $ac_status); } &&
14724          { ac_try='test -s conftest.$ac_objext'
14725   { (eval echo "$as_me:14725: \"$ac_try\"") >&5
14726   (eval $ac_try) 2>&5
14727   ac_status=$?
14728   echo "$as_me:14728: \$? = $ac_status" >&5
14729   (exit $ac_status); }; }; then
14730
14731 echo "$as_me:14731: checking for X11/Xt const-feature" >&5
14732 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14733 if test "${cf_cv_const_x_string+set}" = set; then
14734   echo $ECHO_N "(cached) $ECHO_C" >&6
14735 else
14736
14737         cat >conftest.$ac_ext <<_ACEOF
14738 #line 14738 "configure"
14739 #include "confdefs.h"
14740
14741 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14742 #undef  XTSTRINGDEFINES /* X11R5 and later */
14743 #include <stdlib.h>
14744 #include <X11/Intrinsic.h>
14745
14746 int
14747 main (void)
14748 {
14749 String foo = malloc(1); *foo = 0
14750   ;
14751   return 0;
14752 }
14753 _ACEOF
14754 rm -f conftest.$ac_objext
14755 if { (eval echo "$as_me:14755: \"$ac_compile\"") >&5
14756   (eval $ac_compile) 2>&5
14757   ac_status=$?
14758   echo "$as_me:14758: \$? = $ac_status" >&5
14759   (exit $ac_status); } &&
14760          { ac_try='test -s conftest.$ac_objext'
14761   { (eval echo "$as_me:14761: \"$ac_try\"") >&5
14762   (eval $ac_try) 2>&5
14763   ac_status=$?
14764   echo "$as_me:14764: \$? = $ac_status" >&5
14765   (exit $ac_status); }; }; then
14766
14767                         cf_cv_const_x_string=no
14768
14769 else
14770   echo "$as_me: failed program was:" >&5
14771 cat conftest.$ac_ext >&5
14772
14773                         cf_cv_const_x_string=yes
14774
14775 fi
14776 rm -f conftest.$ac_objext conftest.$ac_ext
14777
14778 fi
14779 echo "$as_me:14779: result: $cf_cv_const_x_string" >&5
14780 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14781
14782 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14783 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14784 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14785
14786 case $cf_cv_const_x_string in
14787 (no)
14788
14789         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14790         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14791
14792         ;;
14793 (*)
14794
14795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14796         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14797
14798         ;;
14799 esac
14800
14801 else
14802   echo "$as_me: failed program was:" >&5
14803 cat conftest.$ac_ext >&5
14804 fi
14805 rm -f conftest.$ac_objext conftest.$ac_ext
14806  fi
14807 cat > conftest.$ac_ext <<EOF
14808 #line 14808 "${as_me:-configure}"
14809 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14810 EOF
14811 if test "$INTEL_COMPILER" = yes
14812 then
14813 # The "-wdXXX" options suppress warnings:
14814 # remark #1419: external declaration in primary source file
14815 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14816 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14817 # remark #193: zero used for undefined preprocessing identifier
14818 # remark #593: variable "curs_sb_left_arrow" was set but never used
14819 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14820 # remark #869: parameter "tw" was never referenced
14821 # remark #981: operands are evaluated in unspecified order
14822 # warning #279: controlling expression is constant
14823
14824         { echo "$as_me:14824: checking for $CC warning options..." >&5
14825 echo "$as_me: checking for $CC warning options..." >&6;}
14826         cf_save_CFLAGS="$CFLAGS"
14827         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
14828         for cf_opt in \
14829                 wd1419 \
14830                 wd1683 \
14831                 wd1684 \
14832                 wd193 \
14833                 wd593 \
14834                 wd279 \
14835                 wd810 \
14836                 wd869 \
14837                 wd981
14838         do
14839                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14840                 if { (eval echo "$as_me:14840: \"$ac_compile\"") >&5
14841   (eval $ac_compile) 2>&5
14842   ac_status=$?
14843   echo "$as_me:14843: \$? = $ac_status" >&5
14844   (exit $ac_status); }; then
14845                         test -n "$verbose" && echo "$as_me:14845: result: ... -$cf_opt" >&5
14846 echo "${ECHO_T}... -$cf_opt" >&6
14847                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14848                 fi
14849         done
14850         CFLAGS="$cf_save_CFLAGS"
14851 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14852 then
14853         { echo "$as_me:14853: checking for $CC warning options..." >&5
14854 echo "$as_me: checking for $CC warning options..." >&6;}
14855         cf_save_CFLAGS="$CFLAGS"
14856         cf_warn_CONST=""
14857         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14858         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14859         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14860         for cf_opt in W Wall \
14861                 Wbad-function-cast \
14862                 Wcast-align \
14863                 Wcast-qual \
14864                 Wdeclaration-after-statement \
14865                 Wextra \
14866                 Winline \
14867                 Wmissing-declarations \
14868                 Wmissing-prototypes \
14869                 Wnested-externs \
14870                 Wpointer-arith \
14871                 Wshadow \
14872                 Wstrict-prototypes \
14873                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14874         do
14875                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14876                 if { (eval echo "$as_me:14876: \"$ac_compile\"") >&5
14877   (eval $ac_compile) 2>&5
14878   ac_status=$?
14879   echo "$as_me:14879: \$? = $ac_status" >&5
14880   (exit $ac_status); }; then
14881                         test -n "$verbose" && echo "$as_me:14881: result: ... -$cf_opt" >&5
14882 echo "${ECHO_T}... -$cf_opt" >&6
14883                         case $cf_opt in
14884                         (Winline)
14885                                 case $GCC_VERSION in
14886                                 ([34].*)
14887                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14888
14889 echo "${as_me:-configure}:14889: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14890
14891                                         continue;;
14892                                 esac
14893                                 ;;
14894                         (Wpointer-arith)
14895                                 case $GCC_VERSION in
14896                                 ([12].*)
14897                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14898
14899 echo "${as_me:-configure}:14899: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14900
14901                                         continue;;
14902                                 esac
14903                                 ;;
14904                         esac
14905                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14906                 fi
14907         done
14908         CFLAGS="$cf_save_CFLAGS"
14909 fi
14910 rm -rf conftest*
14911
14912 fi
14913
14914 if ( test "$GCC" = yes || test "$GXX" = yes )
14915 then
14916 cat > conftest.i <<EOF
14917 #ifndef GCC_PRINTF
14918 #define GCC_PRINTF 0
14919 #endif
14920 #ifndef GCC_SCANF
14921 #define GCC_SCANF 0
14922 #endif
14923 #ifndef GCC_NORETURN
14924 #define GCC_NORETURN /* nothing */
14925 #endif
14926 #ifndef GCC_UNUSED
14927 #define GCC_UNUSED /* nothing */
14928 #endif
14929 EOF
14930 if test "$GCC" = yes
14931 then
14932         { echo "$as_me:14932: checking for $CC __attribute__ directives..." >&5
14933 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14934 cat > conftest.$ac_ext <<EOF
14935 #line 14935 "${as_me:-configure}"
14936 #include "confdefs.h"
14937 #include "conftest.h"
14938 #include "conftest.i"
14939 #if     GCC_PRINTF
14940 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14941 #else
14942 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14943 #endif
14944 #if     GCC_SCANF
14945 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14946 #else
14947 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14948 #endif
14949 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14950 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14951 extern void foo(void) GCC_NORETURN;
14952 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
14953 EOF
14954         cf_printf_attribute=no
14955         cf_scanf_attribute=no
14956         for cf_attribute in scanf printf unused noreturn
14957         do
14958
14959 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14960
14961                 cf_directive="__attribute__(($cf_attribute))"
14962                 echo "checking for $CC $cf_directive" 1>&5
14963
14964                 case $cf_attribute in
14965                 (printf)
14966                         cf_printf_attribute=yes
14967                         cat >conftest.h <<EOF
14968 #define GCC_$cf_ATTRIBUTE 1
14969 EOF
14970                         ;;
14971                 (scanf)
14972                         cf_scanf_attribute=yes
14973                         cat >conftest.h <<EOF
14974 #define GCC_$cf_ATTRIBUTE 1
14975 EOF
14976                         ;;
14977                 (*)
14978                         cat >conftest.h <<EOF
14979 #define GCC_$cf_ATTRIBUTE $cf_directive
14980 EOF
14981                         ;;
14982                 esac
14983
14984                 if { (eval echo "$as_me:14984: \"$ac_compile\"") >&5
14985   (eval $ac_compile) 2>&5
14986   ac_status=$?
14987   echo "$as_me:14987: \$? = $ac_status" >&5
14988   (exit $ac_status); }; then
14989                         test -n "$verbose" && echo "$as_me:14989: result: ... $cf_attribute" >&5
14990 echo "${ECHO_T}... $cf_attribute" >&6
14991                         cat conftest.h >>confdefs.h
14992                         case $cf_attribute in
14993                         (noreturn)
14994
14995 cat >>confdefs.h <<EOF
14996 #define GCC_NORETURN $cf_directive
14997 EOF
14998
14999                                 ;;
15000                         (printf)
15001                                 cf_value='/* nothing */'
15002                                 if test "$cf_printf_attribute" != no ; then
15003                                         cf_value='__attribute__((format(printf,fmt,var)))'
15004
15005 cat >>confdefs.h <<\EOF
15006 #define GCC_PRINTF 1
15007 EOF
15008
15009                                 fi
15010
15011 cat >>confdefs.h <<EOF
15012 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15013 EOF
15014
15015                                 ;;
15016                         (scanf)
15017                                 cf_value='/* nothing */'
15018                                 if test "$cf_scanf_attribute" != no ; then
15019                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15020
15021 cat >>confdefs.h <<\EOF
15022 #define GCC_SCANF 1
15023 EOF
15024
15025                                 fi
15026
15027 cat >>confdefs.h <<EOF
15028 #define GCC_SCANFLIKE(fmt,var) $cf_value
15029 EOF
15030
15031                                 ;;
15032                         (unused)
15033
15034 cat >>confdefs.h <<EOF
15035 #define GCC_UNUSED $cf_directive
15036 EOF
15037
15038                                 ;;
15039                         esac
15040                 fi
15041         done
15042 else
15043         fgrep define conftest.i >>confdefs.h
15044 fi
15045 rm -rf conftest*
15046 fi
15047
15048 fi
15049
15050 if test "x$with_warnings" = "xyes"; then
15051
15052         ADAFLAGS="$ADAFLAGS -gnatg"
15053
15054 fi
15055
15056 ###     use option --enable-assertions to turn on generation of assertion code
15057 echo "$as_me:15057: checking if you want to enable runtime assertions" >&5
15058 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15059
15060 # Check whether --enable-assertions or --disable-assertions was given.
15061 if test "${enable_assertions+set}" = set; then
15062   enableval="$enable_assertions"
15063   with_assertions=$enableval
15064 else
15065   with_assertions=no
15066 fi;
15067 echo "$as_me:15067: result: $with_assertions" >&5
15068 echo "${ECHO_T}$with_assertions" >&6
15069 if test -n "$GCC"
15070 then
15071         if test "$with_assertions" = no
15072         then
15073                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15074         else
15075
15076         ADAFLAGS="$ADAFLAGS -gnata"
15077
15078         fi
15079 fi
15080
15081 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15082
15083 cat >>confdefs.h <<\EOF
15084 #define HAVE_NC_ALLOC_H 1
15085 EOF
15086
15087 ###     use option --enable-expanded to generate certain macros as functions
15088
15089 # Check whether --enable-expanded or --disable-expanded was given.
15090 if test "${enable_expanded+set}" = set; then
15091   enableval="$enable_expanded"
15092   test "$enableval" = yes &&
15093 cat >>confdefs.h <<\EOF
15094 #define NCURSES_EXPANDED 1
15095 EOF
15096
15097 fi;
15098
15099 ###     use option --disable-macros to suppress macros in favor of functions
15100
15101 # Check whether --enable-macros or --disable-macros was given.
15102 if test "${enable_macros+set}" = set; then
15103   enableval="$enable_macros"
15104   test "$enableval" = no &&
15105 cat >>confdefs.h <<\EOF
15106 #define NCURSES_NOMACROS 1
15107 EOF
15108
15109 fi;
15110
15111 # Normally we only add trace() to the debug-library.  Allow this to be
15112 # extended to all models of the ncurses library:
15113 cf_all_traces=no
15114 case "$CFLAGS $CPPFLAGS" in
15115 (*-DTRACE*)
15116         cf_all_traces=yes
15117         ;;
15118 esac
15119
15120 echo "$as_me:15120: checking whether to add trace feature to all models" >&5
15121 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15122
15123 # Check whether --with-trace or --without-trace was given.
15124 if test "${with_trace+set}" = set; then
15125   withval="$with_trace"
15126   cf_with_trace=$withval
15127 else
15128   cf_with_trace=$cf_all_traces
15129 fi;
15130 echo "$as_me:15130: result: $cf_with_trace" >&5
15131 echo "${ECHO_T}$cf_with_trace" >&6
15132
15133 if test "$cf_with_trace" = yes ; then
15134         ADA_TRACE=TRUE
15135
15136 cf_fix_cppflags=no
15137 cf_new_cflags=
15138 cf_new_cppflags=
15139 cf_new_extra_cppflags=
15140
15141 for cf_add_cflags in -DTRACE
15142 do
15143 case $cf_fix_cppflags in
15144 (no)
15145         case $cf_add_cflags in
15146         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15147                 case $cf_add_cflags in
15148                 (-D*)
15149                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15150
15151                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15152                                 && test -z "${cf_tst_cflags}" \
15153                                 && cf_fix_cppflags=yes
15154
15155                         if test $cf_fix_cppflags = yes ; then
15156
15157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15159
15160                                 continue
15161                         elif test "${cf_tst_cflags}" = "\"'" ; then
15162
15163         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15164         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15165
15166                                 continue
15167                         fi
15168                         ;;
15169                 esac
15170                 case "$CPPFLAGS" in
15171                 (*$cf_add_cflags)
15172                         ;;
15173                 (*)
15174                         case $cf_add_cflags in
15175                         (-D*)
15176                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15177
15178 CPPFLAGS=`echo "$CPPFLAGS" | \
15179         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15180                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15181
15182                                 ;;
15183                         esac
15184
15185         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15186         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15187
15188                         ;;
15189                 esac
15190                 ;;
15191         (*)
15192
15193         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15194         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15195
15196                 ;;
15197         esac
15198         ;;
15199 (yes)
15200
15201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15203
15204         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15205
15206         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15207                 && test -z "${cf_tst_cflags}" \
15208                 && cf_fix_cppflags=no
15209         ;;
15210 esac
15211 done
15212
15213 if test -n "$cf_new_cflags" ; then
15214
15215         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15216         CFLAGS="${CFLAGS}$cf_new_cflags"
15217
15218 fi
15219
15220 if test -n "$cf_new_cppflags" ; then
15221
15222         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15223         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15224
15225 fi
15226
15227 if test -n "$cf_new_extra_cppflags" ; then
15228
15229         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15230         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15231
15232 fi
15233
15234 else
15235         ADA_TRACE=FALSE
15236 fi
15237
15238 echo "$as_me:15238: checking if we want to use GNAT projects" >&5
15239 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15240
15241 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15242 if test "${enable_gnat_projects+set}" = set; then
15243   enableval="$enable_gnat_projects"
15244   test "$enableval" != no && enableval=yes
15245         if test "$enableval" != "yes" ; then
15246     enable_gnat_projects=no
15247         else
15248                 enable_gnat_projects=yes
15249         fi
15250 else
15251   enableval=yes
15252         enable_gnat_projects=yes
15253
15254 fi;
15255 echo "$as_me:15255: result: $enable_gnat_projects" >&5
15256 echo "${ECHO_T}$enable_gnat_projects" >&6
15257
15258 ###     Checks for libraries.
15259 case $cf_cv_system_name in
15260 (*mingw32*)
15261         ;;
15262 (*)
15263 echo "$as_me:15263: checking for gettimeofday" >&5
15264 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15265 if test "${ac_cv_func_gettimeofday+set}" = set; then
15266   echo $ECHO_N "(cached) $ECHO_C" >&6
15267 else
15268   cat >conftest.$ac_ext <<_ACEOF
15269 #line 15269 "configure"
15270 #include "confdefs.h"
15271 #define gettimeofday autoconf_temporary
15272 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15273 #undef gettimeofday
15274
15275 #ifdef __cplusplus
15276 extern "C"
15277 #endif
15278
15279 /* We use char because int might match the return type of a gcc2
15280    builtin and then its argument prototype would still apply.  */
15281 char gettimeofday (void);
15282
15283 int
15284 main (void)
15285 {
15286
15287 /* The GNU C library defines stubs for functions which it implements
15288     to always fail with ENOSYS.  Some functions are actually named
15289     something starting with __ and the normal name is an alias.  */
15290 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15291 #error found stub for gettimeofday
15292 #endif
15293
15294         return gettimeofday ();
15295   ;
15296   return 0;
15297 }
15298 _ACEOF
15299 rm -f conftest.$ac_objext conftest$ac_exeext
15300 if { (eval echo "$as_me:15300: \"$ac_link\"") >&5
15301   (eval $ac_link) 2>&5
15302   ac_status=$?
15303   echo "$as_me:15303: \$? = $ac_status" >&5
15304   (exit $ac_status); } &&
15305          { ac_try='test -s conftest$ac_exeext'
15306   { (eval echo "$as_me:15306: \"$ac_try\"") >&5
15307   (eval $ac_try) 2>&5
15308   ac_status=$?
15309   echo "$as_me:15309: \$? = $ac_status" >&5
15310   (exit $ac_status); }; }; then
15311   ac_cv_func_gettimeofday=yes
15312 else
15313   echo "$as_me: failed program was:" >&5
15314 cat conftest.$ac_ext >&5
15315 ac_cv_func_gettimeofday=no
15316 fi
15317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15318 fi
15319 echo "$as_me:15319: result: $ac_cv_func_gettimeofday" >&5
15320 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15321 if test $ac_cv_func_gettimeofday = yes; then
15322   cat >>confdefs.h <<\EOF
15323 #define HAVE_GETTIMEOFDAY 1
15324 EOF
15325
15326 else
15327
15328 echo "$as_me:15328: checking for gettimeofday in -lbsd" >&5
15329 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15330 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15331   echo $ECHO_N "(cached) $ECHO_C" >&6
15332 else
15333   ac_check_lib_save_LIBS=$LIBS
15334 LIBS="-lbsd  $LIBS"
15335 cat >conftest.$ac_ext <<_ACEOF
15336 #line 15336 "configure"
15337 #include "confdefs.h"
15338
15339 /* Override any gcc2 internal prototype to avoid an error.  */
15340 #ifdef __cplusplus
15341 extern "C"
15342 #endif
15343 /* We use char because int might match the return type of a gcc2
15344    builtin and then its argument prototype would still apply.  */
15345 char gettimeofday ();
15346 int
15347 main (void)
15348 {
15349 gettimeofday ();
15350   ;
15351   return 0;
15352 }
15353 _ACEOF
15354 rm -f conftest.$ac_objext conftest$ac_exeext
15355 if { (eval echo "$as_me:15355: \"$ac_link\"") >&5
15356   (eval $ac_link) 2>&5
15357   ac_status=$?
15358   echo "$as_me:15358: \$? = $ac_status" >&5
15359   (exit $ac_status); } &&
15360          { ac_try='test -s conftest$ac_exeext'
15361   { (eval echo "$as_me:15361: \"$ac_try\"") >&5
15362   (eval $ac_try) 2>&5
15363   ac_status=$?
15364   echo "$as_me:15364: \$? = $ac_status" >&5
15365   (exit $ac_status); }; }; then
15366   ac_cv_lib_bsd_gettimeofday=yes
15367 else
15368   echo "$as_me: failed program was:" >&5
15369 cat conftest.$ac_ext >&5
15370 ac_cv_lib_bsd_gettimeofday=no
15371 fi
15372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15373 LIBS=$ac_check_lib_save_LIBS
15374 fi
15375 echo "$as_me:15375: result: $ac_cv_lib_bsd_gettimeofday" >&5
15376 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15377 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15378
15379 cat >>confdefs.h <<\EOF
15380 #define HAVE_GETTIMEOFDAY 1
15381 EOF
15382
15383         LIBS="$LIBS -lbsd"
15384 fi
15385
15386 fi
15387         ;;
15388 esac
15389
15390 ###     Checks for header files.
15391 echo "$as_me:15391: checking for ANSI C header files" >&5
15392 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15393 if test "${ac_cv_header_stdc+set}" = set; then
15394   echo $ECHO_N "(cached) $ECHO_C" >&6
15395 else
15396   cat >conftest.$ac_ext <<_ACEOF
15397 #line 15397 "configure"
15398 #include "confdefs.h"
15399 #include <stdlib.h>
15400 #include <stdarg.h>
15401 #include <string.h>
15402 #include <float.h>
15403
15404 _ACEOF
15405 if { (eval echo "$as_me:15405: \"$ac_cpp conftest.$ac_ext\"") >&5
15406   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15407   ac_status=$?
15408   egrep -v '^ *\+' conftest.er1 >conftest.err
15409   rm -f conftest.er1
15410   cat conftest.err >&5
15411   echo "$as_me:15411: \$? = $ac_status" >&5
15412   (exit $ac_status); } >/dev/null; then
15413   if test -s conftest.err; then
15414     ac_cpp_err=$ac_c_preproc_warn_flag
15415   else
15416     ac_cpp_err=
15417   fi
15418 else
15419   ac_cpp_err=yes
15420 fi
15421 if test -z "$ac_cpp_err"; then
15422   ac_cv_header_stdc=yes
15423 else
15424   echo "$as_me: failed program was:" >&5
15425   cat conftest.$ac_ext >&5
15426   ac_cv_header_stdc=no
15427 fi
15428 rm -f conftest.err conftest.$ac_ext
15429
15430 if test $ac_cv_header_stdc = yes; then
15431   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15432   cat >conftest.$ac_ext <<_ACEOF
15433 #line 15433 "configure"
15434 #include "confdefs.h"
15435 #include <string.h>
15436
15437 _ACEOF
15438 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15439   egrep "memchr" >/dev/null 2>&1; then
15440   :
15441 else
15442   ac_cv_header_stdc=no
15443 fi
15444 rm -rf conftest*
15445
15446 fi
15447
15448 if test $ac_cv_header_stdc = yes; then
15449   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15450   cat >conftest.$ac_ext <<_ACEOF
15451 #line 15451 "configure"
15452 #include "confdefs.h"
15453 #include <stdlib.h>
15454
15455 _ACEOF
15456 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15457   egrep "free" >/dev/null 2>&1; then
15458   :
15459 else
15460   ac_cv_header_stdc=no
15461 fi
15462 rm -rf conftest*
15463
15464 fi
15465
15466 if test $ac_cv_header_stdc = yes; then
15467   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15468   if test "$cross_compiling" = yes; then
15469   :
15470 else
15471   cat >conftest.$ac_ext <<_ACEOF
15472 #line 15472 "configure"
15473 #include "confdefs.h"
15474 #include <ctype.h>
15475 #if ((' ' & 0x0FF) == 0x020)
15476 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15477 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15478 #else
15479 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15480                      || ('j' <= (c) && (c) <= 'r') \
15481                      || ('s' <= (c) && (c) <= 'z'))
15482 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15483 #endif
15484
15485 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15486 int
15487 main (void)
15488 {
15489   int i;
15490   for (i = 0; i < 256; i++)
15491     if (XOR (islower (i), ISLOWER (i))
15492         || toupper (i) != TOUPPER (i))
15493       $ac_main_return(2);
15494   $ac_main_return (0);
15495 }
15496 _ACEOF
15497 rm -f conftest$ac_exeext
15498 if { (eval echo "$as_me:15498: \"$ac_link\"") >&5
15499   (eval $ac_link) 2>&5
15500   ac_status=$?
15501   echo "$as_me:15501: \$? = $ac_status" >&5
15502   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15503   { (eval echo "$as_me:15503: \"$ac_try\"") >&5
15504   (eval $ac_try) 2>&5
15505   ac_status=$?
15506   echo "$as_me:15506: \$? = $ac_status" >&5
15507   (exit $ac_status); }; }; then
15508   :
15509 else
15510   echo "$as_me: program exited with status $ac_status" >&5
15511 echo "$as_me: failed program was:" >&5
15512 cat conftest.$ac_ext >&5
15513 ac_cv_header_stdc=no
15514 fi
15515 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15516 fi
15517 fi
15518 fi
15519 echo "$as_me:15519: result: $ac_cv_header_stdc" >&5
15520 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15521 if test $ac_cv_header_stdc = yes; then
15522
15523 cat >>confdefs.h <<\EOF
15524 #define STDC_HEADERS 1
15525 EOF
15526
15527 fi
15528
15529 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15530
15531 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15532                   inttypes.h stdint.h unistd.h
15533 do
15534 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15535 echo "$as_me:15535: checking for $ac_header" >&5
15536 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15537 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15538   echo $ECHO_N "(cached) $ECHO_C" >&6
15539 else
15540   cat >conftest.$ac_ext <<_ACEOF
15541 #line 15541 "configure"
15542 #include "confdefs.h"
15543 $ac_includes_default
15544 #include <$ac_header>
15545 _ACEOF
15546 rm -f conftest.$ac_objext
15547 if { (eval echo "$as_me:15547: \"$ac_compile\"") >&5
15548   (eval $ac_compile) 2>&5
15549   ac_status=$?
15550   echo "$as_me:15550: \$? = $ac_status" >&5
15551   (exit $ac_status); } &&
15552          { ac_try='test -s conftest.$ac_objext'
15553   { (eval echo "$as_me:15553: \"$ac_try\"") >&5
15554   (eval $ac_try) 2>&5
15555   ac_status=$?
15556   echo "$as_me:15556: \$? = $ac_status" >&5
15557   (exit $ac_status); }; }; then
15558   eval "$as_ac_Header=yes"
15559 else
15560   echo "$as_me: failed program was:" >&5
15561 cat conftest.$ac_ext >&5
15562 eval "$as_ac_Header=no"
15563 fi
15564 rm -f conftest.$ac_objext conftest.$ac_ext
15565 fi
15566 echo "$as_me:15566: result: `eval echo '${'$as_ac_Header'}'`" >&5
15567 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15568 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15569   cat >>confdefs.h <<EOF
15570 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15571 EOF
15572
15573 fi
15574 done
15575
15576 echo "$as_me:15576: checking for signed char" >&5
15577 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15578 if test "${ac_cv_type_signed_char+set}" = set; then
15579   echo $ECHO_N "(cached) $ECHO_C" >&6
15580 else
15581   cat >conftest.$ac_ext <<_ACEOF
15582 #line 15582 "configure"
15583 #include "confdefs.h"
15584 $ac_includes_default
15585 int
15586 main (void)
15587 {
15588 if ((signed char *) 0)
15589   return 0;
15590 if (sizeof (signed char))
15591   return 0;
15592   ;
15593   return 0;
15594 }
15595 _ACEOF
15596 rm -f conftest.$ac_objext
15597 if { (eval echo "$as_me:15597: \"$ac_compile\"") >&5
15598   (eval $ac_compile) 2>&5
15599   ac_status=$?
15600   echo "$as_me:15600: \$? = $ac_status" >&5
15601   (exit $ac_status); } &&
15602          { ac_try='test -s conftest.$ac_objext'
15603   { (eval echo "$as_me:15603: \"$ac_try\"") >&5
15604   (eval $ac_try) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); }; }; then
15608   ac_cv_type_signed_char=yes
15609 else
15610   echo "$as_me: failed program was:" >&5
15611 cat conftest.$ac_ext >&5
15612 ac_cv_type_signed_char=no
15613 fi
15614 rm -f conftest.$ac_objext conftest.$ac_ext
15615 fi
15616 echo "$as_me:15616: result: $ac_cv_type_signed_char" >&5
15617 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15618
15619 echo "$as_me:15619: checking size of signed char" >&5
15620 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15621 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15622   echo $ECHO_N "(cached) $ECHO_C" >&6
15623 else
15624   if test "$ac_cv_type_signed_char" = yes; then
15625   if test "$cross_compiling" = yes; then
15626   # Depending upon the size, compute the lo and hi bounds.
15627 cat >conftest.$ac_ext <<_ACEOF
15628 #line 15628 "configure"
15629 #include "confdefs.h"
15630 $ac_includes_default
15631 int
15632 main (void)
15633 {
15634 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15635   ;
15636   return 0;
15637 }
15638 _ACEOF
15639 rm -f conftest.$ac_objext
15640 if { (eval echo "$as_me:15640: \"$ac_compile\"") >&5
15641   (eval $ac_compile) 2>&5
15642   ac_status=$?
15643   echo "$as_me:15643: \$? = $ac_status" >&5
15644   (exit $ac_status); } &&
15645          { ac_try='test -s conftest.$ac_objext'
15646   { (eval echo "$as_me:15646: \"$ac_try\"") >&5
15647   (eval $ac_try) 2>&5
15648   ac_status=$?
15649   echo "$as_me:15649: \$? = $ac_status" >&5
15650   (exit $ac_status); }; }; then
15651   ac_lo=0 ac_mid=0
15652   while :; do
15653     cat >conftest.$ac_ext <<_ACEOF
15654 #line 15654 "configure"
15655 #include "confdefs.h"
15656 $ac_includes_default
15657 int
15658 main (void)
15659 {
15660 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15661   ;
15662   return 0;
15663 }
15664 _ACEOF
15665 rm -f conftest.$ac_objext
15666 if { (eval echo "$as_me:15666: \"$ac_compile\"") >&5
15667   (eval $ac_compile) 2>&5
15668   ac_status=$?
15669   echo "$as_me:15669: \$? = $ac_status" >&5
15670   (exit $ac_status); } &&
15671          { ac_try='test -s conftest.$ac_objext'
15672   { (eval echo "$as_me:15672: \"$ac_try\"") >&5
15673   (eval $ac_try) 2>&5
15674   ac_status=$?
15675   echo "$as_me:15675: \$? = $ac_status" >&5
15676   (exit $ac_status); }; }; then
15677   ac_hi=$ac_mid; break
15678 else
15679   echo "$as_me: failed program was:" >&5
15680 cat conftest.$ac_ext >&5
15681 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15682 fi
15683 rm -f conftest.$ac_objext conftest.$ac_ext
15684   done
15685 else
15686   echo "$as_me: failed program was:" >&5
15687 cat conftest.$ac_ext >&5
15688 ac_hi=-1 ac_mid=-1
15689   while :; do
15690     cat >conftest.$ac_ext <<_ACEOF
15691 #line 15691 "configure"
15692 #include "confdefs.h"
15693 $ac_includes_default
15694 int
15695 main (void)
15696 {
15697 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15698   ;
15699   return 0;
15700 }
15701 _ACEOF
15702 rm -f conftest.$ac_objext
15703 if { (eval echo "$as_me:15703: \"$ac_compile\"") >&5
15704   (eval $ac_compile) 2>&5
15705   ac_status=$?
15706   echo "$as_me:15706: \$? = $ac_status" >&5
15707   (exit $ac_status); } &&
15708          { ac_try='test -s conftest.$ac_objext'
15709   { (eval echo "$as_me:15709: \"$ac_try\"") >&5
15710   (eval $ac_try) 2>&5
15711   ac_status=$?
15712   echo "$as_me:15712: \$? = $ac_status" >&5
15713   (exit $ac_status); }; }; then
15714   ac_lo=$ac_mid; break
15715 else
15716   echo "$as_me: failed program was:" >&5
15717 cat conftest.$ac_ext >&5
15718 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15719 fi
15720 rm -f conftest.$ac_objext conftest.$ac_ext
15721   done
15722 fi
15723 rm -f conftest.$ac_objext conftest.$ac_ext
15724 # Binary search between lo and hi bounds.
15725 while test "x$ac_lo" != "x$ac_hi"; do
15726   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15727   cat >conftest.$ac_ext <<_ACEOF
15728 #line 15728 "configure"
15729 #include "confdefs.h"
15730 $ac_includes_default
15731 int
15732 main (void)
15733 {
15734 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15735   ;
15736   return 0;
15737 }
15738 _ACEOF
15739 rm -f conftest.$ac_objext
15740 if { (eval echo "$as_me:15740: \"$ac_compile\"") >&5
15741   (eval $ac_compile) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); } &&
15745          { ac_try='test -s conftest.$ac_objext'
15746   { (eval echo "$as_me:15746: \"$ac_try\"") >&5
15747   (eval $ac_try) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); }; }; then
15751   ac_hi=$ac_mid
15752 else
15753   echo "$as_me: failed program was:" >&5
15754 cat conftest.$ac_ext >&5
15755 ac_lo=`expr $ac_mid + 1`
15756 fi
15757 rm -f conftest.$ac_objext conftest.$ac_ext
15758 done
15759 ac_cv_sizeof_signed_char=$ac_lo
15760 else
15761   if test "$cross_compiling" = yes; then
15762   { { echo "$as_me:15762: error: cannot run test program while cross compiling" >&5
15763 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15764    { (exit 1); exit 1; }; }
15765 else
15766   cat >conftest.$ac_ext <<_ACEOF
15767 #line 15767 "configure"
15768 #include "confdefs.h"
15769 $ac_includes_default
15770 int
15771 main (void)
15772 {
15773 FILE *f = fopen ("conftest.val", "w");
15774 if (!f)
15775   $ac_main_return (1);
15776 fprintf (f, "%d", (sizeof (signed char)));
15777 fclose (f);
15778   ;
15779   return 0;
15780 }
15781 _ACEOF
15782 rm -f conftest$ac_exeext
15783 if { (eval echo "$as_me:15783: \"$ac_link\"") >&5
15784   (eval $ac_link) 2>&5
15785   ac_status=$?
15786   echo "$as_me:15786: \$? = $ac_status" >&5
15787   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15788   { (eval echo "$as_me:15788: \"$ac_try\"") >&5
15789   (eval $ac_try) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit $ac_status); }; }; then
15793   ac_cv_sizeof_signed_char=`cat conftest.val`
15794 else
15795   echo "$as_me: program exited with status $ac_status" >&5
15796 echo "$as_me: failed program was:" >&5
15797 cat conftest.$ac_ext >&5
15798 fi
15799 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15800 fi
15801 fi
15802 rm -f conftest.val
15803 else
15804   ac_cv_sizeof_signed_char=0
15805 fi
15806 fi
15807 echo "$as_me:15807: result: $ac_cv_sizeof_signed_char" >&5
15808 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15809 cat >>confdefs.h <<EOF
15810 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15811 EOF
15812
15813 echo "$as_me:15813: checking for ANSI C header files" >&5
15814 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15815 if test "${ac_cv_header_stdc+set}" = set; then
15816   echo $ECHO_N "(cached) $ECHO_C" >&6
15817 else
15818   cat >conftest.$ac_ext <<_ACEOF
15819 #line 15819 "configure"
15820 #include "confdefs.h"
15821 #include <stdlib.h>
15822 #include <stdarg.h>
15823 #include <string.h>
15824 #include <float.h>
15825
15826 _ACEOF
15827 if { (eval echo "$as_me:15827: \"$ac_cpp conftest.$ac_ext\"") >&5
15828   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15829   ac_status=$?
15830   egrep -v '^ *\+' conftest.er1 >conftest.err
15831   rm -f conftest.er1
15832   cat conftest.err >&5
15833   echo "$as_me:15833: \$? = $ac_status" >&5
15834   (exit $ac_status); } >/dev/null; then
15835   if test -s conftest.err; then
15836     ac_cpp_err=$ac_c_preproc_warn_flag
15837   else
15838     ac_cpp_err=
15839   fi
15840 else
15841   ac_cpp_err=yes
15842 fi
15843 if test -z "$ac_cpp_err"; then
15844   ac_cv_header_stdc=yes
15845 else
15846   echo "$as_me: failed program was:" >&5
15847   cat conftest.$ac_ext >&5
15848   ac_cv_header_stdc=no
15849 fi
15850 rm -f conftest.err conftest.$ac_ext
15851
15852 if test $ac_cv_header_stdc = yes; then
15853   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15854   cat >conftest.$ac_ext <<_ACEOF
15855 #line 15855 "configure"
15856 #include "confdefs.h"
15857 #include <string.h>
15858
15859 _ACEOF
15860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15861   egrep "memchr" >/dev/null 2>&1; then
15862   :
15863 else
15864   ac_cv_header_stdc=no
15865 fi
15866 rm -rf conftest*
15867
15868 fi
15869
15870 if test $ac_cv_header_stdc = yes; then
15871   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15872   cat >conftest.$ac_ext <<_ACEOF
15873 #line 15873 "configure"
15874 #include "confdefs.h"
15875 #include <stdlib.h>
15876
15877 _ACEOF
15878 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15879   egrep "free" >/dev/null 2>&1; then
15880   :
15881 else
15882   ac_cv_header_stdc=no
15883 fi
15884 rm -rf conftest*
15885
15886 fi
15887
15888 if test $ac_cv_header_stdc = yes; then
15889   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15890   if test "$cross_compiling" = yes; then
15891   :
15892 else
15893   cat >conftest.$ac_ext <<_ACEOF
15894 #line 15894 "configure"
15895 #include "confdefs.h"
15896 #include <ctype.h>
15897 #if ((' ' & 0x0FF) == 0x020)
15898 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15899 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15900 #else
15901 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15902                      || ('j' <= (c) && (c) <= 'r') \
15903                      || ('s' <= (c) && (c) <= 'z'))
15904 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15905 #endif
15906
15907 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15908 int
15909 main (void)
15910 {
15911   int i;
15912   for (i = 0; i < 256; i++)
15913     if (XOR (islower (i), ISLOWER (i))
15914         || toupper (i) != TOUPPER (i))
15915       $ac_main_return(2);
15916   $ac_main_return (0);
15917 }
15918 _ACEOF
15919 rm -f conftest$ac_exeext
15920 if { (eval echo "$as_me:15920: \"$ac_link\"") >&5
15921   (eval $ac_link) 2>&5
15922   ac_status=$?
15923   echo "$as_me:15923: \$? = $ac_status" >&5
15924   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15925   { (eval echo "$as_me:15925: \"$ac_try\"") >&5
15926   (eval $ac_try) 2>&5
15927   ac_status=$?
15928   echo "$as_me:15928: \$? = $ac_status" >&5
15929   (exit $ac_status); }; }; then
15930   :
15931 else
15932   echo "$as_me: program exited with status $ac_status" >&5
15933 echo "$as_me: failed program was:" >&5
15934 cat conftest.$ac_ext >&5
15935 ac_cv_header_stdc=no
15936 fi
15937 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15938 fi
15939 fi
15940 fi
15941 echo "$as_me:15941: result: $ac_cv_header_stdc" >&5
15942 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15943 if test $ac_cv_header_stdc = yes; then
15944
15945 cat >>confdefs.h <<\EOF
15946 #define STDC_HEADERS 1
15947 EOF
15948
15949 fi
15950
15951 ac_header_dirent=no
15952 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
15953   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
15954 echo "$as_me:15954: checking for $ac_hdr that defines DIR" >&5
15955 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
15956 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15957   echo $ECHO_N "(cached) $ECHO_C" >&6
15958 else
15959   cat >conftest.$ac_ext <<_ACEOF
15960 #line 15960 "configure"
15961 #include "confdefs.h"
15962 #include <sys/types.h>
15963 #include <$ac_hdr>
15964
15965 int
15966 main (void)
15967 {
15968 if ((DIR *) 0)
15969 return 0;
15970   ;
15971   return 0;
15972 }
15973 _ACEOF
15974 rm -f conftest.$ac_objext
15975 if { (eval echo "$as_me:15975: \"$ac_compile\"") >&5
15976   (eval $ac_compile) 2>&5
15977   ac_status=$?
15978   echo "$as_me:15978: \$? = $ac_status" >&5
15979   (exit $ac_status); } &&
15980          { ac_try='test -s conftest.$ac_objext'
15981   { (eval echo "$as_me:15981: \"$ac_try\"") >&5
15982   (eval $ac_try) 2>&5
15983   ac_status=$?
15984   echo "$as_me:15984: \$? = $ac_status" >&5
15985   (exit $ac_status); }; }; then
15986   eval "$as_ac_Header=yes"
15987 else
15988   echo "$as_me: failed program was:" >&5
15989 cat conftest.$ac_ext >&5
15990 eval "$as_ac_Header=no"
15991 fi
15992 rm -f conftest.$ac_objext conftest.$ac_ext
15993 fi
15994 echo "$as_me:15994: result: `eval echo '${'$as_ac_Header'}'`" >&5
15995 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15996 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15997   cat >>confdefs.h <<EOF
15998 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15999 EOF
16000
16001 ac_header_dirent=$ac_hdr; break
16002 fi
16003
16004 done
16005 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16006 if test $ac_header_dirent = dirent.h; then
16007   echo "$as_me:16007: checking for opendir in -ldir" >&5
16008 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16009 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16010   echo $ECHO_N "(cached) $ECHO_C" >&6
16011 else
16012   ac_check_lib_save_LIBS=$LIBS
16013 LIBS="-ldir  $LIBS"
16014 cat >conftest.$ac_ext <<_ACEOF
16015 #line 16015 "configure"
16016 #include "confdefs.h"
16017
16018 /* Override any gcc2 internal prototype to avoid an error.  */
16019 #ifdef __cplusplus
16020 extern "C"
16021 #endif
16022 /* We use char because int might match the return type of a gcc2
16023    builtin and then its argument prototype would still apply.  */
16024 char opendir ();
16025 int
16026 main (void)
16027 {
16028 opendir ();
16029   ;
16030   return 0;
16031 }
16032 _ACEOF
16033 rm -f conftest.$ac_objext conftest$ac_exeext
16034 if { (eval echo "$as_me:16034: \"$ac_link\"") >&5
16035   (eval $ac_link) 2>&5
16036   ac_status=$?
16037   echo "$as_me:16037: \$? = $ac_status" >&5
16038   (exit $ac_status); } &&
16039          { ac_try='test -s conftest$ac_exeext'
16040   { (eval echo "$as_me:16040: \"$ac_try\"") >&5
16041   (eval $ac_try) 2>&5
16042   ac_status=$?
16043   echo "$as_me:16043: \$? = $ac_status" >&5
16044   (exit $ac_status); }; }; then
16045   ac_cv_lib_dir_opendir=yes
16046 else
16047   echo "$as_me: failed program was:" >&5
16048 cat conftest.$ac_ext >&5
16049 ac_cv_lib_dir_opendir=no
16050 fi
16051 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16052 LIBS=$ac_check_lib_save_LIBS
16053 fi
16054 echo "$as_me:16054: result: $ac_cv_lib_dir_opendir" >&5
16055 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16056 if test $ac_cv_lib_dir_opendir = yes; then
16057   LIBS="$LIBS -ldir"
16058 fi
16059
16060 else
16061   echo "$as_me:16061: checking for opendir in -lx" >&5
16062 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16063 if test "${ac_cv_lib_x_opendir+set}" = set; then
16064   echo $ECHO_N "(cached) $ECHO_C" >&6
16065 else
16066   ac_check_lib_save_LIBS=$LIBS
16067 LIBS="-lx  $LIBS"
16068 cat >conftest.$ac_ext <<_ACEOF
16069 #line 16069 "configure"
16070 #include "confdefs.h"
16071
16072 /* Override any gcc2 internal prototype to avoid an error.  */
16073 #ifdef __cplusplus
16074 extern "C"
16075 #endif
16076 /* We use char because int might match the return type of a gcc2
16077    builtin and then its argument prototype would still apply.  */
16078 char opendir ();
16079 int
16080 main (void)
16081 {
16082 opendir ();
16083   ;
16084   return 0;
16085 }
16086 _ACEOF
16087 rm -f conftest.$ac_objext conftest$ac_exeext
16088 if { (eval echo "$as_me:16088: \"$ac_link\"") >&5
16089   (eval $ac_link) 2>&5
16090   ac_status=$?
16091   echo "$as_me:16091: \$? = $ac_status" >&5
16092   (exit $ac_status); } &&
16093          { ac_try='test -s conftest$ac_exeext'
16094   { (eval echo "$as_me:16094: \"$ac_try\"") >&5
16095   (eval $ac_try) 2>&5
16096   ac_status=$?
16097   echo "$as_me:16097: \$? = $ac_status" >&5
16098   (exit $ac_status); }; }; then
16099   ac_cv_lib_x_opendir=yes
16100 else
16101   echo "$as_me: failed program was:" >&5
16102 cat conftest.$ac_ext >&5
16103 ac_cv_lib_x_opendir=no
16104 fi
16105 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16106 LIBS=$ac_check_lib_save_LIBS
16107 fi
16108 echo "$as_me:16108: result: $ac_cv_lib_x_opendir" >&5
16109 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16110 if test $ac_cv_lib_x_opendir = yes; then
16111   LIBS="$LIBS -lx"
16112 fi
16113
16114 fi
16115
16116 echo "$as_me:16116: checking whether time.h and sys/time.h may both be included" >&5
16117 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16118 if test "${ac_cv_header_time+set}" = set; then
16119   echo $ECHO_N "(cached) $ECHO_C" >&6
16120 else
16121   cat >conftest.$ac_ext <<_ACEOF
16122 #line 16122 "configure"
16123 #include "confdefs.h"
16124 #include <sys/types.h>
16125 #include <sys/time.h>
16126 #include <time.h>
16127
16128 int
16129 main (void)
16130 {
16131 if ((struct tm *) 0)
16132 return 0;
16133   ;
16134   return 0;
16135 }
16136 _ACEOF
16137 rm -f conftest.$ac_objext
16138 if { (eval echo "$as_me:16138: \"$ac_compile\"") >&5
16139   (eval $ac_compile) 2>&5
16140   ac_status=$?
16141   echo "$as_me:16141: \$? = $ac_status" >&5
16142   (exit $ac_status); } &&
16143          { ac_try='test -s conftest.$ac_objext'
16144   { (eval echo "$as_me:16144: \"$ac_try\"") >&5
16145   (eval $ac_try) 2>&5
16146   ac_status=$?
16147   echo "$as_me:16147: \$? = $ac_status" >&5
16148   (exit $ac_status); }; }; then
16149   ac_cv_header_time=yes
16150 else
16151   echo "$as_me: failed program was:" >&5
16152 cat conftest.$ac_ext >&5
16153 ac_cv_header_time=no
16154 fi
16155 rm -f conftest.$ac_objext conftest.$ac_ext
16156 fi
16157 echo "$as_me:16157: result: $ac_cv_header_time" >&5
16158 echo "${ECHO_T}$ac_cv_header_time" >&6
16159 if test $ac_cv_header_time = yes; then
16160
16161 cat >>confdefs.h <<\EOF
16162 #define TIME_WITH_SYS_TIME 1
16163 EOF
16164
16165 fi
16166
16167 ###     checks for compiler characteristics
16168 ac_ext=c
16169 ac_cpp='$CPP $CPPFLAGS'
16170 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16171 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16172 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16173 ac_main_return=return
16174
16175 echo "$as_me:16175: checking for an ANSI C-conforming const" >&5
16176 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16177 if test "${ac_cv_c_const+set}" = set; then
16178   echo $ECHO_N "(cached) $ECHO_C" >&6
16179 else
16180   cat >conftest.$ac_ext <<_ACEOF
16181 #line 16181 "configure"
16182 #include "confdefs.h"
16183
16184 int
16185 main (void)
16186 {
16187 /* FIXME: Include the comments suggested by Paul. */
16188 #ifndef __cplusplus
16189   /* Ultrix mips cc rejects this.  */
16190   typedef int charset[2];
16191   const charset x;
16192   /* SunOS 4.1.1 cc rejects this.  */
16193   char const *const *ccp;
16194   char **p;
16195   /* NEC SVR4.0.2 mips cc rejects this.  */
16196   struct point {int x, y;};
16197   static struct point const zero = {0,0};
16198   /* AIX XL C 1.02.0.0 rejects this.
16199      It does not let you subtract one const X* pointer from another in
16200      an arm of an if-expression whose if-part is not a constant
16201      expression */
16202   const char *g = "string";
16203   ccp = &g + (g ? g-g : 0);
16204   /* HPUX 7.0 cc rejects these. */
16205   ++ccp;
16206   p = (char**) ccp;
16207   ccp = (char const *const *) p;
16208   { /* SCO 3.2v4 cc rejects this.  */
16209     char *t;
16210     char const *s = 0 ? (char *) 0 : (char const *) 0;
16211
16212     *t++ = 0;
16213   }
16214   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16215     int x[] = {25, 17};
16216     const int *foo = &x[0];
16217     ++foo;
16218   }
16219   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16220     typedef const int *iptr;
16221     iptr p = 0;
16222     ++p;
16223   }
16224   { /* AIX XL C 1.02.0.0 rejects this saying
16225        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16226     struct s { int j; const int *ap[3]; };
16227     struct s *b; b->j = 5;
16228   }
16229   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16230     const int foo = 10;
16231   }
16232 #endif
16233
16234   ;
16235   return 0;
16236 }
16237 _ACEOF
16238 rm -f conftest.$ac_objext
16239 if { (eval echo "$as_me:16239: \"$ac_compile\"") >&5
16240   (eval $ac_compile) 2>&5
16241   ac_status=$?
16242   echo "$as_me:16242: \$? = $ac_status" >&5
16243   (exit $ac_status); } &&
16244          { ac_try='test -s conftest.$ac_objext'
16245   { (eval echo "$as_me:16245: \"$ac_try\"") >&5
16246   (eval $ac_try) 2>&5
16247   ac_status=$?
16248   echo "$as_me:16248: \$? = $ac_status" >&5
16249   (exit $ac_status); }; }; then
16250   ac_cv_c_const=yes
16251 else
16252   echo "$as_me: failed program was:" >&5
16253 cat conftest.$ac_ext >&5
16254 ac_cv_c_const=no
16255 fi
16256 rm -f conftest.$ac_objext conftest.$ac_ext
16257 fi
16258 echo "$as_me:16258: result: $ac_cv_c_const" >&5
16259 echo "${ECHO_T}$ac_cv_c_const" >&6
16260 if test $ac_cv_c_const = no; then
16261
16262 cat >>confdefs.h <<\EOF
16263 #define const
16264 EOF
16265
16266 fi
16267
16268 ###     Checks for external-data
16269
16270 echo "$as_me:16270: checking if data-only library module links" >&5
16271 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16272 if test "${cf_cv_link_dataonly+set}" = set; then
16273   echo $ECHO_N "(cached) $ECHO_C" >&6
16274 else
16275
16276         rm -f conftest.a
16277         cat >conftest.$ac_ext <<EOF
16278 #line 16278 "configure"
16279 int     testdata[3] = { 123, 456, 789 };
16280 EOF
16281         if { (eval echo "$as_me:16281: \"$ac_compile\"") >&5
16282   (eval $ac_compile) 2>&5
16283   ac_status=$?
16284   echo "$as_me:16284: \$? = $ac_status" >&5
16285   (exit $ac_status); } ; then
16286                 mv conftest.o data.o && \
16287                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16288         fi
16289         rm -f conftest.$ac_ext data.o
16290         cat >conftest.$ac_ext <<EOF
16291 #line 16291 "configure"
16292 int     testfunc(void)
16293 {
16294 #if defined(NeXT)
16295         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16296 #else
16297         extern int testdata[3];
16298         return testdata[0] == 123
16299            &&  testdata[1] == 456
16300            &&  testdata[2] == 789;
16301 #endif
16302 }
16303 EOF
16304         if { (eval echo "$as_me:16304: \"$ac_compile\"") >&5
16305   (eval $ac_compile) 2>&5
16306   ac_status=$?
16307   echo "$as_me:16307: \$? = $ac_status" >&5
16308   (exit $ac_status); }; then
16309                 mv conftest.o func.o && \
16310                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16311         fi
16312         rm -f conftest.$ac_ext func.o
16313         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16314         cf_saveLIBS="$LIBS"
16315         LIBS="conftest.a $LIBS"
16316         if test "$cross_compiling" = yes; then
16317   cf_cv_link_dataonly=unknown
16318 else
16319   cat >conftest.$ac_ext <<_ACEOF
16320 #line 16320 "configure"
16321 #include "confdefs.h"
16322
16323         int main(void)
16324         {
16325                 extern int testfunc();
16326                 ${cf_cv_main_return:-return} (!testfunc());
16327         }
16328
16329 _ACEOF
16330 rm -f conftest$ac_exeext
16331 if { (eval echo "$as_me:16331: \"$ac_link\"") >&5
16332   (eval $ac_link) 2>&5
16333   ac_status=$?
16334   echo "$as_me:16334: \$? = $ac_status" >&5
16335   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16336   { (eval echo "$as_me:16336: \"$ac_try\"") >&5
16337   (eval $ac_try) 2>&5
16338   ac_status=$?
16339   echo "$as_me:16339: \$? = $ac_status" >&5
16340   (exit $ac_status); }; }; then
16341   cf_cv_link_dataonly=yes
16342 else
16343   echo "$as_me: program exited with status $ac_status" >&5
16344 echo "$as_me: failed program was:" >&5
16345 cat conftest.$ac_ext >&5
16346 cf_cv_link_dataonly=no
16347 fi
16348 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16349 fi
16350         LIBS="$cf_saveLIBS"
16351
16352 fi
16353
16354 echo "$as_me:16354: result: $cf_cv_link_dataonly" >&5
16355 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16356
16357 if test "$cf_cv_link_dataonly" = no ; then
16358
16359 cat >>confdefs.h <<\EOF
16360 #define BROKEN_LINKER 1
16361 EOF
16362
16363         BROKEN_LINKER=1
16364 fi
16365
16366 ###     Checks for library functions.
16367
16368 for ac_header in \
16369 unistd.h \
16370
16371 do
16372 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16373 echo "$as_me:16373: checking for $ac_header" >&5
16374 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16375 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16376   echo $ECHO_N "(cached) $ECHO_C" >&6
16377 else
16378   cat >conftest.$ac_ext <<_ACEOF
16379 #line 16379 "configure"
16380 #include "confdefs.h"
16381 #include <$ac_header>
16382 _ACEOF
16383 if { (eval echo "$as_me:16383: \"$ac_cpp conftest.$ac_ext\"") >&5
16384   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16385   ac_status=$?
16386   egrep -v '^ *\+' conftest.er1 >conftest.err
16387   rm -f conftest.er1
16388   cat conftest.err >&5
16389   echo "$as_me:16389: \$? = $ac_status" >&5
16390   (exit $ac_status); } >/dev/null; then
16391   if test -s conftest.err; then
16392     ac_cpp_err=$ac_c_preproc_warn_flag
16393   else
16394     ac_cpp_err=
16395   fi
16396 else
16397   ac_cpp_err=yes
16398 fi
16399 if test -z "$ac_cpp_err"; then
16400   eval "$as_ac_Header=yes"
16401 else
16402   echo "$as_me: failed program was:" >&5
16403   cat conftest.$ac_ext >&5
16404   eval "$as_ac_Header=no"
16405 fi
16406 rm -f conftest.err conftest.$ac_ext
16407 fi
16408 echo "$as_me:16408: result: `eval echo '${'$as_ac_Header'}'`" >&5
16409 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16410 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16411   cat >>confdefs.h <<EOF
16412 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16413 EOF
16414
16415 fi
16416 done
16417
16418 echo "$as_me:16418: checking for working mkstemp" >&5
16419 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16420 if test "${cf_cv_func_mkstemp+set}" = set; then
16421   echo $ECHO_N "(cached) $ECHO_C" >&6
16422 else
16423
16424 rm -rf conftest*
16425 if test "$cross_compiling" = yes; then
16426   cf_cv_func_mkstemp=maybe
16427 else
16428   cat >conftest.$ac_ext <<_ACEOF
16429 #line 16429 "configure"
16430 #include "confdefs.h"
16431
16432 #include <sys/types.h>
16433 #ifdef HAVE_UNISTD_H
16434 #include <unistd.h>
16435 #endif
16436 #include <stdlib.h>
16437 #include <stdio.h>
16438 #include <string.h>
16439 #include <sys/stat.h>
16440 int main(void)
16441 {
16442         char *tmpl = "conftestXXXXXX";
16443         char name[2][80];
16444         int n;
16445         int result = 0;
16446         int fd;
16447         struct stat sb;
16448
16449         umask(077);
16450         for (n = 0; n < 2; ++n) {
16451                 strcpy(name[n], tmpl);
16452                 if ((fd = mkstemp(name[n])) >= 0) {
16453                         if (!strcmp(name[n], tmpl)
16454                          || stat(name[n], &sb) != 0
16455                          || (sb.st_mode & S_IFMT) != S_IFREG
16456                          || (sb.st_mode & 077) != 0) {
16457                                 result = 1;
16458                         }
16459                         close(fd);
16460                 }
16461         }
16462         if (result == 0
16463          && !strcmp(name[0], name[1]))
16464                 result = 1;
16465         ${cf_cv_main_return:-return}(result);
16466 }
16467
16468 _ACEOF
16469 rm -f conftest$ac_exeext
16470 if { (eval echo "$as_me:16470: \"$ac_link\"") >&5
16471   (eval $ac_link) 2>&5
16472   ac_status=$?
16473   echo "$as_me:16473: \$? = $ac_status" >&5
16474   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16475   { (eval echo "$as_me:16475: \"$ac_try\"") >&5
16476   (eval $ac_try) 2>&5
16477   ac_status=$?
16478   echo "$as_me:16478: \$? = $ac_status" >&5
16479   (exit $ac_status); }; }; then
16480   cf_cv_func_mkstemp=yes
16481
16482 else
16483   echo "$as_me: program exited with status $ac_status" >&5
16484 echo "$as_me: failed program was:" >&5
16485 cat conftest.$ac_ext >&5
16486 cf_cv_func_mkstemp=no
16487
16488 fi
16489 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16490 fi
16491
16492 fi
16493 echo "$as_me:16493: result: $cf_cv_func_mkstemp" >&5
16494 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16495 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16496         echo "$as_me:16496: checking for mkstemp" >&5
16497 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16498 if test "${ac_cv_func_mkstemp+set}" = set; then
16499   echo $ECHO_N "(cached) $ECHO_C" >&6
16500 else
16501   cat >conftest.$ac_ext <<_ACEOF
16502 #line 16502 "configure"
16503 #include "confdefs.h"
16504 #define mkstemp autoconf_temporary
16505 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16506 #undef mkstemp
16507
16508 #ifdef __cplusplus
16509 extern "C"
16510 #endif
16511
16512 /* We use char because int might match the return type of a gcc2
16513    builtin and then its argument prototype would still apply.  */
16514 char mkstemp (void);
16515
16516 int
16517 main (void)
16518 {
16519
16520 /* The GNU C library defines stubs for functions which it implements
16521     to always fail with ENOSYS.  Some functions are actually named
16522     something starting with __ and the normal name is an alias.  */
16523 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16524 #error found stub for mkstemp
16525 #endif
16526
16527         return mkstemp ();
16528   ;
16529   return 0;
16530 }
16531 _ACEOF
16532 rm -f conftest.$ac_objext conftest$ac_exeext
16533 if { (eval echo "$as_me:16533: \"$ac_link\"") >&5
16534   (eval $ac_link) 2>&5
16535   ac_status=$?
16536   echo "$as_me:16536: \$? = $ac_status" >&5
16537   (exit $ac_status); } &&
16538          { ac_try='test -s conftest$ac_exeext'
16539   { (eval echo "$as_me:16539: \"$ac_try\"") >&5
16540   (eval $ac_try) 2>&5
16541   ac_status=$?
16542   echo "$as_me:16542: \$? = $ac_status" >&5
16543   (exit $ac_status); }; }; then
16544   ac_cv_func_mkstemp=yes
16545 else
16546   echo "$as_me: failed program was:" >&5
16547 cat conftest.$ac_ext >&5
16548 ac_cv_func_mkstemp=no
16549 fi
16550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16551 fi
16552 echo "$as_me:16552: result: $ac_cv_func_mkstemp" >&5
16553 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16554
16555 fi
16556 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16557
16558 cat >>confdefs.h <<\EOF
16559 #define HAVE_MKSTEMP 1
16560 EOF
16561
16562 fi
16563
16564 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16565         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16566         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16567 fi
16568
16569 cf_with_ada=yes
16570 if test "$cf_with_ada" != "no" ; then
16571
16572 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16573 do
16574
16575 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16576
16577         unset ac_cv_path_cf_TEMP_gnat
16578         unset cf_TEMP_gnat
16579         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16580 set dummy $cf_prog_gnat; ac_word=$2
16581 echo "$as_me:16581: checking for $ac_word" >&5
16582 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16583 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16584   echo $ECHO_N "(cached) $ECHO_C" >&6
16585 else
16586   case $cf_TEMP_gnat in
16587   [\\/]* | ?:[\\/]*)
16588   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16589   ;;
16590   *)
16591   ac_save_IFS=$IFS; IFS=$ac_path_separator
16592 ac_dummy="$PATH"
16593 for ac_dir in $ac_dummy; do
16594   IFS=$ac_save_IFS
16595   test -z "$ac_dir" && ac_dir=.
16596   if $as_executable_p "$ac_dir/$ac_word"; then
16597    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16598    echo "$as_me:16598: found $ac_dir/$ac_word" >&5
16599    break
16600 fi
16601 done
16602
16603   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16604   ;;
16605 esac
16606 fi
16607 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16608
16609 if test -n "$cf_TEMP_gnat"; then
16610   echo "$as_me:16610: result: $cf_TEMP_gnat" >&5
16611 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16612 else
16613   echo "$as_me:16613: result: no" >&5
16614 echo "${ECHO_T}no" >&6
16615 fi
16616
16617         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16618
16619         if test "x$cf_TEMP_gnat" != xno; then
16620                 unset cf_cv_gnat_version
16621                 unset cf_TEMP_gnat
16622
16623 echo "$as_me:16623: checking for $cf_prog_gnat version" >&5
16624 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16625 if test "${cf_cv_gnat_version+set}" = set; then
16626   echo $ECHO_N "(cached) $ECHO_C" >&6
16627 else
16628
16629 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16630         grep '[0-9].[0-9][0-9]*' |\
16631         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16632
16633 fi
16634 echo "$as_me:16634: result: $cf_cv_gnat_version" >&5
16635 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16636 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16637 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16638
16639         fi
16640         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16641
16642         unset cf_TEMP_gnat
16643         unset cf_cv_gnat_version
16644         unset ac_cv_path_cf_TEMP_gnat
16645 done
16646
16647 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16648         cf_ada_make=
16649         cf_cv_prog_gnat_correct=no
16650 else
16651         cf_ada_make=gnatmake
16652         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16653                 # gprconfig is newer than gnatmake; we can continue...
16654                 cf_ada_config="##"
16655         else
16656                 rm -rf conftest* *~conftest*
16657                 if mkdir conftest.src
16658                 then
16659                         cf_ada_config=""
16660                         cd conftest.src
16661                         for cf_gprconfig in Ada C
16662                         do
16663                                 echo "$as_me:16663: checking for gprconfig name for $cf_gprconfig" >&5
16664 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16665                                 if test $cf_gprconfig = C
16666                                 then
16667                                         for cf_gprconfig_param in \
16668                                                 $cf_gprconfig,,,,GNATGCC \
16669                                                 $cf_gprconfig,,,,GCC \
16670                                                 $cf_gprconfig
16671                                         do
16672                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16673                                                 test -n "$cf_gprconfig_value" && break
16674                                         done
16675                                 else
16676                                         cf_gprconfig_param=$cf_gprconfig
16677                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16678                                 fi
16679                                 if test -n "$cf_gprconfig_value"
16680                                 then
16681                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16682                                         echo "$as_me:16682: result: $cf_gprconfig_value" >&5
16683 echo "${ECHO_T}$cf_gprconfig_value" >&6
16684                                 else
16685                                         echo "$as_me:16685: result: missing" >&5
16686 echo "${ECHO_T}missing" >&6
16687                                         cf_ada_config="#"
16688                                         break
16689                                 fi
16690                         done
16691                         cd ..
16692                         rm -rf conftest* *~conftest*
16693                 fi
16694         fi
16695         if test "x$cf_ada_config" != "x#"
16696         then
16697
16698 echo "$as_me:16698: checking for gnat version" >&5
16699 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16700 if test "${cf_cv_gnat_version+set}" = set; then
16701   echo $ECHO_N "(cached) $ECHO_C" >&6
16702 else
16703
16704 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16705         grep '[0-9].[0-9][0-9]*' |\
16706         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16707
16708 fi
16709 echo "$as_me:16709: result: $cf_cv_gnat_version" >&5
16710 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16711 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16712
16713 case $cf_cv_gnat_version in
16714 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16715         cf_cv_prog_gnat_correct=yes
16716         ;;
16717 (*)
16718         { echo "$as_me:16718: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16719 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16720         cf_cv_prog_gnat_correct=no
16721         ;;
16722 esac
16723
16724                 # Extract the first word of "m4", so it can be a program name with args.
16725 set dummy m4; ac_word=$2
16726 echo "$as_me:16726: checking for $ac_word" >&5
16727 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16728 if test "${ac_cv_prog_M4_exists+set}" = set; then
16729   echo $ECHO_N "(cached) $ECHO_C" >&6
16730 else
16731   if test -n "$M4_exists"; then
16732   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16733 else
16734   ac_save_IFS=$IFS; IFS=$ac_path_separator
16735 ac_dummy="$PATH"
16736 for ac_dir in $ac_dummy; do
16737   IFS=$ac_save_IFS
16738   test -z "$ac_dir" && ac_dir=.
16739   $as_executable_p "$ac_dir/$ac_word" || continue
16740 ac_cv_prog_M4_exists="yes"
16741 echo "$as_me:16741: found $ac_dir/$ac_word" >&5
16742 break
16743 done
16744
16745   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16746 fi
16747 fi
16748 M4_exists=$ac_cv_prog_M4_exists
16749 if test -n "$M4_exists"; then
16750   echo "$as_me:16750: result: $M4_exists" >&5
16751 echo "${ECHO_T}$M4_exists" >&6
16752 else
16753   echo "$as_me:16753: result: no" >&5
16754 echo "${ECHO_T}no" >&6
16755 fi
16756
16757                 if test "$ac_cv_prog_M4_exists" = no; then
16758                         cf_cv_prog_gnat_correct=no
16759                         { echo "$as_me:16759: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16760 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16761                 fi
16762                 if test "$cf_cv_prog_gnat_correct" = yes; then
16763                         echo "$as_me:16763: checking if GNAT works" >&5
16764 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16765
16766 rm -rf conftest* *~conftest*
16767 cat >>conftest.ads <<CF_EOF
16768 procedure conftest;
16769 CF_EOF
16770 cat >>conftest.adb <<CF_EOF
16771 with Text_IO;
16772 with GNAT.OS_Lib;
16773 procedure conftest is
16774 begin
16775    Text_IO.Put ("Hello World");
16776    Text_IO.New_Line;
16777    GNAT.OS_Lib.OS_Exit (0);
16778 end conftest;
16779 CF_EOF
16780 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16781    if ( ./conftest 1>&5 2>&1 ) ; then
16782       cf_cv_prog_gnat_correct=yes
16783    else
16784       cf_cv_prog_gnat_correct=no
16785    fi
16786 else
16787    cf_cv_prog_gnat_correct=no
16788 fi
16789 rm -rf conftest* *~conftest*
16790
16791                         echo "$as_me:16791: result: $cf_cv_prog_gnat_correct" >&5
16792 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16793                 fi
16794         else
16795                 cf_cv_prog_gnat_correct=no
16796         fi
16797 fi
16798
16799         if test "$cf_cv_prog_gnat_correct" = yes; then
16800
16801         echo "$as_me:16801: checking optimization options for ADAFLAGS" >&5
16802 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16803         case "$CFLAGS" in
16804         (*-g*)
16805
16806         ADAFLAGS="$ADAFLAGS -g"
16807
16808                 ;;
16809         esac
16810         case "$CFLAGS" in
16811         (*-O*)
16812                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16813
16814         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16815
16816                 ;;
16817         esac
16818         echo "$as_me:16818: result: $ADAFLAGS" >&5
16819 echo "${ECHO_T}$ADAFLAGS" >&6
16820
16821 echo "$as_me:16821: checking if GNATPREP supports -T option" >&5
16822 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16823 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16824   echo $ECHO_N "(cached) $ECHO_C" >&6
16825 else
16826
16827 cf_cv_gnatprep_opt_t=no
16828 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16829
16830 fi
16831 echo "$as_me:16831: result: $cf_cv_gnatprep_opt_t" >&5
16832 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16833 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16834
16835 echo "$as_me:16835: checking if GNAT supports generics" >&5
16836 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16837 case $cf_cv_gnat_version in
16838 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16839         cf_gnat_generics=yes
16840         ;;
16841 (*)
16842         cf_gnat_generics=no
16843         ;;
16844 esac
16845 echo "$as_me:16845: result: $cf_gnat_generics" >&5
16846 echo "${ECHO_T}$cf_gnat_generics" >&6
16847
16848 if test "$cf_gnat_generics" = yes
16849 then
16850         cf_compile_generics=generics
16851         cf_generic_objects="\${GENOBJS}"
16852 else
16853         cf_compile_generics=
16854         cf_generic_objects=
16855 fi
16856
16857 echo "$as_me:16857: checking if GNAT supports SIGINT" >&5
16858 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16859 if test "${cf_cv_gnat_sigint+set}" = set; then
16860   echo $ECHO_N "(cached) $ECHO_C" >&6
16861 else
16862
16863 rm -rf conftest* *~conftest*
16864 cat >>conftest.ads <<CF_EOF
16865 with Ada.Interrupts.Names;
16866
16867 package ConfTest is
16868
16869    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16870    pragma Unreserve_All_Interrupts;
16871    pragma Warnings (On);
16872
16873    protected Process is
16874       procedure Stop;
16875       function Continue return Boolean;
16876       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16877    private
16878       Done : Boolean := False;
16879    end Process;
16880
16881 end ConfTest;
16882 CF_EOF
16883 cat >>conftest.adb <<CF_EOF
16884 package body ConfTest is
16885    protected body Process is
16886       procedure Stop is
16887       begin
16888          Done := True;
16889       end Stop;
16890       function Continue return Boolean is
16891       begin
16892          return not Done;
16893       end Continue;
16894    end Process;
16895 end ConfTest;
16896 CF_EOF
16897 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16898       cf_cv_gnat_sigint=yes
16899 else
16900    cf_cv_gnat_sigint=no
16901 fi
16902 rm -rf conftest* *~conftest*
16903
16904 fi
16905 echo "$as_me:16905: result: $cf_cv_gnat_sigint" >&5
16906 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16907
16908 if test $cf_cv_gnat_sigint = yes ; then
16909         USE_GNAT_SIGINT=""
16910 else
16911         USE_GNAT_SIGINT="#"
16912 fi
16913
16914 cf_gnat_libraries=no
16915 cf_gnat_projects=no
16916
16917 if test "$enable_gnat_projects" != no ; then
16918 echo "$as_me:16918: checking if GNAT supports project files" >&5
16919 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16920 case $cf_cv_gnat_version in
16921 (3.[0-9]*)
16922         ;;
16923 (*)
16924         case $cf_cv_system_name in
16925         (cygwin*|msys*)
16926                 ;;
16927         (*)
16928                 rm -rf conftest* *~conftest*
16929                 if mkdir conftest.src conftest.bin conftest.lib
16930                 then
16931                         cd conftest.src
16932                         rm -rf conftest* *~conftest*
16933                         cat >>library.gpr <<CF_EOF
16934 project Library is
16935   Kind := External ("LIB_KIND");
16936   for Library_Name use "ConfTest";
16937   for Object_Dir use ".";
16938   for Library_ALI_Dir use External("LIBRARY_DIR");
16939   for Library_Version use External ("SONAME");
16940   for Library_Kind use Kind;
16941   for Library_Dir use External("BUILD_DIR");
16942   Source_Dir := External ("SOURCE_DIR");
16943   for Source_Dirs use (Source_Dir);
16944 end Library;
16945 CF_EOF
16946                         cat >>confpackage.ads <<CF_EOF
16947 package ConfPackage is
16948    procedure conftest;
16949 end ConfPackage;
16950 CF_EOF
16951                         cat >>confpackage.adb <<CF_EOF
16952 with Text_IO;
16953 package body ConfPackage is
16954    procedure conftest is
16955    begin
16956       Text_IO.Put ("Hello World");
16957       Text_IO.New_Line;
16958    end conftest;
16959 end ConfPackage;
16960 CF_EOF
16961                         if ( $cf_ada_make $ADAFLAGS \
16962                                         -Plibrary.gpr \
16963                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
16964                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
16965                                         -XSOURCE_DIR=`pwd` \
16966                                         -XSONAME=libConfTest.so.1 \
16967                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
16968                                 cf_gnat_projects=yes
16969                         fi
16970                         cd ..
16971                 fi
16972                 if test -f conftest.lib/confpackage.ali
16973                 then
16974                         cf_gnat_libraries=yes
16975                 fi
16976                 rm -rf conftest* *~conftest*
16977                 ;;
16978         esac
16979         ;;
16980 esac
16981 echo "$as_me:16981: result: $cf_gnat_projects" >&5
16982 echo "${ECHO_T}$cf_gnat_projects" >&6
16983 fi # enable_gnat_projects
16984
16985 if test $cf_gnat_projects = yes
16986 then
16987         echo "$as_me:16987: checking if GNAT supports libraries" >&5
16988 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
16989         echo "$as_me:16989: result: $cf_gnat_libraries" >&5
16990 echo "${ECHO_T}$cf_gnat_libraries" >&6
16991 fi
16992
16993 if test "$cf_gnat_projects" = yes
16994 then
16995         USE_OLD_MAKERULES="#"
16996         USE_GNAT_PROJECTS=""
16997 else
16998         USE_OLD_MAKERULES=""
16999         USE_GNAT_PROJECTS="#"
17000 fi
17001
17002 if test "$cf_gnat_libraries" = yes
17003 then
17004         USE_GNAT_LIBRARIES=""
17005 else
17006         USE_GNAT_LIBRARIES="#"
17007 fi
17008
17009 echo "$as_me:17009: checking for ada-compiler" >&5
17010 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17011
17012 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17013 if test "${with_ada_compiler+set}" = set; then
17014   withval="$with_ada_compiler"
17015   cf_ada_compiler=$withval
17016 else
17017   cf_ada_compiler=gnatmake
17018 fi;
17019
17020 echo "$as_me:17020: result: $cf_ada_compiler" >&5
17021 echo "${ECHO_T}$cf_ada_compiler" >&6
17022
17023                 cf_ada_package=terminal_interface
17024
17025 echo "$as_me:17025: checking for ada-include" >&5
17026 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17027
17028 # Check whether --with-ada-include or --without-ada-include was given.
17029 if test "${with_ada_include+set}" = set; then
17030   withval="$with_ada_include"
17031
17032 else
17033   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17034 fi; if test -n "$prefix/share/ada/adainclude" ; then
17035
17036 if test "x$prefix" != xNONE; then
17037         cf_path_syntax="$prefix"
17038 else
17039         cf_path_syntax="$ac_default_prefix"
17040 fi
17041
17042 case ".$withval" in
17043 (.\$\(*\)*|.\'*\'*)
17044         ;;
17045 (..|./*|.\\*)
17046         ;;
17047 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17048         ;;
17049 (.\${*prefix}*|.\${*dir}*)
17050         eval withval="$withval"
17051         case ".$withval" in
17052         (.NONE/*)
17053                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17054                 ;;
17055         esac
17056         ;;
17057 (.no|.NONE/*)
17058         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17059         ;;
17060 (*)
17061         { { echo "$as_me:17061: error: expected a pathname, not \"$withval\"" >&5
17062 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17063    { (exit 1); exit 1; }; }
17064         ;;
17065 esac
17066
17067 fi
17068 eval ADA_INCLUDE="$withval"
17069
17070 echo "$as_me:17070: result: $ADA_INCLUDE" >&5
17071 echo "${ECHO_T}$ADA_INCLUDE" >&6
17072
17073 echo "$as_me:17073: checking for ada-objects" >&5
17074 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17075
17076 # Check whether --with-ada-objects or --without-ada-objects was given.
17077 if test "${with_ada_objects+set}" = set; then
17078   withval="$with_ada_objects"
17079
17080 else
17081   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17082 fi; if test -n "$prefix/lib/ada/adalib" ; then
17083
17084 if test "x$prefix" != xNONE; then
17085         cf_path_syntax="$prefix"
17086 else
17087         cf_path_syntax="$ac_default_prefix"
17088 fi
17089
17090 case ".$withval" in
17091 (.\$\(*\)*|.\'*\'*)
17092         ;;
17093 (..|./*|.\\*)
17094         ;;
17095 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17096         ;;
17097 (.\${*prefix}*|.\${*dir}*)
17098         eval withval="$withval"
17099         case ".$withval" in
17100         (.NONE/*)
17101                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17102                 ;;
17103         esac
17104         ;;
17105 (.no|.NONE/*)
17106         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17107         ;;
17108 (*)
17109         { { echo "$as_me:17109: error: expected a pathname, not \"$withval\"" >&5
17110 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17111    { (exit 1); exit 1; }; }
17112         ;;
17113 esac
17114
17115 fi
17116 eval ADA_OBJECTS="$withval"
17117
17118 echo "$as_me:17118: result: $ADA_OBJECTS" >&5
17119 echo "${ECHO_T}$ADA_OBJECTS" >&6
17120
17121 echo "$as_me:17121: checking if an Ada95 shared-library should be built" >&5
17122 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17123
17124 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17125 if test "${with_ada_sharedlib+set}" = set; then
17126   withval="$with_ada_sharedlib"
17127   with_ada_sharedlib=$withval
17128 else
17129   with_ada_sharedlib=no
17130 fi;
17131 echo "$as_me:17131: result: $with_ada_sharedlib" >&5
17132 echo "${ECHO_T}$with_ada_sharedlib" >&6
17133
17134 if test "x$with_ada_sharedlib" != xno
17135 then
17136         if test "x$cf_gnat_projects" != xyes
17137         then
17138                 { echo "$as_me:17138: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17139 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17140                 with_ada_sharedlib=no
17141         fi
17142 fi
17143
17144 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17145 MAKE_ADA_SHAREDLIB="#"
17146
17147 if test "x$with_ada_sharedlib" != xno
17148 then
17149         MAKE_ADA_SHAREDLIB=
17150         if test "x$with_ada_sharedlib" != xyes
17151         then
17152                 ADA_SHAREDLIB="$with_ada_sharedlib"
17153         fi
17154 fi
17155
17156                 # allow the Ada binding to be renamed
17157
17158 echo "$as_me:17158: checking for ada-libname" >&5
17159 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17160
17161 # Check whether --with-ada-libname or --without-ada-libname was given.
17162 if test "${with_ada_libname+set}" = set; then
17163   withval="$with_ada_libname"
17164   ADA_LIBNAME=$withval
17165 else
17166   ADA_LIBNAME=AdaCurses
17167 fi;
17168 case "x$ADA_LIBNAME" in
17169 (x|xyes|xno)
17170         ADA_LIBNAME=AdaCurses
17171         ;;
17172 esac
17173
17174 echo "$as_me:17174: result: $ADA_LIBNAME" >&5
17175 echo "${ECHO_T}$ADA_LIBNAME" >&6
17176
17177         else
17178                 { { echo "$as_me:17178: error: No usable Ada compiler found" >&5
17179 echo "$as_me: error: No usable Ada compiler found" >&2;}
17180    { (exit 1); exit 1; }; }
17181         fi
17182 else
17183         { { echo "$as_me:17183: error: The Ada compiler is needed for this package" >&5
17184 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17185    { (exit 1); exit 1; }; }
17186 fi
17187
17188 ################################################################################
17189
17190 # not needed
17191 TINFO_LDFLAGS2=
17192
17193 TINFO_LIBS=
17194
17195 ### Construct the list of include-directories to be generated
17196
17197 if test "$srcdir" != "."; then
17198         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17199 fi
17200 CPPFLAGS="-I../include $CPPFLAGS"
17201 if test "$srcdir" != "."; then
17202         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17203 fi
17204 CPPFLAGS="-I. $CPPFLAGS"
17205
17206 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17207 if test "$srcdir" != "."; then
17208         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17209 fi
17210 if test "$GCC" != yes; then
17211         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17212 elif test "$includedir" != "/usr/include"; then
17213         if test "$includedir" = '${prefix}/include' ; then
17214                 if test x$prefix != x/usr ; then
17215                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17216                 fi
17217         else
17218                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17219         fi
17220 fi
17221
17222 ### Build up pieces for makefile rules
17223 echo "$as_me:17223: checking default library suffix" >&5
17224 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17225
17226         case $DFT_LWR_MODEL in
17227         (libtool) DFT_ARG_SUFFIX=''   ;;
17228         (normal)  DFT_ARG_SUFFIX=''   ;;
17229         (debug)   DFT_ARG_SUFFIX='_g' ;;
17230         (profile) DFT_ARG_SUFFIX='_p' ;;
17231         (shared)  DFT_ARG_SUFFIX=''   ;;
17232         esac
17233         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17234 echo "$as_me:17234: result: $DFT_ARG_SUFFIX" >&5
17235 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17236
17237 echo "$as_me:17237: checking default library-dependency suffix" >&5
17238 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17239
17240         case X$DFT_LWR_MODEL in
17241         (Xlibtool)
17242                 DFT_LIB_SUFFIX='.la'
17243                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17244                 ;;
17245         (Xdebug)
17246                 case $cf_cv_system_name in
17247                 (*-msvc*)
17248                         DFT_LIB_SUFFIX='_g.lib'
17249                         ;;
17250                 (*)
17251                         DFT_LIB_SUFFIX='_g.a'
17252                         ;;
17253                 esac
17254                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17255                 ;;
17256         (Xprofile)
17257                 case $cf_cv_system_name in
17258                 (*-msvc*)
17259                         DFT_LIB_SUFFIX='_p.lib'
17260                         ;;
17261                 (*)
17262                         DFT_LIB_SUFFIX='_p.a'
17263                         ;;
17264                 esac
17265                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17266                 ;;
17267         (Xshared)
17268                 case $cf_cv_system_name in
17269                 (aix[5-7]*)
17270                         DFT_LIB_SUFFIX='.so'
17271                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17272                         ;;
17273                 (*-msvc*)
17274                         DFT_LIB_SUFFIX='.dll'
17275                         DFT_DEP_SUFFIX='.dll.lib'
17276                         ;;
17277                 (cygwin*|msys*|mingw*)
17278                         DFT_LIB_SUFFIX='.dll'
17279                         DFT_DEP_SUFFIX='.dll.a'
17280                         ;;
17281                 (darwin*)
17282                         DFT_LIB_SUFFIX='.dylib'
17283                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17284                         ;;
17285                 (hpux*)
17286                         case $target in
17287                         (ia64*)
17288                                 DFT_LIB_SUFFIX='.so'
17289                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17290                                 ;;
17291                         (*)
17292                                 DFT_LIB_SUFFIX='.sl'
17293                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17294                                 ;;
17295                         esac
17296                         ;;
17297                 (*)
17298                         DFT_LIB_SUFFIX='.so'
17299                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17300                         ;;
17301                 esac
17302                 ;;
17303         (*)
17304                 case $target in
17305                 (*-msvc*)
17306                         DFT_LIB_SUFFIX='.lib'
17307                         ;;
17308                 (*)
17309                         DFT_LIB_SUFFIX='.a'
17310                         ;;
17311                 esac
17312                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17313                 ;;
17314         esac
17315         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17316         then
17317                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17318                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17319         fi
17320 echo "$as_me:17320: result: $DFT_DEP_SUFFIX" >&5
17321 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17322
17323 echo "$as_me:17323: checking default object directory" >&5
17324 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17325
17326         case $DFT_LWR_MODEL in
17327         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17328         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17329         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17330         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17331         (shared)
17332                 case $cf_cv_system_name in
17333                 (cygwin|msys)
17334                         DFT_OBJ_SUBDIR='objects' ;;
17335                 (*)
17336                         DFT_OBJ_SUBDIR='obj_s' ;;
17337                 esac
17338         esac
17339 echo "$as_me:17339: result: $DFT_OBJ_SUBDIR" >&5
17340 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17341
17342 ### Set up low-level terminfo dependencies for makefiles.
17343
17344 if test "$DFT_LWR_MODEL" = shared ; then
17345         case $cf_cv_system_name in
17346         (cygwin*)
17347                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17348                 ;;
17349         (msys*)
17350                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17351                 ;;
17352         esac
17353 fi
17354
17355 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17356
17357 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17358
17359 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17360
17361 ### Construct the list of subdirectories for which we'll customize makefiles
17362 ### with the appropriate compile-rules.
17363
17364 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17365
17366 cat >>confdefs.h <<EOF
17367 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17368 EOF
17369
17370 ################################################################################
17371
17372 TEST_ARG2=
17373
17374 TEST_LIBS2=
17375
17376 NCURSES_SHLIB2="sh -c"
17377
17378 ADA_SUBDIRS="include gen src doc"
17379 if test "x$cf_with_tests" != "xno" ; then
17380         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17381 fi
17382 for cf_dir in $ADA_SUBDIRS
17383 do
17384         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17385 done
17386
17387 NCURSES_TREE="#"
17388
17389 EXTERNAL_TREE=
17390
17391 # match layout used by make-tar.sh
17392 ADAHTML_DIR=../doc/ada
17393
17394 if test "x$cross_compiling" = xyes ; then
17395         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17396 else
17397         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17398 fi
17399
17400 ac_config_files="$ac_config_files $SUB_MAKEFILES src/library.gpr:src/library.gpr.in doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
17401 ac_config_commands="$ac_config_commands default"
17402 cat >confcache <<\_ACEOF
17403 # This file is a shell script that caches the results of configure
17404 # tests run on this system so they can be shared between configure
17405 # scripts and configure runs, see configure's option --config-cache.
17406 # It is not useful on other systems.  If it contains results you don't
17407 # want to keep, you may remove or edit it.
17408 #
17409 # config.status only pays attention to the cache file if you give it
17410 # the --recheck option to rerun configure.
17411 #
17412 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17413 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17414 # following values.
17415
17416 _ACEOF
17417
17418 # The following way of writing the cache mishandles newlines in values,
17419 # but we know of no workaround that is simple, portable, and efficient.
17420 # So, don't put newlines in cache variables' values.
17421 # Ultrix sh set writes to stderr and can't be redirected directly,
17422 # and sets the high bit in the cache file unless we assign to the vars.
17423 {
17424   (set) 2>&1 |
17425     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17426     *ac_space=\ *)
17427       # `set' does not quote correctly, so add quotes (double-quote
17428       # substitution turns \\\\ into \\, and sed turns \\ into \).
17429       sed -n \
17430         "s/'/'\\\\''/g;
17431           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17432       ;;
17433     *)
17434       # `set' quotes correctly as required by POSIX, so do not add quotes.
17435       sed -n \
17436         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17437       ;;
17438     esac;
17439 } |
17440   sed '
17441      t clear
17442      : clear
17443      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17444      t end
17445      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17446      : end' >>confcache
17447 if cmp -s $cache_file confcache; then :; else
17448   if test -w $cache_file; then
17449     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17450     cat confcache >$cache_file
17451   else
17452     echo "not updating unwritable cache $cache_file"
17453   fi
17454 fi
17455 rm -f confcache
17456
17457 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17458 # Let make expand exec_prefix.
17459 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17460
17461 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17462 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17463 # trailing colons and then remove the whole line if VPATH becomes empty
17464 # (actually we leave an empty line to preserve line numbers).
17465 if test "x$srcdir" = x.; then
17466   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17467 s/:*\$(srcdir):*/:/;
17468 s/:*\${srcdir}:*/:/;
17469 s/:*@srcdir@:*/:/;
17470 s/^\([^=]*=[    ]*\):*/\1/;
17471 s/:*$//;
17472 s/^[^=]*=[      ]*$//;
17473 }'
17474 fi
17475
17476 DEFS=-DHAVE_CONFIG_H
17477
17478 : ${CONFIG_STATUS=./config.status}
17479 ac_clean_files_save=$ac_clean_files
17480 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17481 { echo "$as_me:17481: creating $CONFIG_STATUS" >&5
17482 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17483 cat >$CONFIG_STATUS <<_ACEOF
17484 #! $SHELL
17485 # Generated automatically by configure.
17486 # Run this file to recreate the current configuration.
17487 # Compiler output produced by configure, useful for debugging
17488 # configure, is in config.log if it exists.
17489
17490 debug=false
17491 SHELL=\${CONFIG_SHELL-$SHELL}
17492 ac_cs_invocation="\$0 \$@"
17493
17494 CLICOLOR_FORCE= GREP_OPTIONS=
17495 unset CLICOLOR_FORCE GREP_OPTIONS
17496 _ACEOF
17497
17498 cat >>$CONFIG_STATUS <<\_ACEOF
17499 # Be Bourne compatible
17500 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17501   emulate sh
17502   NULLCMD=:
17503 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17504   set -o posix
17505 fi
17506
17507 # Name of the executable.
17508 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17509
17510 if expr a : '\(a\)' >/dev/null 2>&1; then
17511   as_expr=expr
17512 else
17513   as_expr=false
17514 fi
17515
17516 rm -f conf$$ conf$$.exe conf$$.file
17517 echo >conf$$.file
17518 if ln -s conf$$.file conf$$ 2>/dev/null; then
17519   # We could just check for DJGPP; but this test a) works b) is more generic
17520   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17521   if test -f conf$$.exe; then
17522     # Don't use ln at all; we don't have any links
17523     as_ln_s='cp -p'
17524   else
17525     as_ln_s='ln -s'
17526   fi
17527 elif ln conf$$.file conf$$ 2>/dev/null; then
17528   as_ln_s=ln
17529 else
17530   as_ln_s='cp -p'
17531 fi
17532 rm -f conf$$ conf$$.exe conf$$.file
17533
17534 as_executable_p="test -f"
17535
17536 # Support unset when possible.
17537 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17538   as_unset=unset
17539 else
17540   as_unset=false
17541 fi
17542
17543 # NLS nuisances.
17544 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17545 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17546 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17547 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17548 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17549 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17550 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17551 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17552
17553 # IFS
17554 # We need space, tab and new line, in precisely that order.
17555 as_nl='
17556 '
17557 IFS="   $as_nl"
17558
17559 # CDPATH.
17560 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17561
17562 exec 6>&1
17563
17564 _ACEOF
17565
17566 # Files that config.status was made for.
17567 if test -n "$ac_config_files"; then
17568   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17569 fi
17570
17571 if test -n "$ac_config_headers"; then
17572   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17573 fi
17574
17575 if test -n "$ac_config_links"; then
17576   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17577 fi
17578
17579 if test -n "$ac_config_commands"; then
17580   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17581 fi
17582
17583 cat >>$CONFIG_STATUS <<\EOF
17584
17585 ac_cs_usage="\
17586 \`$as_me' instantiates files from templates according to the
17587 current configuration.
17588
17589 Usage: $0 [OPTIONS] [FILE]...
17590
17591   -h, --help       print this help, then exit
17592   -V, --version    print version number, then exit
17593   -d, --debug      don't remove temporary files
17594       --recheck    update $as_me by reconfiguring in the same conditions
17595   --file=FILE[:TEMPLATE]
17596                    instantiate the configuration file FILE
17597   --header=FILE[:TEMPLATE]
17598                    instantiate the configuration header FILE
17599
17600 Configuration files:
17601 $config_files
17602
17603 Configuration headers:
17604 $config_headers
17605
17606 Configuration commands:
17607 $config_commands
17608
17609 Report bugs to <dickey@invisible-island.net>."
17610 EOF
17611
17612 cat >>$CONFIG_STATUS <<EOF
17613 ac_cs_version="\\
17614 config.status
17615 configured by $0, generated by GNU Autoconf 2.52.20200802,
17616   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17617
17618 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17619 Free Software Foundation, Inc.
17620 This config.status script is free software; the Free Software Foundation
17621 gives unlimited permission to copy, distribute and modify it."
17622 srcdir=$srcdir
17623 INSTALL="$INSTALL"
17624 EOF
17625
17626 cat >>$CONFIG_STATUS <<\EOF
17627 # If no file are specified by the user, then we need to provide default
17628 # value.  By we need to know if files were specified by the user.
17629 ac_need_defaults=:
17630 while test $# != 0
17631 do
17632   case $1 in
17633   --*=*)
17634     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17635     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17636     shift
17637     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17638     shift
17639     ;;
17640   -*);;
17641   *) # This is not an option, so the user has probably given explicit
17642      # arguments.
17643      ac_need_defaults=false;;
17644   esac
17645
17646   case $1 in
17647   # Handling of the options.
17648 EOF
17649 cat >>$CONFIG_STATUS <<EOF
17650   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17651     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17652     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17653 EOF
17654 cat >>$CONFIG_STATUS <<\EOF
17655   --version | --vers* | -V )
17656     echo "$ac_cs_version"; exit 0 ;;
17657   --he | --h)
17658     # Conflict between --help and --header
17659     { { echo "$as_me:17659: error: ambiguous option: $1
17660 Try \`$0 --help' for more information." >&5
17661 echo "$as_me: error: ambiguous option: $1
17662 Try \`$0 --help' for more information." >&2;}
17663    { (exit 1); exit 1; }; };;
17664   --help | --hel | -h )
17665     echo "$ac_cs_usage"; exit 0 ;;
17666   --debug | --d* | -d )
17667     debug=: ;;
17668   --file | --fil | --fi | --f )
17669     shift
17670     CONFIG_FILES="$CONFIG_FILES $1"
17671     ac_need_defaults=false;;
17672   --header | --heade | --head | --hea )
17673     shift
17674     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17675     ac_need_defaults=false;;
17676
17677   # This is an error.
17678   -*) { { echo "$as_me:17678: error: unrecognized option: $1
17679 Try \`$0 --help' for more information." >&5
17680 echo "$as_me: error: unrecognized option: $1
17681 Try \`$0 --help' for more information." >&2;}
17682    { (exit 1); exit 1; }; } ;;
17683
17684   *) ac_config_targets="$ac_config_targets $1" ;;
17685
17686   esac
17687   shift
17688 done
17689
17690 exec 5>>config.log
17691 cat >&5 << _ACEOF
17692
17693 ## ----------------------- ##
17694 ## Running config.status.  ##
17695 ## ----------------------- ##
17696
17697 This file was extended by $as_me 2.52.20200802, executed with
17698   CONFIG_FILES    = $CONFIG_FILES
17699   CONFIG_HEADERS  = $CONFIG_HEADERS
17700   CONFIG_LINKS    = $CONFIG_LINKS
17701   CONFIG_COMMANDS = $CONFIG_COMMANDS
17702   > $ac_cs_invocation
17703 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17704
17705 _ACEOF
17706 EOF
17707
17708 cat >>$CONFIG_STATUS <<EOF
17709 #
17710 # INIT-COMMANDS section.
17711 #
17712
17713 ### Special initialization commands, used to pass information from the
17714 ### configuration-run into config.status
17715
17716 AWK="$AWK"
17717 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17718 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17719 LIB_NAME="$LIB_NAME"
17720 LIB_PREFIX="$LIB_PREFIX"
17721 LIB_SUFFIX="$LIB_SUFFIX"
17722 LN_S="$LN_S"
17723 NCURSES_MAJOR="$NCURSES_MAJOR"
17724 NCURSES_MINOR="$NCURSES_MINOR"
17725 NCURSES_PATCH="$NCURSES_PATCH"
17726 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17727 cf_cv_abi_version="$cf_cv_abi_version"
17728 cf_cv_rel_version="$cf_cv_rel_version"
17729 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17730 cf_cv_shared_soname='$cf_cv_shared_soname'
17731 cf_cv_shlib_version="$cf_cv_shlib_version"
17732 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17733 cf_cv_system_name="$cf_cv_system_name"
17734 host="$host"
17735 target="$target"
17736
17737 EOF
17738
17739 cat >>$CONFIG_STATUS <<\EOF
17740 for ac_config_target in $ac_config_targets
17741 do
17742   case "$ac_config_target" in
17743   # Handling of arguments.
17744   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17745   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17746   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17747   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17748   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17749   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17750   *) { { echo "$as_me:17750: error: invalid argument: $ac_config_target" >&5
17751 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17752    { (exit 1); exit 1; }; };;
17753   esac
17754 done
17755
17756 # If the user did not use the arguments to specify the items to instantiate,
17757 # then the envvar interface is used.  Set only those that are not.
17758 # We use the long form for the default assignment because of an extremely
17759 # bizarre bug on SunOS 4.1.3.
17760 if $ac_need_defaults; then
17761   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17762   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17763   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17764 fi
17765
17766 # Create a temporary directory, and hook for its removal unless debugging.
17767 $debug ||
17768 {
17769   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17770   trap '{ (exit 1); exit 1; }' 1 2 13 15
17771 }
17772
17773 # Create a (secure) tmp directory for tmp files.
17774 : ${TMPDIR=/tmp}
17775 {
17776   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17777   test -n "$tmp" && test -d "$tmp"
17778 }  ||
17779 {
17780   tmp=$TMPDIR/cs$$-$RANDOM
17781   (umask 077 && mkdir $tmp)
17782 } ||
17783 {
17784    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17785    { (exit 1); exit 1; }
17786 }
17787
17788 EOF
17789
17790 cat >>$CONFIG_STATUS <<EOF
17791
17792 #
17793 # CONFIG_FILES section.
17794 #
17795
17796 # No need to generate the scripts if there are no CONFIG_FILES.
17797 # This happens for instance when ./config.status config.h
17798 if test -n "\$CONFIG_FILES"; then
17799   # Protect against being on the right side of a sed subst in config.status.
17800   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17801    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17802 s,@SHELL@,$SHELL,;t t
17803 s,@exec_prefix@,$exec_prefix,;t t
17804 s,@prefix@,$prefix,;t t
17805 s,@program_transform_name@,$program_transform_name,;t t
17806 s,@bindir@,$bindir,;t t
17807 s,@sbindir@,$sbindir,;t t
17808 s,@libexecdir@,$libexecdir,;t t
17809 s,@datarootdir@,$datarootdir,;t t
17810 s,@datadir@,$datadir,;t t
17811 s,@sysconfdir@,$sysconfdir,;t t
17812 s,@sharedstatedir@,$sharedstatedir,;t t
17813 s,@localstatedir@,$localstatedir,;t t
17814 s,@runstatedir@,$runstatedir,;t t
17815 s,@libdir@,$libdir,;t t
17816 s,@includedir@,$includedir,;t t
17817 s,@oldincludedir@,$oldincludedir,;t t
17818 s,@infodir@,$infodir,;t t
17819 s,@mandir@,$mandir,;t t
17820 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17821 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17822 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17823 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17824 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17825 s,@build_alias@,$build_alias,;t t
17826 s,@host_alias@,$host_alias,;t t
17827 s,@target_alias@,$target_alias,;t t
17828 s,@ECHO_C@,$ECHO_C,;t t
17829 s,@ECHO_N@,$ECHO_N,;t t
17830 s,@ECHO_T@,$ECHO_T,;t t
17831 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17832 s,@DEFS@,$DEFS,;t t
17833 s,@LIBS@,$LIBS,;t t
17834 s,@top_builddir@,$top_builddir,;t t
17835 s,@build@,$build,;t t
17836 s,@build_cpu@,$build_cpu,;t t
17837 s,@build_vendor@,$build_vendor,;t t
17838 s,@build_os@,$build_os,;t t
17839 s,@host@,$host,;t t
17840 s,@host_cpu@,$host_cpu,;t t
17841 s,@host_vendor@,$host_vendor,;t t
17842 s,@host_os@,$host_os,;t t
17843 s,@target@,$target,;t t
17844 s,@target_cpu@,$target_cpu,;t t
17845 s,@target_vendor@,$target_vendor,;t t
17846 s,@target_os@,$target_os,;t t
17847 s,@CC@,$CC,;t t
17848 s,@CFLAGS@,$CFLAGS,;t t
17849 s,@LDFLAGS@,$LDFLAGS,;t t
17850 s,@CPPFLAGS@,$CPPFLAGS,;t t
17851 s,@ac_ct_CC@,$ac_ct_CC,;t t
17852 s,@EXEEXT@,$EXEEXT,;t t
17853 s,@OBJEXT@,$OBJEXT,;t t
17854 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17855 s,@CPP@,$CPP,;t t
17856 s,@AWK@,$AWK,;t t
17857 s,@EGREP@,$EGREP,;t t
17858 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17859 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17860 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17861 s,@LN_S@,$LN_S,;t t
17862 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17863 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17864 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17865 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17866 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17867 s,@SET_MAKE@,$SET_MAKE,;t t
17868 s,@CTAGS@,$CTAGS,;t t
17869 s,@ETAGS@,$ETAGS,;t t
17870 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17871 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17872 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17873 s,@RANLIB@,$RANLIB,;t t
17874 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17875 s,@LD@,$LD,;t t
17876 s,@ac_ct_LD@,$ac_ct_LD,;t t
17877 s,@AR@,$AR,;t t
17878 s,@ac_ct_AR@,$ac_ct_AR,;t t
17879 s,@ARFLAGS@,$ARFLAGS,;t t
17880 s,@DESTDIR@,$DESTDIR,;t t
17881 s,@BUILD_CC@,$BUILD_CC,;t t
17882 s,@BUILD_CPP@,$BUILD_CPP,;t t
17883 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17884 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17885 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17886 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17887 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17888 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17889 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17890 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17891 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17892 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17893 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17894 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17895 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17896 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17897 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17898 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17899 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17900 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17901 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17902 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17903 s,@CC_G_OPT@,$CC_G_OPT,;t t
17904 s,@LD_MODEL@,$LD_MODEL,;t t
17905 s,@shlibdir@,$shlibdir,;t t
17906 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17907 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17908 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17909 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17910 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17911 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17912 s,@LINK_PROGS@,$LINK_PROGS,;t t
17913 s,@LINK_TESTS@,$LINK_TESTS,;t t
17914 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17915 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17916 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17917 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17918 s,@RPATH_LIST@,$RPATH_LIST,;t t
17919 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17920 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17921 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17922 s,@PTHREAD@,$PTHREAD,;t t
17923 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17924 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17925 s,@ECHO_LT@,$ECHO_LT,;t t
17926 s,@ECHO_LD@,$ECHO_LD,;t t
17927 s,@RULE_CC@,$RULE_CC,;t t
17928 s,@SHOW_CC@,$SHOW_CC,;t t
17929 s,@ECHO_CC@,$ECHO_CC,;t t
17930 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17931 s,@ADAFLAGS@,$ADAFLAGS,;t t
17932 s,@ADA_TRACE@,$ADA_TRACE,;t t
17933 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17934 s,@M4_exists@,$M4_exists,;t t
17935 s,@cf_ada_make@,$cf_ada_make,;t t
17936 s,@cf_ada_config@,$cf_ada_config,;t t
17937 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17938 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17939 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17940 s,@cf_compile_generics@,$cf_compile_generics,;t t
17941 s,@cf_generic_objects@,$cf_generic_objects,;t t
17942 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17943 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17944 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17945 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17946 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17947 s,@cf_ada_package@,$cf_ada_package,;t t
17948 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17949 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17950 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17951 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17952 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
17953 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17954 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17955 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17956 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17957 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17958 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17959 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17960 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17961 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17962 s,@TEST_ARG2@,$TEST_ARG2,;t t
17963 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17964 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17965 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17966 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17967 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17968 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17969 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17970 CEOF
17971
17972 EOF
17973
17974   cat >>$CONFIG_STATUS <<\EOF
17975   # Split the substitutions into bite-sized pieces for seds with
17976   # small command number limits, like on Digital OSF/1 and HP-UX.
17977   ac_max_sed_lines=48
17978   ac_sed_frag=1 # Number of current file.
17979   ac_beg=1 # First line for current file.
17980   ac_end=$ac_max_sed_lines # Line after last line for current file.
17981   ac_more_lines=:
17982   ac_sed_cmds=
17983   while $ac_more_lines; do
17984     if test $ac_beg -gt 1; then
17985       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17986     else
17987       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17988     fi
17989     if test ! -s $tmp/subs.frag; then
17990       ac_more_lines=false
17991     else
17992       # The purpose of the label and of the branching condition is to
17993       # speed up the sed processing (if there are no `@' at all, there
17994       # is no need to browse any of the substitutions).
17995       # These are the two extra sed commands mentioned above.
17996       (echo ':t
17997   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17998       # It is possible to make a multiline substitution using escaped newlines.
17999       # Ensure that we do not split the substitution between script fragments.
18000       ac_BEG=$ac_end
18001       ac_END=`expr $ac_end + $ac_max_sed_lines`
18002       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18003       if test -s $tmp/subs.next; then
18004         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18005         if test ! -s $tmp/subs.edit; then
18006           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18007           if test ! -s $tmp/subs.edit; then
18008             if test $ac_beg -gt 1; then
18009               ac_end=`expr $ac_end - 1`
18010               continue
18011             fi
18012           fi
18013         fi
18014       fi
18015
18016       if test -z "$ac_sed_cmds"; then
18017         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18018       else
18019         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18020       fi
18021       ac_sed_frag=`expr $ac_sed_frag + 1`
18022       ac_beg=$ac_end
18023       ac_end=`expr $ac_end + $ac_max_sed_lines`
18024     fi
18025   done
18026   if test -z "$ac_sed_cmds"; then
18027     ac_sed_cmds=cat
18028   fi
18029 fi # test -n "$CONFIG_FILES"
18030
18031 EOF
18032 cat >>$CONFIG_STATUS <<\EOF
18033 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18034   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18035   case $ac_file in
18036   - | *:- | *:-:* ) # input from stdin
18037         cat >$tmp/stdin
18038         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18039         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18040   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18041         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18042   * )   ac_file_in=$ac_file.in ;;
18043   esac
18044
18045   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18046   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18047          X"$ac_file" : 'X\(//\)[^/]' \| \
18048          X"$ac_file" : 'X\(//\)$' \| \
18049          X"$ac_file" : 'X\(/\)' \| \
18050          .     : '\(.\)' 2>/dev/null ||
18051 echo X"$ac_file" |
18052     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18053           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18054           /^X\(\/\/\)$/{ s//\1/; q; }
18055           /^X\(\/\).*/{ s//\1/; q; }
18056           s/.*/./; q'`
18057   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18058     { case "$ac_dir" in
18059   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18060   *)                      as_incr_dir=.;;
18061 esac
18062 as_dummy="$ac_dir"
18063 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18064   case $as_mkdir_dir in
18065     # Skip DOS drivespec
18066     ?:) as_incr_dir=$as_mkdir_dir ;;
18067     *)
18068       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18069       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18070     ;;
18071   esac
18072 done; }
18073
18074     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18075     # A "../" for each directory in $ac_dir_suffix.
18076     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18077   else
18078     ac_dir_suffix= ac_dots=
18079   fi
18080
18081   case $srcdir in
18082   .)  ac_srcdir=.
18083       if test -z "$ac_dots"; then
18084          ac_top_srcdir=.
18085       else
18086          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18087       fi ;;
18088   [\\/]* | ?:[\\/]* )
18089       ac_srcdir=$srcdir$ac_dir_suffix;
18090       ac_top_srcdir=$srcdir ;;
18091   *) # Relative path.
18092     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18093     ac_top_srcdir=$ac_dots$srcdir ;;
18094   esac
18095
18096   case $INSTALL in
18097   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18098   *) ac_INSTALL=$ac_dots$INSTALL ;;
18099   esac
18100
18101   if test x"$ac_file" != x-; then
18102     { echo "$as_me:18102: creating $ac_file" >&5
18103 echo "$as_me: creating $ac_file" >&6;}
18104     rm -f "$ac_file"
18105   fi
18106   # Let's still pretend it is `configure' which instantiates (i.e., don't
18107   # use $as_me), people would be surprised to read:
18108   #    /* config.h.  Generated automatically by config.status.  */
18109   configure_input="Generated automatically from `echo $ac_file_in |
18110                                                  sed 's,.*/,,'` by configure."
18111
18112   # First look for the input files in the build tree, otherwise in the
18113   # src tree.
18114   ac_file_inputs=`IFS=:
18115     for f in $ac_file_in; do
18116       case $f in
18117       -) echo $tmp/stdin ;;
18118       [\\/$]*)
18119          # Absolute (can't be DOS-style, as IFS=:)
18120          test -f "$f" || { { echo "$as_me:18120: error: cannot find input file: $f" >&5
18121 echo "$as_me: error: cannot find input file: $f" >&2;}
18122    { (exit 1); exit 1; }; }
18123          echo $f;;
18124       *) # Relative
18125          if test -f "$f"; then
18126            # Build tree
18127            echo $f
18128          elif test -f "$srcdir/$f"; then
18129            # Source tree
18130            echo $srcdir/$f
18131          else
18132            # /dev/null tree
18133            { { echo "$as_me:18133: error: cannot find input file: $f" >&5
18134 echo "$as_me: error: cannot find input file: $f" >&2;}
18135    { (exit 1); exit 1; }; }
18136          fi;;
18137       esac
18138     done` || { (exit 1); exit 1; }
18139 EOF
18140 cat >>$CONFIG_STATUS <<\EOF
18141   ac_warn_datarootdir=no
18142   if test x"$ac_file" != x-; then
18143     for ac_item in $ac_file_inputs
18144     do
18145       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18146       if test -n "$ac_seen"; then
18147         ac_used=`grep '@datarootdir@' $ac_item`
18148         if test -z "$ac_used"; then
18149           { echo "$as_me:18149: WARNING: datarootdir was used implicitly but not set:
18150 $ac_seen" >&5
18151 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18152 $ac_seen" >&2;}
18153           ac_warn_datarootdir=yes
18154         fi
18155       fi
18156       ac_seen=`grep '${datarootdir}' $ac_item`
18157       if test -n "$ac_seen"; then
18158         { echo "$as_me:18158: WARNING: datarootdir was used explicitly but not set:
18159 $ac_seen" >&5
18160 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18161 $ac_seen" >&2;}
18162         ac_warn_datarootdir=yes
18163       fi
18164     done
18165   fi
18166
18167 if test "x$ac_warn_datarootdir" = xyes; then
18168   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18169 fi
18170
18171 EOF
18172 cat >>$CONFIG_STATUS <<EOF
18173   sed "$ac_vpsub
18174 $extrasub
18175 EOF
18176 cat >>$CONFIG_STATUS <<\EOF
18177 :t
18178 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18179 s,@configure_input@,$configure_input,;t t
18180 s,@srcdir@,$ac_srcdir,;t t
18181 s,@top_srcdir@,$ac_top_srcdir,;t t
18182 s,@INSTALL@,$ac_INSTALL,;t t
18183 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18184   rm -f $tmp/stdin
18185   if test x"$ac_file" != x-; then
18186     cp $tmp/out $ac_file
18187
18188     for ac_name in prefix exec_prefix datarootdir
18189     do
18190         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18191         if test -n "$ac_seen"; then
18192             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18193             if test -z "$ac_init"; then
18194               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18195               { echo "$as_me:18195: WARNING: Variable $ac_name is used but was not set:
18196 $ac_seen" >&5
18197 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18198 $ac_seen" >&2;}
18199             fi
18200         fi
18201     done
18202     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18203     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18204     if test -s $tmp/out; then
18205       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18206       { echo "$as_me:18206: WARNING: Some variables may not be substituted:
18207 $ac_seen" >&5
18208 echo "$as_me: WARNING: Some variables may not be substituted:
18209 $ac_seen" >&2;}
18210     fi
18211   else
18212     cat $tmp/out
18213   fi
18214   rm -f $tmp/out
18215
18216 done
18217 EOF
18218 cat >>$CONFIG_STATUS <<\EOF
18219
18220 #
18221 # CONFIG_HEADER section.
18222 #
18223
18224 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18225 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18226 #
18227 # ac_d sets the value in "#define NAME VALUE" lines.
18228 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18229 ac_dB='[        ].*$,\1#\2'
18230 ac_dC=' '
18231 ac_dD=',;t'
18232 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18233 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18234 ac_iB='\([      ]\),\1#\2define\3'
18235 ac_iC=' '
18236 ac_iD='\4,;t'
18237 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18238 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18239 ac_uB='$,\1#\2define\3'
18240 ac_uC=' '
18241 ac_uD=',;t'
18242
18243 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18244   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18245   case $ac_file in
18246   - | *:- | *:-:* ) # input from stdin
18247         cat >$tmp/stdin
18248         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18249         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18250   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18251         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18252   * )   ac_file_in=$ac_file.in ;;
18253   esac
18254
18255   test x"$ac_file" != x- && { echo "$as_me:18255: creating $ac_file" >&5
18256 echo "$as_me: creating $ac_file" >&6;}
18257
18258   # First look for the input files in the build tree, otherwise in the
18259   # src tree.
18260   ac_file_inputs=`IFS=:
18261     for f in $ac_file_in; do
18262       case $f in
18263       -) echo $tmp/stdin ;;
18264       [\\/$]*)
18265          # Absolute (can't be DOS-style, as IFS=:)
18266          test -f "$f" || { { echo "$as_me:18266: error: cannot find input file: $f" >&5
18267 echo "$as_me: error: cannot find input file: $f" >&2;}
18268    { (exit 1); exit 1; }; }
18269          echo $f;;
18270       *) # Relative
18271          if test -f "$f"; then
18272            # Build tree
18273            echo $f
18274          elif test -f "$srcdir/$f"; then
18275            # Source tree
18276            echo $srcdir/$f
18277          else
18278            # /dev/null tree
18279            { { echo "$as_me:18279: error: cannot find input file: $f" >&5
18280 echo "$as_me: error: cannot find input file: $f" >&2;}
18281    { (exit 1); exit 1; }; }
18282          fi;;
18283       esac
18284     done` || { (exit 1); exit 1; }
18285   # Remove the trailing spaces.
18286   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18287
18288 EOF
18289
18290 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18291 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18292 # be either 'cat' or 'sort'.
18293 cat confdefs.h | uniq >conftest.vals
18294
18295 # Break up conftest.vals because some shells have a limit on
18296 # the size of here documents, and old seds have small limits too.
18297
18298 rm -f conftest.tail
18299 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18300 while grep . conftest.vals >/dev/null
18301 do
18302   # Write chunks of a limited-size here document to conftest.frag.
18303   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18304   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18305   echo 'CEOF' >> $CONFIG_STATUS
18306   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18307   rm -f conftest.vals
18308   mv conftest.tail conftest.vals
18309 done
18310 rm -f conftest.vals
18311
18312 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18313 # marker @DEFS@.
18314 echo '  cat >> conftest.edit <<CEOF
18315 /@DEFS@/r conftest.frag
18316 /@DEFS@/d
18317 CEOF
18318 sed -f conftest.edit $tmp/in > $tmp/out
18319 rm -f $tmp/in
18320 mv $tmp/out $tmp/in
18321 rm -f conftest.edit conftest.frag
18322 ' >> $CONFIG_STATUS
18323
18324 cat >>$CONFIG_STATUS <<\EOF
18325   # Let's still pretend it is `configure' which instantiates (i.e., don't
18326   # use $as_me), people would be surprised to read:
18327   #    /* config.h.  Generated automatically by config.status.  */
18328   if test x"$ac_file" = x-; then
18329     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18330   else
18331     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18332   fi
18333   cat $tmp/in >>$tmp/config.h
18334   rm -f $tmp/in
18335   if test x"$ac_file" != x-; then
18336     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18337       { echo "$as_me:18337: $ac_file is unchanged" >&5
18338 echo "$as_me: $ac_file is unchanged" >&6;}
18339     else
18340       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18341          X"$ac_file" : 'X\(//\)[^/]' \| \
18342          X"$ac_file" : 'X\(//\)$' \| \
18343          X"$ac_file" : 'X\(/\)' \| \
18344          .     : '\(.\)' 2>/dev/null ||
18345 echo X"$ac_file" |
18346     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18347           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18348           /^X\(\/\/\)$/{ s//\1/; q; }
18349           /^X\(\/\).*/{ s//\1/; q; }
18350           s/.*/./; q'`
18351       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18352         { case "$ac_dir" in
18353   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18354   *)                      as_incr_dir=.;;
18355 esac
18356 as_dummy="$ac_dir"
18357 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18358   case $as_mkdir_dir in
18359     # Skip DOS drivespec
18360     ?:) as_incr_dir=$as_mkdir_dir ;;
18361     *)
18362       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18363       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18364     ;;
18365   esac
18366 done; }
18367
18368       fi
18369       rm -f $ac_file
18370       mv $tmp/config.h $ac_file
18371     fi
18372   else
18373     cat $tmp/config.h
18374     rm -f $tmp/config.h
18375   fi
18376 done
18377 EOF
18378 cat >>$CONFIG_STATUS <<\EOF
18379 #
18380 # CONFIG_COMMANDS section.
18381 #
18382 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18383   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18384   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18385
18386   case $ac_dest in
18387     default )
18388 if test -z "$USE_OLD_MAKERULES" ; then
18389         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18390 fi
18391  ;;
18392   esac
18393 done
18394 EOF
18395
18396 cat >>$CONFIG_STATUS <<\EOF
18397
18398 { (exit 0); exit 0; }
18399 EOF
18400 chmod +x $CONFIG_STATUS
18401 ac_clean_files=$ac_clean_files_save
18402
18403 # configure is writing to config.log, and then calls config.status.
18404 # config.status does its own redirection, appending to config.log.
18405 # Unfortunately, on DOS this fails, as config.log is still kept open
18406 # by configure, so config.status won't be able to write to it; its
18407 # output is simply discarded.  So we exec the FD to /dev/null,
18408 # effectively closing config.log, so it can be properly (re)opened and
18409 # appended to by config.status.  When coming back to configure, we
18410 # need to make the FD available again.
18411 if test "$no_create" != yes; then
18412   ac_cs_success=:
18413   exec 5>/dev/null
18414   $SHELL $CONFIG_STATUS || ac_cs_success=false
18415   exec 5>>config.log
18416   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18417   # would make configure fail if this is the last instruction.
18418   $ac_cs_success || { (exit 1); exit 1; }
18419 fi
18420 ${MAKE:-make} preinstall