]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
61a921f1681a4edb12c16b2a9e203f7267a00239
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.76 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20200111.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 runstatedir='${localstatedir}/run'
180 libdir='${exec_prefix}/lib'
181 includedir='${prefix}/include'
182 oldincludedir='/usr/include'
183 infodir='${datarootdir}/info'
184 mandir='${datarootdir}/man'
185
186 # Identity of this package.
187 PACKAGE_NAME=
188 PACKAGE_TARNAME=
189 PACKAGE_VERSION=
190 PACKAGE_STRING=
191 PACKAGE_BUGREPORT=
192
193 ac_prev=
194 for ac_option
195 do
196   # If the previous option needs an argument, assign it.
197   if test -n "$ac_prev"; then
198     eval "$ac_prev=\$ac_option"
199     ac_prev=
200     continue
201   fi
202
203   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
204
205   # Accept the important Cygnus configure options, so we can diagnose typos.
206
207   case $ac_option in
208
209   -bindir | --bindir | --bindi | --bind | --bin | --bi)
210     ac_prev=bindir ;;
211   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
212     bindir=$ac_optarg ;;
213
214   -build | --build | --buil | --bui | --bu)
215     ac_prev=build_alias ;;
216   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
217     build_alias=$ac_optarg ;;
218
219   -cache-file | --cache-file | --cache-fil | --cache-fi \
220   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
221     ac_prev=cache_file ;;
222   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
223   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
224     cache_file=$ac_optarg ;;
225
226   --config-cache | -C)
227     cache_file=config.cache ;;
228
229   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
230     ac_prev=datadir ;;
231   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
232   | --da=*)
233     datadir=$ac_optarg ;;
234
235   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
236   | --dataroo | --dataro | --datar)
237     ac_prev=datarootdir ;;
238   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
239   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
240     datarootdir=$ac_optarg ;;
241
242   -disable-* | --disable-*)
243     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
244     # Reject names that are not valid shell variable names.
245     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
246       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
247    { (exit 1); exit 1; }; }
248     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
249     eval "enable_$ac_feature=no" ;;
250
251   -enable-* | --enable-*)
252     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
253     # Reject names that are not valid shell variable names.
254     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
255       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
256    { (exit 1); exit 1; }; }
257     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
258     case $ac_option in
259       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
260       *) ac_optarg=yes ;;
261     esac
262     eval "enable_$ac_feature='$ac_optarg'" ;;
263
264   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
265   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
266   | --exec | --exe | --ex)
267     ac_prev=exec_prefix ;;
268   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
269   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
270   | --exec=* | --exe=* | --ex=*)
271     exec_prefix=$ac_optarg ;;
272
273   -gas | --gas | --ga | --g)
274     # Obsolete; use --with-gas.
275     with_gas=yes ;;
276
277   -help | --help | --hel | --he | -h)
278     ac_init_help=long ;;
279   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
280     ac_init_help=recursive ;;
281   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
282     ac_init_help=short ;;
283
284   -host | --host | --hos | --ho)
285     ac_prev=host_alias ;;
286   -host=* | --host=* | --hos=* | --ho=*)
287     host_alias=$ac_optarg ;;
288
289   -includedir | --includedir | --includedi | --included | --include \
290   | --includ | --inclu | --incl | --inc)
291     ac_prev=includedir ;;
292   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
293   | --includ=* | --inclu=* | --incl=* | --inc=*)
294     includedir=$ac_optarg ;;
295
296   -infodir | --infodir | --infodi | --infod | --info | --inf)
297     ac_prev=infodir ;;
298   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
299     infodir=$ac_optarg ;;
300
301   -libdir | --libdir | --libdi | --libd)
302     ac_prev=libdir ;;
303   -libdir=* | --libdir=* | --libdi=* | --libd=*)
304     libdir=$ac_optarg ;;
305
306   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
307   | --libexe | --libex | --libe)
308     ac_prev=libexecdir ;;
309   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
310   | --libexe=* | --libex=* | --libe=*)
311     libexecdir=$ac_optarg ;;
312
313   -localstatedir | --localstatedir | --localstatedi | --localstated \
314   | --localstate | --localstat | --localsta | --localst \
315   | --locals | --local | --loca | --loc | --lo)
316     ac_prev=localstatedir ;;
317   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
318   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
319   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
320     localstatedir=$ac_optarg ;;
321
322   -runstatedir | --runstatedir | --runstatedi | --runstated \
323   | --runstate | --runstat | --runsta | --runst \
324   | --runs | --run | --ru)
325     ac_prev=runstatedir ;;
326   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
327   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
328   | --runs=* | --run=* | --ru=*)
329     runstatedir=$ac_optarg ;;
330
331   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
332     ac_prev=mandir ;;
333   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
334     mandir=$ac_optarg ;;
335
336   -nfp | --nfp | --nf)
337     # Obsolete; use --without-fp.
338     with_fp=no ;;
339
340   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
341   | --no-cr | --no-c)
342     no_create=yes ;;
343
344   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
345   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
346     no_recursion=yes ;;
347
348   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
349   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
350   | --oldin | --oldi | --old | --ol | --o)
351     ac_prev=oldincludedir ;;
352   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
353   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
354   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
355     oldincludedir=$ac_optarg ;;
356
357   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
358     ac_prev=prefix ;;
359   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
360     prefix=$ac_optarg ;;
361
362   -program-prefix | --program-prefix | --program-prefi | --program-pref \
363   | --program-pre | --program-pr | --program-p)
364     ac_prev=program_prefix ;;
365   -program-prefix=* | --program-prefix=* | --program-prefi=* \
366   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
367     program_prefix=$ac_optarg ;;
368
369   -program-suffix | --program-suffix | --program-suffi | --program-suff \
370   | --program-suf | --program-su | --program-s)
371     ac_prev=program_suffix ;;
372   -program-suffix=* | --program-suffix=* | --program-suffi=* \
373   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
374     program_suffix=$ac_optarg ;;
375
376   -program-transform-name | --program-transform-name \
377   | --program-transform-nam | --program-transform-na \
378   | --program-transform-n | --program-transform- \
379   | --program-transform | --program-transfor \
380   | --program-transfo | --program-transf \
381   | --program-trans | --program-tran \
382   | --progr-tra | --program-tr | --program-t)
383     ac_prev=program_transform_name ;;
384   -program-transform-name=* | --program-transform-name=* \
385   | --program-transform-nam=* | --program-transform-na=* \
386   | --program-transform-n=* | --program-transform-=* \
387   | --program-transform=* | --program-transfor=* \
388   | --program-transfo=* | --program-transf=* \
389   | --program-trans=* | --program-tran=* \
390   | --progr-tra=* | --program-tr=* | --program-t=*)
391     program_transform_name=$ac_optarg ;;
392
393   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
394   | -silent | --silent | --silen | --sile | --sil)
395     silent=yes ;;
396
397   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
398     ac_prev=sbindir ;;
399   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
400   | --sbi=* | --sb=*)
401     sbindir=$ac_optarg ;;
402
403   -sharedstatedir | --sharedstatedir | --sharedstatedi \
404   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
405   | --sharedst | --shareds | --shared | --share | --shar \
406   | --sha | --sh)
407     ac_prev=sharedstatedir ;;
408   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
409   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
410   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
411   | --sha=* | --sh=*)
412     sharedstatedir=$ac_optarg ;;
413
414   -site | --site | --sit)
415     ac_prev=site ;;
416   -site=* | --site=* | --sit=*)
417     site=$ac_optarg ;;
418
419   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
420     ac_prev=srcdir ;;
421   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
422     srcdir=$ac_optarg ;;
423
424   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
425   | --syscon | --sysco | --sysc | --sys | --sy)
426     ac_prev=sysconfdir ;;
427   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
428   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
429     sysconfdir=$ac_optarg ;;
430
431   -target | --target | --targe | --targ | --tar | --ta | --t)
432     ac_prev=target_alias ;;
433   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
434     target_alias=$ac_optarg ;;
435
436   -v | -verbose | --verbose | --verbos | --verbo | --verb)
437     verbose=yes ;;
438
439   -version | --version | --versio | --versi | --vers | -V)
440     ac_init_version=: ;;
441
442   -with-* | --with-*)
443     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
444     # Reject names that are not valid shell variable names.
445     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
446       { echo "$as_me: error: invalid package name: $ac_package" >&2
447    { (exit 1); exit 1; }; }
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     case $ac_option in
450       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
451       *) ac_optarg=yes ;;
452     esac
453     eval "with_$ac_package='$ac_optarg'" ;;
454
455   -without-* | --without-*)
456     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
457     # Reject names that are not valid shell variable names.
458     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
459       { echo "$as_me: error: invalid package name: $ac_package" >&2
460    { (exit 1); exit 1; }; }
461     ac_package=`echo $ac_package | sed 's/-/_/g'`
462     eval "with_$ac_package=no" ;;
463
464   --x)
465     # Obsolete; use --with-x.
466     with_x=yes ;;
467
468   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
469   | --x-incl | --x-inc | --x-in | --x-i)
470     ac_prev=x_includes ;;
471   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
472   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
473     x_includes=$ac_optarg ;;
474
475   -x-libraries | --x-libraries | --x-librarie | --x-librari \
476   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
477     ac_prev=x_libraries ;;
478   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
479   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
480     x_libraries=$ac_optarg ;;
481
482   -*) { echo "$as_me: error: unrecognized option: $ac_option
483 Try \`$0 --help' for more information." >&2
484    { (exit 1); exit 1; }; }
485     ;;
486
487   *=*)
488     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
489     # Reject names that are not valid shell variable names.
490     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
491       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
492    { (exit 1); exit 1; }; }
493     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
494     eval "$ac_envvar='$ac_optarg'"
495     export $ac_envvar ;;
496
497   *)
498     # FIXME: should be removed in autoconf 3.0.
499     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
500     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
501       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
502     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
503     ;;
504
505   esac
506 done
507
508 if test -n "$ac_prev"; then
509   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
510   { echo "$as_me: error: missing argument to $ac_option" >&2
511    { (exit 1); exit 1; }; }
512 fi
513
514 # Be sure to have absolute paths.
515 for ac_var in exec_prefix prefix
516 do
517   eval ac_val=$`echo $ac_var`
518   case $ac_val in
519     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
520     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
521    { (exit 1); exit 1; }; };;
522   esac
523 done
524
525 # Be sure to have absolute paths.
526 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
527               localstatedir libdir includedir oldincludedir infodir mandir
528 do
529   eval ac_val=$`echo $ac_var`
530   case $ac_val in
531     [\\/$]* | ?:[\\/]* ) ;;
532     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
533    { (exit 1); exit 1; }; };;
534   esac
535 done
536
537 # There might be people who depend on the old broken behavior: `$host'
538 # used to hold the argument of --host etc.
539 build=$build_alias
540 host=$host_alias
541 target=$target_alias
542
543 # FIXME: should be removed in autoconf 3.0.
544 if test "x$host_alias" != x; then
545   if test "x$build_alias" = x; then
546     cross_compiling=maybe
547     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
548     If a cross compiler is detected then cross compile mode will be used." >&2
549   elif test "x$build_alias" != "x$host_alias"; then
550     cross_compiling=yes
551   fi
552 fi
553
554 ac_tool_prefix=
555 test -n "$host_alias" && ac_tool_prefix=$host_alias-
556
557 test "$silent" = yes && exec 6>/dev/null
558
559 # Find the source files, if location was not specified.
560 if test -z "$srcdir"; then
561   ac_srcdir_defaulted=yes
562   # Try the directory containing this script, then its parent.
563   ac_prog=$0
564   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
565   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
566   srcdir=$ac_confdir
567   if test ! -r $srcdir/$ac_unique_file; then
568     srcdir=..
569   fi
570 else
571   ac_srcdir_defaulted=no
572 fi
573 if test ! -r $srcdir/$ac_unique_file; then
574   if test "$ac_srcdir_defaulted" = yes; then
575     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
576    { (exit 1); exit 1; }; }
577   else
578     { echo "$as_me: error: cannot find sources in $srcdir" >&2
579    { (exit 1); exit 1; }; }
580   fi
581 fi
582 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
583 ac_env_build_alias_set=${build_alias+set}
584 ac_env_build_alias_value=$build_alias
585 ac_cv_env_build_alias_set=${build_alias+set}
586 ac_cv_env_build_alias_value=$build_alias
587 ac_env_host_alias_set=${host_alias+set}
588 ac_env_host_alias_value=$host_alias
589 ac_cv_env_host_alias_set=${host_alias+set}
590 ac_cv_env_host_alias_value=$host_alias
591 ac_env_target_alias_set=${target_alias+set}
592 ac_env_target_alias_value=$target_alias
593 ac_cv_env_target_alias_set=${target_alias+set}
594 ac_cv_env_target_alias_value=$target_alias
595 ac_env_CC_set=${CC+set}
596 ac_env_CC_value=$CC
597 ac_cv_env_CC_set=${CC+set}
598 ac_cv_env_CC_value=$CC
599 ac_env_CFLAGS_set=${CFLAGS+set}
600 ac_env_CFLAGS_value=$CFLAGS
601 ac_cv_env_CFLAGS_set=${CFLAGS+set}
602 ac_cv_env_CFLAGS_value=$CFLAGS
603 ac_env_LDFLAGS_set=${LDFLAGS+set}
604 ac_env_LDFLAGS_value=$LDFLAGS
605 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_cv_env_LDFLAGS_value=$LDFLAGS
607 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
608 ac_env_CPPFLAGS_value=$CPPFLAGS
609 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
611 ac_env_CPP_set=${CPP+set}
612 ac_env_CPP_value=$CPP
613 ac_cv_env_CPP_set=${CPP+set}
614 ac_cv_env_CPP_value=$CPP
615
616 #
617 # Report the --help message.
618 #
619 if test "$ac_init_help" = "long"; then
620   # Omit some internal or obsolete options to make the list less imposing.
621   # This message is too long to be a string in the A/UX 3.1 sh.
622   cat <<EOF
623 \`configure' configures this package to adapt to many kinds of systems.
624
625 Usage: $0 [OPTION]... [VAR=VALUE]...
626
627 To assign environment variables (e.g., CC, CFLAGS...), specify them as
628 VAR=VALUE.  See below for descriptions of some of the useful variables.
629
630 Defaults for the options are specified in brackets.
631
632 Configuration:
633   -h, --help              display this help and exit
634       --help=short        display options specific to this package
635       --help=recursive    display the short help of all the included packages
636   -V, --version           display version information and exit
637   -q, --quiet, --silent   do not print \`checking...' messages
638       --cache-file=FILE   cache test results in FILE [disabled]
639   -C, --config-cache      alias for \`--cache-file=config.cache'
640   -n, --no-create         do not create output files
641       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
642
643 EOF
644
645   cat <<EOF
646 Installation directories:
647   --prefix=PREFIX         install architecture-independent files in PREFIX
648                           [$ac_default_prefix]
649   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
650                           [PREFIX]
651
652 By default, \`make install' will install all the files in
653 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
654 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
655 for instance \`--prefix=\$HOME'.
656
657 For better control, use the options below.
658
659 Fine tuning of the installation directories:
660   --bindir=DIR            user executables [EPREFIX/bin]
661   --sbindir=DIR           system admin executables [EPREFIX/sbin]
662   --libexecdir=DIR        program executables [EPREFIX/libexec]
663   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
664   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
665   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
666   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
667   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
668   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
669   --libdir=DIR            object code libraries [EPREFIX/lib]
670   --includedir=DIR        C header files [PREFIX/include]
671   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
672   --infodir=DIR           info documentation [DATAROOTDIR/info]
673   --mandir=DIR            man documentation [DATAROOTDIR/man]
674 EOF
675
676   cat <<\EOF
677
678 Program names:
679   --program-prefix=PREFIX            prepend PREFIX to installed program names
680   --program-suffix=SUFFIX            append SUFFIX to installed program names
681   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
682
683 System types:
684   --build=BUILD           configure for building on BUILD [guessed]
685   --host=HOST       build programs to run on HOST [BUILD]
686   --target=TARGET   configure for building compilers for TARGET [HOST]
687 EOF
688 fi
689
690 if test -n "$ac_init_help"; then
691
692   cat <<\EOF
693
694 Optional Packages:
695   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
696   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
697
698 Optional Features:
699   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
700   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
701
702 General Options:
703   --with-system-type=XXX  test: override derived host system-type
704   --disable-stripping     do not strip (debug info) installed executables
705   --with-pkg-config{=path} enable/disable use of pkg-config
706   --with-pkg-config-libdir=XXX use given directory for installing pc-files
707   --without-tests         suppress build with test-programs
708   --enable-mixed-case     tic should assume mixed-case filenames
709   --with-install-prefix   prefixes actual install-location ($DESTDIR)
710 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
711   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
712   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
713   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
714   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
715   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
716   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
717 Options to Specify the Libraries Built/Used:
718   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
719   --with-curses-dir=DIR   directory in which (n)curses is installed
720   --enable-widec          compile with wide-char/UTF-8 code
721   --with-lib-prefix       override library-prefix
722   --with-shlib-version=X  Specify rel or abi version for shared libs
723   --enable-rpath-link     link sample programs with rpath option
724 Fine-Tuning Your Configuration:
725   --enable-broken_linker  compile with broken-linker support code
726   --disable-largefile     omit support for large files
727   --with-rcs-ids          compile-in RCS identifiers
728 Extensions:
729   --disable-ext-funcs     disable function-extensions
730   --enable-const          compile with extra/non-standard const
731 Development Code:
732   --without-develop       disable development options
733 Experimental Code:
734   --with-pthread          use POSIX thread library
735   --enable-weak-symbols   enable weak-symbols for pthreads
736   --enable-reentrant      compile with experimental reentrant code
737   --with-wrap-prefix=XXX  override prefix used for public variables
738 Testing/development Options:
739   --disable-echo          do not display "compiling" commands
740   --enable-warnings       build: turn on GCC compiler warnings
741   --enable-assertions     test: turn on generation of assertion code
742   --enable-expanded       test: generate functions for certain macros
743   --disable-macros        test: use functions rather than macros
744   --with-trace            test: add trace() function to all models of ncurses
745   --disable-gnat-projects test: disable GNAT projects even if usable
746 Ada95 Binding Options:
747   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
748   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
749   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
750   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
751   --with-ada-libname=XXX  override default Ada library-name
752
753 Some influential environment variables:
754   CC          C compiler command
755   CFLAGS      C compiler flags
756   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
757               nonstandard directory <lib dir>
758   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
759               headers in a nonstandard directory <include dir>
760   CPP         C preprocessor
761
762 Use these variables to override the choices made by `configure' or to help
763 it to find libraries and programs with nonstandard names/locations.
764
765 EOF
766 fi
767
768 if test "$ac_init_help" = "recursive"; then
769   # If there are subdirs, report their specific --help.
770   ac_popdir=`pwd`
771   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
772     cd $ac_subdir
773     # A "../" for each directory in /$ac_subdir.
774     ac_dots=`echo $ac_subdir |
775              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
776
777     case $srcdir in
778     .) # No --srcdir option.  We are building in place.
779       ac_sub_srcdir=$srcdir ;;
780     [\\/]* | ?:[\\/]* ) # Absolute path.
781       ac_sub_srcdir=$srcdir/$ac_subdir ;;
782     *) # Relative path.
783       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
784     esac
785
786     # Check for guested configure; otherwise get Cygnus style configure.
787     if test -f $ac_sub_srcdir/configure.gnu; then
788       echo
789       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
790     elif test -f $ac_sub_srcdir/configure; then
791       echo
792       $SHELL $ac_sub_srcdir/configure  --help=recursive
793     elif test -f $ac_sub_srcdir/configure.ac ||
794            test -f $ac_sub_srcdir/configure.in; then
795       echo
796       $ac_configure --help
797     else
798       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
799     fi
800     cd $ac_popdir
801   done
802 fi
803
804 test -n "$ac_init_help" && exit 0
805 if $ac_init_version; then
806   cat <<\EOF
807
808 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
809 Free Software Foundation, Inc.
810 This configure script is free software; the Free Software Foundation
811 gives unlimited permission to copy, distribute and modify it.
812 EOF
813   exit 0
814 fi
815 exec 5>config.log
816 cat >&5 <<EOF
817 This file contains any messages produced by compilers while
818 running configure, to aid debugging if configure makes a mistake.
819
820 It was created by $as_me, which was
821 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
822
823   $ $0 $@
824
825 EOF
826 {
827 cat <<_ASUNAME
828 ## ---------- ##
829 ## Platform.  ##
830 ## ---------- ##
831
832 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
833 uname -m = `(uname -m) 2>/dev/null || echo unknown`
834 uname -r = `(uname -r) 2>/dev/null || echo unknown`
835 uname -s = `(uname -s) 2>/dev/null || echo unknown`
836 uname -v = `(uname -v) 2>/dev/null || echo unknown`
837
838 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
839 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
840
841 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
842 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
843 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
844 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
845 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
846 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
847 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
848
849 PATH = $PATH
850
851 _ASUNAME
852 } >&5
853
854 cat >&5 <<EOF
855 ## ------------ ##
856 ## Core tests.  ##
857 ## ------------ ##
858
859 EOF
860
861 # Keep a trace of the command line.
862 # Strip out --no-create and --no-recursion so they do not pile up.
863 # Also quote any args containing shell meta-characters.
864 ac_configure_args=
865 ac_sep=
866 for ac_arg
867 do
868   case $ac_arg in
869   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
870   | --no-cr | --no-c) ;;
871   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
872   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
873   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
874     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
875     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
876     ac_sep=" " ;;
877   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
878      ac_sep=" " ;;
879   esac
880   # Get rid of the leading space.
881 done
882
883 # When interrupted or exit'd, cleanup temporary files, and complete
884 # config.log.  We remove comments because anyway the quotes in there
885 # would cause problems or look ugly.
886 trap 'exit_status=$?
887   # Save into config.log some information that might help in debugging.
888   echo >&5
889   echo "## ----------------- ##" >&5
890   echo "## Cache variables.  ##" >&5
891   echo "## ----------------- ##" >&5
892   echo >&5
893   # The following way of writing the cache mishandles newlines in values,
894 {
895   (set) 2>&1 |
896     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
897     *ac_space=\ *)
898       sed -n \
899         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
900           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
901       ;;
902     *)
903       sed -n \
904         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
905       ;;
906     esac;
907 } >&5
908   sed "/^$/d" confdefs.h >conftest.log
909   if test -s conftest.log; then
910     echo >&5
911     echo "## ------------ ##" >&5
912     echo "## confdefs.h.  ##" >&5
913     echo "## ------------ ##" >&5
914     echo >&5
915     cat conftest.log >&5
916   fi
917   (echo; echo) >&5
918   test "$ac_signal" != 0 &&
919     echo "$as_me: caught signal $ac_signal" >&5
920   echo "$as_me: exit $exit_status" >&5
921   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
922     exit $exit_status
923      ' 0
924 for ac_signal in 1 2 13 15; do
925   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
926 done
927 ac_signal=0
928
929 # confdefs.h avoids OS command line length limits that DEFS can exceed.
930 rm -rf conftest* confdefs.h
931 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
932 echo >confdefs.h
933
934 # Let the site file select an alternate cache file if it wants to.
935 # Prefer explicitly selected file to automatically selected ones.
936 if test -z "$CONFIG_SITE"; then
937   if test "x$prefix" != xNONE; then
938     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
939   else
940     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
941   fi
942 fi
943 for ac_site_file in $CONFIG_SITE; do
944   if test -r "$ac_site_file"; then
945     { echo "$as_me:945: loading site script $ac_site_file" >&5
946 echo "$as_me: loading site script $ac_site_file" >&6;}
947     cat "$ac_site_file" >&5
948     . "$ac_site_file"
949   fi
950 done
951
952 if test -r "$cache_file"; then
953   # Some versions of bash will fail to source /dev/null (special
954   # files actually), so we avoid doing that.
955   if test -f "$cache_file"; then
956     { echo "$as_me:956: loading cache $cache_file" >&5
957 echo "$as_me: loading cache $cache_file" >&6;}
958     case $cache_file in
959       [\\/]* | ?:[\\/]* ) . $cache_file;;
960       *)                      . ./$cache_file;;
961     esac
962   fi
963 else
964   { echo "$as_me:964: creating cache $cache_file" >&5
965 echo "$as_me: creating cache $cache_file" >&6;}
966   >$cache_file
967 fi
968
969 # Check that the precious variables saved in the cache have kept the same
970 # value.
971 ac_cache_corrupted=false
972 for ac_var in `(set) 2>&1 |
973                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
974   eval ac_old_set=\$ac_cv_env_${ac_var}_set
975   eval ac_new_set=\$ac_env_${ac_var}_set
976   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
977   eval ac_new_val="\$ac_env_${ac_var}_value"
978   case $ac_old_set,$ac_new_set in
979     set,)
980       { echo "$as_me:980: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
981 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
982       ac_cache_corrupted=: ;;
983     ,set)
984       { echo "$as_me:984: error: \`$ac_var' was not set in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,);;
988     *)
989       if test "x$ac_old_val" != "x$ac_new_val"; then
990         { echo "$as_me:990: error: \`$ac_var' has changed since the previous run:" >&5
991 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
992         { echo "$as_me:992:   former value:  $ac_old_val" >&5
993 echo "$as_me:   former value:  $ac_old_val" >&2;}
994         { echo "$as_me:994:   current value: $ac_new_val" >&5
995 echo "$as_me:   current value: $ac_new_val" >&2;}
996         ac_cache_corrupted=:
997       fi;;
998   esac
999   # Pass precious variables to config.status.  It doesn't matter if
1000   # we pass some twice (in addition to the command line arguments).
1001   if test "$ac_new_set" = set; then
1002     case $ac_new_val in
1003     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1004       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1005       ac_configure_args="$ac_configure_args '$ac_arg'"
1006       ;;
1007     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1008        ;;
1009     esac
1010   fi
1011 done
1012 if $ac_cache_corrupted; then
1013   { echo "$as_me:1013: error: changes in the environment can compromise the build" >&5
1014 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1015   { { echo "$as_me:1015: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1016 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1017    { (exit 1); exit 1; }; }
1018 fi
1019
1020 ac_ext=c
1021 ac_cpp='$CPP $CPPFLAGS'
1022 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1023 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1024 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1025 ac_main_return=return
1026
1027 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1028   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1029                    ECHO_T='     ' ;;
1030   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1031   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1032 esac
1033 echo "#! $SHELL" >conftest.sh
1034 echo  "exit 0"   >>conftest.sh
1035 chmod +x conftest.sh
1036 if { (echo "$as_me:1036: PATH=\".;.\"; conftest.sh") >&5
1037   (PATH=".;."; conftest.sh) 2>&5
1038   ac_status=$?
1039   echo "$as_me:1039: \$? = $ac_status" >&5
1040   (exit $ac_status); }; then
1041   ac_path_separator=';'
1042 else
1043   ac_path_separator=:
1044 fi
1045 PATH_SEPARATOR="$ac_path_separator"
1046 rm -f conftest.sh
1047
1048 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1049
1050 top_builddir=`pwd`
1051
1052 ac_aux_dir=
1053 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1054   if test -f $ac_dir/install-sh; then
1055     ac_aux_dir=$ac_dir
1056     ac_install_sh="$ac_aux_dir/install-sh -c"
1057     break
1058   elif test -f $ac_dir/install.sh; then
1059     ac_aux_dir=$ac_dir
1060     ac_install_sh="$ac_aux_dir/install.sh -c"
1061     break
1062   elif test -f $ac_dir/shtool; then
1063     ac_aux_dir=$ac_dir
1064     ac_install_sh="$ac_aux_dir/shtool install -c"
1065     break
1066   fi
1067 done
1068 if test -z "$ac_aux_dir"; then
1069   { { echo "$as_me:1069: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1070 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1071    { (exit 1); exit 1; }; }
1072 fi
1073 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1074 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1075 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1076
1077 # Make sure we can run config.sub.
1078 $ac_config_sub sun4 >/dev/null 2>&1 ||
1079   { { echo "$as_me:1079: error: cannot run $ac_config_sub" >&5
1080 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1081    { (exit 1); exit 1; }; }
1082
1083 echo "$as_me:1083: checking build system type" >&5
1084 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1085 if test "${ac_cv_build+set}" = set; then
1086   echo $ECHO_N "(cached) $ECHO_C" >&6
1087 else
1088   ac_cv_build_alias=$build_alias
1089 test -z "$ac_cv_build_alias" &&
1090   ac_cv_build_alias=`$ac_config_guess`
1091 test -z "$ac_cv_build_alias" &&
1092   { { echo "$as_me:1092: error: cannot guess build type; you must specify one" >&5
1093 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1094    { (exit 1); exit 1; }; }
1095 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1096   { { echo "$as_me:1096: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1097 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1098    { (exit 1); exit 1; }; }
1099
1100 fi
1101 echo "$as_me:1101: result: $ac_cv_build" >&5
1102 echo "${ECHO_T}$ac_cv_build" >&6
1103 build=$ac_cv_build
1104 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1105 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1106 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1107
1108 echo "$as_me:1108: checking host system type" >&5
1109 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1110 if test "${ac_cv_host+set}" = set; then
1111   echo $ECHO_N "(cached) $ECHO_C" >&6
1112 else
1113   ac_cv_host_alias=$host_alias
1114 test -z "$ac_cv_host_alias" &&
1115   ac_cv_host_alias=$ac_cv_build_alias
1116 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1117   { { echo "$as_me:1117: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1118 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1119    { (exit 1); exit 1; }; }
1120
1121 fi
1122 echo "$as_me:1122: result: $ac_cv_host" >&5
1123 echo "${ECHO_T}$ac_cv_host" >&6
1124 host=$ac_cv_host
1125 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1126 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1127 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1128
1129 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1130         echo "$as_me:1130: checking target system type" >&5
1131 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1132 if test "${ac_cv_target+set}" = set; then
1133   echo $ECHO_N "(cached) $ECHO_C" >&6
1134 else
1135   ac_cv_target_alias=$target_alias
1136 test "x$ac_cv_target_alias" = "x" &&
1137   ac_cv_target_alias=$ac_cv_host_alias
1138 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1139   { { echo "$as_me:1139: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1140 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1141    { (exit 1); exit 1; }; }
1142
1143 fi
1144 echo "$as_me:1144: result: $ac_cv_target" >&5
1145 echo "${ECHO_T}$ac_cv_target" >&6
1146 target=$ac_cv_target
1147 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1148 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1149 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1150
1151 # The aliases save the names the user supplied, while $host etc.
1152 # will get canonicalized.
1153 test -n "$target_alias" &&
1154   test "$program_prefix$program_suffix$program_transform_name" = \
1155     NONENONEs,x,x, &&
1156   program_prefix=${target_alias}-
1157         system_name="$host_os"
1158 else
1159         system_name="`(uname -s -r) 2>/dev/null`"
1160         if test -z "$system_name" ; then
1161                 system_name="`(hostname) 2>/dev/null`"
1162         fi
1163 fi
1164 test -n "$system_name" &&
1165 cat >>confdefs.h <<EOF
1166 #define SYSTEM_NAME "$system_name"
1167 EOF
1168
1169 if test "${cf_cv_system_name+set}" = set; then
1170   echo $ECHO_N "(cached) $ECHO_C" >&6
1171 else
1172   cf_cv_system_name="$system_name"
1173 fi
1174
1175 test -z "$system_name" && system_name="$cf_cv_system_name"
1176 test -n "$cf_cv_system_name" && echo "$as_me:1176: result: Configuring for $cf_cv_system_name" >&5
1177 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1178
1179 if test ".$system_name" != ".$cf_cv_system_name" ; then
1180         echo "$as_me:1180: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1181 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1182         { { echo "$as_me:1182: error: \"Please remove config.cache and try again.\"" >&5
1183 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1184    { (exit 1); exit 1; }; }
1185 fi
1186
1187 # Check whether --with-system-type or --without-system-type was given.
1188 if test "${with_system_type+set}" = set; then
1189   withval="$with_system_type"
1190   { echo "$as_me:1190: WARNING: overriding system type to $withval" >&5
1191 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1192         cf_cv_system_name=$withval
1193         host_os=$withval
1194
1195 fi;
1196
1197 ###     Save the given $CFLAGS to allow user-override.
1198 cf_user_CFLAGS="$CFLAGS"
1199
1200 ###     Default install-location
1201
1202 echo "$as_me:1202: checking for prefix" >&5
1203 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1204 if test "x$prefix" = "xNONE" ; then
1205         case "$cf_cv_system_name" in
1206                 # non-vendor systems don't have a conflict
1207         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1208                 prefix=/usr
1209                 ;;
1210         (*)     prefix=$ac_default_prefix
1211                 ;;
1212         esac
1213 fi
1214 echo "$as_me:1214: result: $prefix" >&5
1215 echo "${ECHO_T}$prefix" >&6
1216
1217 if test "x$prefix" = "xNONE" ; then
1218 echo "$as_me:1218: checking for default include-directory" >&5
1219 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1220 test -n "$verbose" && echo 1>&6
1221 for cf_symbol in \
1222         $includedir \
1223         $includedir/ncurses \
1224         $prefix/include \
1225         $prefix/include/ncurses \
1226         /usr/local/include \
1227         /usr/local/include/ncurses \
1228         /usr/include \
1229         /usr/include/ncurses
1230 do
1231         cf_dir=`eval echo $cf_symbol`
1232         if test -f $cf_dir/curses.h ; then
1233         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1234                 includedir="$cf_symbol"
1235                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1236                 break
1237         fi
1238         fi
1239         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1240 done
1241 echo "$as_me:1241: result: $includedir" >&5
1242 echo "${ECHO_T}$includedir" >&6
1243 fi
1244
1245 ###     Checks for programs.
1246
1247 ac_ext=c
1248 ac_cpp='$CPP $CPPFLAGS'
1249 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1250 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1251 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1252 ac_main_return=return
1253 if test -n "$ac_tool_prefix"; then
1254   for ac_prog in gnatgcc gcc cc
1255   do
1256     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1257 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1258 echo "$as_me:1258: checking for $ac_word" >&5
1259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1260 if test "${ac_cv_prog_CC+set}" = set; then
1261   echo $ECHO_N "(cached) $ECHO_C" >&6
1262 else
1263   if test -n "$CC"; then
1264   ac_cv_prog_CC="$CC" # Let the user override the test.
1265 else
1266   ac_save_IFS=$IFS; IFS=$ac_path_separator
1267 ac_dummy="$PATH"
1268 for ac_dir in $ac_dummy; do
1269   IFS=$ac_save_IFS
1270   test -z "$ac_dir" && ac_dir=.
1271   $as_executable_p "$ac_dir/$ac_word" || continue
1272 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1273 echo "$as_me:1273: found $ac_dir/$ac_word" >&5
1274 break
1275 done
1276
1277 fi
1278 fi
1279 CC=$ac_cv_prog_CC
1280 if test -n "$CC"; then
1281   echo "$as_me:1281: result: $CC" >&5
1282 echo "${ECHO_T}$CC" >&6
1283 else
1284   echo "$as_me:1284: result: no" >&5
1285 echo "${ECHO_T}no" >&6
1286 fi
1287
1288     test -n "$CC" && break
1289   done
1290 fi
1291 if test -z "$CC"; then
1292   ac_ct_CC=$CC
1293   for ac_prog in gnatgcc gcc cc
1294 do
1295   # Extract the first word of "$ac_prog", so it can be a program name with args.
1296 set dummy $ac_prog; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$ac_ct_CC"; then
1303   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1304 else
1305   ac_save_IFS=$IFS; IFS=$ac_path_separator
1306 ac_dummy="$PATH"
1307 for ac_dir in $ac_dummy; do
1308   IFS=$ac_save_IFS
1309   test -z "$ac_dir" && ac_dir=.
1310   $as_executable_p "$ac_dir/$ac_word" || continue
1311 ac_cv_prog_ac_ct_CC="$ac_prog"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 fi
1317 fi
1318 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1319 if test -n "$ac_ct_CC"; then
1320   echo "$as_me:1320: result: $ac_ct_CC" >&5
1321 echo "${ECHO_T}$ac_ct_CC" >&6
1322 else
1323   echo "$as_me:1323: result: no" >&5
1324 echo "${ECHO_T}no" >&6
1325 fi
1326
1327   test -n "$ac_ct_CC" && break
1328 done
1329
1330   CC=$ac_ct_CC
1331 fi
1332
1333 test -z "$CC" && { { echo "$as_me:1333: error: no acceptable cc found in \$PATH" >&5
1334 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1335    { (exit 1); exit 1; }; }
1336
1337 # Provide some information about the compiler.
1338 echo "$as_me:1338:" \
1339      "checking for C compiler version" >&5
1340 ac_compiler=`set X $ac_compile; echo $2`
1341 { (eval echo "$as_me:1341: \"$ac_compiler --version </dev/null >&5\"") >&5
1342   (eval $ac_compiler --version </dev/null >&5) 2>&5
1343   ac_status=$?
1344   echo "$as_me:1344: \$? = $ac_status" >&5
1345   (exit $ac_status); }
1346 { (eval echo "$as_me:1346: \"$ac_compiler -v </dev/null >&5\"") >&5
1347   (eval $ac_compiler -v </dev/null >&5) 2>&5
1348   ac_status=$?
1349   echo "$as_me:1349: \$? = $ac_status" >&5
1350   (exit $ac_status); }
1351 { (eval echo "$as_me:1351: \"$ac_compiler -V </dev/null >&5\"") >&5
1352   (eval $ac_compiler -V </dev/null >&5) 2>&5
1353   ac_status=$?
1354   echo "$as_me:1354: \$? = $ac_status" >&5
1355   (exit $ac_status); }
1356
1357 cat >conftest.$ac_ext <<_ACEOF
1358 #line 1358 "configure"
1359 #include "confdefs.h"
1360
1361 int
1362 main (void)
1363 {
1364
1365   ;
1366   return 0;
1367 }
1368 _ACEOF
1369 ac_clean_files_save=$ac_clean_files
1370 ac_clean_files="$ac_clean_files a.out a.exe"
1371 # Try to create an executable without -o first, disregard a.out.
1372 # It will help us diagnose broken compilers, and finding out an intuition
1373 # of exeext.
1374 echo "$as_me:1374: checking for C compiler default output" >&5
1375 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1376 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1377 if { (eval echo "$as_me:1377: \"$ac_link_default\"") >&5
1378   (eval $ac_link_default) 2>&5
1379   ac_status=$?
1380   echo "$as_me:1380: \$? = $ac_status" >&5
1381   (exit $ac_status); }; then
1382   # Find the output, starting from the most likely.  This scheme is
1383 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1384 # resort.
1385 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1386                 ls a.out conftest 2>/dev/null;
1387                 ls a.* conftest.* 2>/dev/null`; do
1388   case $ac_file in
1389     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1390     a.out ) # We found the default executable, but exeext='' is most
1391             # certainly right.
1392             break;;
1393     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1394           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1395           export ac_cv_exeext
1396           break;;
1397     * ) break;;
1398   esac
1399 done
1400 else
1401   echo "$as_me: failed program was:" >&5
1402 cat conftest.$ac_ext >&5
1403 { { echo "$as_me:1403: error: C compiler cannot create executables" >&5
1404 echo "$as_me: error: C compiler cannot create executables" >&2;}
1405    { (exit 77); exit 77; }; }
1406 fi
1407
1408 ac_exeext=$ac_cv_exeext
1409 echo "$as_me:1409: result: $ac_file" >&5
1410 echo "${ECHO_T}$ac_file" >&6
1411
1412 # Check the compiler produces executables we can run.  If not, either
1413 # the compiler is broken, or we cross compile.
1414 echo "$as_me:1414: checking whether the C compiler works" >&5
1415 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1416 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1417 # If not cross compiling, check that we can run a simple program.
1418 if test "$cross_compiling" != yes; then
1419   if { ac_try='./$ac_file'
1420   { (eval echo "$as_me:1420: \"$ac_try\"") >&5
1421   (eval $ac_try) 2>&5
1422   ac_status=$?
1423   echo "$as_me:1423: \$? = $ac_status" >&5
1424   (exit $ac_status); }; }; then
1425     cross_compiling=no
1426   else
1427     if test "$cross_compiling" = maybe; then
1428         cross_compiling=yes
1429     else
1430         { { echo "$as_me:1430: error: cannot run C compiled programs.
1431 If you meant to cross compile, use \`--host'." >&5
1432 echo "$as_me: error: cannot run C compiled programs.
1433 If you meant to cross compile, use \`--host'." >&2;}
1434    { (exit 1); exit 1; }; }
1435     fi
1436   fi
1437 fi
1438 echo "$as_me:1438: result: yes" >&5
1439 echo "${ECHO_T}yes" >&6
1440
1441 rm -f a.out a.exe conftest$ac_cv_exeext
1442 ac_clean_files=$ac_clean_files_save
1443 # Check the compiler produces executables we can run.  If not, either
1444 # the compiler is broken, or we cross compile.
1445 echo "$as_me:1445: checking whether we are cross compiling" >&5
1446 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1447 echo "$as_me:1447: result: $cross_compiling" >&5
1448 echo "${ECHO_T}$cross_compiling" >&6
1449
1450 echo "$as_me:1450: checking for executable suffix" >&5
1451 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1452 if { (eval echo "$as_me:1452: \"$ac_link\"") >&5
1453   (eval $ac_link) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }; then
1457   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1458 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1459 # work properly (i.e., refer to `conftest.exe'), while it won't with
1460 # `rm'.
1461 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1462   case $ac_file in
1463     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1464     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1465           export ac_cv_exeext
1466           break;;
1467     * ) break;;
1468   esac
1469 done
1470 else
1471   { { echo "$as_me:1471: error: cannot compute EXEEXT: cannot compile and link" >&5
1472 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1473    { (exit 1); exit 1; }; }
1474 fi
1475
1476 rm -f conftest$ac_cv_exeext
1477 echo "$as_me:1477: result: $ac_cv_exeext" >&5
1478 echo "${ECHO_T}$ac_cv_exeext" >&6
1479
1480 rm -f conftest.$ac_ext
1481 EXEEXT=$ac_cv_exeext
1482 ac_exeext=$EXEEXT
1483 echo "$as_me:1483: checking for object suffix" >&5
1484 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1485 if test "${ac_cv_objext+set}" = set; then
1486   echo $ECHO_N "(cached) $ECHO_C" >&6
1487 else
1488   cat >conftest.$ac_ext <<_ACEOF
1489 #line 1489 "configure"
1490 #include "confdefs.h"
1491
1492 int
1493 main (void)
1494 {
1495
1496   ;
1497   return 0;
1498 }
1499 _ACEOF
1500 rm -f conftest.o conftest.obj
1501 if { (eval echo "$as_me:1501: \"$ac_compile\"") >&5
1502   (eval $ac_compile) 2>&5
1503   ac_status=$?
1504   echo "$as_me:1504: \$? = $ac_status" >&5
1505   (exit $ac_status); }; then
1506   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1507   case $ac_file in
1508     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1509     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1510        break;;
1511   esac
1512 done
1513 else
1514   echo "$as_me: failed program was:" >&5
1515 cat conftest.$ac_ext >&5
1516 { { echo "$as_me:1516: error: cannot compute OBJEXT: cannot compile" >&5
1517 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1518    { (exit 1); exit 1; }; }
1519 fi
1520
1521 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1522 fi
1523 echo "$as_me:1523: result: $ac_cv_objext" >&5
1524 echo "${ECHO_T}$ac_cv_objext" >&6
1525 OBJEXT=$ac_cv_objext
1526 ac_objext=$OBJEXT
1527 echo "$as_me:1527: checking whether we are using the GNU C compiler" >&5
1528 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1529 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1530   echo $ECHO_N "(cached) $ECHO_C" >&6
1531 else
1532   cat >conftest.$ac_ext <<_ACEOF
1533 #line 1533 "configure"
1534 #include "confdefs.h"
1535
1536 int
1537 main (void)
1538 {
1539 #ifndef __GNUC__
1540        choke me
1541 #endif
1542
1543   ;
1544   return 0;
1545 }
1546 _ACEOF
1547 rm -f conftest.$ac_objext
1548 if { (eval echo "$as_me:1548: \"$ac_compile\"") >&5
1549   (eval $ac_compile) 2>&5
1550   ac_status=$?
1551   echo "$as_me:1551: \$? = $ac_status" >&5
1552   (exit $ac_status); } &&
1553          { ac_try='test -s conftest.$ac_objext'
1554   { (eval echo "$as_me:1554: \"$ac_try\"") >&5
1555   (eval $ac_try) 2>&5
1556   ac_status=$?
1557   echo "$as_me:1557: \$? = $ac_status" >&5
1558   (exit $ac_status); }; }; then
1559   ac_compiler_gnu=yes
1560 else
1561   echo "$as_me: failed program was:" >&5
1562 cat conftest.$ac_ext >&5
1563 ac_compiler_gnu=no
1564 fi
1565 rm -f conftest.$ac_objext conftest.$ac_ext
1566 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1567
1568 fi
1569 echo "$as_me:1569: result: $ac_cv_c_compiler_gnu" >&5
1570 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1571 GCC=`test $ac_compiler_gnu = yes && echo yes`
1572 ac_test_CFLAGS=${CFLAGS+set}
1573 ac_save_CFLAGS=$CFLAGS
1574 CFLAGS="-g"
1575 echo "$as_me:1575: checking whether $CC accepts -g" >&5
1576 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1577 if test "${ac_cv_prog_cc_g+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main (void)
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.$ac_objext
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); } &&
1598          { ac_try='test -s conftest.$ac_objext'
1599   { (eval echo "$as_me:1599: \"$ac_try\"") >&5
1600   (eval $ac_try) 2>&5
1601   ac_status=$?
1602   echo "$as_me:1602: \$? = $ac_status" >&5
1603   (exit $ac_status); }; }; then
1604   ac_cv_prog_cc_g=yes
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 ac_cv_prog_cc_g=no
1609 fi
1610 rm -f conftest.$ac_objext conftest.$ac_ext
1611 fi
1612 echo "$as_me:1612: result: $ac_cv_prog_cc_g" >&5
1613 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1614 if test "$ac_test_CFLAGS" = set; then
1615   CFLAGS=$ac_save_CFLAGS
1616 elif test $ac_cv_prog_cc_g = yes; then
1617   if test "$GCC" = yes; then
1618     CFLAGS="-g -O2"
1619   else
1620     CFLAGS="-g"
1621   fi
1622 else
1623   if test "$GCC" = yes; then
1624     CFLAGS="-O2"
1625   else
1626     CFLAGS=
1627   fi
1628 fi
1629 # Some people use a C++ compiler to compile C.  Since we use `exit',
1630 # in C++ we need to declare it.  In case someone uses the same compiler
1631 # for both compiling C and C++ we need to have the C++ compiler decide
1632 # the declaration of exit, since it's the most demanding environment.
1633 cat >conftest.$ac_ext <<_ACEOF
1634 #ifndef __cplusplus
1635   choke me
1636 #endif
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   for ac_declaration in \
1651    ''\
1652    '#include <stdlib.h>' \
1653    'extern "C" void std::exit (int) throw (); using std::exit;' \
1654    'extern "C" void std::exit (int); using std::exit;' \
1655    'extern "C" void exit (int) throw ();' \
1656    'extern "C" void exit (int);' \
1657    'void exit (int);'
1658 do
1659   cat >conftest.$ac_ext <<_ACEOF
1660 #line 1660 "configure"
1661 #include "confdefs.h"
1662 #include <stdlib.h>
1663 $ac_declaration
1664 int
1665 main (void)
1666 {
1667 exit (42);
1668   ;
1669   return 0;
1670 }
1671 _ACEOF
1672 rm -f conftest.$ac_objext
1673 if { (eval echo "$as_me:1673: \"$ac_compile\"") >&5
1674   (eval $ac_compile) 2>&5
1675   ac_status=$?
1676   echo "$as_me:1676: \$? = $ac_status" >&5
1677   (exit $ac_status); } &&
1678          { ac_try='test -s conftest.$ac_objext'
1679   { (eval echo "$as_me:1679: \"$ac_try\"") >&5
1680   (eval $ac_try) 2>&5
1681   ac_status=$?
1682   echo "$as_me:1682: \$? = $ac_status" >&5
1683   (exit $ac_status); }; }; then
1684   :
1685 else
1686   echo "$as_me: failed program was:" >&5
1687 cat conftest.$ac_ext >&5
1688 continue
1689 fi
1690 rm -f conftest.$ac_objext conftest.$ac_ext
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694 $ac_declaration
1695 int
1696 main (void)
1697 {
1698 exit (42);
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   break
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 fi
1720 rm -f conftest.$ac_objext conftest.$ac_ext
1721 done
1722 rm -rf conftest*
1723 if test -n "$ac_declaration"; then
1724   echo '#ifdef __cplusplus' >>confdefs.h
1725   echo $ac_declaration      >>confdefs.h
1726   echo '#endif'             >>confdefs.h
1727 fi
1728
1729 else
1730   echo "$as_me: failed program was:" >&5
1731 cat conftest.$ac_ext >&5
1732 fi
1733 rm -f conftest.$ac_objext conftest.$ac_ext
1734 ac_ext=c
1735 ac_cpp='$CPP $CPPFLAGS'
1736 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1737 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1738 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1739 ac_main_return=return
1740
1741 GCC_VERSION=none
1742 if test "$GCC" = yes ; then
1743         echo "$as_me:1743: checking version of $CC" >&5
1744 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1745         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1746         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1747         echo "$as_me:1747: result: $GCC_VERSION" >&5
1748 echo "${ECHO_T}$GCC_VERSION" >&6
1749 fi
1750
1751 INTEL_COMPILER=no
1752
1753 if test "$GCC" = yes ; then
1754         case $host_os in
1755         (linux*|gnu*)
1756                 echo "$as_me:1756: checking if this is really Intel C compiler" >&5
1757 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1758                 cf_save_CFLAGS="$CFLAGS"
1759                 CFLAGS="$CFLAGS -no-gcc"
1760                 cat >conftest.$ac_ext <<_ACEOF
1761 #line 1761 "configure"
1762 #include "confdefs.h"
1763
1764 int
1765 main (void)
1766 {
1767
1768 #ifdef __INTEL_COMPILER
1769 #else
1770 make an error
1771 #endif
1772
1773   ;
1774   return 0;
1775 }
1776 _ACEOF
1777 rm -f conftest.$ac_objext
1778 if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5
1779   (eval $ac_compile) 2>&5
1780   ac_status=$?
1781   echo "$as_me:1781: \$? = $ac_status" >&5
1782   (exit $ac_status); } &&
1783          { ac_try='test -s conftest.$ac_objext'
1784   { (eval echo "$as_me:1784: \"$ac_try\"") >&5
1785   (eval $ac_try) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); }; }; then
1789   INTEL_COMPILER=yes
1790 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1791
1792 else
1793   echo "$as_me: failed program was:" >&5
1794 cat conftest.$ac_ext >&5
1795 fi
1796 rm -f conftest.$ac_objext conftest.$ac_ext
1797                 CFLAGS="$cf_save_CFLAGS"
1798                 echo "$as_me:1798: result: $INTEL_COMPILER" >&5
1799 echo "${ECHO_T}$INTEL_COMPILER" >&6
1800                 ;;
1801         esac
1802 fi
1803
1804 CLANG_COMPILER=no
1805
1806 if test "$GCC" = yes ; then
1807         echo "$as_me:1807: checking if this is really Clang C compiler" >&5
1808 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1809         cf_save_CFLAGS="$CFLAGS"
1810         CFLAGS="$CFLAGS -Qunused-arguments"
1811         cat >conftest.$ac_ext <<_ACEOF
1812 #line 1812 "configure"
1813 #include "confdefs.h"
1814
1815 int
1816 main (void)
1817 {
1818
1819 #ifdef __clang__
1820 #else
1821 make an error
1822 #endif
1823
1824   ;
1825   return 0;
1826 }
1827 _ACEOF
1828 rm -f conftest.$ac_objext
1829 if { (eval echo "$as_me:1829: \"$ac_compile\"") >&5
1830   (eval $ac_compile) 2>&5
1831   ac_status=$?
1832   echo "$as_me:1832: \$? = $ac_status" >&5
1833   (exit $ac_status); } &&
1834          { ac_try='test -s conftest.$ac_objext'
1835   { (eval echo "$as_me:1835: \"$ac_try\"") >&5
1836   (eval $ac_try) 2>&5
1837   ac_status=$?
1838   echo "$as_me:1838: \$? = $ac_status" >&5
1839   (exit $ac_status); }; }; then
1840   CLANG_COMPILER=yes
1841 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1842
1843 else
1844   echo "$as_me: failed program was:" >&5
1845 cat conftest.$ac_ext >&5
1846 fi
1847 rm -f conftest.$ac_objext conftest.$ac_ext
1848         CFLAGS="$cf_save_CFLAGS"
1849         echo "$as_me:1849: result: $CLANG_COMPILER" >&5
1850 echo "${ECHO_T}$CLANG_COMPILER" >&6
1851 fi
1852
1853 echo "$as_me:1853: checking for $CC option to accept ANSI C" >&5
1854 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1855 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1856   echo $ECHO_N "(cached) $ECHO_C" >&6
1857 else
1858   ac_cv_prog_cc_stdc=no
1859 ac_save_CC=$CC
1860 cat >conftest.$ac_ext <<_ACEOF
1861 #line 1861 "configure"
1862 #include "confdefs.h"
1863 #include <stdarg.h>
1864 #include <stdio.h>
1865 #include <sys/types.h>
1866 #include <sys/stat.h>
1867 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1868 struct buf { int x; };
1869 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1870 static char *e (p, i)
1871      char **p;
1872      int i;
1873 {
1874   return p[i];
1875 }
1876 static char *f (char * (*g) (char **, int), char **p, ...)
1877 {
1878   char *s;
1879   va_list v;
1880   va_start (v,p);
1881   s = g (p, va_arg (v,int));
1882   va_end (v);
1883   return s;
1884 }
1885 int test (int i, double x);
1886 struct s1 {int (*f) (int a);};
1887 struct s2 {int (*f) (double a);};
1888 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1889 int argc;
1890 char **argv;
1891 int
1892 main (void)
1893 {
1894 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1895   ;
1896   return 0;
1897 }
1898 _ACEOF
1899 # Don't try gcc -ansi; that turns off useful extensions and
1900 # breaks some systems' header files.
1901 # AIX                   -qlanglvl=ansi
1902 # Ultrix and OSF/1      -std1
1903 # HP-UX 10.20 and later -Ae
1904 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1905 # SVR4                  -Xc -D__EXTENSIONS__
1906 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1907 do
1908   CC="$ac_save_CC $ac_arg"
1909   rm -f conftest.$ac_objext
1910 if { (eval echo "$as_me:1910: \"$ac_compile\"") >&5
1911   (eval $ac_compile) 2>&5
1912   ac_status=$?
1913   echo "$as_me:1913: \$? = $ac_status" >&5
1914   (exit $ac_status); } &&
1915          { ac_try='test -s conftest.$ac_objext'
1916   { (eval echo "$as_me:1916: \"$ac_try\"") >&5
1917   (eval $ac_try) 2>&5
1918   ac_status=$?
1919   echo "$as_me:1919: \$? = $ac_status" >&5
1920   (exit $ac_status); }; }; then
1921   ac_cv_prog_cc_stdc=$ac_arg
1922 break
1923 else
1924   echo "$as_me: failed program was:" >&5
1925 cat conftest.$ac_ext >&5
1926 fi
1927 rm -f conftest.$ac_objext
1928 done
1929 rm -f conftest.$ac_ext conftest.$ac_objext
1930 CC=$ac_save_CC
1931
1932 fi
1933
1934 case "x$ac_cv_prog_cc_stdc" in
1935   x|xno)
1936     echo "$as_me:1936: result: none needed" >&5
1937 echo "${ECHO_T}none needed" >&6 ;;
1938   *)
1939     echo "$as_me:1939: result: $ac_cv_prog_cc_stdc" >&5
1940 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1941     CC="$CC $ac_cv_prog_cc_stdc" ;;
1942 esac
1943
1944 # This should have been defined by AC_PROG_CC
1945 : ${CC:=cc}
1946
1947 echo "$as_me:1947: checking \$CFLAGS variable" >&5
1948 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1949 case "x$CFLAGS" in
1950 (*-[IUD]*)
1951         echo "$as_me:1951: result: broken" >&5
1952 echo "${ECHO_T}broken" >&6
1953         { echo "$as_me:1953: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1954 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1955         cf_flags="$CFLAGS"
1956         CFLAGS=
1957         for cf_arg in $cf_flags
1958         do
1959
1960 cf_fix_cppflags=no
1961 cf_new_cflags=
1962 cf_new_cppflags=
1963 cf_new_extra_cppflags=
1964
1965 for cf_add_cflags in $cf_arg
1966 do
1967 case $cf_fix_cppflags in
1968 (no)
1969         case $cf_add_cflags in
1970         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1971                 case $cf_add_cflags in
1972                 (-D*)
1973                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1974
1975                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1976                                 && test -z "${cf_tst_cflags}" \
1977                                 && cf_fix_cppflags=yes
1978
1979                         if test $cf_fix_cppflags = yes ; then
1980
1981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1983
1984                                 continue
1985                         elif test "${cf_tst_cflags}" = "\"'" ; then
1986
1987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1989
1990                                 continue
1991                         fi
1992                         ;;
1993                 esac
1994                 case "$CPPFLAGS" in
1995                 (*$cf_add_cflags)
1996                         ;;
1997                 (*)
1998                         case $cf_add_cflags in
1999                         (-D*)
2000                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2001
2002 CPPFLAGS=`echo "$CPPFLAGS" | \
2003         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2004                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2005
2006                                 ;;
2007                         esac
2008
2009         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2010         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2011
2012                         ;;
2013                 esac
2014                 ;;
2015         (*)
2016
2017         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2018         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2019
2020                 ;;
2021         esac
2022         ;;
2023 (yes)
2024
2025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2027
2028         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2029
2030         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2031                 && test -z "${cf_tst_cflags}" \
2032                 && cf_fix_cppflags=no
2033         ;;
2034 esac
2035 done
2036
2037 if test -n "$cf_new_cflags" ; then
2038
2039         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2040         CFLAGS="${CFLAGS}$cf_new_cflags"
2041
2042 fi
2043
2044 if test -n "$cf_new_cppflags" ; then
2045
2046         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2047         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2048
2049 fi
2050
2051 if test -n "$cf_new_extra_cppflags" ; then
2052
2053         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2054         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2055
2056 fi
2057
2058         done
2059         ;;
2060 (*)
2061         echo "$as_me:2061: result: ok" >&5
2062 echo "${ECHO_T}ok" >&6
2063         ;;
2064 esac
2065
2066 echo "$as_me:2066: checking \$CC variable" >&5
2067 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2068 case "$CC" in
2069 (*[\ \  ]-*)
2070         echo "$as_me:2070: result: broken" >&5
2071 echo "${ECHO_T}broken" >&6
2072         { echo "$as_me:2072: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2073 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2074         # humor him...
2075         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2076         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2077         CC="$cf_prog"
2078         for cf_arg in $cf_flags
2079         do
2080                 case "x$cf_arg" in
2081                 (x-[IUDfgOW]*)
2082
2083 cf_fix_cppflags=no
2084 cf_new_cflags=
2085 cf_new_cppflags=
2086 cf_new_extra_cppflags=
2087
2088 for cf_add_cflags in $cf_arg
2089 do
2090 case $cf_fix_cppflags in
2091 (no)
2092         case $cf_add_cflags in
2093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2094                 case $cf_add_cflags in
2095                 (-D*)
2096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2097
2098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2099                                 && test -z "${cf_tst_cflags}" \
2100                                 && cf_fix_cppflags=yes
2101
2102                         if test $cf_fix_cppflags = yes ; then
2103
2104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2106
2107                                 continue
2108                         elif test "${cf_tst_cflags}" = "\"'" ; then
2109
2110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2112
2113                                 continue
2114                         fi
2115                         ;;
2116                 esac
2117                 case "$CPPFLAGS" in
2118                 (*$cf_add_cflags)
2119                         ;;
2120                 (*)
2121                         case $cf_add_cflags in
2122                         (-D*)
2123                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2124
2125 CPPFLAGS=`echo "$CPPFLAGS" | \
2126         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2127                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2128
2129                                 ;;
2130                         esac
2131
2132         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2133         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2134
2135                         ;;
2136                 esac
2137                 ;;
2138         (*)
2139
2140         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2141         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2142
2143                 ;;
2144         esac
2145         ;;
2146 (yes)
2147
2148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2150
2151         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2152
2153         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2154                 && test -z "${cf_tst_cflags}" \
2155                 && cf_fix_cppflags=no
2156         ;;
2157 esac
2158 done
2159
2160 if test -n "$cf_new_cflags" ; then
2161
2162         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2163         CFLAGS="${CFLAGS}$cf_new_cflags"
2164
2165 fi
2166
2167 if test -n "$cf_new_cppflags" ; then
2168
2169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2170         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2171
2172 fi
2173
2174 if test -n "$cf_new_extra_cppflags" ; then
2175
2176         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2177         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2178
2179 fi
2180
2181                         ;;
2182                 (*)
2183                         CC="$CC $cf_arg"
2184                         ;;
2185                 esac
2186         done
2187         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2188
2189 echo "${as_me:-configure}:2189: testing resulting CC: '$CC' ..." 1>&5
2190
2191         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2192
2193 echo "${as_me:-configure}:2193: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2194
2195         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2196
2197 echo "${as_me:-configure}:2197: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2198
2199         ;;
2200 (*)
2201         echo "$as_me:2201: result: ok" >&5
2202 echo "${ECHO_T}ok" >&6
2203         ;;
2204 esac
2205
2206 ac_ext=c
2207 ac_cpp='$CPP $CPPFLAGS'
2208 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2209 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2210 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2211 ac_main_return=return
2212 echo "$as_me:2212: checking how to run the C preprocessor" >&5
2213 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2214 # On Suns, sometimes $CPP names a directory.
2215 if test -n "$CPP" && test -d "$CPP"; then
2216   CPP=
2217 fi
2218 if test -z "$CPP"; then
2219   if test "${ac_cv_prog_CPP+set}" = set; then
2220   echo $ECHO_N "(cached) $ECHO_C" >&6
2221 else
2222       # Double quotes because CPP needs to be expanded
2223     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2224     do
2225       ac_preproc_ok=false
2226 for ac_c_preproc_warn_flag in '' yes
2227 do
2228   # Use a header file that comes with gcc, so configuring glibc
2229   # with a fresh cross-compiler works.
2230   # On the NeXT, cc -E runs the code through the compiler's parser,
2231   # not just through cpp. "Syntax error" is here to catch this case.
2232   cat >conftest.$ac_ext <<_ACEOF
2233 #line 2233 "configure"
2234 #include "confdefs.h"
2235 #include <assert.h>
2236                      Syntax error
2237 _ACEOF
2238 if { (eval echo "$as_me:2238: \"$ac_cpp conftest.$ac_ext\"") >&5
2239   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2240   ac_status=$?
2241   egrep -v '^ *\+' conftest.er1 >conftest.err
2242   rm -f conftest.er1
2243   cat conftest.err >&5
2244   echo "$as_me:2244: \$? = $ac_status" >&5
2245   (exit $ac_status); } >/dev/null; then
2246   if test -s conftest.err; then
2247     ac_cpp_err=$ac_c_preproc_warn_flag
2248   else
2249     ac_cpp_err=
2250   fi
2251 else
2252   ac_cpp_err=yes
2253 fi
2254 if test -z "$ac_cpp_err"; then
2255   :
2256 else
2257   echo "$as_me: failed program was:" >&5
2258   cat conftest.$ac_ext >&5
2259   # Broken: fails on valid input.
2260 continue
2261 fi
2262 rm -f conftest.err conftest.$ac_ext
2263
2264   # OK, works on sane cases.  Now check whether non-existent headers
2265   # can be detected and how.
2266   cat >conftest.$ac_ext <<_ACEOF
2267 #line 2267 "configure"
2268 #include "confdefs.h"
2269 #include <ac_nonexistent.h>
2270 _ACEOF
2271 if { (eval echo "$as_me:2271: \"$ac_cpp conftest.$ac_ext\"") >&5
2272   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2273   ac_status=$?
2274   egrep -v '^ *\+' conftest.er1 >conftest.err
2275   rm -f conftest.er1
2276   cat conftest.err >&5
2277   echo "$as_me:2277: \$? = $ac_status" >&5
2278   (exit $ac_status); } >/dev/null; then
2279   if test -s conftest.err; then
2280     ac_cpp_err=$ac_c_preproc_warn_flag
2281   else
2282     ac_cpp_err=
2283   fi
2284 else
2285   ac_cpp_err=yes
2286 fi
2287 if test -z "$ac_cpp_err"; then
2288   # Broken: success on invalid input.
2289 continue
2290 else
2291   echo "$as_me: failed program was:" >&5
2292   cat conftest.$ac_ext >&5
2293   # Passes both tests.
2294 ac_preproc_ok=:
2295 break
2296 fi
2297 rm -f conftest.err conftest.$ac_ext
2298
2299 done
2300 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2301 rm -f conftest.err conftest.$ac_ext
2302 if $ac_preproc_ok; then
2303   break
2304 fi
2305
2306     done
2307     ac_cv_prog_CPP=$CPP
2308
2309 fi
2310   CPP=$ac_cv_prog_CPP
2311 else
2312   ac_cv_prog_CPP=$CPP
2313 fi
2314 echo "$as_me:2314: result: $CPP" >&5
2315 echo "${ECHO_T}$CPP" >&6
2316 ac_preproc_ok=false
2317 for ac_c_preproc_warn_flag in '' yes
2318 do
2319   # Use a header file that comes with gcc, so configuring glibc
2320   # with a fresh cross-compiler works.
2321   # On the NeXT, cc -E runs the code through the compiler's parser,
2322   # not just through cpp. "Syntax error" is here to catch this case.
2323   cat >conftest.$ac_ext <<_ACEOF
2324 #line 2324 "configure"
2325 #include "confdefs.h"
2326 #include <assert.h>
2327                      Syntax error
2328 _ACEOF
2329 if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
2330   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2331   ac_status=$?
2332   egrep -v '^ *\+' conftest.er1 >conftest.err
2333   rm -f conftest.er1
2334   cat conftest.err >&5
2335   echo "$as_me:2335: \$? = $ac_status" >&5
2336   (exit $ac_status); } >/dev/null; then
2337   if test -s conftest.err; then
2338     ac_cpp_err=$ac_c_preproc_warn_flag
2339   else
2340     ac_cpp_err=
2341   fi
2342 else
2343   ac_cpp_err=yes
2344 fi
2345 if test -z "$ac_cpp_err"; then
2346   :
2347 else
2348   echo "$as_me: failed program was:" >&5
2349   cat conftest.$ac_ext >&5
2350   # Broken: fails on valid input.
2351 continue
2352 fi
2353 rm -f conftest.err conftest.$ac_ext
2354
2355   # OK, works on sane cases.  Now check whether non-existent headers
2356   # can be detected and how.
2357   cat >conftest.$ac_ext <<_ACEOF
2358 #line 2358 "configure"
2359 #include "confdefs.h"
2360 #include <ac_nonexistent.h>
2361 _ACEOF
2362 if { (eval echo "$as_me:2362: \"$ac_cpp conftest.$ac_ext\"") >&5
2363   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2364   ac_status=$?
2365   egrep -v '^ *\+' conftest.er1 >conftest.err
2366   rm -f conftest.er1
2367   cat conftest.err >&5
2368   echo "$as_me:2368: \$? = $ac_status" >&5
2369   (exit $ac_status); } >/dev/null; then
2370   if test -s conftest.err; then
2371     ac_cpp_err=$ac_c_preproc_warn_flag
2372   else
2373     ac_cpp_err=
2374   fi
2375 else
2376   ac_cpp_err=yes
2377 fi
2378 if test -z "$ac_cpp_err"; then
2379   # Broken: success on invalid input.
2380 continue
2381 else
2382   echo "$as_me: failed program was:" >&5
2383   cat conftest.$ac_ext >&5
2384   # Passes both tests.
2385 ac_preproc_ok=:
2386 break
2387 fi
2388 rm -f conftest.err conftest.$ac_ext
2389
2390 done
2391 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2392 rm -f conftest.err conftest.$ac_ext
2393 if $ac_preproc_ok; then
2394   :
2395 else
2396   { { echo "$as_me:2396: error: C preprocessor \"$CPP\" fails sanity check" >&5
2397 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2398    { (exit 1); exit 1; }; }
2399 fi
2400
2401 ac_ext=c
2402 ac_cpp='$CPP $CPPFLAGS'
2403 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2404 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2405 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2406 ac_main_return=return
2407
2408 if test $ac_cv_c_compiler_gnu = yes; then
2409     echo "$as_me:2409: checking whether $CC needs -traditional" >&5
2410 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2411 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2412   echo $ECHO_N "(cached) $ECHO_C" >&6
2413 else
2414     ac_pattern="Autoconf.*'x'"
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <sgtty.h>
2419 int Autoconf = TIOCGETP;
2420 _ACEOF
2421 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2422   egrep "$ac_pattern" >/dev/null 2>&1; then
2423   ac_cv_prog_gcc_traditional=yes
2424 else
2425   ac_cv_prog_gcc_traditional=no
2426 fi
2427 rm -rf conftest*
2428
2429   if test $ac_cv_prog_gcc_traditional = no; then
2430     cat >conftest.$ac_ext <<_ACEOF
2431 #line 2431 "configure"
2432 #include "confdefs.h"
2433 #include <termio.h>
2434 int Autoconf = TCGETA;
2435 _ACEOF
2436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2437   egrep "$ac_pattern" >/dev/null 2>&1; then
2438   ac_cv_prog_gcc_traditional=yes
2439 fi
2440 rm -rf conftest*
2441
2442   fi
2443 fi
2444 echo "$as_me:2444: result: $ac_cv_prog_gcc_traditional" >&5
2445 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2446   if test $ac_cv_prog_gcc_traditional = yes; then
2447     CC="$CC -traditional"
2448   fi
2449 fi
2450
2451 echo "$as_me:2451: checking whether $CC understands -c and -o together" >&5
2452 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2453 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2454   echo $ECHO_N "(cached) $ECHO_C" >&6
2455 else
2456
2457 cat > conftest.$ac_ext <<CF_EOF
2458 int main(void)
2459 {
2460         ${cf_cv_main_return:-return}(0);
2461 }
2462 CF_EOF
2463 # We do the test twice because some compilers refuse to overwrite an
2464 # existing .o file with -o, though they will create one.
2465 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2466 if { (eval echo "$as_me:2466: \"$ac_try\"") >&5
2467   (eval $ac_try) 2>&5
2468   ac_status=$?
2469   echo "$as_me:2469: \$? = $ac_status" >&5
2470   (exit $ac_status); } &&
2471   test -f conftest2.$ac_objext && { (eval echo "$as_me:2471: \"$ac_try\"") >&5
2472   (eval $ac_try) 2>&5
2473   ac_status=$?
2474   echo "$as_me:2474: \$? = $ac_status" >&5
2475   (exit $ac_status); };
2476 then
2477   eval cf_cv_prog_CC_c_o=yes
2478 else
2479   eval cf_cv_prog_CC_c_o=no
2480 fi
2481 rm -rf conftest*
2482
2483 fi
2484 if test $cf_cv_prog_CC_c_o = yes; then
2485   echo "$as_me:2485: result: yes" >&5
2486 echo "${ECHO_T}yes" >&6
2487 else
2488   echo "$as_me:2488: result: no" >&5
2489 echo "${ECHO_T}no" >&6
2490 fi
2491
2492 test "$program_prefix" != NONE &&
2493   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2494 # Use a double $ so make ignores it.
2495 test "$program_suffix" != NONE &&
2496   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2497 # Double any \ or $.  echo might interpret backslashes.
2498 # By default was `s,x,x', remove it if useless.
2499 cat <<\_ACEOF >conftest.sed
2500 s/[\\$]/&&/g;s/;s,x,x,$//
2501 _ACEOF
2502 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2503 rm conftest.sed
2504
2505 for ac_prog in mawk gawk nawk awk
2506 do
2507   # Extract the first word of "$ac_prog", so it can be a program name with args.
2508 set dummy $ac_prog; ac_word=$2
2509 echo "$as_me:2509: checking for $ac_word" >&5
2510 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2511 if test "${ac_cv_prog_AWK+set}" = set; then
2512   echo $ECHO_N "(cached) $ECHO_C" >&6
2513 else
2514   if test -n "$AWK"; then
2515   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2516 else
2517   ac_save_IFS=$IFS; IFS=$ac_path_separator
2518 ac_dummy="$PATH"
2519 for ac_dir in $ac_dummy; do
2520   IFS=$ac_save_IFS
2521   test -z "$ac_dir" && ac_dir=.
2522   $as_executable_p "$ac_dir/$ac_word" || continue
2523 ac_cv_prog_AWK="$ac_prog"
2524 echo "$as_me:2524: found $ac_dir/$ac_word" >&5
2525 break
2526 done
2527
2528 fi
2529 fi
2530 AWK=$ac_cv_prog_AWK
2531 if test -n "$AWK"; then
2532   echo "$as_me:2532: result: $AWK" >&5
2533 echo "${ECHO_T}$AWK" >&6
2534 else
2535   echo "$as_me:2535: result: no" >&5
2536 echo "${ECHO_T}no" >&6
2537 fi
2538
2539   test -n "$AWK" && break
2540 done
2541
2542 test -z "$AWK" && { { echo "$as_me:2542: error: No awk program found" >&5
2543 echo "$as_me: error: No awk program found" >&2;}
2544    { (exit 1); exit 1; }; }
2545
2546 echo "$as_me:2546: checking for egrep" >&5
2547 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2548 if test "${ac_cv_prog_egrep+set}" = set; then
2549   echo $ECHO_N "(cached) $ECHO_C" >&6
2550 else
2551   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2552                 then ac_cv_prog_egrep='grep -E'
2553                 else ac_cv_prog_egrep='egrep'
2554         fi
2555 fi
2556 echo "$as_me:2556: result: $ac_cv_prog_egrep" >&5
2557 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2558         EGREP=$ac_cv_prog_egrep
2559
2560         test -z "$EGREP" && { { echo "$as_me:2560: error: No egrep program found" >&5
2561 echo "$as_me: error: No egrep program found" >&2;}
2562    { (exit 1); exit 1; }; }
2563
2564 # Find a good install program.  We prefer a C program (faster),
2565 # so one script is as good as another.  But avoid the broken or
2566 # incompatible versions:
2567 # SysV /etc/install, /usr/sbin/install
2568 # SunOS /usr/etc/install
2569 # IRIX /sbin/install
2570 # AIX /bin/install
2571 # AmigaOS /C/install, which installs bootblocks on floppy discs
2572 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2573 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2574 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2575 # ./install, which can be erroneously created by make from ./install.sh.
2576 echo "$as_me:2576: checking for a BSD compatible install" >&5
2577 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2578 if test -z "$INSTALL"; then
2579 if test "${ac_cv_path_install+set}" = set; then
2580   echo $ECHO_N "(cached) $ECHO_C" >&6
2581 else
2582     ac_save_IFS=$IFS; IFS=$ac_path_separator
2583   for ac_dir in $PATH; do
2584     IFS=$ac_save_IFS
2585     # Account for people who put trailing slashes in PATH elements.
2586     case $ac_dir/ in
2587     / | ./ | .// | /cC/* \
2588     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2589     | /usr/ucb/* ) ;;
2590     *)
2591       # OSF1 and SCO ODT 3.0 have their own names for install.
2592       # Don't use installbsd from OSF since it installs stuff as root
2593       # by default.
2594       for ac_prog in ginstall scoinst install; do
2595         if $as_executable_p "$ac_dir/$ac_prog"; then
2596           if test $ac_prog = install &&
2597             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2598             # AIX install.  It has an incompatible calling convention.
2599             :
2600           elif test $ac_prog = install &&
2601             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2602             # program-specific install script used by HP pwplus--don't use.
2603             :
2604           else
2605             ac_cv_path_install="$ac_dir/$ac_prog -c"
2606             break 2
2607           fi
2608         fi
2609       done
2610       ;;
2611     esac
2612   done
2613
2614 fi
2615   if test "${ac_cv_path_install+set}" = set; then
2616     INSTALL=$ac_cv_path_install
2617   else
2618     # As a last resort, use the slow shell script.  We don't cache a
2619     # path for INSTALL within a source directory, because that will
2620     # break other packages using the cache if that directory is
2621     # removed, or if the path is relative.
2622     INSTALL=$ac_install_sh
2623   fi
2624 fi
2625 echo "$as_me:2625: result: $INSTALL" >&5
2626 echo "${ECHO_T}$INSTALL" >&6
2627
2628 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2629 # It thinks the first close brace ends the variable substitution.
2630 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2631
2632 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2633
2634 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2635
2636 echo "$as_me:2636: checking whether ln -s works" >&5
2637 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2638 LN_S=$as_ln_s
2639 if test "$LN_S" = "ln -s"; then
2640   echo "$as_me:2640: result: yes" >&5
2641 echo "${ECHO_T}yes" >&6
2642 else
2643   echo "$as_me:2643: result: no, using $LN_S" >&5
2644 echo "${ECHO_T}no, using $LN_S" >&6
2645 fi
2646
2647 echo "$as_me:2647: checking if $LN_S -f options work" >&5
2648 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2649
2650 rm -f conf$$.src conf$$dst
2651 echo >conf$$.dst
2652 echo first >conf$$.src
2653 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2654         cf_prog_ln_sf=yes
2655 else
2656         cf_prog_ln_sf=no
2657 fi
2658 rm -f conf$$.dst conf$$src
2659 echo "$as_me:2659: result: $cf_prog_ln_sf" >&5
2660 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2661
2662 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2663
2664 # Find a good install program.  We prefer a C program (faster),
2665 # so one script is as good as another.  But avoid the broken or
2666 # incompatible versions:
2667 # SysV /etc/install, /usr/sbin/install
2668 # SunOS /usr/etc/install
2669 # IRIX /sbin/install
2670 # AIX /bin/install
2671 # AmigaOS /C/install, which installs bootblocks on floppy discs
2672 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2673 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2674 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2675 # ./install, which can be erroneously created by make from ./install.sh.
2676 echo "$as_me:2676: checking for a BSD compatible install" >&5
2677 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2678 if test -z "$INSTALL"; then
2679 if test "${ac_cv_path_install+set}" = set; then
2680   echo $ECHO_N "(cached) $ECHO_C" >&6
2681 else
2682     ac_save_IFS=$IFS; IFS=$ac_path_separator
2683   for ac_dir in $PATH; do
2684     IFS=$ac_save_IFS
2685     # Account for people who put trailing slashes in PATH elements.
2686     case $ac_dir/ in
2687     / | ./ | .// | /cC/* \
2688     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2689     | /usr/ucb/* ) ;;
2690     *)
2691       # OSF1 and SCO ODT 3.0 have their own names for install.
2692       # Don't use installbsd from OSF since it installs stuff as root
2693       # by default.
2694       for ac_prog in ginstall scoinst install; do
2695         if $as_executable_p "$ac_dir/$ac_prog"; then
2696           if test $ac_prog = install &&
2697             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2698             # AIX install.  It has an incompatible calling convention.
2699             :
2700           elif test $ac_prog = install &&
2701             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2702             # program-specific install script used by HP pwplus--don't use.
2703             :
2704           else
2705             ac_cv_path_install="$ac_dir/$ac_prog -c"
2706             break 2
2707           fi
2708         fi
2709       done
2710       ;;
2711     esac
2712   done
2713
2714 fi
2715   if test "${ac_cv_path_install+set}" = set; then
2716     INSTALL=$ac_cv_path_install
2717   else
2718     # As a last resort, use the slow shell script.  We don't cache a
2719     # path for INSTALL within a source directory, because that will
2720     # break other packages using the cache if that directory is
2721     # removed, or if the path is relative.
2722     INSTALL=$ac_install_sh
2723   fi
2724 fi
2725 echo "$as_me:2725: result: $INSTALL" >&5
2726 echo "${ECHO_T}$INSTALL" >&6
2727
2728 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2729 # It thinks the first close brace ends the variable substitution.
2730 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2731
2732 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2733
2734 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2735
2736 case $INSTALL in
2737 (/*)
2738         ;;
2739 (*)
2740         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2741         test -z "$cf_dir" && cf_dir=.
2742         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2743         ;;
2744 esac
2745
2746 echo "$as_me:2746: checking if you want to install stripped executables" >&5
2747 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2748
2749 # Check whether --enable-stripping or --disable-stripping was given.
2750 if test "${enable_stripping+set}" = set; then
2751   enableval="$enable_stripping"
2752   test "$enableval" != no && enableval=yes
2753         if test "$enableval" != "yes" ; then
2754     with_stripping=no
2755         else
2756                 with_stripping=yes
2757         fi
2758 else
2759   enableval=yes
2760         with_stripping=yes
2761
2762 fi;
2763 echo "$as_me:2763: result: $with_stripping" >&5
2764 echo "${ECHO_T}$with_stripping" >&6
2765
2766 if test "$with_stripping" = yes
2767 then
2768         INSTALL_OPT_S="-s"
2769 else
2770         INSTALL_OPT_S=
2771 fi
2772
2773 : ${INSTALL:=install}
2774 echo "$as_me:2774: checking if install accepts -p option" >&5
2775 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2776 if test "${cf_cv_install_p+set}" = set; then
2777   echo $ECHO_N "(cached) $ECHO_C" >&6
2778 else
2779
2780         rm -rf conftest*
2781         date >conftest.in
2782         mkdir conftest.out
2783         sleep 3
2784         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2785         then
2786                 if test -f conftest.out/conftest.in
2787                 then
2788                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2789                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2790                         if test -s conftest.err
2791                         then
2792                                 cf_cv_install_p=no
2793                         else
2794                                 cf_cv_install_p=yes
2795                         fi
2796                 else
2797                         cf_cv_install_p=no
2798                 fi
2799         else
2800                 cf_cv_install_p=no
2801         fi
2802         rm -rf conftest*
2803
2804 fi
2805 echo "$as_me:2805: result: $cf_cv_install_p" >&5
2806 echo "${ECHO_T}$cf_cv_install_p" >&6
2807
2808 echo "$as_me:2808: checking if install needs to be told about ownership" >&5
2809 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2810 case `$ac_config_guess` in
2811 (*minix)
2812         with_install_o=yes
2813         ;;
2814 (*)
2815         with_install_o=no
2816         ;;
2817 esac
2818
2819 echo "$as_me:2819: result: $with_install_o" >&5
2820 echo "${ECHO_T}$with_install_o" >&6
2821 if test "x$with_install_o" = xyes
2822 then
2823         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2824 else
2825         INSTALL_OPT_O=
2826 fi
2827
2828 echo "$as_me:2828: checking for long file names" >&5
2829 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2830 if test "${ac_cv_sys_long_file_names+set}" = set; then
2831   echo $ECHO_N "(cached) $ECHO_C" >&6
2832 else
2833   ac_cv_sys_long_file_names=yes
2834 # Test for long file names in all the places we know might matter:
2835 #      .                the current directory, where building will happen
2836 #      $prefix/lib      where we will be installing things
2837 #      $exec_prefix/lib likewise
2838 # eval it to expand exec_prefix.
2839 #      $TMPDIR          if set, where it might want to write temporary files
2840 # if $TMPDIR is not set:
2841 #      /tmp             where it might want to write temporary files
2842 #      /var/tmp         likewise
2843 #      /usr/tmp         likewise
2844 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2845   ac_tmpdirs=$TMPDIR
2846 else
2847   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2848 fi
2849 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2850   test -d $ac_dir || continue
2851   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2852   ac_xdir=$ac_dir/cf$$
2853   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2854   ac_tf1=$ac_xdir/conftest9012345
2855   ac_tf2=$ac_xdir/conftest9012346
2856   (echo 1 >$ac_tf1) 2>/dev/null
2857   (echo 2 >$ac_tf2) 2>/dev/null
2858   ac_val=`cat $ac_tf1 2>/dev/null`
2859   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2860     ac_cv_sys_long_file_names=no
2861     rm -rf $ac_xdir 2>/dev/null
2862     break
2863   fi
2864   rm -rf $ac_xdir 2>/dev/null
2865 done
2866 fi
2867 echo "$as_me:2867: result: $ac_cv_sys_long_file_names" >&5
2868 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2869 if test $ac_cv_sys_long_file_names = yes; then
2870
2871 cat >>confdefs.h <<\EOF
2872 #define HAVE_LONG_FILE_NAMES 1
2873 EOF
2874
2875 fi
2876
2877 # if we find pkg-config, check if we should install the ".pc" files.
2878
2879 echo "$as_me:2879: checking if you want to use pkg-config" >&5
2880 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2881
2882 # Check whether --with-pkg-config or --without-pkg-config was given.
2883 if test "${with_pkg_config+set}" = set; then
2884   withval="$with_pkg_config"
2885   cf_pkg_config=$withval
2886 else
2887   cf_pkg_config=yes
2888 fi;
2889 echo "$as_me:2889: result: $cf_pkg_config" >&5
2890 echo "${ECHO_T}$cf_pkg_config" >&6
2891
2892 case $cf_pkg_config in
2893 (no)
2894         PKG_CONFIG=none
2895         ;;
2896 (yes)
2897
2898 if test -n "$ac_tool_prefix"; then
2899   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2900 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2901 echo "$as_me:2901: checking for $ac_word" >&5
2902 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2903 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2904   echo $ECHO_N "(cached) $ECHO_C" >&6
2905 else
2906   case $PKG_CONFIG in
2907   [\\/]* | ?:[\\/]*)
2908   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2909   ;;
2910   *)
2911   ac_save_IFS=$IFS; IFS=$ac_path_separator
2912 ac_dummy="$PATH"
2913 for ac_dir in $ac_dummy; do
2914   IFS=$ac_save_IFS
2915   test -z "$ac_dir" && ac_dir=.
2916   if $as_executable_p "$ac_dir/$ac_word"; then
2917    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2918    echo "$as_me:2918: found $ac_dir/$ac_word" >&5
2919    break
2920 fi
2921 done
2922
2923   ;;
2924 esac
2925 fi
2926 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2927
2928 if test -n "$PKG_CONFIG"; then
2929   echo "$as_me:2929: result: $PKG_CONFIG" >&5
2930 echo "${ECHO_T}$PKG_CONFIG" >&6
2931 else
2932   echo "$as_me:2932: result: no" >&5
2933 echo "${ECHO_T}no" >&6
2934 fi
2935
2936 fi
2937 if test -z "$ac_cv_path_PKG_CONFIG"; then
2938   ac_pt_PKG_CONFIG=$PKG_CONFIG
2939   # Extract the first word of "pkg-config", so it can be a program name with args.
2940 set dummy pkg-config; ac_word=$2
2941 echo "$as_me:2941: checking for $ac_word" >&5
2942 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2943 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2944   echo $ECHO_N "(cached) $ECHO_C" >&6
2945 else
2946   case $ac_pt_PKG_CONFIG in
2947   [\\/]* | ?:[\\/]*)
2948   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2949   ;;
2950   *)
2951   ac_save_IFS=$IFS; IFS=$ac_path_separator
2952 ac_dummy="$PATH"
2953 for ac_dir in $ac_dummy; do
2954   IFS=$ac_save_IFS
2955   test -z "$ac_dir" && ac_dir=.
2956   if $as_executable_p "$ac_dir/$ac_word"; then
2957    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2958    echo "$as_me:2958: found $ac_dir/$ac_word" >&5
2959    break
2960 fi
2961 done
2962
2963   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2964   ;;
2965 esac
2966 fi
2967 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2968
2969 if test -n "$ac_pt_PKG_CONFIG"; then
2970   echo "$as_me:2970: result: $ac_pt_PKG_CONFIG" >&5
2971 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2972 else
2973   echo "$as_me:2973: result: no" >&5
2974 echo "${ECHO_T}no" >&6
2975 fi
2976
2977   PKG_CONFIG=$ac_pt_PKG_CONFIG
2978 else
2979   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2980 fi
2981
2982         ;;
2983 (*)
2984         PKG_CONFIG=$withval
2985         ;;
2986 esac
2987
2988 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2989 if test "$PKG_CONFIG" != none ; then
2990
2991 if test "x$prefix" != xNONE; then
2992         cf_path_syntax="$prefix"
2993 else
2994         cf_path_syntax="$ac_default_prefix"
2995 fi
2996
2997 case ".$PKG_CONFIG" in
2998 (.\$\(*\)*|.\'*\'*)
2999         ;;
3000 (..|./*|.\\*)
3001         ;;
3002 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3003         ;;
3004 (.\${*prefix}*|.\${*dir}*)
3005         eval PKG_CONFIG="$PKG_CONFIG"
3006         case ".$PKG_CONFIG" in
3007         (.NONE/*)
3008                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3009                 ;;
3010         esac
3011         ;;
3012 (.no|.NONE/*)
3013         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3014         ;;
3015 (*)
3016         { { echo "$as_me:3016: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3017 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3018    { (exit 1); exit 1; }; }
3019         ;;
3020 esac
3021
3022 elif test "x$cf_pkg_config" != xno ; then
3023         { echo "$as_me:3023: WARNING: pkg-config is not installed" >&5
3024 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3025 fi
3026
3027 case $PKG_CONFIG in
3028 (no|none|yes)
3029         echo "$as_me:3029: checking for pkg-config library directory" >&5
3030 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3031         ;;
3032 (*)
3033         echo "$as_me:3033: checking for $PKG_CONFIG library directory" >&5
3034 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3035         ;;
3036 esac
3037
3038 PKG_CONFIG_LIBDIR=no
3039
3040 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3041 if test "${with_pkg_config_libdir+set}" = set; then
3042   withval="$with_pkg_config_libdir"
3043   PKG_CONFIG_LIBDIR=$withval
3044 else
3045   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3046 fi;
3047
3048 case x$PKG_CONFIG_LIBDIR in
3049 (x/*)
3050         ;;
3051 (xyes)
3052         # Look for the library directory using the same prefix as the executable
3053         if test "x$PKG_CONFIG" = xnone
3054         then
3055                 cf_path=$prefix
3056         else
3057                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3058         fi
3059
3060         # If you don't like using the default architecture, you have to specify the
3061         # intended library directory and corresponding compiler/linker options.
3062         #
3063         # This case allows for Debian's 2014-flavor of multiarch, along with the
3064         # most common variations before that point.  Some other variants spell the
3065         # directory differently, e.g., "pkg-config", and put it in unusual places.
3066         # pkg-config has always been poorly standardized, which is ironic...
3067         case x`(arch) 2>/dev/null` in
3068         (*64)
3069                 cf_search_path="\
3070                         $cf_path/lib/*64-linux-gnu \
3071                         $cf_path/share \
3072                         $cf_path/lib64 \
3073                         $cf_path/lib32 \
3074                         $cf_path/lib"
3075                 ;;
3076         (*)
3077                 cf_search_path="\
3078                         $cf_path/lib/*-linux-gnu \
3079                         $cf_path/share \
3080                         $cf_path/lib32 \
3081                         $cf_path/lib \
3082                         $cf_path/libdata"
3083                 ;;
3084         esac
3085
3086         test -n "$verbose" && echo "    list..." 1>&6
3087
3088 echo "${as_me:-configure}:3088: testing list... ..." 1>&5
3089
3090         for cf_config in $cf_search_path
3091         do
3092                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3093
3094 echo "${as_me:-configure}:3094: testing checking $cf_config/pkgconfig ..." 1>&5
3095
3096                 if test -d $cf_config/pkgconfig
3097                 then
3098                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3099                         echo "$as_me:3099: checking done" >&5
3100 echo $ECHO_N "checking done... $ECHO_C" >&6
3101                         break
3102                 fi
3103         done
3104         ;;
3105 (*)
3106         ;;
3107 esac
3108
3109 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3110         echo "$as_me:3110: result: $PKG_CONFIG_LIBDIR" >&5
3111 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3112 fi
3113
3114 echo "$as_me:3114: checking if you want to build test-programs" >&5
3115 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3116
3117 # Check whether --with-tests or --without-tests was given.
3118 if test "${with_tests+set}" = set; then
3119   withval="$with_tests"
3120   cf_with_tests=$withval
3121 else
3122   cf_with_tests=yes
3123 fi;
3124 echo "$as_me:3124: result: $cf_with_tests" >&5
3125 echo "${ECHO_T}$cf_with_tests" >&6
3126
3127 echo "$as_me:3127: checking if we should assume mixed-case filenames" >&5
3128 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3129
3130 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3131 if test "${enable_mixed_case+set}" = set; then
3132   enableval="$enable_mixed_case"
3133   enable_mixedcase=$enableval
3134 else
3135   enable_mixedcase=auto
3136 fi;
3137 echo "$as_me:3137: result: $enable_mixedcase" >&5
3138 echo "${ECHO_T}$enable_mixedcase" >&6
3139 if test "$enable_mixedcase" = "auto" ; then
3140
3141 echo "$as_me:3141: checking if filesystem supports mixed-case filenames" >&5
3142 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3143 if test "${cf_cv_mixedcase+set}" = set; then
3144   echo $ECHO_N "(cached) $ECHO_C" >&6
3145 else
3146
3147 if test "$cross_compiling" = yes ; then
3148         case $target_alias in
3149         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3150                 cf_cv_mixedcase=no
3151                 ;;
3152         (*)
3153                 cf_cv_mixedcase=yes
3154                 ;;
3155         esac
3156 else
3157         rm -f conftest CONFTEST
3158         echo test >conftest
3159         if test -f CONFTEST ; then
3160                 cf_cv_mixedcase=no
3161         else
3162                 cf_cv_mixedcase=yes
3163         fi
3164         rm -f conftest CONFTEST
3165 fi
3166
3167 fi
3168 echo "$as_me:3168: result: $cf_cv_mixedcase" >&5
3169 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3170 test "$cf_cv_mixedcase" = yes &&
3171 cat >>confdefs.h <<\EOF
3172 #define MIXEDCASE_FILENAMES 1
3173 EOF
3174
3175 else
3176         cf_cv_mixedcase=$enable_mixedcase
3177         if test "$enable_mixedcase" = "yes" ; then
3178                 cat >>confdefs.h <<\EOF
3179 #define MIXEDCASE_FILENAMES 1
3180 EOF
3181
3182         fi
3183 fi
3184
3185 # do this after mixed-case option (tags/TAGS is not as important as tic).
3186 echo "$as_me:3186: checking whether ${MAKE-make} sets \${MAKE}" >&5
3187 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3188 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3189 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3190   echo $ECHO_N "(cached) $ECHO_C" >&6
3191 else
3192   cat >conftest.make <<\EOF
3193 all:
3194         @echo 'ac_maketemp="${MAKE}"'
3195 EOF
3196 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3197 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3198 if test -n "$ac_maketemp"; then
3199   eval ac_cv_prog_make_${ac_make}_set=yes
3200 else
3201   eval ac_cv_prog_make_${ac_make}_set=no
3202 fi
3203 rm -f conftest.make
3204 fi
3205 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3206   echo "$as_me:3206: result: yes" >&5
3207 echo "${ECHO_T}yes" >&6
3208   SET_MAKE=
3209 else
3210   echo "$as_me:3210: result: no" >&5
3211 echo "${ECHO_T}no" >&6
3212   SET_MAKE="MAKE=${MAKE-make}"
3213 fi
3214
3215 for ac_prog in exctags ctags
3216 do
3217   # Extract the first word of "$ac_prog", so it can be a program name with args.
3218 set dummy $ac_prog; ac_word=$2
3219 echo "$as_me:3219: checking for $ac_word" >&5
3220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3221 if test "${ac_cv_prog_CTAGS+set}" = set; then
3222   echo $ECHO_N "(cached) $ECHO_C" >&6
3223 else
3224   if test -n "$CTAGS"; then
3225   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3226 else
3227   ac_save_IFS=$IFS; IFS=$ac_path_separator
3228 ac_dummy="$PATH"
3229 for ac_dir in $ac_dummy; do
3230   IFS=$ac_save_IFS
3231   test -z "$ac_dir" && ac_dir=.
3232   $as_executable_p "$ac_dir/$ac_word" || continue
3233 ac_cv_prog_CTAGS="$ac_prog"
3234 echo "$as_me:3234: found $ac_dir/$ac_word" >&5
3235 break
3236 done
3237
3238 fi
3239 fi
3240 CTAGS=$ac_cv_prog_CTAGS
3241 if test -n "$CTAGS"; then
3242   echo "$as_me:3242: result: $CTAGS" >&5
3243 echo "${ECHO_T}$CTAGS" >&6
3244 else
3245   echo "$as_me:3245: result: no" >&5
3246 echo "${ECHO_T}no" >&6
3247 fi
3248
3249   test -n "$CTAGS" && break
3250 done
3251
3252 for ac_prog in exetags etags
3253 do
3254   # Extract the first word of "$ac_prog", so it can be a program name with args.
3255 set dummy $ac_prog; ac_word=$2
3256 echo "$as_me:3256: checking for $ac_word" >&5
3257 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3258 if test "${ac_cv_prog_ETAGS+set}" = set; then
3259   echo $ECHO_N "(cached) $ECHO_C" >&6
3260 else
3261   if test -n "$ETAGS"; then
3262   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3263 else
3264   ac_save_IFS=$IFS; IFS=$ac_path_separator
3265 ac_dummy="$PATH"
3266 for ac_dir in $ac_dummy; do
3267   IFS=$ac_save_IFS
3268   test -z "$ac_dir" && ac_dir=.
3269   $as_executable_p "$ac_dir/$ac_word" || continue
3270 ac_cv_prog_ETAGS="$ac_prog"
3271 echo "$as_me:3271: found $ac_dir/$ac_word" >&5
3272 break
3273 done
3274
3275 fi
3276 fi
3277 ETAGS=$ac_cv_prog_ETAGS
3278 if test -n "$ETAGS"; then
3279   echo "$as_me:3279: result: $ETAGS" >&5
3280 echo "${ECHO_T}$ETAGS" >&6
3281 else
3282   echo "$as_me:3282: result: no" >&5
3283 echo "${ECHO_T}no" >&6
3284 fi
3285
3286   test -n "$ETAGS" && break
3287 done
3288
3289 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3290 set dummy ${CTAGS:-ctags}; ac_word=$2
3291 echo "$as_me:3291: checking for $ac_word" >&5
3292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3293 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3294   echo $ECHO_N "(cached) $ECHO_C" >&6
3295 else
3296   if test -n "$MAKE_LOWER_TAGS"; then
3297   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3298 else
3299   ac_save_IFS=$IFS; IFS=$ac_path_separator
3300 ac_dummy="$PATH"
3301 for ac_dir in $ac_dummy; do
3302   IFS=$ac_save_IFS
3303   test -z "$ac_dir" && ac_dir=.
3304   $as_executable_p "$ac_dir/$ac_word" || continue
3305 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3306 echo "$as_me:3306: found $ac_dir/$ac_word" >&5
3307 break
3308 done
3309
3310   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3311 fi
3312 fi
3313 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3314 if test -n "$MAKE_LOWER_TAGS"; then
3315   echo "$as_me:3315: result: $MAKE_LOWER_TAGS" >&5
3316 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3317 else
3318   echo "$as_me:3318: result: no" >&5
3319 echo "${ECHO_T}no" >&6
3320 fi
3321
3322 if test "$cf_cv_mixedcase" = yes ; then
3323         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3324 set dummy ${ETAGS:-etags}; ac_word=$2
3325 echo "$as_me:3325: checking for $ac_word" >&5
3326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3327 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   if test -n "$MAKE_UPPER_TAGS"; then
3331   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3332 else
3333   ac_save_IFS=$IFS; IFS=$ac_path_separator
3334 ac_dummy="$PATH"
3335 for ac_dir in $ac_dummy; do
3336   IFS=$ac_save_IFS
3337   test -z "$ac_dir" && ac_dir=.
3338   $as_executable_p "$ac_dir/$ac_word" || continue
3339 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3340 echo "$as_me:3340: found $ac_dir/$ac_word" >&5
3341 break
3342 done
3343
3344   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3345 fi
3346 fi
3347 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3348 if test -n "$MAKE_UPPER_TAGS"; then
3349   echo "$as_me:3349: result: $MAKE_UPPER_TAGS" >&5
3350 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3351 else
3352   echo "$as_me:3352: result: no" >&5
3353 echo "${ECHO_T}no" >&6
3354 fi
3355
3356 else
3357         MAKE_UPPER_TAGS=no
3358 fi
3359
3360 if test "$MAKE_UPPER_TAGS" = yes ; then
3361         MAKE_UPPER_TAGS=
3362 else
3363         MAKE_UPPER_TAGS="#"
3364 fi
3365
3366 if test "$MAKE_LOWER_TAGS" = yes ; then
3367         MAKE_LOWER_TAGS=
3368 else
3369         MAKE_LOWER_TAGS="#"
3370 fi
3371
3372 echo "$as_me:3372: checking for makeflags variable" >&5
3373 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3374 if test "${cf_cv_makeflags+set}" = set; then
3375   echo $ECHO_N "(cached) $ECHO_C" >&6
3376 else
3377
3378         cf_cv_makeflags=''
3379         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3380         do
3381                 cat >cf_makeflags.tmp <<CF_EOF
3382 SHELL = $SHELL
3383 all :
3384         @ echo '.$cf_option'
3385 CF_EOF
3386                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3387                 case "$cf_result" in
3388                 (.*k|.*kw)
3389                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3390                         case "$cf_result" in
3391                         (.*CC=*)        cf_cv_makeflags=
3392                                 ;;
3393                         (*)     cf_cv_makeflags=$cf_option
3394                                 ;;
3395                         esac
3396                         break
3397                         ;;
3398                 (.-)
3399                         ;;
3400                 (*)
3401
3402 echo "${as_me:-configure}:3402: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3403
3404                         ;;
3405                 esac
3406         done
3407         rm -f cf_makeflags.tmp
3408
3409 fi
3410 echo "$as_me:3410: result: $cf_cv_makeflags" >&5
3411 echo "${ECHO_T}$cf_cv_makeflags" >&6
3412
3413 if test -n "$ac_tool_prefix"; then
3414   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3415 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3416 echo "$as_me:3416: checking for $ac_word" >&5
3417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3418 if test "${ac_cv_prog_RANLIB+set}" = set; then
3419   echo $ECHO_N "(cached) $ECHO_C" >&6
3420 else
3421   if test -n "$RANLIB"; then
3422   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3423 else
3424   ac_save_IFS=$IFS; IFS=$ac_path_separator
3425 ac_dummy="$PATH"
3426 for ac_dir in $ac_dummy; do
3427   IFS=$ac_save_IFS
3428   test -z "$ac_dir" && ac_dir=.
3429   $as_executable_p "$ac_dir/$ac_word" || continue
3430 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3431 echo "$as_me:3431: found $ac_dir/$ac_word" >&5
3432 break
3433 done
3434
3435 fi
3436 fi
3437 RANLIB=$ac_cv_prog_RANLIB
3438 if test -n "$RANLIB"; then
3439   echo "$as_me:3439: result: $RANLIB" >&5
3440 echo "${ECHO_T}$RANLIB" >&6
3441 else
3442   echo "$as_me:3442: result: no" >&5
3443 echo "${ECHO_T}no" >&6
3444 fi
3445
3446 fi
3447 if test -z "$ac_cv_prog_RANLIB"; then
3448   ac_ct_RANLIB=$RANLIB
3449   # Extract the first word of "ranlib", so it can be a program name with args.
3450 set dummy ranlib; ac_word=$2
3451 echo "$as_me:3451: checking for $ac_word" >&5
3452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3453 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3454   echo $ECHO_N "(cached) $ECHO_C" >&6
3455 else
3456   if test -n "$ac_ct_RANLIB"; then
3457   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3458 else
3459   ac_save_IFS=$IFS; IFS=$ac_path_separator
3460 ac_dummy="$PATH"
3461 for ac_dir in $ac_dummy; do
3462   IFS=$ac_save_IFS
3463   test -z "$ac_dir" && ac_dir=.
3464   $as_executable_p "$ac_dir/$ac_word" || continue
3465 ac_cv_prog_ac_ct_RANLIB="ranlib"
3466 echo "$as_me:3466: found $ac_dir/$ac_word" >&5
3467 break
3468 done
3469
3470   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3471 fi
3472 fi
3473 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3474 if test -n "$ac_ct_RANLIB"; then
3475   echo "$as_me:3475: result: $ac_ct_RANLIB" >&5
3476 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3477 else
3478   echo "$as_me:3478: result: no" >&5
3479 echo "${ECHO_T}no" >&6
3480 fi
3481
3482   RANLIB=$ac_ct_RANLIB
3483 else
3484   RANLIB="$ac_cv_prog_RANLIB"
3485 fi
3486
3487 if test -n "$ac_tool_prefix"; then
3488   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3489 set dummy ${ac_tool_prefix}ld; ac_word=$2
3490 echo "$as_me:3490: checking for $ac_word" >&5
3491 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3492 if test "${ac_cv_prog_LD+set}" = set; then
3493   echo $ECHO_N "(cached) $ECHO_C" >&6
3494 else
3495   if test -n "$LD"; then
3496   ac_cv_prog_LD="$LD" # Let the user override the test.
3497 else
3498   ac_save_IFS=$IFS; IFS=$ac_path_separator
3499 ac_dummy="$PATH"
3500 for ac_dir in $ac_dummy; do
3501   IFS=$ac_save_IFS
3502   test -z "$ac_dir" && ac_dir=.
3503   $as_executable_p "$ac_dir/$ac_word" || continue
3504 ac_cv_prog_LD="${ac_tool_prefix}ld"
3505 echo "$as_me:3505: found $ac_dir/$ac_word" >&5
3506 break
3507 done
3508
3509 fi
3510 fi
3511 LD=$ac_cv_prog_LD
3512 if test -n "$LD"; then
3513   echo "$as_me:3513: result: $LD" >&5
3514 echo "${ECHO_T}$LD" >&6
3515 else
3516   echo "$as_me:3516: result: no" >&5
3517 echo "${ECHO_T}no" >&6
3518 fi
3519
3520 fi
3521 if test -z "$ac_cv_prog_LD"; then
3522   ac_ct_LD=$LD
3523   # Extract the first word of "ld", so it can be a program name with args.
3524 set dummy ld; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$ac_ct_LD"; then
3531   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_ac_ct_LD="ld"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3545 fi
3546 fi
3547 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3548 if test -n "$ac_ct_LD"; then
3549   echo "$as_me:3549: result: $ac_ct_LD" >&5
3550 echo "${ECHO_T}$ac_ct_LD" >&6
3551 else
3552   echo "$as_me:3552: result: no" >&5
3553 echo "${ECHO_T}no" >&6
3554 fi
3555
3556   LD=$ac_ct_LD
3557 else
3558   LD="$ac_cv_prog_LD"
3559 fi
3560
3561 if test -n "$ac_tool_prefix"; then
3562   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3563 set dummy ${ac_tool_prefix}ar; ac_word=$2
3564 echo "$as_me:3564: checking for $ac_word" >&5
3565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3566 if test "${ac_cv_prog_AR+set}" = set; then
3567   echo $ECHO_N "(cached) $ECHO_C" >&6
3568 else
3569   if test -n "$AR"; then
3570   ac_cv_prog_AR="$AR" # Let the user override the test.
3571 else
3572   ac_save_IFS=$IFS; IFS=$ac_path_separator
3573 ac_dummy="$PATH"
3574 for ac_dir in $ac_dummy; do
3575   IFS=$ac_save_IFS
3576   test -z "$ac_dir" && ac_dir=.
3577   $as_executable_p "$ac_dir/$ac_word" || continue
3578 ac_cv_prog_AR="${ac_tool_prefix}ar"
3579 echo "$as_me:3579: found $ac_dir/$ac_word" >&5
3580 break
3581 done
3582
3583 fi
3584 fi
3585 AR=$ac_cv_prog_AR
3586 if test -n "$AR"; then
3587   echo "$as_me:3587: result: $AR" >&5
3588 echo "${ECHO_T}$AR" >&6
3589 else
3590   echo "$as_me:3590: result: no" >&5
3591 echo "${ECHO_T}no" >&6
3592 fi
3593
3594 fi
3595 if test -z "$ac_cv_prog_AR"; then
3596   ac_ct_AR=$AR
3597   # Extract the first word of "ar", so it can be a program name with args.
3598 set dummy ar; ac_word=$2
3599 echo "$as_me:3599: checking for $ac_word" >&5
3600 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3601 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3602   echo $ECHO_N "(cached) $ECHO_C" >&6
3603 else
3604   if test -n "$ac_ct_AR"; then
3605   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3606 else
3607   ac_save_IFS=$IFS; IFS=$ac_path_separator
3608 ac_dummy="$PATH"
3609 for ac_dir in $ac_dummy; do
3610   IFS=$ac_save_IFS
3611   test -z "$ac_dir" && ac_dir=.
3612   $as_executable_p "$ac_dir/$ac_word" || continue
3613 ac_cv_prog_ac_ct_AR="ar"
3614 echo "$as_me:3614: found $ac_dir/$ac_word" >&5
3615 break
3616 done
3617
3618   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3619 fi
3620 fi
3621 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3622 if test -n "$ac_ct_AR"; then
3623   echo "$as_me:3623: result: $ac_ct_AR" >&5
3624 echo "${ECHO_T}$ac_ct_AR" >&6
3625 else
3626   echo "$as_me:3626: result: no" >&5
3627 echo "${ECHO_T}no" >&6
3628 fi
3629
3630   AR=$ac_ct_AR
3631 else
3632   AR="$ac_cv_prog_AR"
3633 fi
3634
3635 if test -n "$ac_tool_prefix"; then
3636   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3637 set dummy ${ac_tool_prefix}ar; ac_word=$2
3638 echo "$as_me:3638: checking for $ac_word" >&5
3639 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3640 if test "${ac_cv_prog_AR+set}" = set; then
3641   echo $ECHO_N "(cached) $ECHO_C" >&6
3642 else
3643   if test -n "$AR"; then
3644   ac_cv_prog_AR="$AR" # Let the user override the test.
3645 else
3646   ac_save_IFS=$IFS; IFS=$ac_path_separator
3647 ac_dummy="$PATH"
3648 for ac_dir in $ac_dummy; do
3649   IFS=$ac_save_IFS
3650   test -z "$ac_dir" && ac_dir=.
3651   $as_executable_p "$ac_dir/$ac_word" || continue
3652 ac_cv_prog_AR="${ac_tool_prefix}ar"
3653 echo "$as_me:3653: found $ac_dir/$ac_word" >&5
3654 break
3655 done
3656
3657 fi
3658 fi
3659 AR=$ac_cv_prog_AR
3660 if test -n "$AR"; then
3661   echo "$as_me:3661: result: $AR" >&5
3662 echo "${ECHO_T}$AR" >&6
3663 else
3664   echo "$as_me:3664: result: no" >&5
3665 echo "${ECHO_T}no" >&6
3666 fi
3667
3668 fi
3669 if test -z "$ac_cv_prog_AR"; then
3670   ac_ct_AR=$AR
3671   # Extract the first word of "ar", so it can be a program name with args.
3672 set dummy ar; ac_word=$2
3673 echo "$as_me:3673: checking for $ac_word" >&5
3674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3675 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3676   echo $ECHO_N "(cached) $ECHO_C" >&6
3677 else
3678   if test -n "$ac_ct_AR"; then
3679   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3680 else
3681   ac_save_IFS=$IFS; IFS=$ac_path_separator
3682 ac_dummy="$PATH"
3683 for ac_dir in $ac_dummy; do
3684   IFS=$ac_save_IFS
3685   test -z "$ac_dir" && ac_dir=.
3686   $as_executable_p "$ac_dir/$ac_word" || continue
3687 ac_cv_prog_ac_ct_AR="ar"
3688 echo "$as_me:3688: found $ac_dir/$ac_word" >&5
3689 break
3690 done
3691
3692   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3693 fi
3694 fi
3695 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3696 if test -n "$ac_ct_AR"; then
3697   echo "$as_me:3697: result: $ac_ct_AR" >&5
3698 echo "${ECHO_T}$ac_ct_AR" >&6
3699 else
3700   echo "$as_me:3700: result: no" >&5
3701 echo "${ECHO_T}no" >&6
3702 fi
3703
3704   AR=$ac_ct_AR
3705 else
3706   AR="$ac_cv_prog_AR"
3707 fi
3708
3709 echo "$as_me:3709: checking for options to update archives" >&5
3710 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3711 if test "${cf_cv_ar_flags+set}" = set; then
3712   echo $ECHO_N "(cached) $ECHO_C" >&6
3713 else
3714
3715         case $cf_cv_system_name in
3716         (*-msvc*)
3717                 cf_cv_ar_flags=''
3718                 cat >mk_static_lib.sh <<-EOF
3719                 #!$SHELL
3720                 MSVC_BIN="$AR"
3721                 out="\$1"
3722                 shift
3723                 exec \$MSVC_BIN -out:"\$out" \$@
3724                 EOF
3725                 chmod +x mk_static_lib.sh
3726                 AR=`pwd`/mk_static_lib.sh
3727                 ;;
3728         (*)
3729                 cf_cv_ar_flags=unknown
3730                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3731                 do
3732
3733                         # check if $ARFLAGS already contains this choice
3734                         if test "x$ARFLAGS" != "x" ; then
3735                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3736                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3737                                         cf_cv_ar_flags=
3738                                         break
3739                                 fi
3740                         fi
3741
3742                         rm -f conftest.$ac_cv_objext
3743                         rm -f conftest.a
3744
3745                         cat >conftest.$ac_ext <<EOF
3746 #line 3746 "configure"
3747 int     testdata[3] = { 123, 456, 789 };
3748 EOF
3749                         if { (eval echo "$as_me:3749: \"$ac_compile\"") >&5
3750   (eval $ac_compile) 2>&5
3751   ac_status=$?
3752   echo "$as_me:3752: \$? = $ac_status" >&5
3753   (exit $ac_status); } ; then
3754                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3755                                 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3756                                 if test -f conftest.a ; then
3757                                         cf_cv_ar_flags=$cf_ar_flags
3758                                         break
3759                                 fi
3760                         else
3761                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3762
3763 echo "${as_me:-configure}:3763: testing cannot compile test-program ..." 1>&5
3764
3765                                 break
3766                         fi
3767                 done
3768                 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3769                 ;;
3770         esac
3771
3772 fi
3773 echo "$as_me:3773: result: $cf_cv_ar_flags" >&5
3774 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3775
3776 if test -n "$ARFLAGS" ; then
3777         if test -n "$cf_cv_ar_flags" ; then
3778                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3779         fi
3780 else
3781         ARFLAGS=$cf_cv_ar_flags
3782 fi
3783
3784         echo "$as_me:3784: checking for PATH separator" >&5
3785 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3786         case $cf_cv_system_name in
3787         (os2*)  PATH_SEPARATOR=';'  ;;
3788         (*)     ${PATH_SEPARATOR:=':'}  ;;
3789         esac
3790
3791         echo "$as_me:3791: result: $PATH_SEPARATOR" >&5
3792 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3793
3794 echo "$as_me:3794: checking if you have specified an install-prefix" >&5
3795 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3796
3797 # Check whether --with-install-prefix or --without-install-prefix was given.
3798 if test "${with_install_prefix+set}" = set; then
3799   withval="$with_install_prefix"
3800   case "$withval" in
3801         (yes|no)
3802                 ;;
3803         (*)     DESTDIR="$withval"
3804                 ;;
3805         esac
3806 fi;
3807 echo "$as_me:3807: result: $DESTDIR" >&5
3808 echo "${ECHO_T}$DESTDIR" >&6
3809
3810 ###############################################################################
3811
3812 # If we're cross-compiling, allow the user to override the tools and their
3813 # options.  The configure script is oriented toward identifying the host
3814 # compiler, etc., but we need a build compiler to generate parts of the source.
3815
3816 if test "$cross_compiling" = yes ; then
3817
3818         # defaults that we might want to override
3819         : ${BUILD_CFLAGS:=''}
3820         : ${BUILD_CPPFLAGS:=''}
3821         : ${BUILD_LDFLAGS:=''}
3822         : ${BUILD_LIBS:=''}
3823         : ${BUILD_EXEEXT:='$x'}
3824         : ${BUILD_OBJEXT:='o'}
3825
3826 # Check whether --with-build-cc or --without-build-cc was given.
3827 if test "${with_build_cc+set}" = set; then
3828   withval="$with_build_cc"
3829   BUILD_CC="$withval"
3830 else
3831   for ac_prog in gcc clang c99 c89 cc cl
3832 do
3833   # Extract the first word of "$ac_prog", so it can be a program name with args.
3834 set dummy $ac_prog; ac_word=$2
3835 echo "$as_me:3835: checking for $ac_word" >&5
3836 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3837 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3838   echo $ECHO_N "(cached) $ECHO_C" >&6
3839 else
3840   if test -n "$BUILD_CC"; then
3841   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3842 else
3843   ac_save_IFS=$IFS; IFS=$ac_path_separator
3844 ac_dummy="$PATH"
3845 for ac_dir in $ac_dummy; do
3846   IFS=$ac_save_IFS
3847   test -z "$ac_dir" && ac_dir=.
3848   $as_executable_p "$ac_dir/$ac_word" || continue
3849 ac_cv_prog_BUILD_CC="$ac_prog"
3850 echo "$as_me:3850: found $ac_dir/$ac_word" >&5
3851 break
3852 done
3853
3854 fi
3855 fi
3856 BUILD_CC=$ac_cv_prog_BUILD_CC
3857 if test -n "$BUILD_CC"; then
3858   echo "$as_me:3858: result: $BUILD_CC" >&5
3859 echo "${ECHO_T}$BUILD_CC" >&6
3860 else
3861   echo "$as_me:3861: result: no" >&5
3862 echo "${ECHO_T}no" >&6
3863 fi
3864
3865   test -n "$BUILD_CC" && break
3866 done
3867 test -n "$BUILD_CC" || BUILD_CC="none"
3868
3869 fi;
3870         echo "$as_me:3870: checking for native build C compiler" >&5
3871 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3872         echo "$as_me:3872: result: $BUILD_CC" >&5
3873 echo "${ECHO_T}$BUILD_CC" >&6
3874
3875         echo "$as_me:3875: checking for native build C preprocessor" >&5
3876 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3877
3878 # Check whether --with-build-cpp or --without-build-cpp was given.
3879 if test "${with_build_cpp+set}" = set; then
3880   withval="$with_build_cpp"
3881   BUILD_CPP="$withval"
3882 else
3883   BUILD_CPP='${BUILD_CC} -E'
3884 fi;
3885         echo "$as_me:3885: result: $BUILD_CPP" >&5
3886 echo "${ECHO_T}$BUILD_CPP" >&6
3887
3888         echo "$as_me:3888: checking for native build C flags" >&5
3889 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3890
3891 # Check whether --with-build-cflags or --without-build-cflags was given.
3892 if test "${with_build_cflags+set}" = set; then
3893   withval="$with_build_cflags"
3894   BUILD_CFLAGS="$withval"
3895 fi;
3896         echo "$as_me:3896: result: $BUILD_CFLAGS" >&5
3897 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3898
3899         echo "$as_me:3899: checking for native build C preprocessor-flags" >&5
3900 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3901
3902 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3903 if test "${with_build_cppflags+set}" = set; then
3904   withval="$with_build_cppflags"
3905   BUILD_CPPFLAGS="$withval"
3906 fi;
3907         echo "$as_me:3907: result: $BUILD_CPPFLAGS" >&5
3908 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3909
3910         echo "$as_me:3910: checking for native build linker-flags" >&5
3911 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3912
3913 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3914 if test "${with_build_ldflags+set}" = set; then
3915   withval="$with_build_ldflags"
3916   BUILD_LDFLAGS="$withval"
3917 fi;
3918         echo "$as_me:3918: result: $BUILD_LDFLAGS" >&5
3919 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3920
3921         echo "$as_me:3921: checking for native build linker-libraries" >&5
3922 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3923
3924 # Check whether --with-build-libs or --without-build-libs was given.
3925 if test "${with_build_libs+set}" = set; then
3926   withval="$with_build_libs"
3927   BUILD_LIBS="$withval"
3928 fi;
3929         echo "$as_me:3929: result: $BUILD_LIBS" >&5
3930 echo "${ECHO_T}$BUILD_LIBS" >&6
3931
3932         # this assumes we're on Unix.
3933         BUILD_EXEEXT=
3934         BUILD_OBJEXT=o
3935
3936         : ${BUILD_CC:='${CC}'}
3937
3938         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3939                 { { echo "$as_me:3939: error: Cross-build requires two compilers.
3940 Use --with-build-cc to specify the native compiler." >&5
3941 echo "$as_me: error: Cross-build requires two compilers.
3942 Use --with-build-cc to specify the native compiler." >&2;}
3943    { (exit 1); exit 1; }; }
3944         fi
3945
3946 else
3947         : ${BUILD_CC:='${CC}'}
3948         : ${BUILD_CPP:='${CPP}'}
3949         : ${BUILD_CFLAGS:='${CFLAGS}'}
3950         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3951         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3952         : ${BUILD_LIBS:='${LIBS}'}
3953         : ${BUILD_EXEEXT:='$x'}
3954         : ${BUILD_OBJEXT:='o'}
3955 fi
3956
3957 ###############################################################################
3958
3959 ### Options to allow the user to specify the set of libraries which are used.
3960 ### Use "--without-normal --with-shared" to allow the default model to be
3961 ### shared, for example.
3962 cf_list_models=""
3963
3964 echo "$as_me:3964: checking if you want to build shared C-objects" >&5
3965 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3966
3967 # Check whether --with-shared or --without-shared was given.
3968 if test "${with_shared+set}" = set; then
3969   withval="$with_shared"
3970   with_shared=$withval
3971 else
3972   with_shared=no
3973 fi;
3974 echo "$as_me:3974: result: $with_shared" >&5
3975 echo "${ECHO_T}$with_shared" >&6
3976 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3977
3978 echo "$as_me:3978: checking for specified models" >&5
3979 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3980 test -z "$cf_list_models" && cf_list_models=normal
3981 echo "$as_me:3981: result: $cf_list_models" >&5
3982 echo "${ECHO_T}$cf_list_models" >&6
3983
3984 ### Use the first model as the default, and save its suffix for use in building
3985 ### up test-applications.
3986 echo "$as_me:3986: checking for default model" >&5
3987 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3988 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3989 echo "$as_me:3989: result: $DFT_LWR_MODEL" >&5
3990 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3991
3992 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3993
3994 echo "$as_me:3994: checking for specific curses-directory" >&5
3995 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3996
3997 # Check whether --with-curses-dir or --without-curses-dir was given.
3998 if test "${with_curses_dir+set}" = set; then
3999   withval="$with_curses_dir"
4000   cf_cv_curses_dir=$withval
4001 else
4002   cf_cv_curses_dir=no
4003 fi;
4004 echo "$as_me:4004: result: $cf_cv_curses_dir" >&5
4005 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4006
4007 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4008 then
4009
4010 if test "x$prefix" != xNONE; then
4011         cf_path_syntax="$prefix"
4012 else
4013         cf_path_syntax="$ac_default_prefix"
4014 fi
4015
4016 case ".$withval" in
4017 (.\$\(*\)*|.\'*\'*)
4018         ;;
4019 (..|./*|.\\*)
4020         ;;
4021 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4022         ;;
4023 (.\${*prefix}*|.\${*dir}*)
4024         eval withval="$withval"
4025         case ".$withval" in
4026         (.NONE/*)
4027                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4028                 ;;
4029         esac
4030         ;;
4031 (.no|.NONE/*)
4032         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4033         ;;
4034 (*)
4035         { { echo "$as_me:4035: error: expected a pathname, not \"$withval\"" >&5
4036 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4037    { (exit 1); exit 1; }; }
4038         ;;
4039 esac
4040
4041         if test -d "$cf_cv_curses_dir"
4042         then
4043
4044 if test -n "$cf_cv_curses_dir/include" ; then
4045   for cf_add_incdir in $cf_cv_curses_dir/include
4046   do
4047         while test $cf_add_incdir != /usr/include
4048         do
4049           if test -d $cf_add_incdir
4050           then
4051                 cf_have_incdir=no
4052                 if test -n "$CFLAGS$CPPFLAGS" ; then
4053                   # a loop is needed to ensure we can add subdirs of existing dirs
4054                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4055                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4056                           cf_have_incdir=yes; break
4057                         fi
4058                   done
4059                 fi
4060
4061                 if test "$cf_have_incdir" = no ; then
4062                   if test "$cf_add_incdir" = /usr/local/include ; then
4063                         if test "$GCC" = yes
4064                         then
4065                           cf_save_CPPFLAGS=$CPPFLAGS
4066
4067         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4068         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4069
4070                           cat >conftest.$ac_ext <<_ACEOF
4071 #line 4071 "configure"
4072 #include "confdefs.h"
4073 #include <stdio.h>
4074 int
4075 main (void)
4076 {
4077 printf("Hello")
4078   ;
4079   return 0;
4080 }
4081 _ACEOF
4082 rm -f conftest.$ac_objext
4083 if { (eval echo "$as_me:4083: \"$ac_compile\"") >&5
4084   (eval $ac_compile) 2>&5
4085   ac_status=$?
4086   echo "$as_me:4086: \$? = $ac_status" >&5
4087   (exit $ac_status); } &&
4088          { ac_try='test -s conftest.$ac_objext'
4089   { (eval echo "$as_me:4089: \"$ac_try\"") >&5
4090   (eval $ac_try) 2>&5
4091   ac_status=$?
4092   echo "$as_me:4092: \$? = $ac_status" >&5
4093   (exit $ac_status); }; }; then
4094   :
4095 else
4096   echo "$as_me: failed program was:" >&5
4097 cat conftest.$ac_ext >&5
4098 cf_have_incdir=yes
4099 fi
4100 rm -f conftest.$ac_objext conftest.$ac_ext
4101                           CPPFLAGS=$cf_save_CPPFLAGS
4102                         fi
4103                   fi
4104                 fi
4105
4106                 if test "$cf_have_incdir" = no ; then
4107                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4108
4109 echo "${as_me:-configure}:4109: testing adding $cf_add_incdir to include-path ..." 1>&5
4110
4111                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4112
4113                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4114                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4115                   cf_add_incdir="$cf_top_incdir"
4116                 else
4117                   break
4118                 fi
4119           else
4120                 break
4121           fi
4122         done
4123   done
4124 fi
4125
4126 if test -n "$cf_cv_curses_dir/lib" ; then
4127         for cf_add_libdir in $cf_cv_curses_dir/lib
4128         do
4129                 if test $cf_add_libdir = /usr/lib ; then
4130                         :
4131                 elif test -d $cf_add_libdir
4132                 then
4133                         cf_have_libdir=no
4134                         if test -n "$LDFLAGS$LIBS" ; then
4135                                 # a loop is needed to ensure we can add subdirs of existing dirs
4136                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4137                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4138                                                 cf_have_libdir=yes; break
4139                                         fi
4140                                 done
4141                         fi
4142                         if test "$cf_have_libdir" = no ; then
4143                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4144
4145 echo "${as_me:-configure}:4145: testing adding $cf_add_libdir to library-path ..." 1>&5
4146
4147                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4148                         fi
4149                 fi
4150         done
4151 fi
4152
4153         fi
4154 fi
4155
4156 cf_ncuconfig_root=ncurses
4157 cf_have_ncuconfig=no
4158
4159 if test "x${PKG_CONFIG:=none}" != xnone; then
4160         echo "$as_me:4160: checking pkg-config for $cf_ncuconfig_root" >&5
4161 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4162         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4163                 echo "$as_me:4163: result: yes" >&5
4164 echo "${ECHO_T}yes" >&6
4165
4166                 echo "$as_me:4166: checking if the $cf_ncuconfig_root package files work" >&5
4167 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4168                 cf_have_ncuconfig=unknown
4169
4170                 cf_save_CFLAGS="$CFLAGS"
4171                 cf_save_CPPFLAGS="$CPPFLAGS"
4172                 cf_save_LIBS="$LIBS"
4173
4174                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4175                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4176
4177                 # while -W for passing linker flags is prevalent, it is not "standard".
4178                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4179                 # incompatible _and_ non-standard -W option which gives an error.  Work
4180                 # around that pitfall.
4181                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4182                 (x*c[89]9@@*-W*)
4183
4184 cf_fix_cppflags=no
4185 cf_new_cflags=
4186 cf_new_cppflags=
4187 cf_new_extra_cppflags=
4188
4189 for cf_add_cflags in $cf_pkg_cflags
4190 do
4191 case $cf_fix_cppflags in
4192 (no)
4193         case $cf_add_cflags in
4194         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4195                 case $cf_add_cflags in
4196                 (-D*)
4197                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4198
4199                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4200                                 && test -z "${cf_tst_cflags}" \
4201                                 && cf_fix_cppflags=yes
4202
4203                         if test $cf_fix_cppflags = yes ; then
4204
4205         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4206         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4207
4208                                 continue
4209                         elif test "${cf_tst_cflags}" = "\"'" ; then
4210
4211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4213
4214                                 continue
4215                         fi
4216                         ;;
4217                 esac
4218                 case "$CPPFLAGS" in
4219                 (*$cf_add_cflags)
4220                         ;;
4221                 (*)
4222                         case $cf_add_cflags in
4223                         (-D*)
4224                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4225
4226 CPPFLAGS=`echo "$CPPFLAGS" | \
4227         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4228                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4229
4230                                 ;;
4231                         esac
4232
4233         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4234         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4235
4236                         ;;
4237                 esac
4238                 ;;
4239         (*)
4240
4241         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4242         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4243
4244                 ;;
4245         esac
4246         ;;
4247 (yes)
4248
4249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4251
4252         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4253
4254         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4255                 && test -z "${cf_tst_cflags}" \
4256                 && cf_fix_cppflags=no
4257         ;;
4258 esac
4259 done
4260
4261 if test -n "$cf_new_cflags" ; then
4262
4263         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4264         CFLAGS="${CFLAGS}$cf_new_cflags"
4265
4266 fi
4267
4268 if test -n "$cf_new_cppflags" ; then
4269
4270         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4271         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4272
4273 fi
4274
4275 if test -n "$cf_new_extra_cppflags" ; then
4276
4277         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4278         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4279
4280 fi
4281
4282 cf_add_libs="$LIBS"
4283 # reverse order
4284 cf_add_0lib=
4285 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4286 # filter duplicates
4287 for cf_add_1lib in $cf_add_0lib; do
4288         for cf_add_2lib in $cf_add_libs; do
4289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4290                         cf_add_1lib=
4291                         break
4292                 fi
4293         done
4294         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4295 done
4296 LIBS="$cf_add_libs"
4297
4298                         cat >conftest.$ac_ext <<_ACEOF
4299 #line 4299 "configure"
4300 #include "confdefs.h"
4301 #include <${cf_cv_ncurses_header:-curses.h}>
4302 int
4303 main (void)
4304 {
4305 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4306   ;
4307   return 0;
4308 }
4309 _ACEOF
4310 rm -f conftest.$ac_objext conftest$ac_exeext
4311 if { (eval echo "$as_me:4311: \"$ac_link\"") >&5
4312   (eval $ac_link) 2>&5
4313   ac_status=$?
4314   echo "$as_me:4314: \$? = $ac_status" >&5
4315   (exit $ac_status); } &&
4316          { ac_try='test -s conftest$ac_exeext'
4317   { (eval echo "$as_me:4317: \"$ac_try\"") >&5
4318   (eval $ac_try) 2>&5
4319   ac_status=$?
4320   echo "$as_me:4320: \$? = $ac_status" >&5
4321   (exit $ac_status); }; }; then
4322   if test "$cross_compiling" = yes; then
4323   cf_test_ncuconfig=maybe
4324 else
4325   cat >conftest.$ac_ext <<_ACEOF
4326 #line 4326 "configure"
4327 #include "confdefs.h"
4328 #include <${cf_cv_ncurses_header:-curses.h}>
4329                                         int main(void)
4330                                         { char *xx = curses_version(); return (xx == 0); }
4331 _ACEOF
4332 rm -f conftest$ac_exeext
4333 if { (eval echo "$as_me:4333: \"$ac_link\"") >&5
4334   (eval $ac_link) 2>&5
4335   ac_status=$?
4336   echo "$as_me:4336: \$? = $ac_status" >&5
4337   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4338   { (eval echo "$as_me:4338: \"$ac_try\"") >&5
4339   (eval $ac_try) 2>&5
4340   ac_status=$?
4341   echo "$as_me:4341: \$? = $ac_status" >&5
4342   (exit $ac_status); }; }; then
4343   cf_test_ncuconfig=yes
4344 else
4345   echo "$as_me: program exited with status $ac_status" >&5
4346 echo "$as_me: failed program was:" >&5
4347 cat conftest.$ac_ext >&5
4348 cf_test_ncuconfig=no
4349 fi
4350 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4351 fi
4352 else
4353   echo "$as_me: failed program was:" >&5
4354 cat conftest.$ac_ext >&5
4355 cf_test_ncuconfig=no
4356 fi
4357 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4358
4359                         CFLAGS="$cf_save_CFLAGS"
4360                         CPPFLAGS="$cf_save_CPPFLAGS"
4361                         LIBS="$cf_save_LIBS"
4362
4363                         if test "x$cf_test_ncuconfig" != xyes; then
4364                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4365                                 cf_pkg_cflags="$cf_temp"
4366                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4367                                 cf_pkg_libs="$cf_temp"
4368                         fi
4369                         ;;
4370                 esac
4371
4372 cf_fix_cppflags=no
4373 cf_new_cflags=
4374 cf_new_cppflags=
4375 cf_new_extra_cppflags=
4376
4377 for cf_add_cflags in $cf_pkg_cflags
4378 do
4379 case $cf_fix_cppflags in
4380 (no)
4381         case $cf_add_cflags in
4382         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4383                 case $cf_add_cflags in
4384                 (-D*)
4385                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4386
4387                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4388                                 && test -z "${cf_tst_cflags}" \
4389                                 && cf_fix_cppflags=yes
4390
4391                         if test $cf_fix_cppflags = yes ; then
4392
4393         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4394         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4395
4396                                 continue
4397                         elif test "${cf_tst_cflags}" = "\"'" ; then
4398
4399         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4400         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4401
4402                                 continue
4403                         fi
4404                         ;;
4405                 esac
4406                 case "$CPPFLAGS" in
4407                 (*$cf_add_cflags)
4408                         ;;
4409                 (*)
4410                         case $cf_add_cflags in
4411                         (-D*)
4412                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4413
4414 CPPFLAGS=`echo "$CPPFLAGS" | \
4415         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4416                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4417
4418                                 ;;
4419                         esac
4420
4421         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4422         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4423
4424                         ;;
4425                 esac
4426                 ;;
4427         (*)
4428
4429         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4430         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4431
4432                 ;;
4433         esac
4434         ;;
4435 (yes)
4436
4437         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4438         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4439
4440         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4441
4442         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4443                 && test -z "${cf_tst_cflags}" \
4444                 && cf_fix_cppflags=no
4445         ;;
4446 esac
4447 done
4448
4449 if test -n "$cf_new_cflags" ; then
4450
4451         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4452         CFLAGS="${CFLAGS}$cf_new_cflags"
4453
4454 fi
4455
4456 if test -n "$cf_new_cppflags" ; then
4457
4458         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4459         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4460
4461 fi
4462
4463 if test -n "$cf_new_extra_cppflags" ; then
4464
4465         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4466         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4467
4468 fi
4469
4470 cf_add_libs="$LIBS"
4471 # reverse order
4472 cf_add_0lib=
4473 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4474 # filter duplicates
4475 for cf_add_1lib in $cf_add_0lib; do
4476         for cf_add_2lib in $cf_add_libs; do
4477                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4478                         cf_add_1lib=
4479                         break
4480                 fi
4481         done
4482         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4483 done
4484 LIBS="$cf_add_libs"
4485
4486                 cat >conftest.$ac_ext <<_ACEOF
4487 #line 4487 "configure"
4488 #include "confdefs.h"
4489 #include <${cf_cv_ncurses_header:-curses.h}>
4490 int
4491 main (void)
4492 {
4493 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4494   ;
4495   return 0;
4496 }
4497 _ACEOF
4498 rm -f conftest.$ac_objext conftest$ac_exeext
4499 if { (eval echo "$as_me:4499: \"$ac_link\"") >&5
4500   (eval $ac_link) 2>&5
4501   ac_status=$?
4502   echo "$as_me:4502: \$? = $ac_status" >&5
4503   (exit $ac_status); } &&
4504          { ac_try='test -s conftest$ac_exeext'
4505   { (eval echo "$as_me:4505: \"$ac_try\"") >&5
4506   (eval $ac_try) 2>&5
4507   ac_status=$?
4508   echo "$as_me:4508: \$? = $ac_status" >&5
4509   (exit $ac_status); }; }; then
4510   if test "$cross_compiling" = yes; then
4511   cf_have_ncuconfig=maybe
4512 else
4513   cat >conftest.$ac_ext <<_ACEOF
4514 #line 4514 "configure"
4515 #include "confdefs.h"
4516 #include <${cf_cv_ncurses_header:-curses.h}>
4517                                 int main(void)
4518                                 { char *xx = curses_version(); return (xx == 0); }
4519 _ACEOF
4520 rm -f conftest$ac_exeext
4521 if { (eval echo "$as_me:4521: \"$ac_link\"") >&5
4522   (eval $ac_link) 2>&5
4523   ac_status=$?
4524   echo "$as_me:4524: \$? = $ac_status" >&5
4525   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4526   { (eval echo "$as_me:4526: \"$ac_try\"") >&5
4527   (eval $ac_try) 2>&5
4528   ac_status=$?
4529   echo "$as_me:4529: \$? = $ac_status" >&5
4530   (exit $ac_status); }; }; then
4531   cf_have_ncuconfig=yes
4532 else
4533   echo "$as_me: program exited with status $ac_status" >&5
4534 echo "$as_me: failed program was:" >&5
4535 cat conftest.$ac_ext >&5
4536 cf_have_ncuconfig=no
4537 fi
4538 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4539 fi
4540 else
4541   echo "$as_me: failed program was:" >&5
4542 cat conftest.$ac_ext >&5
4543 cf_have_ncuconfig=no
4544 fi
4545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4546                 echo "$as_me:4546: result: $cf_have_ncuconfig" >&5
4547 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4548                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4549                 if test "$cf_have_ncuconfig" != "yes"
4550                 then
4551                         CPPFLAGS="$cf_save_CPPFLAGS"
4552                         LIBS="$cf_save_LIBS"
4553                         NCURSES_CONFIG_PKG=none
4554                 else
4555
4556 cat >>confdefs.h <<\EOF
4557 #define NCURSES 1
4558 EOF
4559
4560                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4561
4562 echo "$as_me:4562: checking for terminfo header" >&5
4563 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4564 if test "${cf_cv_term_header+set}" = set; then
4565   echo $ECHO_N "(cached) $ECHO_C" >&6
4566 else
4567
4568 case ${cf_cv_ncurses_header} in
4569 (*/ncurses.h|*/ncursesw.h)
4570         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4571         ;;
4572 (*)
4573         cf_term_header=term.h
4574         ;;
4575 esac
4576
4577 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4578 do
4579 cat >conftest.$ac_ext <<_ACEOF
4580 #line 4580 "configure"
4581 #include "confdefs.h"
4582 #include <stdio.h>
4583 #include <${cf_cv_ncurses_header:-curses.h}>
4584 #include <$cf_test>
4585
4586 int
4587 main (void)
4588 {
4589 int x = auto_left_margin; (void)x
4590   ;
4591   return 0;
4592 }
4593 _ACEOF
4594 rm -f conftest.$ac_objext
4595 if { (eval echo "$as_me:4595: \"$ac_compile\"") >&5
4596   (eval $ac_compile) 2>&5
4597   ac_status=$?
4598   echo "$as_me:4598: \$? = $ac_status" >&5
4599   (exit $ac_status); } &&
4600          { ac_try='test -s conftest.$ac_objext'
4601   { (eval echo "$as_me:4601: \"$ac_try\"") >&5
4602   (eval $ac_try) 2>&5
4603   ac_status=$?
4604   echo "$as_me:4604: \$? = $ac_status" >&5
4605   (exit $ac_status); }; }; then
4606
4607         cf_cv_term_header="$cf_test"
4608 else
4609   echo "$as_me: failed program was:" >&5
4610 cat conftest.$ac_ext >&5
4611
4612         cf_cv_term_header=unknown
4613
4614 fi
4615 rm -f conftest.$ac_objext conftest.$ac_ext
4616         test "$cf_cv_term_header" != unknown && break
4617 done
4618
4619 fi
4620 echo "$as_me:4620: result: $cf_cv_term_header" >&5
4621 echo "${ECHO_T}$cf_cv_term_header" >&6
4622
4623 # Set definitions to allow ifdef'ing to accommodate subdirectories
4624
4625 case $cf_cv_term_header in
4626 (*term.h)
4627
4628 cat >>confdefs.h <<\EOF
4629 #define HAVE_TERM_H 1
4630 EOF
4631
4632         ;;
4633 esac
4634
4635 case $cf_cv_term_header in
4636 (ncurses/term.h)
4637
4638 cat >>confdefs.h <<\EOF
4639 #define HAVE_NCURSES_TERM_H 1
4640 EOF
4641
4642         ;;
4643 (ncursesw/term.h)
4644
4645 cat >>confdefs.h <<\EOF
4646 #define HAVE_NCURSESW_TERM_H 1
4647 EOF
4648
4649         ;;
4650 esac
4651
4652                 fi
4653
4654         else
4655                 echo "$as_me:4655: result: no" >&5
4656 echo "${ECHO_T}no" >&6
4657                 NCURSES_CONFIG_PKG=none
4658         fi
4659 else
4660         NCURSES_CONFIG_PKG=none
4661 fi
4662
4663 if test "x$cf_have_ncuconfig" = "xno"; then
4664         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4665
4666 if test -n "$ac_tool_prefix"; then
4667   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4668   do
4669     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4670 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4671 echo "$as_me:4671: checking for $ac_word" >&5
4672 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4673 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4674   echo $ECHO_N "(cached) $ECHO_C" >&6
4675 else
4676   if test -n "$NCURSES_CONFIG"; then
4677   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4678 else
4679   ac_save_IFS=$IFS; IFS=$ac_path_separator
4680 ac_dummy="$PATH"
4681 for ac_dir in $ac_dummy; do
4682   IFS=$ac_save_IFS
4683   test -z "$ac_dir" && ac_dir=.
4684   $as_executable_p "$ac_dir/$ac_word" || continue
4685 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4686 echo "$as_me:4686: found $ac_dir/$ac_word" >&5
4687 break
4688 done
4689
4690 fi
4691 fi
4692 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4693 if test -n "$NCURSES_CONFIG"; then
4694   echo "$as_me:4694: result: $NCURSES_CONFIG" >&5
4695 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4696 else
4697   echo "$as_me:4697: result: no" >&5
4698 echo "${ECHO_T}no" >&6
4699 fi
4700
4701     test -n "$NCURSES_CONFIG" && break
4702   done
4703 fi
4704 if test -z "$NCURSES_CONFIG"; then
4705   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4706   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4707 do
4708   # Extract the first word of "$ac_prog", so it can be a program name with args.
4709 set dummy $ac_prog; ac_word=$2
4710 echo "$as_me:4710: checking for $ac_word" >&5
4711 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4712 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4713   echo $ECHO_N "(cached) $ECHO_C" >&6
4714 else
4715   if test -n "$ac_ct_NCURSES_CONFIG"; then
4716   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4717 else
4718   ac_save_IFS=$IFS; IFS=$ac_path_separator
4719 ac_dummy="$PATH"
4720 for ac_dir in $ac_dummy; do
4721   IFS=$ac_save_IFS
4722   test -z "$ac_dir" && ac_dir=.
4723   $as_executable_p "$ac_dir/$ac_word" || continue
4724 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4725 echo "$as_me:4725: found $ac_dir/$ac_word" >&5
4726 break
4727 done
4728
4729 fi
4730 fi
4731 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4732 if test -n "$ac_ct_NCURSES_CONFIG"; then
4733   echo "$as_me:4733: result: $ac_ct_NCURSES_CONFIG" >&5
4734 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4735 else
4736   echo "$as_me:4736: result: no" >&5
4737 echo "${ECHO_T}no" >&6
4738 fi
4739
4740   test -n "$ac_ct_NCURSES_CONFIG" && break
4741 done
4742 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4743
4744   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4745 fi
4746
4747         if test "$NCURSES_CONFIG" != none ; then
4748
4749 cf_fix_cppflags=no
4750 cf_new_cflags=
4751 cf_new_cppflags=
4752 cf_new_extra_cppflags=
4753
4754 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4755 do
4756 case $cf_fix_cppflags in
4757 (no)
4758         case $cf_add_cflags in
4759         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4760                 case $cf_add_cflags in
4761                 (-D*)
4762                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4763
4764                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4765                                 && test -z "${cf_tst_cflags}" \
4766                                 && cf_fix_cppflags=yes
4767
4768                         if test $cf_fix_cppflags = yes ; then
4769
4770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4772
4773                                 continue
4774                         elif test "${cf_tst_cflags}" = "\"'" ; then
4775
4776         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4777         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4778
4779                                 continue
4780                         fi
4781                         ;;
4782                 esac
4783                 case "$CPPFLAGS" in
4784                 (*$cf_add_cflags)
4785                         ;;
4786                 (*)
4787                         case $cf_add_cflags in
4788                         (-D*)
4789                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4790
4791 CPPFLAGS=`echo "$CPPFLAGS" | \
4792         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4793                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4794
4795                                 ;;
4796                         esac
4797
4798         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4799         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4800
4801                         ;;
4802                 esac
4803                 ;;
4804         (*)
4805
4806         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4807         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4808
4809                 ;;
4810         esac
4811         ;;
4812 (yes)
4813
4814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4816
4817         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4818
4819         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4820                 && test -z "${cf_tst_cflags}" \
4821                 && cf_fix_cppflags=no
4822         ;;
4823 esac
4824 done
4825
4826 if test -n "$cf_new_cflags" ; then
4827
4828         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4829         CFLAGS="${CFLAGS}$cf_new_cflags"
4830
4831 fi
4832
4833 if test -n "$cf_new_cppflags" ; then
4834
4835         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4836         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4837
4838 fi
4839
4840 if test -n "$cf_new_extra_cppflags" ; then
4841
4842         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4843         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4844
4845 fi
4846
4847 cf_add_libs="$LIBS"
4848 # reverse order
4849 cf_add_0lib=
4850 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4851 # filter duplicates
4852 for cf_add_1lib in $cf_add_0lib; do
4853         for cf_add_2lib in $cf_add_libs; do
4854                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4855                         cf_add_1lib=
4856                         break
4857                 fi
4858         done
4859         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4860 done
4861 LIBS="$cf_add_libs"
4862
4863                 # even with config script, some packages use no-override for curses.h
4864
4865 echo "$as_me:4865: checking if we have identified curses headers" >&5
4866 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4867 if test "${cf_cv_ncurses_header+set}" = set; then
4868   echo $ECHO_N "(cached) $ECHO_C" >&6
4869 else
4870
4871 cf_cv_ncurses_header=none
4872 for cf_header in \
4873         ncurses.h ncurses/ncurses.h \
4874         curses.h ncurses/curses.h
4875 do
4876 cat >conftest.$ac_ext <<_ACEOF
4877 #line 4877 "configure"
4878 #include "confdefs.h"
4879 #include <${cf_header}>
4880 int
4881 main (void)
4882 {
4883 initscr(); tgoto("?", 0,0)
4884   ;
4885   return 0;
4886 }
4887 _ACEOF
4888 rm -f conftest.$ac_objext
4889 if { (eval echo "$as_me:4889: \"$ac_compile\"") >&5
4890   (eval $ac_compile) 2>&5
4891   ac_status=$?
4892   echo "$as_me:4892: \$? = $ac_status" >&5
4893   (exit $ac_status); } &&
4894          { ac_try='test -s conftest.$ac_objext'
4895   { (eval echo "$as_me:4895: \"$ac_try\"") >&5
4896   (eval $ac_try) 2>&5
4897   ac_status=$?
4898   echo "$as_me:4898: \$? = $ac_status" >&5
4899   (exit $ac_status); }; }; then
4900   cf_cv_ncurses_header=$cf_header; break
4901 else
4902   echo "$as_me: failed program was:" >&5
4903 cat conftest.$ac_ext >&5
4904 fi
4905 rm -f conftest.$ac_objext conftest.$ac_ext
4906 done
4907
4908 fi
4909 echo "$as_me:4909: result: $cf_cv_ncurses_header" >&5
4910 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4911
4912 if test "$cf_cv_ncurses_header" = none ; then
4913         { { echo "$as_me:4913: error: No curses header-files found" >&5
4914 echo "$as_me: error: No curses header-files found" >&2;}
4915    { (exit 1); exit 1; }; }
4916 fi
4917
4918 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4919
4920 for ac_header in $cf_cv_ncurses_header
4921 do
4922 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4923 echo "$as_me:4923: checking for $ac_header" >&5
4924 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4925 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928   cat >conftest.$ac_ext <<_ACEOF
4929 #line 4929 "configure"
4930 #include "confdefs.h"
4931 #include <$ac_header>
4932 _ACEOF
4933 if { (eval echo "$as_me:4933: \"$ac_cpp conftest.$ac_ext\"") >&5
4934   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4935   ac_status=$?
4936   egrep -v '^ *\+' conftest.er1 >conftest.err
4937   rm -f conftest.er1
4938   cat conftest.err >&5
4939   echo "$as_me:4939: \$? = $ac_status" >&5
4940   (exit $ac_status); } >/dev/null; then
4941   if test -s conftest.err; then
4942     ac_cpp_err=$ac_c_preproc_warn_flag
4943   else
4944     ac_cpp_err=
4945   fi
4946 else
4947   ac_cpp_err=yes
4948 fi
4949 if test -z "$ac_cpp_err"; then
4950   eval "$as_ac_Header=yes"
4951 else
4952   echo "$as_me: failed program was:" >&5
4953   cat conftest.$ac_ext >&5
4954   eval "$as_ac_Header=no"
4955 fi
4956 rm -f conftest.err conftest.$ac_ext
4957 fi
4958 echo "$as_me:4958: result: `eval echo '${'$as_ac_Header'}'`" >&5
4959 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4960 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4961   cat >>confdefs.h <<EOF
4962 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4963 EOF
4964
4965 fi
4966 done
4967
4968 cat >>confdefs.h <<\EOF
4969 #define NCURSES 1
4970 EOF
4971
4972 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4973
4974                 cat >>confdefs.h <<EOF
4975 #define $cf_nculib_ROOT 1
4976 EOF
4977
4978                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4979
4980         else
4981
4982 cf_ncuhdr_root=ncurses
4983
4984 test -n "$cf_cv_curses_dir" && \
4985 test "$cf_cv_curses_dir" != "no" && { \
4986
4987 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4988   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4989   do
4990         while test $cf_add_incdir != /usr/include
4991         do
4992           if test -d $cf_add_incdir
4993           then
4994                 cf_have_incdir=no
4995                 if test -n "$CFLAGS$CPPFLAGS" ; then
4996                   # a loop is needed to ensure we can add subdirs of existing dirs
4997                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4998                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4999                           cf_have_incdir=yes; break
5000                         fi
5001                   done
5002                 fi
5003
5004                 if test "$cf_have_incdir" = no ; then
5005                   if test "$cf_add_incdir" = /usr/local/include ; then
5006                         if test "$GCC" = yes
5007                         then
5008                           cf_save_CPPFLAGS=$CPPFLAGS
5009
5010         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5011         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5012
5013                           cat >conftest.$ac_ext <<_ACEOF
5014 #line 5014 "configure"
5015 #include "confdefs.h"
5016 #include <stdio.h>
5017 int
5018 main (void)
5019 {
5020 printf("Hello")
5021   ;
5022   return 0;
5023 }
5024 _ACEOF
5025 rm -f conftest.$ac_objext
5026 if { (eval echo "$as_me:5026: \"$ac_compile\"") >&5
5027   (eval $ac_compile) 2>&5
5028   ac_status=$?
5029   echo "$as_me:5029: \$? = $ac_status" >&5
5030   (exit $ac_status); } &&
5031          { ac_try='test -s conftest.$ac_objext'
5032   { (eval echo "$as_me:5032: \"$ac_try\"") >&5
5033   (eval $ac_try) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit $ac_status); }; }; then
5037   :
5038 else
5039   echo "$as_me: failed program was:" >&5
5040 cat conftest.$ac_ext >&5
5041 cf_have_incdir=yes
5042 fi
5043 rm -f conftest.$ac_objext conftest.$ac_ext
5044                           CPPFLAGS=$cf_save_CPPFLAGS
5045                         fi
5046                   fi
5047                 fi
5048
5049                 if test "$cf_have_incdir" = no ; then
5050                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5051
5052 echo "${as_me:-configure}:5052: testing adding $cf_add_incdir to include-path ..." 1>&5
5053
5054                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5055
5056                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5057                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5058                   cf_add_incdir="$cf_top_incdir"
5059                 else
5060                   break
5061                 fi
5062           else
5063                 break
5064           fi
5065         done
5066   done
5067 fi
5068
5069 }
5070
5071 echo "$as_me:5071: checking for $cf_ncuhdr_root header in include-path" >&5
5072 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5073 if test "${cf_cv_ncurses_h+set}" = set; then
5074   echo $ECHO_N "(cached) $ECHO_C" >&6
5075 else
5076
5077         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5078         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5079         for cf_header in $cf_header_list
5080         do
5081
5082         cat >conftest.$ac_ext <<_ACEOF
5083 #line 5083 "configure"
5084 #include "confdefs.h"
5085
5086 #include <$cf_header>
5087 int
5088 main (void)
5089 {
5090
5091 #ifdef NCURSES_VERSION
5092
5093 printf("%s\n", NCURSES_VERSION);
5094 #else
5095 #ifdef __NCURSES_H
5096 printf("old\n");
5097 #else
5098         make an error
5099 #endif
5100 #endif
5101
5102   ;
5103   return 0;
5104 }
5105 _ACEOF
5106 rm -f conftest.$ac_objext
5107 if { (eval echo "$as_me:5107: \"$ac_compile\"") >&5
5108   (eval $ac_compile) 2>&5
5109   ac_status=$?
5110   echo "$as_me:5110: \$? = $ac_status" >&5
5111   (exit $ac_status); } &&
5112          { ac_try='test -s conftest.$ac_objext'
5113   { (eval echo "$as_me:5113: \"$ac_try\"") >&5
5114   (eval $ac_try) 2>&5
5115   ac_status=$?
5116   echo "$as_me:5116: \$? = $ac_status" >&5
5117   (exit $ac_status); }; }; then
5118   cf_cv_ncurses_h=$cf_header
5119
5120 else
5121   echo "$as_me: failed program was:" >&5
5122 cat conftest.$ac_ext >&5
5123 cf_cv_ncurses_h=no
5124 fi
5125 rm -f conftest.$ac_objext conftest.$ac_ext
5126
5127                 test "$cf_cv_ncurses_h" != no && break
5128         done
5129
5130 fi
5131 echo "$as_me:5131: result: $cf_cv_ncurses_h" >&5
5132 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5133
5134 if test "$cf_cv_ncurses_h" != no ; then
5135         cf_cv_ncurses_header=$cf_cv_ncurses_h
5136 else
5137
5138 echo "$as_me:5138: checking for $cf_ncuhdr_root include-path" >&5
5139 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5140 if test "${cf_cv_ncurses_h2+set}" = set; then
5141   echo $ECHO_N "(cached) $ECHO_C" >&6
5142 else
5143
5144         test -n "$verbose" && echo
5145
5146 cf_search=
5147
5148 # collect the current set of include-directories from compiler flags
5149 cf_header_path_list=""
5150 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5151         for cf_header_path in $CPPFLAGS $CFLAGS
5152         do
5153                 case $cf_header_path in
5154                 (-I*)
5155                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5156
5157 test "x$cf_header_path" != "xNONE" && \
5158 test -d "$cf_header_path" && \
5159  {
5160         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5161         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5162         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5163         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5164         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5165         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"
5166 }
5167
5168                         cf_header_path_list="$cf_header_path_list $cf_search"
5169                         ;;
5170                 esac
5171         done
5172 fi
5173
5174 # add the variations for the package we are looking for
5175
5176 cf_search=
5177
5178 test "x$prefix" != "xNONE" && \
5179 test -d "$prefix" && \
5180  {
5181         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5182         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5183         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5184         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5185         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5186         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5187 }
5188
5189 for cf_subdir_prefix in \
5190         /usr \
5191         /usr/local \
5192         /usr/pkg \
5193         /opt \
5194         /opt/local \
5195         $HOME
5196 do
5197
5198 test "x$cf_subdir_prefix" != "x$prefix" && \
5199 test -d "$cf_subdir_prefix" && \
5200 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5201         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5202         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5203         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5204         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5205         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5206         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"
5207 }
5208
5209 done
5210
5211 test "$includedir" != NONE && \
5212 test "$includedir" != "/usr/include" && \
5213 test -d "$includedir" && {
5214         test -d $includedir &&    cf_search="$cf_search $includedir"
5215         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5216 }
5217
5218 test "$oldincludedir" != NONE && \
5219 test "$oldincludedir" != "/usr/include" && \
5220 test -d "$oldincludedir" && {
5221         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5222         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5223 }
5224
5225 cf_search="$cf_search $cf_header_path_list"
5226
5227         test -n "$verbose" && echo search path $cf_search
5228         cf_save2_CPPFLAGS="$CPPFLAGS"
5229         for cf_incdir in $cf_search
5230         do
5231
5232 if test -n "$cf_incdir" ; then
5233   for cf_add_incdir in $cf_incdir
5234   do
5235         while test $cf_add_incdir != /usr/include
5236         do
5237           if test -d $cf_add_incdir
5238           then
5239                 cf_have_incdir=no
5240                 if test -n "$CFLAGS$CPPFLAGS" ; then
5241                   # a loop is needed to ensure we can add subdirs of existing dirs
5242                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5243                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5244                           cf_have_incdir=yes; break
5245                         fi
5246                   done
5247                 fi
5248
5249                 if test "$cf_have_incdir" = no ; then
5250                   if test "$cf_add_incdir" = /usr/local/include ; then
5251                         if test "$GCC" = yes
5252                         then
5253                           cf_save_CPPFLAGS=$CPPFLAGS
5254
5255         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5256         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5257
5258                           cat >conftest.$ac_ext <<_ACEOF
5259 #line 5259 "configure"
5260 #include "confdefs.h"
5261 #include <stdio.h>
5262 int
5263 main (void)
5264 {
5265 printf("Hello")
5266   ;
5267   return 0;
5268 }
5269 _ACEOF
5270 rm -f conftest.$ac_objext
5271 if { (eval echo "$as_me:5271: \"$ac_compile\"") >&5
5272   (eval $ac_compile) 2>&5
5273   ac_status=$?
5274   echo "$as_me:5274: \$? = $ac_status" >&5
5275   (exit $ac_status); } &&
5276          { ac_try='test -s conftest.$ac_objext'
5277   { (eval echo "$as_me:5277: \"$ac_try\"") >&5
5278   (eval $ac_try) 2>&5
5279   ac_status=$?
5280   echo "$as_me:5280: \$? = $ac_status" >&5
5281   (exit $ac_status); }; }; then
5282   :
5283 else
5284   echo "$as_me: failed program was:" >&5
5285 cat conftest.$ac_ext >&5
5286 cf_have_incdir=yes
5287 fi
5288 rm -f conftest.$ac_objext conftest.$ac_ext
5289                           CPPFLAGS=$cf_save_CPPFLAGS
5290                         fi
5291                   fi
5292                 fi
5293
5294                 if test "$cf_have_incdir" = no ; then
5295                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5296
5297 echo "${as_me:-configure}:5297: testing adding $cf_add_incdir to include-path ..." 1>&5
5298
5299                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5300
5301                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5302                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5303                   cf_add_incdir="$cf_top_incdir"
5304                 else
5305                   break
5306                 fi
5307           else
5308                 break
5309           fi
5310         done
5311   done
5312 fi
5313
5314                 for cf_header in \
5315                         ncurses.h \
5316                         curses.h
5317                 do
5318
5319         cat >conftest.$ac_ext <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322
5323 #include <$cf_header>
5324 int
5325 main (void)
5326 {
5327
5328 #ifdef NCURSES_VERSION
5329
5330 printf("%s\n", NCURSES_VERSION);
5331 #else
5332 #ifdef __NCURSES_H
5333 printf("old\n");
5334 #else
5335         make an error
5336 #endif
5337 #endif
5338
5339   ;
5340   return 0;
5341 }
5342 _ACEOF
5343 rm -f conftest.$ac_objext
5344 if { (eval echo "$as_me:5344: \"$ac_compile\"") >&5
5345   (eval $ac_compile) 2>&5
5346   ac_status=$?
5347   echo "$as_me:5347: \$? = $ac_status" >&5
5348   (exit $ac_status); } &&
5349          { ac_try='test -s conftest.$ac_objext'
5350   { (eval echo "$as_me:5350: \"$ac_try\"") >&5
5351   (eval $ac_try) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit $ac_status); }; }; then
5355   cf_cv_ncurses_h2=$cf_header
5356
5357 else
5358   echo "$as_me: failed program was:" >&5
5359 cat conftest.$ac_ext >&5
5360 cf_cv_ncurses_h2=no
5361 fi
5362 rm -f conftest.$ac_objext conftest.$ac_ext
5363
5364                         if test "$cf_cv_ncurses_h2" != no ; then
5365                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5366                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5367                                 break
5368                         fi
5369                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5370                 done
5371                 CPPFLAGS="$cf_save2_CPPFLAGS"
5372                 test "$cf_cv_ncurses_h2" != no && break
5373         done
5374         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5374: error: not found" >&5
5375 echo "$as_me: error: not found" >&2;}
5376    { (exit 1); exit 1; }; }
5377
5378 fi
5379 echo "$as_me:5379: result: $cf_cv_ncurses_h2" >&5
5380 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5381
5382         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5383         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5384         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5385                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5386         fi
5387
5388 if test -n "$cf_1st_incdir" ; then
5389   for cf_add_incdir in $cf_1st_incdir
5390   do
5391         while test $cf_add_incdir != /usr/include
5392         do
5393           if test -d $cf_add_incdir
5394           then
5395                 cf_have_incdir=no
5396                 if test -n "$CFLAGS$CPPFLAGS" ; then
5397                   # a loop is needed to ensure we can add subdirs of existing dirs
5398                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5399                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5400                           cf_have_incdir=yes; break
5401                         fi
5402                   done
5403                 fi
5404
5405                 if test "$cf_have_incdir" = no ; then
5406                   if test "$cf_add_incdir" = /usr/local/include ; then
5407                         if test "$GCC" = yes
5408                         then
5409                           cf_save_CPPFLAGS=$CPPFLAGS
5410
5411         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5412         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5413
5414                           cat >conftest.$ac_ext <<_ACEOF
5415 #line 5415 "configure"
5416 #include "confdefs.h"
5417 #include <stdio.h>
5418 int
5419 main (void)
5420 {
5421 printf("Hello")
5422   ;
5423   return 0;
5424 }
5425 _ACEOF
5426 rm -f conftest.$ac_objext
5427 if { (eval echo "$as_me:5427: \"$ac_compile\"") >&5
5428   (eval $ac_compile) 2>&5
5429   ac_status=$?
5430   echo "$as_me:5430: \$? = $ac_status" >&5
5431   (exit $ac_status); } &&
5432          { ac_try='test -s conftest.$ac_objext'
5433   { (eval echo "$as_me:5433: \"$ac_try\"") >&5
5434   (eval $ac_try) 2>&5
5435   ac_status=$?
5436   echo "$as_me:5436: \$? = $ac_status" >&5
5437   (exit $ac_status); }; }; then
5438   :
5439 else
5440   echo "$as_me: failed program was:" >&5
5441 cat conftest.$ac_ext >&5
5442 cf_have_incdir=yes
5443 fi
5444 rm -f conftest.$ac_objext conftest.$ac_ext
5445                           CPPFLAGS=$cf_save_CPPFLAGS
5446                         fi
5447                   fi
5448                 fi
5449
5450                 if test "$cf_have_incdir" = no ; then
5451                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5452
5453 echo "${as_me:-configure}:5453: testing adding $cf_add_incdir to include-path ..." 1>&5
5454
5455                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5456
5457                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5458                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5459                   cf_add_incdir="$cf_top_incdir"
5460                 else
5461                   break
5462                 fi
5463           else
5464                 break
5465           fi
5466         done
5467   done
5468 fi
5469
5470 fi
5471
5472 # Set definitions to allow ifdef'ing for ncurses.h
5473
5474 case $cf_cv_ncurses_header in
5475 (*ncurses.h)
5476
5477 cat >>confdefs.h <<\EOF
5478 #define HAVE_NCURSES_H 1
5479 EOF
5480
5481         ;;
5482 esac
5483
5484 case $cf_cv_ncurses_header in
5485 (ncurses/curses.h|ncurses/ncurses.h)
5486
5487 cat >>confdefs.h <<\EOF
5488 #define HAVE_NCURSES_NCURSES_H 1
5489 EOF
5490
5491         ;;
5492 (ncursesw/curses.h|ncursesw/ncurses.h)
5493
5494 cat >>confdefs.h <<\EOF
5495 #define HAVE_NCURSESW_NCURSES_H 1
5496 EOF
5497
5498         ;;
5499 esac
5500
5501 echo "$as_me:5501: checking for terminfo header" >&5
5502 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5503 if test "${cf_cv_term_header+set}" = set; then
5504   echo $ECHO_N "(cached) $ECHO_C" >&6
5505 else
5506
5507 case ${cf_cv_ncurses_header} in
5508 (*/ncurses.h|*/ncursesw.h)
5509         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5510         ;;
5511 (*)
5512         cf_term_header=term.h
5513         ;;
5514 esac
5515
5516 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5517 do
5518 cat >conftest.$ac_ext <<_ACEOF
5519 #line 5519 "configure"
5520 #include "confdefs.h"
5521 #include <stdio.h>
5522 #include <${cf_cv_ncurses_header:-curses.h}>
5523 #include <$cf_test>
5524
5525 int
5526 main (void)
5527 {
5528 int x = auto_left_margin; (void)x
5529   ;
5530   return 0;
5531 }
5532 _ACEOF
5533 rm -f conftest.$ac_objext
5534 if { (eval echo "$as_me:5534: \"$ac_compile\"") >&5
5535   (eval $ac_compile) 2>&5
5536   ac_status=$?
5537   echo "$as_me:5537: \$? = $ac_status" >&5
5538   (exit $ac_status); } &&
5539          { ac_try='test -s conftest.$ac_objext'
5540   { (eval echo "$as_me:5540: \"$ac_try\"") >&5
5541   (eval $ac_try) 2>&5
5542   ac_status=$?
5543   echo "$as_me:5543: \$? = $ac_status" >&5
5544   (exit $ac_status); }; }; then
5545
5546         cf_cv_term_header="$cf_test"
5547 else
5548   echo "$as_me: failed program was:" >&5
5549 cat conftest.$ac_ext >&5
5550
5551         cf_cv_term_header=unknown
5552
5553 fi
5554 rm -f conftest.$ac_objext conftest.$ac_ext
5555         test "$cf_cv_term_header" != unknown && break
5556 done
5557
5558 fi
5559 echo "$as_me:5559: result: $cf_cv_term_header" >&5
5560 echo "${ECHO_T}$cf_cv_term_header" >&6
5561
5562 # Set definitions to allow ifdef'ing to accommodate subdirectories
5563
5564 case $cf_cv_term_header in
5565 (*term.h)
5566
5567 cat >>confdefs.h <<\EOF
5568 #define HAVE_TERM_H 1
5569 EOF
5570
5571         ;;
5572 esac
5573
5574 case $cf_cv_term_header in
5575 (ncurses/term.h)
5576
5577 cat >>confdefs.h <<\EOF
5578 #define HAVE_NCURSES_TERM_H 1
5579 EOF
5580
5581         ;;
5582 (ncursesw/term.h)
5583
5584 cat >>confdefs.h <<\EOF
5585 #define HAVE_NCURSESW_TERM_H 1
5586 EOF
5587
5588         ;;
5589 esac
5590
5591 # some applications need this, but should check for NCURSES_VERSION
5592
5593 cat >>confdefs.h <<\EOF
5594 #define NCURSES 1
5595 EOF
5596
5597 echo "$as_me:5597: checking for ncurses version" >&5
5598 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5599 if test "${cf_cv_ncurses_version+set}" = set; then
5600   echo $ECHO_N "(cached) $ECHO_C" >&6
5601 else
5602
5603         cf_cv_ncurses_version=no
5604         cf_tempfile=out$$
5605         rm -f $cf_tempfile
5606         if test "$cross_compiling" = yes; then
5607
5608         # This will not work if the preprocessor splits the line after the
5609         # Autoconf token.  The 'unproto' program does that.
5610         cat > conftest.$ac_ext <<EOF
5611 #include <${cf_cv_ncurses_header:-curses.h}>
5612 #undef Autoconf
5613 #ifdef NCURSES_VERSION
5614 Autoconf NCURSES_VERSION
5615 #else
5616 #ifdef __NCURSES_H
5617 Autoconf "old"
5618 #endif
5619 ;
5620 #endif
5621 EOF
5622         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5623         { (eval echo "$as_me:5623: \"$cf_try\"") >&5
5624   (eval $cf_try) 2>&5
5625   ac_status=$?
5626   echo "$as_me:5626: \$? = $ac_status" >&5
5627   (exit $ac_status); }
5628         if test -f conftest.out ; then
5629                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5630                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5631                 rm -f conftest.out
5632         fi
5633
5634 else
5635   cat >conftest.$ac_ext <<_ACEOF
5636 #line 5636 "configure"
5637 #include "confdefs.h"
5638
5639 #include <${cf_cv_ncurses_header:-curses.h}>
5640 #include <stdio.h>
5641 int main(void)
5642 {
5643         FILE *fp = fopen("$cf_tempfile", "w");
5644 #ifdef NCURSES_VERSION
5645 # ifdef NCURSES_VERSION_PATCH
5646         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5647 # else
5648         fprintf(fp, "%s\n", NCURSES_VERSION);
5649 # endif
5650 #else
5651 # ifdef __NCURSES_H
5652         fprintf(fp, "old\n");
5653 # else
5654         make an error
5655 # endif
5656 #endif
5657         ${cf_cv_main_return:-return}(0);
5658 }
5659 _ACEOF
5660 rm -f conftest$ac_exeext
5661 if { (eval echo "$as_me:5661: \"$ac_link\"") >&5
5662   (eval $ac_link) 2>&5
5663   ac_status=$?
5664   echo "$as_me:5664: \$? = $ac_status" >&5
5665   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5666   { (eval echo "$as_me:5666: \"$ac_try\"") >&5
5667   (eval $ac_try) 2>&5
5668   ac_status=$?
5669   echo "$as_me:5669: \$? = $ac_status" >&5
5670   (exit $ac_status); }; }; then
5671
5672         cf_cv_ncurses_version=`cat $cf_tempfile`
5673 else
5674   echo "$as_me: program exited with status $ac_status" >&5
5675 echo "$as_me: failed program was:" >&5
5676 cat conftest.$ac_ext >&5
5677 fi
5678 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5679 fi
5680         rm -f $cf_tempfile
5681
5682 fi
5683 echo "$as_me:5683: result: $cf_cv_ncurses_version" >&5
5684 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5685 test "$cf_cv_ncurses_version" = no ||
5686 cat >>confdefs.h <<\EOF
5687 #define NCURSES 1
5688 EOF
5689
5690 cf_nculib_root=ncurses
5691         # This works, except for the special case where we find gpm, but
5692         # ncurses is in a nonstandard location via $LIBS, and we really want
5693         # to link gpm.
5694 cf_ncurses_LIBS=""
5695 cf_ncurses_SAVE="$LIBS"
5696 echo "$as_me:5696: checking for Gpm_Open in -lgpm" >&5
5697 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5698 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5699   echo $ECHO_N "(cached) $ECHO_C" >&6
5700 else
5701   ac_check_lib_save_LIBS=$LIBS
5702 LIBS="-lgpm  $LIBS"
5703 cat >conftest.$ac_ext <<_ACEOF
5704 #line 5704 "configure"
5705 #include "confdefs.h"
5706
5707 /* Override any gcc2 internal prototype to avoid an error.  */
5708 #ifdef __cplusplus
5709 extern "C"
5710 #endif
5711 /* We use char because int might match the return type of a gcc2
5712    builtin and then its argument prototype would still apply.  */
5713 char Gpm_Open ();
5714 int
5715 main (void)
5716 {
5717 Gpm_Open ();
5718   ;
5719   return 0;
5720 }
5721 _ACEOF
5722 rm -f conftest.$ac_objext conftest$ac_exeext
5723 if { (eval echo "$as_me:5723: \"$ac_link\"") >&5
5724   (eval $ac_link) 2>&5
5725   ac_status=$?
5726   echo "$as_me:5726: \$? = $ac_status" >&5
5727   (exit $ac_status); } &&
5728          { ac_try='test -s conftest$ac_exeext'
5729   { (eval echo "$as_me:5729: \"$ac_try\"") >&5
5730   (eval $ac_try) 2>&5
5731   ac_status=$?
5732   echo "$as_me:5732: \$? = $ac_status" >&5
5733   (exit $ac_status); }; }; then
5734   ac_cv_lib_gpm_Gpm_Open=yes
5735 else
5736   echo "$as_me: failed program was:" >&5
5737 cat conftest.$ac_ext >&5
5738 ac_cv_lib_gpm_Gpm_Open=no
5739 fi
5740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5741 LIBS=$ac_check_lib_save_LIBS
5742 fi
5743 echo "$as_me:5743: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5744 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5745 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5746   echo "$as_me:5746: checking for initscr in -lgpm" >&5
5747 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5748 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5749   echo $ECHO_N "(cached) $ECHO_C" >&6
5750 else
5751   ac_check_lib_save_LIBS=$LIBS
5752 LIBS="-lgpm  $LIBS"
5753 cat >conftest.$ac_ext <<_ACEOF
5754 #line 5754 "configure"
5755 #include "confdefs.h"
5756
5757 /* Override any gcc2 internal prototype to avoid an error.  */
5758 #ifdef __cplusplus
5759 extern "C"
5760 #endif
5761 /* We use char because int might match the return type of a gcc2
5762    builtin and then its argument prototype would still apply.  */
5763 char initscr ();
5764 int
5765 main (void)
5766 {
5767 initscr ();
5768   ;
5769   return 0;
5770 }
5771 _ACEOF
5772 rm -f conftest.$ac_objext conftest$ac_exeext
5773 if { (eval echo "$as_me:5773: \"$ac_link\"") >&5
5774   (eval $ac_link) 2>&5
5775   ac_status=$?
5776   echo "$as_me:5776: \$? = $ac_status" >&5
5777   (exit $ac_status); } &&
5778          { ac_try='test -s conftest$ac_exeext'
5779   { (eval echo "$as_me:5779: \"$ac_try\"") >&5
5780   (eval $ac_try) 2>&5
5781   ac_status=$?
5782   echo "$as_me:5782: \$? = $ac_status" >&5
5783   (exit $ac_status); }; }; then
5784   ac_cv_lib_gpm_initscr=yes
5785 else
5786   echo "$as_me: failed program was:" >&5
5787 cat conftest.$ac_ext >&5
5788 ac_cv_lib_gpm_initscr=no
5789 fi
5790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5791 LIBS=$ac_check_lib_save_LIBS
5792 fi
5793 echo "$as_me:5793: result: $ac_cv_lib_gpm_initscr" >&5
5794 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5795 if test $ac_cv_lib_gpm_initscr = yes; then
5796   LIBS="$cf_ncurses_SAVE"
5797 else
5798   cf_ncurses_LIBS="-lgpm"
5799 fi
5800
5801 fi
5802
5803 case $host_os in
5804 (freebsd*)
5805         # This is only necessary if you are linking against an obsolete
5806         # version of ncurses (but it should do no harm, since it's static).
5807         if test "$cf_nculib_root" = ncurses ; then
5808                 echo "$as_me:5808: checking for tgoto in -lmytinfo" >&5
5809 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5810 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5811   echo $ECHO_N "(cached) $ECHO_C" >&6
5812 else
5813   ac_check_lib_save_LIBS=$LIBS
5814 LIBS="-lmytinfo  $LIBS"
5815 cat >conftest.$ac_ext <<_ACEOF
5816 #line 5816 "configure"
5817 #include "confdefs.h"
5818
5819 /* Override any gcc2 internal prototype to avoid an error.  */
5820 #ifdef __cplusplus
5821 extern "C"
5822 #endif
5823 /* We use char because int might match the return type of a gcc2
5824    builtin and then its argument prototype would still apply.  */
5825 char tgoto ();
5826 int
5827 main (void)
5828 {
5829 tgoto ();
5830   ;
5831   return 0;
5832 }
5833 _ACEOF
5834 rm -f conftest.$ac_objext conftest$ac_exeext
5835 if { (eval echo "$as_me:5835: \"$ac_link\"") >&5
5836   (eval $ac_link) 2>&5
5837   ac_status=$?
5838   echo "$as_me:5838: \$? = $ac_status" >&5
5839   (exit $ac_status); } &&
5840          { ac_try='test -s conftest$ac_exeext'
5841   { (eval echo "$as_me:5841: \"$ac_try\"") >&5
5842   (eval $ac_try) 2>&5
5843   ac_status=$?
5844   echo "$as_me:5844: \$? = $ac_status" >&5
5845   (exit $ac_status); }; }; then
5846   ac_cv_lib_mytinfo_tgoto=yes
5847 else
5848   echo "$as_me: failed program was:" >&5
5849 cat conftest.$ac_ext >&5
5850 ac_cv_lib_mytinfo_tgoto=no
5851 fi
5852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5853 LIBS=$ac_check_lib_save_LIBS
5854 fi
5855 echo "$as_me:5855: result: $ac_cv_lib_mytinfo_tgoto" >&5
5856 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5857 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5858   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5859 fi
5860
5861         fi
5862         ;;
5863 esac
5864
5865 cf_add_libs="$LIBS"
5866 # reverse order
5867 cf_add_0lib=
5868 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5869 # filter duplicates
5870 for cf_add_1lib in $cf_add_0lib; do
5871         for cf_add_2lib in $cf_add_libs; do
5872                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5873                         cf_add_1lib=
5874                         break
5875                 fi
5876         done
5877         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5878 done
5879 LIBS="$cf_add_libs"
5880
5881 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5882 then
5883
5884 cf_add_libs="$LIBS"
5885 # reverse order
5886 cf_add_0lib=
5887 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5888 # filter duplicates
5889 for cf_add_1lib in $cf_add_0lib; do
5890         for cf_add_2lib in $cf_add_libs; do
5891                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5892                         cf_add_1lib=
5893                         break
5894                 fi
5895         done
5896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5897 done
5898 LIBS="$cf_add_libs"
5899
5900 else
5901
5902         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5903         cf_libdir=""
5904         echo "$as_me:5904: checking for initscr" >&5
5905 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5906 if test "${ac_cv_func_initscr+set}" = set; then
5907   echo $ECHO_N "(cached) $ECHO_C" >&6
5908 else
5909   cat >conftest.$ac_ext <<_ACEOF
5910 #line 5910 "configure"
5911 #include "confdefs.h"
5912 #define initscr autoconf_temporary
5913 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5914 #undef initscr
5915
5916 #ifdef __cplusplus
5917 extern "C"
5918 #endif
5919
5920 /* We use char because int might match the return type of a gcc2
5921    builtin and then its argument prototype would still apply.  */
5922 char initscr (void);
5923
5924 int
5925 main (void)
5926 {
5927
5928 /* The GNU C library defines stubs for functions which it implements
5929     to always fail with ENOSYS.  Some functions are actually named
5930     something starting with __ and the normal name is an alias.  */
5931 #if defined (__stub_initscr) || defined (__stub___initscr)
5932 #error found stub for initscr
5933 #endif
5934
5935         return initscr ();
5936   ;
5937   return 0;
5938 }
5939 _ACEOF
5940 rm -f conftest.$ac_objext conftest$ac_exeext
5941 if { (eval echo "$as_me:5941: \"$ac_link\"") >&5
5942   (eval $ac_link) 2>&5
5943   ac_status=$?
5944   echo "$as_me:5944: \$? = $ac_status" >&5
5945   (exit $ac_status); } &&
5946          { ac_try='test -s conftest$ac_exeext'
5947   { (eval echo "$as_me:5947: \"$ac_try\"") >&5
5948   (eval $ac_try) 2>&5
5949   ac_status=$?
5950   echo "$as_me:5950: \$? = $ac_status" >&5
5951   (exit $ac_status); }; }; then
5952   ac_cv_func_initscr=yes
5953 else
5954   echo "$as_me: failed program was:" >&5
5955 cat conftest.$ac_ext >&5
5956 ac_cv_func_initscr=no
5957 fi
5958 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5959 fi
5960 echo "$as_me:5960: result: $ac_cv_func_initscr" >&5
5961 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5962 if test $ac_cv_func_initscr = yes; then
5963   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5964 else
5965
5966                 cf_save_LIBS="$LIBS"
5967                 echo "$as_me:5967: checking for initscr in -l$cf_nculib_root" >&5
5968 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5969                 LIBS="-l$cf_nculib_root $LIBS"
5970                 cat >conftest.$ac_ext <<_ACEOF
5971 #line 5971 "configure"
5972 #include "confdefs.h"
5973 #include <${cf_cv_ncurses_header:-curses.h}>
5974 int
5975 main (void)
5976 {
5977 initscr()
5978   ;
5979   return 0;
5980 }
5981 _ACEOF
5982 rm -f conftest.$ac_objext conftest$ac_exeext
5983 if { (eval echo "$as_me:5983: \"$ac_link\"") >&5
5984   (eval $ac_link) 2>&5
5985   ac_status=$?
5986   echo "$as_me:5986: \$? = $ac_status" >&5
5987   (exit $ac_status); } &&
5988          { ac_try='test -s conftest$ac_exeext'
5989   { (eval echo "$as_me:5989: \"$ac_try\"") >&5
5990   (eval $ac_try) 2>&5
5991   ac_status=$?
5992   echo "$as_me:5992: \$? = $ac_status" >&5
5993   (exit $ac_status); }; }; then
5994   echo "$as_me:5994: result: yes" >&5
5995 echo "${ECHO_T}yes" >&6
5996                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5997
5998 else
5999   echo "$as_me: failed program was:" >&5
6000 cat conftest.$ac_ext >&5
6001 echo "$as_me:6001: result: no" >&5
6002 echo "${ECHO_T}no" >&6
6003
6004 cf_search=
6005 cf_library_path_list=""
6006 if test -n "${LDFLAGS}${LIBS}" ; then
6007         for cf_library_path in $LDFLAGS $LIBS
6008         do
6009                 case $cf_library_path in
6010                 (-L*)
6011                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6012
6013 test "x$cf_library_path" != "xNONE" && \
6014 test -d "$cf_library_path" && \
6015  {
6016         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6017         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6018         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6019         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6020         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6021         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"
6022 }
6023
6024                         cf_library_path_list="$cf_library_path_list $cf_search"
6025                         ;;
6026                 esac
6027         done
6028 fi
6029
6030 cf_search=
6031
6032 test "x$prefix" != "xNONE" && \
6033 test -d "$prefix" && \
6034  {
6035         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6036         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6037         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6038         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6039         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6040         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6041 }
6042
6043 for cf_subdir_prefix in \
6044         /usr \
6045         /usr/local \
6046         /usr/pkg \
6047         /opt \
6048         /opt/local \
6049         $HOME
6050 do
6051
6052 test "x$cf_subdir_prefix" != "x$prefix" && \
6053 test -d "$cf_subdir_prefix" && \
6054 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6055         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6056         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6057         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6058         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6059         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6060         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"
6061 }
6062
6063 done
6064
6065 cf_search="$cf_library_path_list $cf_search"
6066
6067                         for cf_libdir in $cf_search
6068                         do
6069                                 echo "$as_me:6069: checking for -l$cf_nculib_root in $cf_libdir" >&5
6070 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6071                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6072                                 cat >conftest.$ac_ext <<_ACEOF
6073 #line 6073 "configure"
6074 #include "confdefs.h"
6075 #include <${cf_cv_ncurses_header:-curses.h}>
6076 int
6077 main (void)
6078 {
6079 initscr()
6080   ;
6081   return 0;
6082 }
6083 _ACEOF
6084 rm -f conftest.$ac_objext conftest$ac_exeext
6085 if { (eval echo "$as_me:6085: \"$ac_link\"") >&5
6086   (eval $ac_link) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit $ac_status); } &&
6090          { ac_try='test -s conftest$ac_exeext'
6091   { (eval echo "$as_me:6091: \"$ac_try\"") >&5
6092   (eval $ac_try) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); }; }; then
6096   echo "$as_me:6096: result: yes" >&5
6097 echo "${ECHO_T}yes" >&6
6098                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6099                                          break
6100 else
6101   echo "$as_me: failed program was:" >&5
6102 cat conftest.$ac_ext >&5
6103 echo "$as_me:6103: result: no" >&5
6104 echo "${ECHO_T}no" >&6
6105                                          LIBS="$cf_save_LIBS"
6106 fi
6107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6108                         done
6109
6110 fi
6111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6112
6113 fi
6114
6115 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6116
6117 if test $cf_found_library = no ; then
6118         { { echo "$as_me:6118: error: Cannot link $cf_nculib_root library" >&5
6119 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6120    { (exit 1); exit 1; }; }
6121 fi
6122
6123 fi
6124
6125 if test -n "$cf_ncurses_LIBS" ; then
6126         echo "$as_me:6126: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6127 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6128         cf_ncurses_SAVE="$LIBS"
6129         for p in $cf_ncurses_LIBS ; do
6130                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6131                 if test "$q" != "$LIBS" ; then
6132                         LIBS="$q"
6133                 fi
6134         done
6135         cat >conftest.$ac_ext <<_ACEOF
6136 #line 6136 "configure"
6137 #include "confdefs.h"
6138 #include <${cf_cv_ncurses_header:-curses.h}>
6139 int
6140 main (void)
6141 {
6142 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6143   ;
6144   return 0;
6145 }
6146 _ACEOF
6147 rm -f conftest.$ac_objext conftest$ac_exeext
6148 if { (eval echo "$as_me:6148: \"$ac_link\"") >&5
6149   (eval $ac_link) 2>&5
6150   ac_status=$?
6151   echo "$as_me:6151: \$? = $ac_status" >&5
6152   (exit $ac_status); } &&
6153          { ac_try='test -s conftest$ac_exeext'
6154   { (eval echo "$as_me:6154: \"$ac_try\"") >&5
6155   (eval $ac_try) 2>&5
6156   ac_status=$?
6157   echo "$as_me:6157: \$? = $ac_status" >&5
6158   (exit $ac_status); }; }; then
6159   echo "$as_me:6159: result: yes" >&5
6160 echo "${ECHO_T}yes" >&6
6161 else
6162   echo "$as_me: failed program was:" >&5
6163 cat conftest.$ac_ext >&5
6164 echo "$as_me:6164: result: no" >&5
6165 echo "${ECHO_T}no" >&6
6166                  LIBS="$cf_ncurses_SAVE"
6167 fi
6168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6169 fi
6170
6171 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6172
6173 cat >>confdefs.h <<EOF
6174 #define $cf_nculib_ROOT 1
6175 EOF
6176
6177         fi
6178 else
6179         NCURSES_CONFIG=none
6180 fi
6181
6182 echo "$as_me:6182: checking if you want wide-character code" >&5
6183 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6184
6185 # Check whether --enable-widec or --disable-widec was given.
6186 if test "${enable_widec+set}" = set; then
6187   enableval="$enable_widec"
6188   with_widec=$enableval
6189 else
6190   with_widec=no
6191 fi;
6192 echo "$as_me:6192: result: $with_widec" >&5
6193 echo "${ECHO_T}$with_widec" >&6
6194 if test "$with_widec" = yes ; then
6195
6196 echo "$as_me:6196: checking for multibyte character support" >&5
6197 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6198 if test "${cf_cv_utf8_lib+set}" = set; then
6199   echo $ECHO_N "(cached) $ECHO_C" >&6
6200 else
6201
6202         cf_save_LIBS="$LIBS"
6203         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <stdlib.h>
6208 int
6209 main (void)
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext conftest$ac_exeext
6217 if { (eval echo "$as_me:6217: \"$ac_link\"") >&5
6218   (eval $ac_link) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest$ac_exeext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228   cf_cv_utf8_lib=yes
6229 else
6230   echo "$as_me: failed program was:" >&5
6231 cat conftest.$ac_ext >&5
6232
6233 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6234 # will be set on completion of the AC_TRY_LINK below.
6235 cf_cv_header_path_utf8=
6236 cf_cv_library_path_utf8=
6237
6238 echo "${as_me:-configure}:6238: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6239
6240 cf_save_LIBS="$LIBS"
6241
6242 cat >conftest.$ac_ext <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #include <libutf8.h>
6247 int
6248 main (void)
6249 {
6250 putwc(0,0);
6251   ;
6252   return 0;
6253 }
6254 _ACEOF
6255 rm -f conftest.$ac_objext conftest$ac_exeext
6256 if { (eval echo "$as_me:6256: \"$ac_link\"") >&5
6257   (eval $ac_link) 2>&5
6258   ac_status=$?
6259   echo "$as_me:6259: \$? = $ac_status" >&5
6260   (exit $ac_status); } &&
6261          { ac_try='test -s conftest$ac_exeext'
6262   { (eval echo "$as_me:6262: \"$ac_try\"") >&5
6263   (eval $ac_try) 2>&5
6264   ac_status=$?
6265   echo "$as_me:6265: \$? = $ac_status" >&5
6266   (exit $ac_status); }; }; then
6267
6268         cf_cv_find_linkage_utf8=yes
6269         cf_cv_header_path_utf8=/usr/include
6270         cf_cv_library_path_utf8=/usr/lib
6271
6272 else
6273   echo "$as_me: failed program was:" >&5
6274 cat conftest.$ac_ext >&5
6275
6276 LIBS="-lutf8  $cf_save_LIBS"
6277
6278 cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 #include <libutf8.h>
6283 int
6284 main (void)
6285 {
6286 putwc(0,0);
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext conftest$ac_exeext
6292 if { (eval echo "$as_me:6292: \"$ac_link\"") >&5
6293   (eval $ac_link) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest$ac_exeext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_find_linkage_utf8=yes
6305         cf_cv_header_path_utf8=/usr/include
6306         cf_cv_library_path_utf8=/usr/lib
6307         cf_cv_library_file_utf8="-lutf8"
6308
6309 else
6310   echo "$as_me: failed program was:" >&5
6311 cat conftest.$ac_ext >&5
6312
6313         cf_cv_find_linkage_utf8=no
6314         LIBS="$cf_save_LIBS"
6315
6316         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6317
6318 echo "${as_me:-configure}:6318: testing find linkage for utf8 library ..." 1>&5
6319
6320 echo "${as_me:-configure}:6320: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6321
6322         cf_save_CPPFLAGS="$CPPFLAGS"
6323         cf_test_CPPFLAGS="$CPPFLAGS"
6324
6325 cf_search=
6326
6327 # collect the current set of include-directories from compiler flags
6328 cf_header_path_list=""
6329 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6330         for cf_header_path in $CPPFLAGS $CFLAGS
6331         do
6332                 case $cf_header_path in
6333                 (-I*)
6334                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6335
6336 test "x$cf_header_path" != "xNONE" && \
6337 test -d "$cf_header_path" && \
6338  {
6339         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6340         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6341         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6342         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6343         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6344         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6345 }
6346
6347                         cf_header_path_list="$cf_header_path_list $cf_search"
6348                         ;;
6349                 esac
6350         done
6351 fi
6352
6353 # add the variations for the package we are looking for
6354
6355 cf_search=
6356
6357 test "x$prefix" != "xNONE" && \
6358 test -d "$prefix" && \
6359  {
6360         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6361         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6362         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6363         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6364         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6365         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6366 }
6367
6368 for cf_subdir_prefix in \
6369         /usr \
6370         /usr/local \
6371         /usr/pkg \
6372         /opt \
6373         /opt/local \
6374         $HOME
6375 do
6376
6377 test "x$cf_subdir_prefix" != "x$prefix" && \
6378 test -d "$cf_subdir_prefix" && \
6379 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6380         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6381         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6382         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6383         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6384         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6385         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6386 }
6387
6388 done
6389
6390 test "$includedir" != NONE && \
6391 test "$includedir" != "/usr/include" && \
6392 test -d "$includedir" && {
6393         test -d $includedir &&    cf_search="$cf_search $includedir"
6394         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6395 }
6396
6397 test "$oldincludedir" != NONE && \
6398 test "$oldincludedir" != "/usr/include" && \
6399 test -d "$oldincludedir" && {
6400         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6401         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6402 }
6403
6404 cf_search="$cf_search $cf_header_path_list"
6405
6406         for cf_cv_header_path_utf8 in $cf_search
6407         do
6408                 if test -d $cf_cv_header_path_utf8 ; then
6409                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6410
6411 echo "${as_me:-configure}:6411: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6412
6413                         CPPFLAGS="$cf_save_CPPFLAGS"
6414
6415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6416         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6417
6418                         cat >conftest.$ac_ext <<_ACEOF
6419 #line 6419 "configure"
6420 #include "confdefs.h"
6421
6422 #include <libutf8.h>
6423 int
6424 main (void)
6425 {
6426 putwc(0,0);
6427   ;
6428   return 0;
6429 }
6430 _ACEOF
6431 rm -f conftest.$ac_objext
6432 if { (eval echo "$as_me:6432: \"$ac_compile\"") >&5
6433   (eval $ac_compile) 2>&5
6434   ac_status=$?
6435   echo "$as_me:6435: \$? = $ac_status" >&5
6436   (exit $ac_status); } &&
6437          { ac_try='test -s conftest.$ac_objext'
6438   { (eval echo "$as_me:6438: \"$ac_try\"") >&5
6439   (eval $ac_try) 2>&5
6440   ac_status=$?
6441   echo "$as_me:6441: \$? = $ac_status" >&5
6442   (exit $ac_status); }; }; then
6443
6444                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6445
6446 echo "${as_me:-configure}:6446: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6447
6448                                 cf_cv_find_linkage_utf8=maybe
6449                                 cf_test_CPPFLAGS="$CPPFLAGS"
6450                                 break
6451 else
6452   echo "$as_me: failed program was:" >&5
6453 cat conftest.$ac_ext >&5
6454
6455                                 CPPFLAGS="$cf_save_CPPFLAGS"
6456
6457 fi
6458 rm -f conftest.$ac_objext conftest.$ac_ext
6459                 fi
6460         done
6461
6462         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6463
6464 echo "${as_me:-configure}:6464: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6465
6466                 cf_save_LIBS="$LIBS"
6467                 cf_save_LDFLAGS="$LDFLAGS"
6468
6469                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6470
6471 cf_search=
6472 cf_library_path_list=""
6473 if test -n "${LDFLAGS}${LIBS}" ; then
6474         for cf_library_path in $LDFLAGS $LIBS
6475         do
6476                 case $cf_library_path in
6477                 (-L*)
6478                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6479
6480 test "x$cf_library_path" != "xNONE" && \
6481 test -d "$cf_library_path" && \
6482  {
6483         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6484         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6485         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6486         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6487         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6488         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6489 }
6490
6491                         cf_library_path_list="$cf_library_path_list $cf_search"
6492                         ;;
6493                 esac
6494         done
6495 fi
6496
6497 cf_search=
6498
6499 test "x$prefix" != "xNONE" && \
6500 test -d "$prefix" && \
6501  {
6502         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6503         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6504         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6505         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6506         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6507         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6508 }
6509
6510 for cf_subdir_prefix in \
6511         /usr \
6512         /usr/local \
6513         /usr/pkg \
6514         /opt \
6515         /opt/local \
6516         $HOME
6517 do
6518
6519 test "x$cf_subdir_prefix" != "x$prefix" && \
6520 test -d "$cf_subdir_prefix" && \
6521 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6522         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6523         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6524         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6525         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6526         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6527         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6528 }
6529
6530 done
6531
6532 cf_search="$cf_library_path_list $cf_search"
6533
6534                         for cf_cv_library_path_utf8 in $cf_search
6535                         do
6536                                 if test -d $cf_cv_library_path_utf8 ; then
6537                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6538
6539 echo "${as_me:-configure}:6539: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6540
6541                                         CPPFLAGS="$cf_test_CPPFLAGS"
6542                                         LIBS="-lutf8  $cf_save_LIBS"
6543                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6544                                         cat >conftest.$ac_ext <<_ACEOF
6545 #line 6545 "configure"
6546 #include "confdefs.h"
6547
6548 #include <libutf8.h>
6549 int
6550 main (void)
6551 {
6552 putwc(0,0);
6553   ;
6554   return 0;
6555 }
6556 _ACEOF
6557 rm -f conftest.$ac_objext conftest$ac_exeext
6558 if { (eval echo "$as_me:6558: \"$ac_link\"") >&5
6559   (eval $ac_link) 2>&5
6560   ac_status=$?
6561   echo "$as_me:6561: \$? = $ac_status" >&5
6562   (exit $ac_status); } &&
6563          { ac_try='test -s conftest$ac_exeext'
6564   { (eval echo "$as_me:6564: \"$ac_try\"") >&5
6565   (eval $ac_try) 2>&5
6566   ac_status=$?
6567   echo "$as_me:6567: \$? = $ac_status" >&5
6568   (exit $ac_status); }; }; then
6569
6570                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6571
6572 echo "${as_me:-configure}:6572: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6573
6574                                         cf_cv_find_linkage_utf8=yes
6575                                         cf_cv_library_file_utf8="-lutf8"
6576                                         break
6577 else
6578   echo "$as_me: failed program was:" >&5
6579 cat conftest.$ac_ext >&5
6580
6581                                         CPPFLAGS="$cf_save_CPPFLAGS"
6582                                         LIBS="$cf_save_LIBS"
6583                                         LDFLAGS="$cf_save_LDFLAGS"
6584
6585 fi
6586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6587                                 fi
6588                         done
6589                         CPPFLAGS="$cf_save_CPPFLAGS"
6590                         LDFLAGS="$cf_save_LDFLAGS"
6591                 fi
6592
6593         else
6594                 cf_cv_find_linkage_utf8=no
6595         fi
6596
6597 fi
6598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6599
6600 fi
6601 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6602
6603 LIBS="$cf_save_LIBS"
6604
6605 if test "$cf_cv_find_linkage_utf8" = yes ; then
6606 cf_cv_utf8_lib=add-on
6607 else
6608 cf_cv_utf8_lib=no
6609 fi
6610
6611 fi
6612 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6613 fi
6614 echo "$as_me:6614: result: $cf_cv_utf8_lib" >&5
6615 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6616
6617 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6618 # ncurses/ncursesw:
6619 if test "$cf_cv_utf8_lib" = "add-on" ; then
6620
6621 cat >>confdefs.h <<\EOF
6622 #define HAVE_LIBUTF8_H 1
6623 EOF
6624
6625 if test -n "$cf_cv_header_path_utf8" ; then
6626   for cf_add_incdir in $cf_cv_header_path_utf8
6627   do
6628         while test $cf_add_incdir != /usr/include
6629         do
6630           if test -d $cf_add_incdir
6631           then
6632                 cf_have_incdir=no
6633                 if test -n "$CFLAGS$CPPFLAGS" ; then
6634                   # a loop is needed to ensure we can add subdirs of existing dirs
6635                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6636                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6637                           cf_have_incdir=yes; break
6638                         fi
6639                   done
6640                 fi
6641
6642                 if test "$cf_have_incdir" = no ; then
6643                   if test "$cf_add_incdir" = /usr/local/include ; then
6644                         if test "$GCC" = yes
6645                         then
6646                           cf_save_CPPFLAGS=$CPPFLAGS
6647
6648         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6649         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6650
6651                           cat >conftest.$ac_ext <<_ACEOF
6652 #line 6652 "configure"
6653 #include "confdefs.h"
6654 #include <stdio.h>
6655 int
6656 main (void)
6657 {
6658 printf("Hello")
6659   ;
6660   return 0;
6661 }
6662 _ACEOF
6663 rm -f conftest.$ac_objext
6664 if { (eval echo "$as_me:6664: \"$ac_compile\"") >&5
6665   (eval $ac_compile) 2>&5
6666   ac_status=$?
6667   echo "$as_me:6667: \$? = $ac_status" >&5
6668   (exit $ac_status); } &&
6669          { ac_try='test -s conftest.$ac_objext'
6670   { (eval echo "$as_me:6670: \"$ac_try\"") >&5
6671   (eval $ac_try) 2>&5
6672   ac_status=$?
6673   echo "$as_me:6673: \$? = $ac_status" >&5
6674   (exit $ac_status); }; }; then
6675   :
6676 else
6677   echo "$as_me: failed program was:" >&5
6678 cat conftest.$ac_ext >&5
6679 cf_have_incdir=yes
6680 fi
6681 rm -f conftest.$ac_objext conftest.$ac_ext
6682                           CPPFLAGS=$cf_save_CPPFLAGS
6683                         fi
6684                   fi
6685                 fi
6686
6687                 if test "$cf_have_incdir" = no ; then
6688                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6689
6690 echo "${as_me:-configure}:6690: testing adding $cf_add_incdir to include-path ..." 1>&5
6691
6692                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6693
6694                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6695                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6696                   cf_add_incdir="$cf_top_incdir"
6697                 else
6698                   break
6699                 fi
6700           else
6701                 break
6702           fi
6703         done
6704   done
6705 fi
6706
6707 if test -n "$cf_cv_library_path_utf8" ; then
6708         for cf_add_libdir in $cf_cv_library_path_utf8
6709         do
6710                 if test $cf_add_libdir = /usr/lib ; then
6711                         :
6712                 elif test -d $cf_add_libdir
6713                 then
6714                         cf_have_libdir=no
6715                         if test -n "$LDFLAGS$LIBS" ; then
6716                                 # a loop is needed to ensure we can add subdirs of existing dirs
6717                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6718                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6719                                                 cf_have_libdir=yes; break
6720                                         fi
6721                                 done
6722                         fi
6723                         if test "$cf_have_libdir" = no ; then
6724                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6725
6726 echo "${as_me:-configure}:6726: testing adding $cf_add_libdir to library-path ..." 1>&5
6727
6728                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6729                         fi
6730                 fi
6731         done
6732 fi
6733
6734 cf_add_libs="$LIBS"
6735 # reverse order
6736 cf_add_0lib=
6737 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6738 # filter duplicates
6739 for cf_add_1lib in $cf_add_0lib; do
6740         for cf_add_2lib in $cf_add_libs; do
6741                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6742                         cf_add_1lib=
6743                         break
6744                 fi
6745         done
6746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6747 done
6748 LIBS="$cf_add_libs"
6749
6750 fi
6751
6752 cf_ncuconfig_root=ncursesw
6753 cf_have_ncuconfig=no
6754
6755 if test "x${PKG_CONFIG:=none}" != xnone; then
6756         echo "$as_me:6756: checking pkg-config for $cf_ncuconfig_root" >&5
6757 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6758         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6759                 echo "$as_me:6759: result: yes" >&5
6760 echo "${ECHO_T}yes" >&6
6761
6762                 echo "$as_me:6762: checking if the $cf_ncuconfig_root package files work" >&5
6763 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6764                 cf_have_ncuconfig=unknown
6765
6766                 cf_save_CFLAGS="$CFLAGS"
6767                 cf_save_CPPFLAGS="$CPPFLAGS"
6768                 cf_save_LIBS="$LIBS"
6769
6770                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6771                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6772
6773                 # while -W for passing linker flags is prevalent, it is not "standard".
6774                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6775                 # incompatible _and_ non-standard -W option which gives an error.  Work
6776                 # around that pitfall.
6777                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6778                 (x*c[89]9@@*-W*)
6779
6780 cf_fix_cppflags=no
6781 cf_new_cflags=
6782 cf_new_cppflags=
6783 cf_new_extra_cppflags=
6784
6785 for cf_add_cflags in $cf_pkg_cflags
6786 do
6787 case $cf_fix_cppflags in
6788 (no)
6789         case $cf_add_cflags in
6790         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6791                 case $cf_add_cflags in
6792                 (-D*)
6793                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6794
6795                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6796                                 && test -z "${cf_tst_cflags}" \
6797                                 && cf_fix_cppflags=yes
6798
6799                         if test $cf_fix_cppflags = yes ; then
6800
6801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6803
6804                                 continue
6805                         elif test "${cf_tst_cflags}" = "\"'" ; then
6806
6807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6809
6810                                 continue
6811                         fi
6812                         ;;
6813                 esac
6814                 case "$CPPFLAGS" in
6815                 (*$cf_add_cflags)
6816                         ;;
6817                 (*)
6818                         case $cf_add_cflags in
6819                         (-D*)
6820                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6821
6822 CPPFLAGS=`echo "$CPPFLAGS" | \
6823         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6824                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6825
6826                                 ;;
6827                         esac
6828
6829         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6830         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6831
6832                         ;;
6833                 esac
6834                 ;;
6835         (*)
6836
6837         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6838         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6839
6840                 ;;
6841         esac
6842         ;;
6843 (yes)
6844
6845         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6846         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6847
6848         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6849
6850         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6851                 && test -z "${cf_tst_cflags}" \
6852                 && cf_fix_cppflags=no
6853         ;;
6854 esac
6855 done
6856
6857 if test -n "$cf_new_cflags" ; then
6858
6859         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6860         CFLAGS="${CFLAGS}$cf_new_cflags"
6861
6862 fi
6863
6864 if test -n "$cf_new_cppflags" ; then
6865
6866         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6867         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6868
6869 fi
6870
6871 if test -n "$cf_new_extra_cppflags" ; then
6872
6873         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6874         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6875
6876 fi
6877
6878 cf_add_libs="$LIBS"
6879 # reverse order
6880 cf_add_0lib=
6881 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6882 # filter duplicates
6883 for cf_add_1lib in $cf_add_0lib; do
6884         for cf_add_2lib in $cf_add_libs; do
6885                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6886                         cf_add_1lib=
6887                         break
6888                 fi
6889         done
6890         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6891 done
6892 LIBS="$cf_add_libs"
6893
6894                         cat >conftest.$ac_ext <<_ACEOF
6895 #line 6895 "configure"
6896 #include "confdefs.h"
6897 #include <${cf_cv_ncurses_header:-curses.h}>
6898 int
6899 main (void)
6900 {
6901 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6902   ;
6903   return 0;
6904 }
6905 _ACEOF
6906 rm -f conftest.$ac_objext conftest$ac_exeext
6907 if { (eval echo "$as_me:6907: \"$ac_link\"") >&5
6908   (eval $ac_link) 2>&5
6909   ac_status=$?
6910   echo "$as_me:6910: \$? = $ac_status" >&5
6911   (exit $ac_status); } &&
6912          { ac_try='test -s conftest$ac_exeext'
6913   { (eval echo "$as_me:6913: \"$ac_try\"") >&5
6914   (eval $ac_try) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); }; }; then
6918   if test "$cross_compiling" = yes; then
6919   cf_test_ncuconfig=maybe
6920 else
6921   cat >conftest.$ac_ext <<_ACEOF
6922 #line 6922 "configure"
6923 #include "confdefs.h"
6924 #include <${cf_cv_ncurses_header:-curses.h}>
6925                                         int main(void)
6926                                         { char *xx = curses_version(); return (xx == 0); }
6927 _ACEOF
6928 rm -f conftest$ac_exeext
6929 if { (eval echo "$as_me:6929: \"$ac_link\"") >&5
6930   (eval $ac_link) 2>&5
6931   ac_status=$?
6932   echo "$as_me:6932: \$? = $ac_status" >&5
6933   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6934   { (eval echo "$as_me:6934: \"$ac_try\"") >&5
6935   (eval $ac_try) 2>&5
6936   ac_status=$?
6937   echo "$as_me:6937: \$? = $ac_status" >&5
6938   (exit $ac_status); }; }; then
6939   cf_test_ncuconfig=yes
6940 else
6941   echo "$as_me: program exited with status $ac_status" >&5
6942 echo "$as_me: failed program was:" >&5
6943 cat conftest.$ac_ext >&5
6944 cf_test_ncuconfig=no
6945 fi
6946 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6947 fi
6948 else
6949   echo "$as_me: failed program was:" >&5
6950 cat conftest.$ac_ext >&5
6951 cf_test_ncuconfig=no
6952 fi
6953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6954
6955                         CFLAGS="$cf_save_CFLAGS"
6956                         CPPFLAGS="$cf_save_CPPFLAGS"
6957                         LIBS="$cf_save_LIBS"
6958
6959                         if test "x$cf_test_ncuconfig" != xyes; then
6960                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
6961                                 cf_pkg_cflags="$cf_temp"
6962                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
6963                                 cf_pkg_libs="$cf_temp"
6964                         fi
6965                         ;;
6966                 esac
6967
6968 cf_fix_cppflags=no
6969 cf_new_cflags=
6970 cf_new_cppflags=
6971 cf_new_extra_cppflags=
6972
6973 for cf_add_cflags in $cf_pkg_cflags
6974 do
6975 case $cf_fix_cppflags in
6976 (no)
6977         case $cf_add_cflags in
6978         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6979                 case $cf_add_cflags in
6980                 (-D*)
6981                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6982
6983                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6984                                 && test -z "${cf_tst_cflags}" \
6985                                 && cf_fix_cppflags=yes
6986
6987                         if test $cf_fix_cppflags = yes ; then
6988
6989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6991
6992                                 continue
6993                         elif test "${cf_tst_cflags}" = "\"'" ; then
6994
6995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6997
6998                                 continue
6999                         fi
7000                         ;;
7001                 esac
7002                 case "$CPPFLAGS" in
7003                 (*$cf_add_cflags)
7004                         ;;
7005                 (*)
7006                         case $cf_add_cflags in
7007                         (-D*)
7008                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7009
7010 CPPFLAGS=`echo "$CPPFLAGS" | \
7011         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7012                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7013
7014                                 ;;
7015                         esac
7016
7017         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7018         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7019
7020                         ;;
7021                 esac
7022                 ;;
7023         (*)
7024
7025         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7026         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7027
7028                 ;;
7029         esac
7030         ;;
7031 (yes)
7032
7033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7035
7036         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7037
7038         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7039                 && test -z "${cf_tst_cflags}" \
7040                 && cf_fix_cppflags=no
7041         ;;
7042 esac
7043 done
7044
7045 if test -n "$cf_new_cflags" ; then
7046
7047         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7048         CFLAGS="${CFLAGS}$cf_new_cflags"
7049
7050 fi
7051
7052 if test -n "$cf_new_cppflags" ; then
7053
7054         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7055         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7056
7057 fi
7058
7059 if test -n "$cf_new_extra_cppflags" ; then
7060
7061         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7062         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7063
7064 fi
7065
7066 cf_add_libs="$LIBS"
7067 # reverse order
7068 cf_add_0lib=
7069 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7070 # filter duplicates
7071 for cf_add_1lib in $cf_add_0lib; do
7072         for cf_add_2lib in $cf_add_libs; do
7073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7074                         cf_add_1lib=
7075                         break
7076                 fi
7077         done
7078         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7079 done
7080 LIBS="$cf_add_libs"
7081
7082                 cat >conftest.$ac_ext <<_ACEOF
7083 #line 7083 "configure"
7084 #include "confdefs.h"
7085 #include <${cf_cv_ncurses_header:-curses.h}>
7086 int
7087 main (void)
7088 {
7089 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7090   ;
7091   return 0;
7092 }
7093 _ACEOF
7094 rm -f conftest.$ac_objext conftest$ac_exeext
7095 if { (eval echo "$as_me:7095: \"$ac_link\"") >&5
7096   (eval $ac_link) 2>&5
7097   ac_status=$?
7098   echo "$as_me:7098: \$? = $ac_status" >&5
7099   (exit $ac_status); } &&
7100          { ac_try='test -s conftest$ac_exeext'
7101   { (eval echo "$as_me:7101: \"$ac_try\"") >&5
7102   (eval $ac_try) 2>&5
7103   ac_status=$?
7104   echo "$as_me:7104: \$? = $ac_status" >&5
7105   (exit $ac_status); }; }; then
7106   if test "$cross_compiling" = yes; then
7107   cf_have_ncuconfig=maybe
7108 else
7109   cat >conftest.$ac_ext <<_ACEOF
7110 #line 7110 "configure"
7111 #include "confdefs.h"
7112 #include <${cf_cv_ncurses_header:-curses.h}>
7113                                 int main(void)
7114                                 { char *xx = curses_version(); return (xx == 0); }
7115 _ACEOF
7116 rm -f conftest$ac_exeext
7117 if { (eval echo "$as_me:7117: \"$ac_link\"") >&5
7118   (eval $ac_link) 2>&5
7119   ac_status=$?
7120   echo "$as_me:7120: \$? = $ac_status" >&5
7121   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7122   { (eval echo "$as_me:7122: \"$ac_try\"") >&5
7123   (eval $ac_try) 2>&5
7124   ac_status=$?
7125   echo "$as_me:7125: \$? = $ac_status" >&5
7126   (exit $ac_status); }; }; then
7127   cf_have_ncuconfig=yes
7128 else
7129   echo "$as_me: program exited with status $ac_status" >&5
7130 echo "$as_me: failed program was:" >&5
7131 cat conftest.$ac_ext >&5
7132 cf_have_ncuconfig=no
7133 fi
7134 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7135 fi
7136 else
7137   echo "$as_me: failed program was:" >&5
7138 cat conftest.$ac_ext >&5
7139 cf_have_ncuconfig=no
7140 fi
7141 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7142                 echo "$as_me:7142: result: $cf_have_ncuconfig" >&5
7143 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7144                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7145                 if test "$cf_have_ncuconfig" != "yes"
7146                 then
7147                         CPPFLAGS="$cf_save_CPPFLAGS"
7148                         LIBS="$cf_save_LIBS"
7149                         NCURSES_CONFIG_PKG=none
7150                 else
7151
7152 cat >>confdefs.h <<\EOF
7153 #define NCURSES 1
7154 EOF
7155
7156                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7157
7158 echo "$as_me:7158: checking for terminfo header" >&5
7159 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7160 if test "${cf_cv_term_header+set}" = set; then
7161   echo $ECHO_N "(cached) $ECHO_C" >&6
7162 else
7163
7164 case ${cf_cv_ncurses_header} in
7165 (*/ncurses.h|*/ncursesw.h)
7166         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7167         ;;
7168 (*)
7169         cf_term_header=term.h
7170         ;;
7171 esac
7172
7173 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7174 do
7175 cat >conftest.$ac_ext <<_ACEOF
7176 #line 7176 "configure"
7177 #include "confdefs.h"
7178 #include <stdio.h>
7179 #include <${cf_cv_ncurses_header:-curses.h}>
7180 #include <$cf_test>
7181
7182 int
7183 main (void)
7184 {
7185 int x = auto_left_margin; (void)x
7186   ;
7187   return 0;
7188 }
7189 _ACEOF
7190 rm -f conftest.$ac_objext
7191 if { (eval echo "$as_me:7191: \"$ac_compile\"") >&5
7192   (eval $ac_compile) 2>&5
7193   ac_status=$?
7194   echo "$as_me:7194: \$? = $ac_status" >&5
7195   (exit $ac_status); } &&
7196          { ac_try='test -s conftest.$ac_objext'
7197   { (eval echo "$as_me:7197: \"$ac_try\"") >&5
7198   (eval $ac_try) 2>&5
7199   ac_status=$?
7200   echo "$as_me:7200: \$? = $ac_status" >&5
7201   (exit $ac_status); }; }; then
7202
7203         cf_cv_term_header="$cf_test"
7204 else
7205   echo "$as_me: failed program was:" >&5
7206 cat conftest.$ac_ext >&5
7207
7208         cf_cv_term_header=unknown
7209
7210 fi
7211 rm -f conftest.$ac_objext conftest.$ac_ext
7212         test "$cf_cv_term_header" != unknown && break
7213 done
7214
7215 fi
7216 echo "$as_me:7216: result: $cf_cv_term_header" >&5
7217 echo "${ECHO_T}$cf_cv_term_header" >&6
7218
7219 # Set definitions to allow ifdef'ing to accommodate subdirectories
7220
7221 case $cf_cv_term_header in
7222 (*term.h)
7223
7224 cat >>confdefs.h <<\EOF
7225 #define HAVE_TERM_H 1
7226 EOF
7227
7228         ;;
7229 esac
7230
7231 case $cf_cv_term_header in
7232 (ncurses/term.h)
7233
7234 cat >>confdefs.h <<\EOF
7235 #define HAVE_NCURSES_TERM_H 1
7236 EOF
7237
7238         ;;
7239 (ncursesw/term.h)
7240
7241 cat >>confdefs.h <<\EOF
7242 #define HAVE_NCURSESW_TERM_H 1
7243 EOF
7244
7245         ;;
7246 esac
7247
7248                 fi
7249
7250         else
7251                 echo "$as_me:7251: result: no" >&5
7252 echo "${ECHO_T}no" >&6
7253                 NCURSES_CONFIG_PKG=none
7254         fi
7255 else
7256         NCURSES_CONFIG_PKG=none
7257 fi
7258
7259 if test "x$cf_have_ncuconfig" = "xno"; then
7260         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7261
7262 if test -n "$ac_tool_prefix"; then
7263   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7264   do
7265     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7266 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7267 echo "$as_me:7267: checking for $ac_word" >&5
7268 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7269 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7270   echo $ECHO_N "(cached) $ECHO_C" >&6
7271 else
7272   if test -n "$NCURSES_CONFIG"; then
7273   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7274 else
7275   ac_save_IFS=$IFS; IFS=$ac_path_separator
7276 ac_dummy="$PATH"
7277 for ac_dir in $ac_dummy; do
7278   IFS=$ac_save_IFS
7279   test -z "$ac_dir" && ac_dir=.
7280   $as_executable_p "$ac_dir/$ac_word" || continue
7281 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7282 echo "$as_me:7282: found $ac_dir/$ac_word" >&5
7283 break
7284 done
7285
7286 fi
7287 fi
7288 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7289 if test -n "$NCURSES_CONFIG"; then
7290   echo "$as_me:7290: result: $NCURSES_CONFIG" >&5
7291 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7292 else
7293   echo "$as_me:7293: result: no" >&5
7294 echo "${ECHO_T}no" >&6
7295 fi
7296
7297     test -n "$NCURSES_CONFIG" && break
7298   done
7299 fi
7300 if test -z "$NCURSES_CONFIG"; then
7301   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7302   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7303 do
7304   # Extract the first word of "$ac_prog", so it can be a program name with args.
7305 set dummy $ac_prog; ac_word=$2
7306 echo "$as_me:7306: checking for $ac_word" >&5
7307 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7308 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7309   echo $ECHO_N "(cached) $ECHO_C" >&6
7310 else
7311   if test -n "$ac_ct_NCURSES_CONFIG"; then
7312   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7313 else
7314   ac_save_IFS=$IFS; IFS=$ac_path_separator
7315 ac_dummy="$PATH"
7316 for ac_dir in $ac_dummy; do
7317   IFS=$ac_save_IFS
7318   test -z "$ac_dir" && ac_dir=.
7319   $as_executable_p "$ac_dir/$ac_word" || continue
7320 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7321 echo "$as_me:7321: found $ac_dir/$ac_word" >&5
7322 break
7323 done
7324
7325 fi
7326 fi
7327 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7328 if test -n "$ac_ct_NCURSES_CONFIG"; then
7329   echo "$as_me:7329: result: $ac_ct_NCURSES_CONFIG" >&5
7330 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7331 else
7332   echo "$as_me:7332: result: no" >&5
7333 echo "${ECHO_T}no" >&6
7334 fi
7335
7336   test -n "$ac_ct_NCURSES_CONFIG" && break
7337 done
7338 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7339
7340   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7341 fi
7342
7343         if test "$NCURSES_CONFIG" != none ; then
7344
7345 cf_fix_cppflags=no
7346 cf_new_cflags=
7347 cf_new_cppflags=
7348 cf_new_extra_cppflags=
7349
7350 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7351 do
7352 case $cf_fix_cppflags in
7353 (no)
7354         case $cf_add_cflags in
7355         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7356                 case $cf_add_cflags in
7357                 (-D*)
7358                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7359
7360                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7361                                 && test -z "${cf_tst_cflags}" \
7362                                 && cf_fix_cppflags=yes
7363
7364                         if test $cf_fix_cppflags = yes ; then
7365
7366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7368
7369                                 continue
7370                         elif test "${cf_tst_cflags}" = "\"'" ; then
7371
7372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7374
7375                                 continue
7376                         fi
7377                         ;;
7378                 esac
7379                 case "$CPPFLAGS" in
7380                 (*$cf_add_cflags)
7381                         ;;
7382                 (*)
7383                         case $cf_add_cflags in
7384                         (-D*)
7385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7386
7387 CPPFLAGS=`echo "$CPPFLAGS" | \
7388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7390
7391                                 ;;
7392                         esac
7393
7394         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7395         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7396
7397                         ;;
7398                 esac
7399                 ;;
7400         (*)
7401
7402         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7403         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7404
7405                 ;;
7406         esac
7407         ;;
7408 (yes)
7409
7410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7412
7413         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7414
7415         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7416                 && test -z "${cf_tst_cflags}" \
7417                 && cf_fix_cppflags=no
7418         ;;
7419 esac
7420 done
7421
7422 if test -n "$cf_new_cflags" ; then
7423
7424         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7425         CFLAGS="${CFLAGS}$cf_new_cflags"
7426
7427 fi
7428
7429 if test -n "$cf_new_cppflags" ; then
7430
7431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7432         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7433
7434 fi
7435
7436 if test -n "$cf_new_extra_cppflags" ; then
7437
7438         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7439         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7440
7441 fi
7442
7443 cf_add_libs="$LIBS"
7444 # reverse order
7445 cf_add_0lib=
7446 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7447 # filter duplicates
7448 for cf_add_1lib in $cf_add_0lib; do
7449         for cf_add_2lib in $cf_add_libs; do
7450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7451                         cf_add_1lib=
7452                         break
7453                 fi
7454         done
7455         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7456 done
7457 LIBS="$cf_add_libs"
7458
7459                 # even with config script, some packages use no-override for curses.h
7460
7461 echo "$as_me:7461: checking if we have identified curses headers" >&5
7462 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7463 if test "${cf_cv_ncurses_header+set}" = set; then
7464   echo $ECHO_N "(cached) $ECHO_C" >&6
7465 else
7466
7467 cf_cv_ncurses_header=none
7468 for cf_header in \
7469         ncurses.h ncursesw/ncurses.h \
7470         curses.h ncursesw/curses.h
7471 do
7472 cat >conftest.$ac_ext <<_ACEOF
7473 #line 7473 "configure"
7474 #include "confdefs.h"
7475 #include <${cf_header}>
7476 int
7477 main (void)
7478 {
7479 initscr(); tgoto("?", 0,0)
7480   ;
7481   return 0;
7482 }
7483 _ACEOF
7484 rm -f conftest.$ac_objext
7485 if { (eval echo "$as_me:7485: \"$ac_compile\"") >&5
7486   (eval $ac_compile) 2>&5
7487   ac_status=$?
7488   echo "$as_me:7488: \$? = $ac_status" >&5
7489   (exit $ac_status); } &&
7490          { ac_try='test -s conftest.$ac_objext'
7491   { (eval echo "$as_me:7491: \"$ac_try\"") >&5
7492   (eval $ac_try) 2>&5
7493   ac_status=$?
7494   echo "$as_me:7494: \$? = $ac_status" >&5
7495   (exit $ac_status); }; }; then
7496   cf_cv_ncurses_header=$cf_header; break
7497 else
7498   echo "$as_me: failed program was:" >&5
7499 cat conftest.$ac_ext >&5
7500 fi
7501 rm -f conftest.$ac_objext conftest.$ac_ext
7502 done
7503
7504 fi
7505 echo "$as_me:7505: result: $cf_cv_ncurses_header" >&5
7506 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7507
7508 if test "$cf_cv_ncurses_header" = none ; then
7509         { { echo "$as_me:7509: error: No curses header-files found" >&5
7510 echo "$as_me: error: No curses header-files found" >&2;}
7511    { (exit 1); exit 1; }; }
7512 fi
7513
7514 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7515
7516 for ac_header in $cf_cv_ncurses_header
7517 do
7518 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7519 echo "$as_me:7519: checking for $ac_header" >&5
7520 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7521 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7522   echo $ECHO_N "(cached) $ECHO_C" >&6
7523 else
7524   cat >conftest.$ac_ext <<_ACEOF
7525 #line 7525 "configure"
7526 #include "confdefs.h"
7527 #include <$ac_header>
7528 _ACEOF
7529 if { (eval echo "$as_me:7529: \"$ac_cpp conftest.$ac_ext\"") >&5
7530   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7531   ac_status=$?
7532   egrep -v '^ *\+' conftest.er1 >conftest.err
7533   rm -f conftest.er1
7534   cat conftest.err >&5
7535   echo "$as_me:7535: \$? = $ac_status" >&5
7536   (exit $ac_status); } >/dev/null; then
7537   if test -s conftest.err; then
7538     ac_cpp_err=$ac_c_preproc_warn_flag
7539   else
7540     ac_cpp_err=
7541   fi
7542 else
7543   ac_cpp_err=yes
7544 fi
7545 if test -z "$ac_cpp_err"; then
7546   eval "$as_ac_Header=yes"
7547 else
7548   echo "$as_me: failed program was:" >&5
7549   cat conftest.$ac_ext >&5
7550   eval "$as_ac_Header=no"
7551 fi
7552 rm -f conftest.err conftest.$ac_ext
7553 fi
7554 echo "$as_me:7554: result: `eval echo '${'$as_ac_Header'}'`" >&5
7555 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7556 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7557   cat >>confdefs.h <<EOF
7558 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7559 EOF
7560
7561 fi
7562 done
7563
7564 cat >>confdefs.h <<\EOF
7565 #define NCURSES 1
7566 EOF
7567
7568 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7569
7570                 cat >>confdefs.h <<EOF
7571 #define $cf_nculib_ROOT 1
7572 EOF
7573
7574                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7575
7576         else
7577
7578 cf_ncuhdr_root=ncursesw
7579
7580 test -n "$cf_cv_curses_dir" && \
7581 test "$cf_cv_curses_dir" != "no" && { \
7582
7583 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7584   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7585   do
7586         while test $cf_add_incdir != /usr/include
7587         do
7588           if test -d $cf_add_incdir
7589           then
7590                 cf_have_incdir=no
7591                 if test -n "$CFLAGS$CPPFLAGS" ; then
7592                   # a loop is needed to ensure we can add subdirs of existing dirs
7593                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7594                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7595                           cf_have_incdir=yes; break
7596                         fi
7597                   done
7598                 fi
7599
7600                 if test "$cf_have_incdir" = no ; then
7601                   if test "$cf_add_incdir" = /usr/local/include ; then
7602                         if test "$GCC" = yes
7603                         then
7604                           cf_save_CPPFLAGS=$CPPFLAGS
7605
7606         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7607         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7608
7609                           cat >conftest.$ac_ext <<_ACEOF
7610 #line 7610 "configure"
7611 #include "confdefs.h"
7612 #include <stdio.h>
7613 int
7614 main (void)
7615 {
7616 printf("Hello")
7617   ;
7618   return 0;
7619 }
7620 _ACEOF
7621 rm -f conftest.$ac_objext
7622 if { (eval echo "$as_me:7622: \"$ac_compile\"") >&5
7623   (eval $ac_compile) 2>&5
7624   ac_status=$?
7625   echo "$as_me:7625: \$? = $ac_status" >&5
7626   (exit $ac_status); } &&
7627          { ac_try='test -s conftest.$ac_objext'
7628   { (eval echo "$as_me:7628: \"$ac_try\"") >&5
7629   (eval $ac_try) 2>&5
7630   ac_status=$?
7631   echo "$as_me:7631: \$? = $ac_status" >&5
7632   (exit $ac_status); }; }; then
7633   :
7634 else
7635   echo "$as_me: failed program was:" >&5
7636 cat conftest.$ac_ext >&5
7637 cf_have_incdir=yes
7638 fi
7639 rm -f conftest.$ac_objext conftest.$ac_ext
7640                           CPPFLAGS=$cf_save_CPPFLAGS
7641                         fi
7642                   fi
7643                 fi
7644
7645                 if test "$cf_have_incdir" = no ; then
7646                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7647
7648 echo "${as_me:-configure}:7648: testing adding $cf_add_incdir to include-path ..." 1>&5
7649
7650                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7651
7652                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7653                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7654                   cf_add_incdir="$cf_top_incdir"
7655                 else
7656                   break
7657                 fi
7658           else
7659                 break
7660           fi
7661         done
7662   done
7663 fi
7664
7665 }
7666
7667 echo "$as_me:7667: checking for $cf_ncuhdr_root header in include-path" >&5
7668 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7669 if test "${cf_cv_ncurses_h+set}" = set; then
7670   echo $ECHO_N "(cached) $ECHO_C" >&6
7671 else
7672
7673         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7674         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7675         for cf_header in $cf_header_list
7676         do
7677
7678         cat >conftest.$ac_ext <<_ACEOF
7679 #line 7679 "configure"
7680 #include "confdefs.h"
7681
7682 #define _XOPEN_SOURCE_EXTENDED
7683 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7684 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7685
7686 #include <$cf_header>
7687 int
7688 main (void)
7689 {
7690
7691 #ifdef NCURSES_VERSION
7692
7693 #ifndef WACS_BSSB
7694         make an error
7695 #endif
7696
7697 printf("%s\n", NCURSES_VERSION);
7698 #else
7699 #ifdef __NCURSES_H
7700 printf("old\n");
7701 #else
7702         make an error
7703 #endif
7704 #endif
7705
7706   ;
7707   return 0;
7708 }
7709 _ACEOF
7710 rm -f conftest.$ac_objext
7711 if { (eval echo "$as_me:7711: \"$ac_compile\"") >&5
7712   (eval $ac_compile) 2>&5
7713   ac_status=$?
7714   echo "$as_me:7714: \$? = $ac_status" >&5
7715   (exit $ac_status); } &&
7716          { ac_try='test -s conftest.$ac_objext'
7717   { (eval echo "$as_me:7717: \"$ac_try\"") >&5
7718   (eval $ac_try) 2>&5
7719   ac_status=$?
7720   echo "$as_me:7720: \$? = $ac_status" >&5
7721   (exit $ac_status); }; }; then
7722   cf_cv_ncurses_h=$cf_header
7723
7724 else
7725   echo "$as_me: failed program was:" >&5
7726 cat conftest.$ac_ext >&5
7727 cf_cv_ncurses_h=no
7728 fi
7729 rm -f conftest.$ac_objext conftest.$ac_ext
7730
7731                 test "$cf_cv_ncurses_h" != no && break
7732         done
7733
7734 fi
7735 echo "$as_me:7735: result: $cf_cv_ncurses_h" >&5
7736 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7737
7738 if test "$cf_cv_ncurses_h" != no ; then
7739         cf_cv_ncurses_header=$cf_cv_ncurses_h
7740 else
7741
7742 echo "$as_me:7742: checking for $cf_ncuhdr_root include-path" >&5
7743 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7744 if test "${cf_cv_ncurses_h2+set}" = set; then
7745   echo $ECHO_N "(cached) $ECHO_C" >&6
7746 else
7747
7748         test -n "$verbose" && echo
7749
7750 cf_search=
7751
7752 # collect the current set of include-directories from compiler flags
7753 cf_header_path_list=""
7754 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7755         for cf_header_path in $CPPFLAGS $CFLAGS
7756         do
7757                 case $cf_header_path in
7758                 (-I*)
7759                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7760
7761 test "x$cf_header_path" != "xNONE" && \
7762 test -d "$cf_header_path" && \
7763  {
7764         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7765         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7766         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7767         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7768         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7769         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"
7770 }
7771
7772                         cf_header_path_list="$cf_header_path_list $cf_search"
7773                         ;;
7774                 esac
7775         done
7776 fi
7777
7778 # add the variations for the package we are looking for
7779
7780 cf_search=
7781
7782 test "x$prefix" != "xNONE" && \
7783 test -d "$prefix" && \
7784  {
7785         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7786         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7787         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7788         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7789         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7790         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7791 }
7792
7793 for cf_subdir_prefix in \
7794         /usr \
7795         /usr/local \
7796         /usr/pkg \
7797         /opt \
7798         /opt/local \
7799         $HOME
7800 do
7801
7802 test "x$cf_subdir_prefix" != "x$prefix" && \
7803 test -d "$cf_subdir_prefix" && \
7804 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7805         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7806         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7807         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7808         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7809         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7810         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"
7811 }
7812
7813 done
7814
7815 test "$includedir" != NONE && \
7816 test "$includedir" != "/usr/include" && \
7817 test -d "$includedir" && {
7818         test -d $includedir &&    cf_search="$cf_search $includedir"
7819         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7820 }
7821
7822 test "$oldincludedir" != NONE && \
7823 test "$oldincludedir" != "/usr/include" && \
7824 test -d "$oldincludedir" && {
7825         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7826         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7827 }
7828
7829 cf_search="$cf_search $cf_header_path_list"
7830
7831         test -n "$verbose" && echo search path $cf_search
7832         cf_save2_CPPFLAGS="$CPPFLAGS"
7833         for cf_incdir in $cf_search
7834         do
7835
7836 if test -n "$cf_incdir" ; then
7837   for cf_add_incdir in $cf_incdir
7838   do
7839         while test $cf_add_incdir != /usr/include
7840         do
7841           if test -d $cf_add_incdir
7842           then
7843                 cf_have_incdir=no
7844                 if test -n "$CFLAGS$CPPFLAGS" ; then
7845                   # a loop is needed to ensure we can add subdirs of existing dirs
7846                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7847                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7848                           cf_have_incdir=yes; break
7849                         fi
7850                   done
7851                 fi
7852
7853                 if test "$cf_have_incdir" = no ; then
7854                   if test "$cf_add_incdir" = /usr/local/include ; then
7855                         if test "$GCC" = yes
7856                         then
7857                           cf_save_CPPFLAGS=$CPPFLAGS
7858
7859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7860         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7861
7862                           cat >conftest.$ac_ext <<_ACEOF
7863 #line 7863 "configure"
7864 #include "confdefs.h"
7865 #include <stdio.h>
7866 int
7867 main (void)
7868 {
7869 printf("Hello")
7870   ;
7871   return 0;
7872 }
7873 _ACEOF
7874 rm -f conftest.$ac_objext
7875 if { (eval echo "$as_me:7875: \"$ac_compile\"") >&5
7876   (eval $ac_compile) 2>&5
7877   ac_status=$?
7878   echo "$as_me:7878: \$? = $ac_status" >&5
7879   (exit $ac_status); } &&
7880          { ac_try='test -s conftest.$ac_objext'
7881   { (eval echo "$as_me:7881: \"$ac_try\"") >&5
7882   (eval $ac_try) 2>&5
7883   ac_status=$?
7884   echo "$as_me:7884: \$? = $ac_status" >&5
7885   (exit $ac_status); }; }; then
7886   :
7887 else
7888   echo "$as_me: failed program was:" >&5
7889 cat conftest.$ac_ext >&5
7890 cf_have_incdir=yes
7891 fi
7892 rm -f conftest.$ac_objext conftest.$ac_ext
7893                           CPPFLAGS=$cf_save_CPPFLAGS
7894                         fi
7895                   fi
7896                 fi
7897
7898                 if test "$cf_have_incdir" = no ; then
7899                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7900
7901 echo "${as_me:-configure}:7901: testing adding $cf_add_incdir to include-path ..." 1>&5
7902
7903                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7904
7905                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7906                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7907                   cf_add_incdir="$cf_top_incdir"
7908                 else
7909                   break
7910                 fi
7911           else
7912                 break
7913           fi
7914         done
7915   done
7916 fi
7917
7918                 for cf_header in \
7919                         ncurses.h \
7920                         curses.h
7921                 do
7922
7923         cat >conftest.$ac_ext <<_ACEOF
7924 #line 7924 "configure"
7925 #include "confdefs.h"
7926
7927 #include <$cf_header>
7928 int
7929 main (void)
7930 {
7931
7932 #ifdef NCURSES_VERSION
7933
7934 printf("%s\n", NCURSES_VERSION);
7935 #else
7936 #ifdef __NCURSES_H
7937 printf("old\n");
7938 #else
7939         make an error
7940 #endif
7941 #endif
7942
7943   ;
7944   return 0;
7945 }
7946 _ACEOF
7947 rm -f conftest.$ac_objext
7948 if { (eval echo "$as_me:7948: \"$ac_compile\"") >&5
7949   (eval $ac_compile) 2>&5
7950   ac_status=$?
7951   echo "$as_me:7951: \$? = $ac_status" >&5
7952   (exit $ac_status); } &&
7953          { ac_try='test -s conftest.$ac_objext'
7954   { (eval echo "$as_me:7954: \"$ac_try\"") >&5
7955   (eval $ac_try) 2>&5
7956   ac_status=$?
7957   echo "$as_me:7957: \$? = $ac_status" >&5
7958   (exit $ac_status); }; }; then
7959   cf_cv_ncurses_h2=$cf_header
7960
7961 else
7962   echo "$as_me: failed program was:" >&5
7963 cat conftest.$ac_ext >&5
7964 cf_cv_ncurses_h2=no
7965 fi
7966 rm -f conftest.$ac_objext conftest.$ac_ext
7967
7968                         if test "$cf_cv_ncurses_h2" != no ; then
7969                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7970                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7971                                 break
7972                         fi
7973                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7974                 done
7975                 CPPFLAGS="$cf_save2_CPPFLAGS"
7976                 test "$cf_cv_ncurses_h2" != no && break
7977         done
7978         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7978: error: not found" >&5
7979 echo "$as_me: error: not found" >&2;}
7980    { (exit 1); exit 1; }; }
7981
7982 fi
7983 echo "$as_me:7983: result: $cf_cv_ncurses_h2" >&5
7984 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7985
7986         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7987         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7988         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7989                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7990         fi
7991
7992 if test -n "$cf_1st_incdir" ; then
7993   for cf_add_incdir in $cf_1st_incdir
7994   do
7995         while test $cf_add_incdir != /usr/include
7996         do
7997           if test -d $cf_add_incdir
7998           then
7999                 cf_have_incdir=no
8000                 if test -n "$CFLAGS$CPPFLAGS" ; then
8001                   # a loop is needed to ensure we can add subdirs of existing dirs
8002                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8003                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8004                           cf_have_incdir=yes; break
8005                         fi
8006                   done
8007                 fi
8008
8009                 if test "$cf_have_incdir" = no ; then
8010                   if test "$cf_add_incdir" = /usr/local/include ; then
8011                         if test "$GCC" = yes
8012                         then
8013                           cf_save_CPPFLAGS=$CPPFLAGS
8014
8015         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8016         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8017
8018                           cat >conftest.$ac_ext <<_ACEOF
8019 #line 8019 "configure"
8020 #include "confdefs.h"
8021 #include <stdio.h>
8022 int
8023 main (void)
8024 {
8025 printf("Hello")
8026   ;
8027   return 0;
8028 }
8029 _ACEOF
8030 rm -f conftest.$ac_objext
8031 if { (eval echo "$as_me:8031: \"$ac_compile\"") >&5
8032   (eval $ac_compile) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit $ac_status); } &&
8036          { ac_try='test -s conftest.$ac_objext'
8037   { (eval echo "$as_me:8037: \"$ac_try\"") >&5
8038   (eval $ac_try) 2>&5
8039   ac_status=$?
8040   echo "$as_me:8040: \$? = $ac_status" >&5
8041   (exit $ac_status); }; }; then
8042   :
8043 else
8044   echo "$as_me: failed program was:" >&5
8045 cat conftest.$ac_ext >&5
8046 cf_have_incdir=yes
8047 fi
8048 rm -f conftest.$ac_objext conftest.$ac_ext
8049                           CPPFLAGS=$cf_save_CPPFLAGS
8050                         fi
8051                   fi
8052                 fi
8053
8054                 if test "$cf_have_incdir" = no ; then
8055                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8056
8057 echo "${as_me:-configure}:8057: testing adding $cf_add_incdir to include-path ..." 1>&5
8058
8059                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8060
8061                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8062                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8063                   cf_add_incdir="$cf_top_incdir"
8064                 else
8065                   break
8066                 fi
8067           else
8068                 break
8069           fi
8070         done
8071   done
8072 fi
8073
8074 fi
8075
8076 # Set definitions to allow ifdef'ing for ncurses.h
8077
8078 case $cf_cv_ncurses_header in
8079 (*ncurses.h)
8080
8081 cat >>confdefs.h <<\EOF
8082 #define HAVE_NCURSES_H 1
8083 EOF
8084
8085         ;;
8086 esac
8087
8088 case $cf_cv_ncurses_header in
8089 (ncurses/curses.h|ncurses/ncurses.h)
8090
8091 cat >>confdefs.h <<\EOF
8092 #define HAVE_NCURSES_NCURSES_H 1
8093 EOF
8094
8095         ;;
8096 (ncursesw/curses.h|ncursesw/ncurses.h)
8097
8098 cat >>confdefs.h <<\EOF
8099 #define HAVE_NCURSESW_NCURSES_H 1
8100 EOF
8101
8102         ;;
8103 esac
8104
8105 echo "$as_me:8105: checking for terminfo header" >&5
8106 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8107 if test "${cf_cv_term_header+set}" = set; then
8108   echo $ECHO_N "(cached) $ECHO_C" >&6
8109 else
8110
8111 case ${cf_cv_ncurses_header} in
8112 (*/ncurses.h|*/ncursesw.h)
8113         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8114         ;;
8115 (*)
8116         cf_term_header=term.h
8117         ;;
8118 esac
8119
8120 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8121 do
8122 cat >conftest.$ac_ext <<_ACEOF
8123 #line 8123 "configure"
8124 #include "confdefs.h"
8125 #include <stdio.h>
8126 #include <${cf_cv_ncurses_header:-curses.h}>
8127 #include <$cf_test>
8128
8129 int
8130 main (void)
8131 {
8132 int x = auto_left_margin; (void)x
8133   ;
8134   return 0;
8135 }
8136 _ACEOF
8137 rm -f conftest.$ac_objext
8138 if { (eval echo "$as_me:8138: \"$ac_compile\"") >&5
8139   (eval $ac_compile) 2>&5
8140   ac_status=$?
8141   echo "$as_me:8141: \$? = $ac_status" >&5
8142   (exit $ac_status); } &&
8143          { ac_try='test -s conftest.$ac_objext'
8144   { (eval echo "$as_me:8144: \"$ac_try\"") >&5
8145   (eval $ac_try) 2>&5
8146   ac_status=$?
8147   echo "$as_me:8147: \$? = $ac_status" >&5
8148   (exit $ac_status); }; }; then
8149
8150         cf_cv_term_header="$cf_test"
8151 else
8152   echo "$as_me: failed program was:" >&5
8153 cat conftest.$ac_ext >&5
8154
8155         cf_cv_term_header=unknown
8156
8157 fi
8158 rm -f conftest.$ac_objext conftest.$ac_ext
8159         test "$cf_cv_term_header" != unknown && break
8160 done
8161
8162 fi
8163 echo "$as_me:8163: result: $cf_cv_term_header" >&5
8164 echo "${ECHO_T}$cf_cv_term_header" >&6
8165
8166 # Set definitions to allow ifdef'ing to accommodate subdirectories
8167
8168 case $cf_cv_term_header in
8169 (*term.h)
8170
8171 cat >>confdefs.h <<\EOF
8172 #define HAVE_TERM_H 1
8173 EOF
8174
8175         ;;
8176 esac
8177
8178 case $cf_cv_term_header in
8179 (ncurses/term.h)
8180
8181 cat >>confdefs.h <<\EOF
8182 #define HAVE_NCURSES_TERM_H 1
8183 EOF
8184
8185         ;;
8186 (ncursesw/term.h)
8187
8188 cat >>confdefs.h <<\EOF
8189 #define HAVE_NCURSESW_TERM_H 1
8190 EOF
8191
8192         ;;
8193 esac
8194
8195 # some applications need this, but should check for NCURSES_VERSION
8196
8197 cat >>confdefs.h <<\EOF
8198 #define NCURSES 1
8199 EOF
8200
8201 echo "$as_me:8201: checking for ncurses version" >&5
8202 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8203 if test "${cf_cv_ncurses_version+set}" = set; then
8204   echo $ECHO_N "(cached) $ECHO_C" >&6
8205 else
8206
8207         cf_cv_ncurses_version=no
8208         cf_tempfile=out$$
8209         rm -f $cf_tempfile
8210         if test "$cross_compiling" = yes; then
8211
8212         # This will not work if the preprocessor splits the line after the
8213         # Autoconf token.  The 'unproto' program does that.
8214         cat > conftest.$ac_ext <<EOF
8215 #include <${cf_cv_ncurses_header:-curses.h}>
8216 #undef Autoconf
8217 #ifdef NCURSES_VERSION
8218 Autoconf NCURSES_VERSION
8219 #else
8220 #ifdef __NCURSES_H
8221 Autoconf "old"
8222 #endif
8223 ;
8224 #endif
8225 EOF
8226         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8227         { (eval echo "$as_me:8227: \"$cf_try\"") >&5
8228   (eval $cf_try) 2>&5
8229   ac_status=$?
8230   echo "$as_me:8230: \$? = $ac_status" >&5
8231   (exit $ac_status); }
8232         if test -f conftest.out ; then
8233                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8234                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8235                 rm -f conftest.out
8236         fi
8237
8238 else
8239   cat >conftest.$ac_ext <<_ACEOF
8240 #line 8240 "configure"
8241 #include "confdefs.h"
8242
8243 #include <${cf_cv_ncurses_header:-curses.h}>
8244 #include <stdio.h>
8245 int main(void)
8246 {
8247         FILE *fp = fopen("$cf_tempfile", "w");
8248 #ifdef NCURSES_VERSION
8249 # ifdef NCURSES_VERSION_PATCH
8250         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8251 # else
8252         fprintf(fp, "%s\n", NCURSES_VERSION);
8253 # endif
8254 #else
8255 # ifdef __NCURSES_H
8256         fprintf(fp, "old\n");
8257 # else
8258         make an error
8259 # endif
8260 #endif
8261         ${cf_cv_main_return:-return}(0);
8262 }
8263 _ACEOF
8264 rm -f conftest$ac_exeext
8265 if { (eval echo "$as_me:8265: \"$ac_link\"") >&5
8266   (eval $ac_link) 2>&5
8267   ac_status=$?
8268   echo "$as_me:8268: \$? = $ac_status" >&5
8269   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8270   { (eval echo "$as_me:8270: \"$ac_try\"") >&5
8271   (eval $ac_try) 2>&5
8272   ac_status=$?
8273   echo "$as_me:8273: \$? = $ac_status" >&5
8274   (exit $ac_status); }; }; then
8275
8276         cf_cv_ncurses_version=`cat $cf_tempfile`
8277 else
8278   echo "$as_me: program exited with status $ac_status" >&5
8279 echo "$as_me: failed program was:" >&5
8280 cat conftest.$ac_ext >&5
8281 fi
8282 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8283 fi
8284         rm -f $cf_tempfile
8285
8286 fi
8287 echo "$as_me:8287: result: $cf_cv_ncurses_version" >&5
8288 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8289 test "$cf_cv_ncurses_version" = no ||
8290 cat >>confdefs.h <<\EOF
8291 #define NCURSES 1
8292 EOF
8293
8294 cf_nculib_root=ncursesw
8295         # This works, except for the special case where we find gpm, but
8296         # ncurses is in a nonstandard location via $LIBS, and we really want
8297         # to link gpm.
8298 cf_ncurses_LIBS=""
8299 cf_ncurses_SAVE="$LIBS"
8300 echo "$as_me:8300: checking for Gpm_Open in -lgpm" >&5
8301 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8302 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8303   echo $ECHO_N "(cached) $ECHO_C" >&6
8304 else
8305   ac_check_lib_save_LIBS=$LIBS
8306 LIBS="-lgpm  $LIBS"
8307 cat >conftest.$ac_ext <<_ACEOF
8308 #line 8308 "configure"
8309 #include "confdefs.h"
8310
8311 /* Override any gcc2 internal prototype to avoid an error.  */
8312 #ifdef __cplusplus
8313 extern "C"
8314 #endif
8315 /* We use char because int might match the return type of a gcc2
8316    builtin and then its argument prototype would still apply.  */
8317 char Gpm_Open ();
8318 int
8319 main (void)
8320 {
8321 Gpm_Open ();
8322   ;
8323   return 0;
8324 }
8325 _ACEOF
8326 rm -f conftest.$ac_objext conftest$ac_exeext
8327 if { (eval echo "$as_me:8327: \"$ac_link\"") >&5
8328   (eval $ac_link) 2>&5
8329   ac_status=$?
8330   echo "$as_me:8330: \$? = $ac_status" >&5
8331   (exit $ac_status); } &&
8332          { ac_try='test -s conftest$ac_exeext'
8333   { (eval echo "$as_me:8333: \"$ac_try\"") >&5
8334   (eval $ac_try) 2>&5
8335   ac_status=$?
8336   echo "$as_me:8336: \$? = $ac_status" >&5
8337   (exit $ac_status); }; }; then
8338   ac_cv_lib_gpm_Gpm_Open=yes
8339 else
8340   echo "$as_me: failed program was:" >&5
8341 cat conftest.$ac_ext >&5
8342 ac_cv_lib_gpm_Gpm_Open=no
8343 fi
8344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8345 LIBS=$ac_check_lib_save_LIBS
8346 fi
8347 echo "$as_me:8347: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8348 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8349 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8350   echo "$as_me:8350: checking for initscr in -lgpm" >&5
8351 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8352 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8353   echo $ECHO_N "(cached) $ECHO_C" >&6
8354 else
8355   ac_check_lib_save_LIBS=$LIBS
8356 LIBS="-lgpm  $LIBS"
8357 cat >conftest.$ac_ext <<_ACEOF
8358 #line 8358 "configure"
8359 #include "confdefs.h"
8360
8361 /* Override any gcc2 internal prototype to avoid an error.  */
8362 #ifdef __cplusplus
8363 extern "C"
8364 #endif
8365 /* We use char because int might match the return type of a gcc2
8366    builtin and then its argument prototype would still apply.  */
8367 char initscr ();
8368 int
8369 main (void)
8370 {
8371 initscr ();
8372   ;
8373   return 0;
8374 }
8375 _ACEOF
8376 rm -f conftest.$ac_objext conftest$ac_exeext
8377 if { (eval echo "$as_me:8377: \"$ac_link\"") >&5
8378   (eval $ac_link) 2>&5
8379   ac_status=$?
8380   echo "$as_me:8380: \$? = $ac_status" >&5
8381   (exit $ac_status); } &&
8382          { ac_try='test -s conftest$ac_exeext'
8383   { (eval echo "$as_me:8383: \"$ac_try\"") >&5
8384   (eval $ac_try) 2>&5
8385   ac_status=$?
8386   echo "$as_me:8386: \$? = $ac_status" >&5
8387   (exit $ac_status); }; }; then
8388   ac_cv_lib_gpm_initscr=yes
8389 else
8390   echo "$as_me: failed program was:" >&5
8391 cat conftest.$ac_ext >&5
8392 ac_cv_lib_gpm_initscr=no
8393 fi
8394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8395 LIBS=$ac_check_lib_save_LIBS
8396 fi
8397 echo "$as_me:8397: result: $ac_cv_lib_gpm_initscr" >&5
8398 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8399 if test $ac_cv_lib_gpm_initscr = yes; then
8400   LIBS="$cf_ncurses_SAVE"
8401 else
8402   cf_ncurses_LIBS="-lgpm"
8403 fi
8404
8405 fi
8406
8407 case $host_os in
8408 (freebsd*)
8409         # This is only necessary if you are linking against an obsolete
8410         # version of ncurses (but it should do no harm, since it's static).
8411         if test "$cf_nculib_root" = ncurses ; then
8412                 echo "$as_me:8412: checking for tgoto in -lmytinfo" >&5
8413 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8414 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8415   echo $ECHO_N "(cached) $ECHO_C" >&6
8416 else
8417   ac_check_lib_save_LIBS=$LIBS
8418 LIBS="-lmytinfo  $LIBS"
8419 cat >conftest.$ac_ext <<_ACEOF
8420 #line 8420 "configure"
8421 #include "confdefs.h"
8422
8423 /* Override any gcc2 internal prototype to avoid an error.  */
8424 #ifdef __cplusplus
8425 extern "C"
8426 #endif
8427 /* We use char because int might match the return type of a gcc2
8428    builtin and then its argument prototype would still apply.  */
8429 char tgoto ();
8430 int
8431 main (void)
8432 {
8433 tgoto ();
8434   ;
8435   return 0;
8436 }
8437 _ACEOF
8438 rm -f conftest.$ac_objext conftest$ac_exeext
8439 if { (eval echo "$as_me:8439: \"$ac_link\"") >&5
8440   (eval $ac_link) 2>&5
8441   ac_status=$?
8442   echo "$as_me:8442: \$? = $ac_status" >&5
8443   (exit $ac_status); } &&
8444          { ac_try='test -s conftest$ac_exeext'
8445   { (eval echo "$as_me:8445: \"$ac_try\"") >&5
8446   (eval $ac_try) 2>&5
8447   ac_status=$?
8448   echo "$as_me:8448: \$? = $ac_status" >&5
8449   (exit $ac_status); }; }; then
8450   ac_cv_lib_mytinfo_tgoto=yes
8451 else
8452   echo "$as_me: failed program was:" >&5
8453 cat conftest.$ac_ext >&5
8454 ac_cv_lib_mytinfo_tgoto=no
8455 fi
8456 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8457 LIBS=$ac_check_lib_save_LIBS
8458 fi
8459 echo "$as_me:8459: result: $ac_cv_lib_mytinfo_tgoto" >&5
8460 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8461 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8462   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8463 fi
8464
8465         fi
8466         ;;
8467 esac
8468
8469 cf_add_libs="$LIBS"
8470 # reverse order
8471 cf_add_0lib=
8472 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8473 # filter duplicates
8474 for cf_add_1lib in $cf_add_0lib; do
8475         for cf_add_2lib in $cf_add_libs; do
8476                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8477                         cf_add_1lib=
8478                         break
8479                 fi
8480         done
8481         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8482 done
8483 LIBS="$cf_add_libs"
8484
8485 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8486 then
8487
8488 cf_add_libs="$LIBS"
8489 # reverse order
8490 cf_add_0lib=
8491 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8492 # filter duplicates
8493 for cf_add_1lib in $cf_add_0lib; do
8494         for cf_add_2lib in $cf_add_libs; do
8495                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8496                         cf_add_1lib=
8497                         break
8498                 fi
8499         done
8500         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8501 done
8502 LIBS="$cf_add_libs"
8503
8504 else
8505
8506         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8507         cf_libdir=""
8508         echo "$as_me:8508: checking for initscr" >&5
8509 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8510 if test "${ac_cv_func_initscr+set}" = set; then
8511   echo $ECHO_N "(cached) $ECHO_C" >&6
8512 else
8513   cat >conftest.$ac_ext <<_ACEOF
8514 #line 8514 "configure"
8515 #include "confdefs.h"
8516 #define initscr autoconf_temporary
8517 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8518 #undef initscr
8519
8520 #ifdef __cplusplus
8521 extern "C"
8522 #endif
8523
8524 /* We use char because int might match the return type of a gcc2
8525    builtin and then its argument prototype would still apply.  */
8526 char initscr (void);
8527
8528 int
8529 main (void)
8530 {
8531
8532 /* The GNU C library defines stubs for functions which it implements
8533     to always fail with ENOSYS.  Some functions are actually named
8534     something starting with __ and the normal name is an alias.  */
8535 #if defined (__stub_initscr) || defined (__stub___initscr)
8536 #error found stub for initscr
8537 #endif
8538
8539         return initscr ();
8540   ;
8541   return 0;
8542 }
8543 _ACEOF
8544 rm -f conftest.$ac_objext conftest$ac_exeext
8545 if { (eval echo "$as_me:8545: \"$ac_link\"") >&5
8546   (eval $ac_link) 2>&5
8547   ac_status=$?
8548   echo "$as_me:8548: \$? = $ac_status" >&5
8549   (exit $ac_status); } &&
8550          { ac_try='test -s conftest$ac_exeext'
8551   { (eval echo "$as_me:8551: \"$ac_try\"") >&5
8552   (eval $ac_try) 2>&5
8553   ac_status=$?
8554   echo "$as_me:8554: \$? = $ac_status" >&5
8555   (exit $ac_status); }; }; then
8556   ac_cv_func_initscr=yes
8557 else
8558   echo "$as_me: failed program was:" >&5
8559 cat conftest.$ac_ext >&5
8560 ac_cv_func_initscr=no
8561 fi
8562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8563 fi
8564 echo "$as_me:8564: result: $ac_cv_func_initscr" >&5
8565 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8566 if test $ac_cv_func_initscr = yes; then
8567   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8568 else
8569
8570                 cf_save_LIBS="$LIBS"
8571                 echo "$as_me:8571: checking for initscr in -l$cf_nculib_root" >&5
8572 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8573                 LIBS="-l$cf_nculib_root $LIBS"
8574                 cat >conftest.$ac_ext <<_ACEOF
8575 #line 8575 "configure"
8576 #include "confdefs.h"
8577 #include <${cf_cv_ncurses_header:-curses.h}>
8578 int
8579 main (void)
8580 {
8581 initscr()
8582   ;
8583   return 0;
8584 }
8585 _ACEOF
8586 rm -f conftest.$ac_objext conftest$ac_exeext
8587 if { (eval echo "$as_me:8587: \"$ac_link\"") >&5
8588   (eval $ac_link) 2>&5
8589   ac_status=$?
8590   echo "$as_me:8590: \$? = $ac_status" >&5
8591   (exit $ac_status); } &&
8592          { ac_try='test -s conftest$ac_exeext'
8593   { (eval echo "$as_me:8593: \"$ac_try\"") >&5
8594   (eval $ac_try) 2>&5
8595   ac_status=$?
8596   echo "$as_me:8596: \$? = $ac_status" >&5
8597   (exit $ac_status); }; }; then
8598   echo "$as_me:8598: result: yes" >&5
8599 echo "${ECHO_T}yes" >&6
8600                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8601
8602 else
8603   echo "$as_me: failed program was:" >&5
8604 cat conftest.$ac_ext >&5
8605 echo "$as_me:8605: result: no" >&5
8606 echo "${ECHO_T}no" >&6
8607
8608 cf_search=
8609 cf_library_path_list=""
8610 if test -n "${LDFLAGS}${LIBS}" ; then
8611         for cf_library_path in $LDFLAGS $LIBS
8612         do
8613                 case $cf_library_path in
8614                 (-L*)
8615                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8616
8617 test "x$cf_library_path" != "xNONE" && \
8618 test -d "$cf_library_path" && \
8619  {
8620         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8621         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8622         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8623         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8624         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8625         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"
8626 }
8627
8628                         cf_library_path_list="$cf_library_path_list $cf_search"
8629                         ;;
8630                 esac
8631         done
8632 fi
8633
8634 cf_search=
8635
8636 test "x$prefix" != "xNONE" && \
8637 test -d "$prefix" && \
8638  {
8639         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8640         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8641         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8642         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8643         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8644         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8645 }
8646
8647 for cf_subdir_prefix in \
8648         /usr \
8649         /usr/local \
8650         /usr/pkg \
8651         /opt \
8652         /opt/local \
8653         $HOME
8654 do
8655
8656 test "x$cf_subdir_prefix" != "x$prefix" && \
8657 test -d "$cf_subdir_prefix" && \
8658 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8659         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8660         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8661         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8662         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8663         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8664         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"
8665 }
8666
8667 done
8668
8669 cf_search="$cf_library_path_list $cf_search"
8670
8671                         for cf_libdir in $cf_search
8672                         do
8673                                 echo "$as_me:8673: checking for -l$cf_nculib_root in $cf_libdir" >&5
8674 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8675                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8676                                 cat >conftest.$ac_ext <<_ACEOF
8677 #line 8677 "configure"
8678 #include "confdefs.h"
8679 #include <${cf_cv_ncurses_header:-curses.h}>
8680 int
8681 main (void)
8682 {
8683 initscr()
8684   ;
8685   return 0;
8686 }
8687 _ACEOF
8688 rm -f conftest.$ac_objext conftest$ac_exeext
8689 if { (eval echo "$as_me:8689: \"$ac_link\"") >&5
8690   (eval $ac_link) 2>&5
8691   ac_status=$?
8692   echo "$as_me:8692: \$? = $ac_status" >&5
8693   (exit $ac_status); } &&
8694          { ac_try='test -s conftest$ac_exeext'
8695   { (eval echo "$as_me:8695: \"$ac_try\"") >&5
8696   (eval $ac_try) 2>&5
8697   ac_status=$?
8698   echo "$as_me:8698: \$? = $ac_status" >&5
8699   (exit $ac_status); }; }; then
8700   echo "$as_me:8700: result: yes" >&5
8701 echo "${ECHO_T}yes" >&6
8702                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8703                                          break
8704 else
8705   echo "$as_me: failed program was:" >&5
8706 cat conftest.$ac_ext >&5
8707 echo "$as_me:8707: result: no" >&5
8708 echo "${ECHO_T}no" >&6
8709                                          LIBS="$cf_save_LIBS"
8710 fi
8711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8712                         done
8713
8714 fi
8715 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8716
8717 fi
8718
8719 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8720
8721 if test $cf_found_library = no ; then
8722         { { echo "$as_me:8722: error: Cannot link $cf_nculib_root library" >&5
8723 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8724    { (exit 1); exit 1; }; }
8725 fi
8726
8727 fi
8728
8729 if test -n "$cf_ncurses_LIBS" ; then
8730         echo "$as_me:8730: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8731 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8732         cf_ncurses_SAVE="$LIBS"
8733         for p in $cf_ncurses_LIBS ; do
8734                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8735                 if test "$q" != "$LIBS" ; then
8736                         LIBS="$q"
8737                 fi
8738         done
8739         cat >conftest.$ac_ext <<_ACEOF
8740 #line 8740 "configure"
8741 #include "confdefs.h"
8742 #include <${cf_cv_ncurses_header:-curses.h}>
8743 int
8744 main (void)
8745 {
8746 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8747   ;
8748   return 0;
8749 }
8750 _ACEOF
8751 rm -f conftest.$ac_objext conftest$ac_exeext
8752 if { (eval echo "$as_me:8752: \"$ac_link\"") >&5
8753   (eval $ac_link) 2>&5
8754   ac_status=$?
8755   echo "$as_me:8755: \$? = $ac_status" >&5
8756   (exit $ac_status); } &&
8757          { ac_try='test -s conftest$ac_exeext'
8758   { (eval echo "$as_me:8758: \"$ac_try\"") >&5
8759   (eval $ac_try) 2>&5
8760   ac_status=$?
8761   echo "$as_me:8761: \$? = $ac_status" >&5
8762   (exit $ac_status); }; }; then
8763   echo "$as_me:8763: result: yes" >&5
8764 echo "${ECHO_T}yes" >&6
8765 else
8766   echo "$as_me: failed program was:" >&5
8767 cat conftest.$ac_ext >&5
8768 echo "$as_me:8768: result: no" >&5
8769 echo "${ECHO_T}no" >&6
8770                  LIBS="$cf_ncurses_SAVE"
8771 fi
8772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8773 fi
8774
8775 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8776
8777 cat >>confdefs.h <<EOF
8778 #define $cf_nculib_ROOT 1
8779 EOF
8780
8781         fi
8782 else
8783         NCURSES_CONFIG=none
8784 fi
8785
8786 else
8787
8788 cf_ncuconfig_root=ncurses
8789 cf_have_ncuconfig=no
8790
8791 if test "x${PKG_CONFIG:=none}" != xnone; then
8792         echo "$as_me:8792: checking pkg-config for $cf_ncuconfig_root" >&5
8793 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8794         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8795                 echo "$as_me:8795: result: yes" >&5
8796 echo "${ECHO_T}yes" >&6
8797
8798                 echo "$as_me:8798: checking if the $cf_ncuconfig_root package files work" >&5
8799 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8800                 cf_have_ncuconfig=unknown
8801
8802                 cf_save_CFLAGS="$CFLAGS"
8803                 cf_save_CPPFLAGS="$CPPFLAGS"
8804                 cf_save_LIBS="$LIBS"
8805
8806                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8807                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8808
8809                 # while -W for passing linker flags is prevalent, it is not "standard".
8810                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8811                 # incompatible _and_ non-standard -W option which gives an error.  Work
8812                 # around that pitfall.
8813                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8814                 (x*c[89]9@@*-W*)
8815
8816 cf_fix_cppflags=no
8817 cf_new_cflags=
8818 cf_new_cppflags=
8819 cf_new_extra_cppflags=
8820
8821 for cf_add_cflags in $cf_pkg_cflags
8822 do
8823 case $cf_fix_cppflags in
8824 (no)
8825         case $cf_add_cflags in
8826         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8827                 case $cf_add_cflags in
8828                 (-D*)
8829                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8830
8831                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8832                                 && test -z "${cf_tst_cflags}" \
8833                                 && cf_fix_cppflags=yes
8834
8835                         if test $cf_fix_cppflags = yes ; then
8836
8837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8839
8840                                 continue
8841                         elif test "${cf_tst_cflags}" = "\"'" ; then
8842
8843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8845
8846                                 continue
8847                         fi
8848                         ;;
8849                 esac
8850                 case "$CPPFLAGS" in
8851                 (*$cf_add_cflags)
8852                         ;;
8853                 (*)
8854                         case $cf_add_cflags in
8855                         (-D*)
8856                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8857
8858 CPPFLAGS=`echo "$CPPFLAGS" | \
8859         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8860                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8861
8862                                 ;;
8863                         esac
8864
8865         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8866         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8867
8868                         ;;
8869                 esac
8870                 ;;
8871         (*)
8872
8873         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8874         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8875
8876                 ;;
8877         esac
8878         ;;
8879 (yes)
8880
8881         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8882         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8883
8884         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8885
8886         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8887                 && test -z "${cf_tst_cflags}" \
8888                 && cf_fix_cppflags=no
8889         ;;
8890 esac
8891 done
8892
8893 if test -n "$cf_new_cflags" ; then
8894
8895         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8896         CFLAGS="${CFLAGS}$cf_new_cflags"
8897
8898 fi
8899
8900 if test -n "$cf_new_cppflags" ; then
8901
8902         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8903         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8904
8905 fi
8906
8907 if test -n "$cf_new_extra_cppflags" ; then
8908
8909         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8910         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8911
8912 fi
8913
8914 cf_add_libs="$LIBS"
8915 # reverse order
8916 cf_add_0lib=
8917 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8918 # filter duplicates
8919 for cf_add_1lib in $cf_add_0lib; do
8920         for cf_add_2lib in $cf_add_libs; do
8921                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8922                         cf_add_1lib=
8923                         break
8924                 fi
8925         done
8926         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8927 done
8928 LIBS="$cf_add_libs"
8929
8930                         cat >conftest.$ac_ext <<_ACEOF
8931 #line 8931 "configure"
8932 #include "confdefs.h"
8933 #include <${cf_cv_ncurses_header:-curses.h}>
8934 int
8935 main (void)
8936 {
8937 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8938   ;
8939   return 0;
8940 }
8941 _ACEOF
8942 rm -f conftest.$ac_objext conftest$ac_exeext
8943 if { (eval echo "$as_me:8943: \"$ac_link\"") >&5
8944   (eval $ac_link) 2>&5
8945   ac_status=$?
8946   echo "$as_me:8946: \$? = $ac_status" >&5
8947   (exit $ac_status); } &&
8948          { ac_try='test -s conftest$ac_exeext'
8949   { (eval echo "$as_me:8949: \"$ac_try\"") >&5
8950   (eval $ac_try) 2>&5
8951   ac_status=$?
8952   echo "$as_me:8952: \$? = $ac_status" >&5
8953   (exit $ac_status); }; }; then
8954   if test "$cross_compiling" = yes; then
8955   cf_test_ncuconfig=maybe
8956 else
8957   cat >conftest.$ac_ext <<_ACEOF
8958 #line 8958 "configure"
8959 #include "confdefs.h"
8960 #include <${cf_cv_ncurses_header:-curses.h}>
8961                                         int main(void)
8962                                         { char *xx = curses_version(); return (xx == 0); }
8963 _ACEOF
8964 rm -f conftest$ac_exeext
8965 if { (eval echo "$as_me:8965: \"$ac_link\"") >&5
8966   (eval $ac_link) 2>&5
8967   ac_status=$?
8968   echo "$as_me:8968: \$? = $ac_status" >&5
8969   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8970   { (eval echo "$as_me:8970: \"$ac_try\"") >&5
8971   (eval $ac_try) 2>&5
8972   ac_status=$?
8973   echo "$as_me:8973: \$? = $ac_status" >&5
8974   (exit $ac_status); }; }; then
8975   cf_test_ncuconfig=yes
8976 else
8977   echo "$as_me: program exited with status $ac_status" >&5
8978 echo "$as_me: failed program was:" >&5
8979 cat conftest.$ac_ext >&5
8980 cf_test_ncuconfig=no
8981 fi
8982 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8983 fi
8984 else
8985   echo "$as_me: failed program was:" >&5
8986 cat conftest.$ac_ext >&5
8987 cf_test_ncuconfig=no
8988 fi
8989 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8990
8991                         CFLAGS="$cf_save_CFLAGS"
8992                         CPPFLAGS="$cf_save_CPPFLAGS"
8993                         LIBS="$cf_save_LIBS"
8994
8995                         if test "x$cf_test_ncuconfig" != xyes; then
8996                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8997                                 cf_pkg_cflags="$cf_temp"
8998                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8999                                 cf_pkg_libs="$cf_temp"
9000                         fi
9001                         ;;
9002                 esac
9003
9004 cf_fix_cppflags=no
9005 cf_new_cflags=
9006 cf_new_cppflags=
9007 cf_new_extra_cppflags=
9008
9009 for cf_add_cflags in $cf_pkg_cflags
9010 do
9011 case $cf_fix_cppflags in
9012 (no)
9013         case $cf_add_cflags in
9014         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9015                 case $cf_add_cflags in
9016                 (-D*)
9017                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9018
9019                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9020                                 && test -z "${cf_tst_cflags}" \
9021                                 && cf_fix_cppflags=yes
9022
9023                         if test $cf_fix_cppflags = yes ; then
9024
9025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9027
9028                                 continue
9029                         elif test "${cf_tst_cflags}" = "\"'" ; then
9030
9031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9033
9034                                 continue
9035                         fi
9036                         ;;
9037                 esac
9038                 case "$CPPFLAGS" in
9039                 (*$cf_add_cflags)
9040                         ;;
9041                 (*)
9042                         case $cf_add_cflags in
9043                         (-D*)
9044                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9045
9046 CPPFLAGS=`echo "$CPPFLAGS" | \
9047         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9048                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9049
9050                                 ;;
9051                         esac
9052
9053         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9054         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9055
9056                         ;;
9057                 esac
9058                 ;;
9059         (*)
9060
9061         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9062         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9063
9064                 ;;
9065         esac
9066         ;;
9067 (yes)
9068
9069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9071
9072         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9073
9074         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9075                 && test -z "${cf_tst_cflags}" \
9076                 && cf_fix_cppflags=no
9077         ;;
9078 esac
9079 done
9080
9081 if test -n "$cf_new_cflags" ; then
9082
9083         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9084         CFLAGS="${CFLAGS}$cf_new_cflags"
9085
9086 fi
9087
9088 if test -n "$cf_new_cppflags" ; then
9089
9090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9091         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9092
9093 fi
9094
9095 if test -n "$cf_new_extra_cppflags" ; then
9096
9097         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9098         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9099
9100 fi
9101
9102 cf_add_libs="$LIBS"
9103 # reverse order
9104 cf_add_0lib=
9105 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9106 # filter duplicates
9107 for cf_add_1lib in $cf_add_0lib; do
9108         for cf_add_2lib in $cf_add_libs; do
9109                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9110                         cf_add_1lib=
9111                         break
9112                 fi
9113         done
9114         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9115 done
9116 LIBS="$cf_add_libs"
9117
9118                 cat >conftest.$ac_ext <<_ACEOF
9119 #line 9119 "configure"
9120 #include "confdefs.h"
9121 #include <${cf_cv_ncurses_header:-curses.h}>
9122 int
9123 main (void)
9124 {
9125 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9126   ;
9127   return 0;
9128 }
9129 _ACEOF
9130 rm -f conftest.$ac_objext conftest$ac_exeext
9131 if { (eval echo "$as_me:9131: \"$ac_link\"") >&5
9132   (eval $ac_link) 2>&5
9133   ac_status=$?
9134   echo "$as_me:9134: \$? = $ac_status" >&5
9135   (exit $ac_status); } &&
9136          { ac_try='test -s conftest$ac_exeext'
9137   { (eval echo "$as_me:9137: \"$ac_try\"") >&5
9138   (eval $ac_try) 2>&5
9139   ac_status=$?
9140   echo "$as_me:9140: \$? = $ac_status" >&5
9141   (exit $ac_status); }; }; then
9142   if test "$cross_compiling" = yes; then
9143   cf_have_ncuconfig=maybe
9144 else
9145   cat >conftest.$ac_ext <<_ACEOF
9146 #line 9146 "configure"
9147 #include "confdefs.h"
9148 #include <${cf_cv_ncurses_header:-curses.h}>
9149                                 int main(void)
9150                                 { char *xx = curses_version(); return (xx == 0); }
9151 _ACEOF
9152 rm -f conftest$ac_exeext
9153 if { (eval echo "$as_me:9153: \"$ac_link\"") >&5
9154   (eval $ac_link) 2>&5
9155   ac_status=$?
9156   echo "$as_me:9156: \$? = $ac_status" >&5
9157   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9158   { (eval echo "$as_me:9158: \"$ac_try\"") >&5
9159   (eval $ac_try) 2>&5
9160   ac_status=$?
9161   echo "$as_me:9161: \$? = $ac_status" >&5
9162   (exit $ac_status); }; }; then
9163   cf_have_ncuconfig=yes
9164 else
9165   echo "$as_me: program exited with status $ac_status" >&5
9166 echo "$as_me: failed program was:" >&5
9167 cat conftest.$ac_ext >&5
9168 cf_have_ncuconfig=no
9169 fi
9170 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9171 fi
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat conftest.$ac_ext >&5
9175 cf_have_ncuconfig=no
9176 fi
9177 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9178                 echo "$as_me:9178: result: $cf_have_ncuconfig" >&5
9179 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9180                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9181                 if test "$cf_have_ncuconfig" != "yes"
9182                 then
9183                         CPPFLAGS="$cf_save_CPPFLAGS"
9184                         LIBS="$cf_save_LIBS"
9185                         NCURSES_CONFIG_PKG=none
9186                 else
9187
9188 cat >>confdefs.h <<\EOF
9189 #define NCURSES 1
9190 EOF
9191
9192                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9193
9194 echo "$as_me:9194: checking for terminfo header" >&5
9195 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9196 if test "${cf_cv_term_header+set}" = set; then
9197   echo $ECHO_N "(cached) $ECHO_C" >&6
9198 else
9199
9200 case ${cf_cv_ncurses_header} in
9201 (*/ncurses.h|*/ncursesw.h)
9202         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9203         ;;
9204 (*)
9205         cf_term_header=term.h
9206         ;;
9207 esac
9208
9209 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9210 do
9211 cat >conftest.$ac_ext <<_ACEOF
9212 #line 9212 "configure"
9213 #include "confdefs.h"
9214 #include <stdio.h>
9215 #include <${cf_cv_ncurses_header:-curses.h}>
9216 #include <$cf_test>
9217
9218 int
9219 main (void)
9220 {
9221 int x = auto_left_margin; (void)x
9222   ;
9223   return 0;
9224 }
9225 _ACEOF
9226 rm -f conftest.$ac_objext
9227 if { (eval echo "$as_me:9227: \"$ac_compile\"") >&5
9228   (eval $ac_compile) 2>&5
9229   ac_status=$?
9230   echo "$as_me:9230: \$? = $ac_status" >&5
9231   (exit $ac_status); } &&
9232          { ac_try='test -s conftest.$ac_objext'
9233   { (eval echo "$as_me:9233: \"$ac_try\"") >&5
9234   (eval $ac_try) 2>&5
9235   ac_status=$?
9236   echo "$as_me:9236: \$? = $ac_status" >&5
9237   (exit $ac_status); }; }; then
9238
9239         cf_cv_term_header="$cf_test"
9240 else
9241   echo "$as_me: failed program was:" >&5
9242 cat conftest.$ac_ext >&5
9243
9244         cf_cv_term_header=unknown
9245
9246 fi
9247 rm -f conftest.$ac_objext conftest.$ac_ext
9248         test "$cf_cv_term_header" != unknown && break
9249 done
9250
9251 fi
9252 echo "$as_me:9252: result: $cf_cv_term_header" >&5
9253 echo "${ECHO_T}$cf_cv_term_header" >&6
9254
9255 # Set definitions to allow ifdef'ing to accommodate subdirectories
9256
9257 case $cf_cv_term_header in
9258 (*term.h)
9259
9260 cat >>confdefs.h <<\EOF
9261 #define HAVE_TERM_H 1
9262 EOF
9263
9264         ;;
9265 esac
9266
9267 case $cf_cv_term_header in
9268 (ncurses/term.h)
9269
9270 cat >>confdefs.h <<\EOF
9271 #define HAVE_NCURSES_TERM_H 1
9272 EOF
9273
9274         ;;
9275 (ncursesw/term.h)
9276
9277 cat >>confdefs.h <<\EOF
9278 #define HAVE_NCURSESW_TERM_H 1
9279 EOF
9280
9281         ;;
9282 esac
9283
9284                 fi
9285
9286         else
9287                 echo "$as_me:9287: result: no" >&5
9288 echo "${ECHO_T}no" >&6
9289                 NCURSES_CONFIG_PKG=none
9290         fi
9291 else
9292         NCURSES_CONFIG_PKG=none
9293 fi
9294
9295 if test "x$cf_have_ncuconfig" = "xno"; then
9296         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9297
9298 if test -n "$ac_tool_prefix"; then
9299   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9300   do
9301     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9302 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9303 echo "$as_me:9303: checking for $ac_word" >&5
9304 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9305 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9306   echo $ECHO_N "(cached) $ECHO_C" >&6
9307 else
9308   if test -n "$NCURSES_CONFIG"; then
9309   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9310 else
9311   ac_save_IFS=$IFS; IFS=$ac_path_separator
9312 ac_dummy="$PATH"
9313 for ac_dir in $ac_dummy; do
9314   IFS=$ac_save_IFS
9315   test -z "$ac_dir" && ac_dir=.
9316   $as_executable_p "$ac_dir/$ac_word" || continue
9317 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9318 echo "$as_me:9318: found $ac_dir/$ac_word" >&5
9319 break
9320 done
9321
9322 fi
9323 fi
9324 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9325 if test -n "$NCURSES_CONFIG"; then
9326   echo "$as_me:9326: result: $NCURSES_CONFIG" >&5
9327 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9328 else
9329   echo "$as_me:9329: result: no" >&5
9330 echo "${ECHO_T}no" >&6
9331 fi
9332
9333     test -n "$NCURSES_CONFIG" && break
9334   done
9335 fi
9336 if test -z "$NCURSES_CONFIG"; then
9337   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9338   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9339 do
9340   # Extract the first word of "$ac_prog", so it can be a program name with args.
9341 set dummy $ac_prog; ac_word=$2
9342 echo "$as_me:9342: checking for $ac_word" >&5
9343 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9344 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9345   echo $ECHO_N "(cached) $ECHO_C" >&6
9346 else
9347   if test -n "$ac_ct_NCURSES_CONFIG"; then
9348   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9349 else
9350   ac_save_IFS=$IFS; IFS=$ac_path_separator
9351 ac_dummy="$PATH"
9352 for ac_dir in $ac_dummy; do
9353   IFS=$ac_save_IFS
9354   test -z "$ac_dir" && ac_dir=.
9355   $as_executable_p "$ac_dir/$ac_word" || continue
9356 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9357 echo "$as_me:9357: found $ac_dir/$ac_word" >&5
9358 break
9359 done
9360
9361 fi
9362 fi
9363 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9364 if test -n "$ac_ct_NCURSES_CONFIG"; then
9365   echo "$as_me:9365: result: $ac_ct_NCURSES_CONFIG" >&5
9366 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9367 else
9368   echo "$as_me:9368: result: no" >&5
9369 echo "${ECHO_T}no" >&6
9370 fi
9371
9372   test -n "$ac_ct_NCURSES_CONFIG" && break
9373 done
9374 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9375
9376   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9377 fi
9378
9379         if test "$NCURSES_CONFIG" != none ; then
9380
9381 cf_fix_cppflags=no
9382 cf_new_cflags=
9383 cf_new_cppflags=
9384 cf_new_extra_cppflags=
9385
9386 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9387 do
9388 case $cf_fix_cppflags in
9389 (no)
9390         case $cf_add_cflags in
9391         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9392                 case $cf_add_cflags in
9393                 (-D*)
9394                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9395
9396                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9397                                 && test -z "${cf_tst_cflags}" \
9398                                 && cf_fix_cppflags=yes
9399
9400                         if test $cf_fix_cppflags = yes ; then
9401
9402         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9403         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9404
9405                                 continue
9406                         elif test "${cf_tst_cflags}" = "\"'" ; then
9407
9408         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9409         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9410
9411                                 continue
9412                         fi
9413                         ;;
9414                 esac
9415                 case "$CPPFLAGS" in
9416                 (*$cf_add_cflags)
9417                         ;;
9418                 (*)
9419                         case $cf_add_cflags in
9420                         (-D*)
9421                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9422
9423 CPPFLAGS=`echo "$CPPFLAGS" | \
9424         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9425                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9426
9427                                 ;;
9428                         esac
9429
9430         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9431         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9432
9433                         ;;
9434                 esac
9435                 ;;
9436         (*)
9437
9438         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9439         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9440
9441                 ;;
9442         esac
9443         ;;
9444 (yes)
9445
9446         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9447         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9448
9449         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9450
9451         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9452                 && test -z "${cf_tst_cflags}" \
9453                 && cf_fix_cppflags=no
9454         ;;
9455 esac
9456 done
9457
9458 if test -n "$cf_new_cflags" ; then
9459
9460         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9461         CFLAGS="${CFLAGS}$cf_new_cflags"
9462
9463 fi
9464
9465 if test -n "$cf_new_cppflags" ; then
9466
9467         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9468         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9469
9470 fi
9471
9472 if test -n "$cf_new_extra_cppflags" ; then
9473
9474         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9475         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9476
9477 fi
9478
9479 cf_add_libs="$LIBS"
9480 # reverse order
9481 cf_add_0lib=
9482 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9483 # filter duplicates
9484 for cf_add_1lib in $cf_add_0lib; do
9485         for cf_add_2lib in $cf_add_libs; do
9486                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9487                         cf_add_1lib=
9488                         break
9489                 fi
9490         done
9491         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9492 done
9493 LIBS="$cf_add_libs"
9494
9495                 # even with config script, some packages use no-override for curses.h
9496
9497 echo "$as_me:9497: checking if we have identified curses headers" >&5
9498 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9499 if test "${cf_cv_ncurses_header+set}" = set; then
9500   echo $ECHO_N "(cached) $ECHO_C" >&6
9501 else
9502
9503 cf_cv_ncurses_header=none
9504 for cf_header in \
9505         ncurses.h ncurses/ncurses.h \
9506         curses.h ncurses/curses.h
9507 do
9508 cat >conftest.$ac_ext <<_ACEOF
9509 #line 9509 "configure"
9510 #include "confdefs.h"
9511 #include <${cf_header}>
9512 int
9513 main (void)
9514 {
9515 initscr(); tgoto("?", 0,0)
9516   ;
9517   return 0;
9518 }
9519 _ACEOF
9520 rm -f conftest.$ac_objext
9521 if { (eval echo "$as_me:9521: \"$ac_compile\"") >&5
9522   (eval $ac_compile) 2>&5
9523   ac_status=$?
9524   echo "$as_me:9524: \$? = $ac_status" >&5
9525   (exit $ac_status); } &&
9526          { ac_try='test -s conftest.$ac_objext'
9527   { (eval echo "$as_me:9527: \"$ac_try\"") >&5
9528   (eval $ac_try) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); }; }; then
9532   cf_cv_ncurses_header=$cf_header; break
9533 else
9534   echo "$as_me: failed program was:" >&5
9535 cat conftest.$ac_ext >&5
9536 fi
9537 rm -f conftest.$ac_objext conftest.$ac_ext
9538 done
9539
9540 fi
9541 echo "$as_me:9541: result: $cf_cv_ncurses_header" >&5
9542 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9543
9544 if test "$cf_cv_ncurses_header" = none ; then
9545         { { echo "$as_me:9545: error: No curses header-files found" >&5
9546 echo "$as_me: error: No curses header-files found" >&2;}
9547    { (exit 1); exit 1; }; }
9548 fi
9549
9550 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9551
9552 for ac_header in $cf_cv_ncurses_header
9553 do
9554 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9555 echo "$as_me:9555: checking for $ac_header" >&5
9556 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9557 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9558   echo $ECHO_N "(cached) $ECHO_C" >&6
9559 else
9560   cat >conftest.$ac_ext <<_ACEOF
9561 #line 9561 "configure"
9562 #include "confdefs.h"
9563 #include <$ac_header>
9564 _ACEOF
9565 if { (eval echo "$as_me:9565: \"$ac_cpp conftest.$ac_ext\"") >&5
9566   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9567   ac_status=$?
9568   egrep -v '^ *\+' conftest.er1 >conftest.err
9569   rm -f conftest.er1
9570   cat conftest.err >&5
9571   echo "$as_me:9571: \$? = $ac_status" >&5
9572   (exit $ac_status); } >/dev/null; then
9573   if test -s conftest.err; then
9574     ac_cpp_err=$ac_c_preproc_warn_flag
9575   else
9576     ac_cpp_err=
9577   fi
9578 else
9579   ac_cpp_err=yes
9580 fi
9581 if test -z "$ac_cpp_err"; then
9582   eval "$as_ac_Header=yes"
9583 else
9584   echo "$as_me: failed program was:" >&5
9585   cat conftest.$ac_ext >&5
9586   eval "$as_ac_Header=no"
9587 fi
9588 rm -f conftest.err conftest.$ac_ext
9589 fi
9590 echo "$as_me:9590: result: `eval echo '${'$as_ac_Header'}'`" >&5
9591 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9592 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9593   cat >>confdefs.h <<EOF
9594 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9595 EOF
9596
9597 fi
9598 done
9599
9600 cat >>confdefs.h <<\EOF
9601 #define NCURSES 1
9602 EOF
9603
9604 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9605
9606                 cat >>confdefs.h <<EOF
9607 #define $cf_nculib_ROOT 1
9608 EOF
9609
9610                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9611
9612         else
9613
9614 cf_ncuhdr_root=ncurses
9615
9616 test -n "$cf_cv_curses_dir" && \
9617 test "$cf_cv_curses_dir" != "no" && { \
9618
9619 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9620   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9621   do
9622         while test $cf_add_incdir != /usr/include
9623         do
9624           if test -d $cf_add_incdir
9625           then
9626                 cf_have_incdir=no
9627                 if test -n "$CFLAGS$CPPFLAGS" ; then
9628                   # a loop is needed to ensure we can add subdirs of existing dirs
9629                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9630                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9631                           cf_have_incdir=yes; break
9632                         fi
9633                   done
9634                 fi
9635
9636                 if test "$cf_have_incdir" = no ; then
9637                   if test "$cf_add_incdir" = /usr/local/include ; then
9638                         if test "$GCC" = yes
9639                         then
9640                           cf_save_CPPFLAGS=$CPPFLAGS
9641
9642         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9643         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9644
9645                           cat >conftest.$ac_ext <<_ACEOF
9646 #line 9646 "configure"
9647 #include "confdefs.h"
9648 #include <stdio.h>
9649 int
9650 main (void)
9651 {
9652 printf("Hello")
9653   ;
9654   return 0;
9655 }
9656 _ACEOF
9657 rm -f conftest.$ac_objext
9658 if { (eval echo "$as_me:9658: \"$ac_compile\"") >&5
9659   (eval $ac_compile) 2>&5
9660   ac_status=$?
9661   echo "$as_me:9661: \$? = $ac_status" >&5
9662   (exit $ac_status); } &&
9663          { ac_try='test -s conftest.$ac_objext'
9664   { (eval echo "$as_me:9664: \"$ac_try\"") >&5
9665   (eval $ac_try) 2>&5
9666   ac_status=$?
9667   echo "$as_me:9667: \$? = $ac_status" >&5
9668   (exit $ac_status); }; }; then
9669   :
9670 else
9671   echo "$as_me: failed program was:" >&5
9672 cat conftest.$ac_ext >&5
9673 cf_have_incdir=yes
9674 fi
9675 rm -f conftest.$ac_objext conftest.$ac_ext
9676                           CPPFLAGS=$cf_save_CPPFLAGS
9677                         fi
9678                   fi
9679                 fi
9680
9681                 if test "$cf_have_incdir" = no ; then
9682                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9683
9684 echo "${as_me:-configure}:9684: testing adding $cf_add_incdir to include-path ..." 1>&5
9685
9686                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9687
9688                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9689                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9690                   cf_add_incdir="$cf_top_incdir"
9691                 else
9692                   break
9693                 fi
9694           else
9695                 break
9696           fi
9697         done
9698   done
9699 fi
9700
9701 }
9702
9703 echo "$as_me:9703: checking for $cf_ncuhdr_root header in include-path" >&5
9704 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9705 if test "${cf_cv_ncurses_h+set}" = set; then
9706   echo $ECHO_N "(cached) $ECHO_C" >&6
9707 else
9708
9709         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9710         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9711         for cf_header in $cf_header_list
9712         do
9713
9714         cat >conftest.$ac_ext <<_ACEOF
9715 #line 9715 "configure"
9716 #include "confdefs.h"
9717
9718 #include <$cf_header>
9719 int
9720 main (void)
9721 {
9722
9723 #ifdef NCURSES_VERSION
9724
9725 printf("%s\n", NCURSES_VERSION);
9726 #else
9727 #ifdef __NCURSES_H
9728 printf("old\n");
9729 #else
9730         make an error
9731 #endif
9732 #endif
9733
9734   ;
9735   return 0;
9736 }
9737 _ACEOF
9738 rm -f conftest.$ac_objext
9739 if { (eval echo "$as_me:9739: \"$ac_compile\"") >&5
9740   (eval $ac_compile) 2>&5
9741   ac_status=$?
9742   echo "$as_me:9742: \$? = $ac_status" >&5
9743   (exit $ac_status); } &&
9744          { ac_try='test -s conftest.$ac_objext'
9745   { (eval echo "$as_me:9745: \"$ac_try\"") >&5
9746   (eval $ac_try) 2>&5
9747   ac_status=$?
9748   echo "$as_me:9748: \$? = $ac_status" >&5
9749   (exit $ac_status); }; }; then
9750   cf_cv_ncurses_h=$cf_header
9751
9752 else
9753   echo "$as_me: failed program was:" >&5
9754 cat conftest.$ac_ext >&5
9755 cf_cv_ncurses_h=no
9756 fi
9757 rm -f conftest.$ac_objext conftest.$ac_ext
9758
9759                 test "$cf_cv_ncurses_h" != no && break
9760         done
9761
9762 fi
9763 echo "$as_me:9763: result: $cf_cv_ncurses_h" >&5
9764 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9765
9766 if test "$cf_cv_ncurses_h" != no ; then
9767         cf_cv_ncurses_header=$cf_cv_ncurses_h
9768 else
9769
9770 echo "$as_me:9770: checking for $cf_ncuhdr_root include-path" >&5
9771 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9772 if test "${cf_cv_ncurses_h2+set}" = set; then
9773   echo $ECHO_N "(cached) $ECHO_C" >&6
9774 else
9775
9776         test -n "$verbose" && echo
9777
9778 cf_search=
9779
9780 # collect the current set of include-directories from compiler flags
9781 cf_header_path_list=""
9782 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9783         for cf_header_path in $CPPFLAGS $CFLAGS
9784         do
9785                 case $cf_header_path in
9786                 (-I*)
9787                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9788
9789 test "x$cf_header_path" != "xNONE" && \
9790 test -d "$cf_header_path" && \
9791  {
9792         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9793         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9794         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9795         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9796         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9797         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"
9798 }
9799
9800                         cf_header_path_list="$cf_header_path_list $cf_search"
9801                         ;;
9802                 esac
9803         done
9804 fi
9805
9806 # add the variations for the package we are looking for
9807
9808 cf_search=
9809
9810 test "x$prefix" != "xNONE" && \
9811 test -d "$prefix" && \
9812  {
9813         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9814         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9815         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9816         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9817         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9818         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9819 }
9820
9821 for cf_subdir_prefix in \
9822         /usr \
9823         /usr/local \
9824         /usr/pkg \
9825         /opt \
9826         /opt/local \
9827         $HOME
9828 do
9829
9830 test "x$cf_subdir_prefix" != "x$prefix" && \
9831 test -d "$cf_subdir_prefix" && \
9832 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9833         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9834         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9835         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9836         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9837         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9838         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"
9839 }
9840
9841 done
9842
9843 test "$includedir" != NONE && \
9844 test "$includedir" != "/usr/include" && \
9845 test -d "$includedir" && {
9846         test -d $includedir &&    cf_search="$cf_search $includedir"
9847         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9848 }
9849
9850 test "$oldincludedir" != NONE && \
9851 test "$oldincludedir" != "/usr/include" && \
9852 test -d "$oldincludedir" && {
9853         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9854         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9855 }
9856
9857 cf_search="$cf_search $cf_header_path_list"
9858
9859         test -n "$verbose" && echo search path $cf_search
9860         cf_save2_CPPFLAGS="$CPPFLAGS"
9861         for cf_incdir in $cf_search
9862         do
9863
9864 if test -n "$cf_incdir" ; then
9865   for cf_add_incdir in $cf_incdir
9866   do
9867         while test $cf_add_incdir != /usr/include
9868         do
9869           if test -d $cf_add_incdir
9870           then
9871                 cf_have_incdir=no
9872                 if test -n "$CFLAGS$CPPFLAGS" ; then
9873                   # a loop is needed to ensure we can add subdirs of existing dirs
9874                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9875                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9876                           cf_have_incdir=yes; break
9877                         fi
9878                   done
9879                 fi
9880
9881                 if test "$cf_have_incdir" = no ; then
9882                   if test "$cf_add_incdir" = /usr/local/include ; then
9883                         if test "$GCC" = yes
9884                         then
9885                           cf_save_CPPFLAGS=$CPPFLAGS
9886
9887         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9888         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9889
9890                           cat >conftest.$ac_ext <<_ACEOF
9891 #line 9891 "configure"
9892 #include "confdefs.h"
9893 #include <stdio.h>
9894 int
9895 main (void)
9896 {
9897 printf("Hello")
9898   ;
9899   return 0;
9900 }
9901 _ACEOF
9902 rm -f conftest.$ac_objext
9903 if { (eval echo "$as_me:9903: \"$ac_compile\"") >&5
9904   (eval $ac_compile) 2>&5
9905   ac_status=$?
9906   echo "$as_me:9906: \$? = $ac_status" >&5
9907   (exit $ac_status); } &&
9908          { ac_try='test -s conftest.$ac_objext'
9909   { (eval echo "$as_me:9909: \"$ac_try\"") >&5
9910   (eval $ac_try) 2>&5
9911   ac_status=$?
9912   echo "$as_me:9912: \$? = $ac_status" >&5
9913   (exit $ac_status); }; }; then
9914   :
9915 else
9916   echo "$as_me: failed program was:" >&5
9917 cat conftest.$ac_ext >&5
9918 cf_have_incdir=yes
9919 fi
9920 rm -f conftest.$ac_objext conftest.$ac_ext
9921                           CPPFLAGS=$cf_save_CPPFLAGS
9922                         fi
9923                   fi
9924                 fi
9925
9926                 if test "$cf_have_incdir" = no ; then
9927                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9928
9929 echo "${as_me:-configure}:9929: testing adding $cf_add_incdir to include-path ..." 1>&5
9930
9931                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9932
9933                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9934                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9935                   cf_add_incdir="$cf_top_incdir"
9936                 else
9937                   break
9938                 fi
9939           else
9940                 break
9941           fi
9942         done
9943   done
9944 fi
9945
9946                 for cf_header in \
9947                         ncurses.h \
9948                         curses.h
9949                 do
9950
9951         cat >conftest.$ac_ext <<_ACEOF
9952 #line 9952 "configure"
9953 #include "confdefs.h"
9954
9955 #include <$cf_header>
9956 int
9957 main (void)
9958 {
9959
9960 #ifdef NCURSES_VERSION
9961
9962 printf("%s\n", NCURSES_VERSION);
9963 #else
9964 #ifdef __NCURSES_H
9965 printf("old\n");
9966 #else
9967         make an error
9968 #endif
9969 #endif
9970
9971   ;
9972   return 0;
9973 }
9974 _ACEOF
9975 rm -f conftest.$ac_objext
9976 if { (eval echo "$as_me:9976: \"$ac_compile\"") >&5
9977   (eval $ac_compile) 2>&5
9978   ac_status=$?
9979   echo "$as_me:9979: \$? = $ac_status" >&5
9980   (exit $ac_status); } &&
9981          { ac_try='test -s conftest.$ac_objext'
9982   { (eval echo "$as_me:9982: \"$ac_try\"") >&5
9983   (eval $ac_try) 2>&5
9984   ac_status=$?
9985   echo "$as_me:9985: \$? = $ac_status" >&5
9986   (exit $ac_status); }; }; then
9987   cf_cv_ncurses_h2=$cf_header
9988
9989 else
9990   echo "$as_me: failed program was:" >&5
9991 cat conftest.$ac_ext >&5
9992 cf_cv_ncurses_h2=no
9993 fi
9994 rm -f conftest.$ac_objext conftest.$ac_ext
9995
9996                         if test "$cf_cv_ncurses_h2" != no ; then
9997                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9998                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9999                                 break
10000                         fi
10001                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10002                 done
10003                 CPPFLAGS="$cf_save2_CPPFLAGS"
10004                 test "$cf_cv_ncurses_h2" != no && break
10005         done
10006         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10006: error: not found" >&5
10007 echo "$as_me: error: not found" >&2;}
10008    { (exit 1); exit 1; }; }
10009
10010 fi
10011 echo "$as_me:10011: result: $cf_cv_ncurses_h2" >&5
10012 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10013
10014         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10015         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10016         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10017                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10018         fi
10019
10020 if test -n "$cf_1st_incdir" ; then
10021   for cf_add_incdir in $cf_1st_incdir
10022   do
10023         while test $cf_add_incdir != /usr/include
10024         do
10025           if test -d $cf_add_incdir
10026           then
10027                 cf_have_incdir=no
10028                 if test -n "$CFLAGS$CPPFLAGS" ; then
10029                   # a loop is needed to ensure we can add subdirs of existing dirs
10030                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10031                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10032                           cf_have_incdir=yes; break
10033                         fi
10034                   done
10035                 fi
10036
10037                 if test "$cf_have_incdir" = no ; then
10038                   if test "$cf_add_incdir" = /usr/local/include ; then
10039                         if test "$GCC" = yes
10040                         then
10041                           cf_save_CPPFLAGS=$CPPFLAGS
10042
10043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10044         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10045
10046                           cat >conftest.$ac_ext <<_ACEOF
10047 #line 10047 "configure"
10048 #include "confdefs.h"
10049 #include <stdio.h>
10050 int
10051 main (void)
10052 {
10053 printf("Hello")
10054   ;
10055   return 0;
10056 }
10057 _ACEOF
10058 rm -f conftest.$ac_objext
10059 if { (eval echo "$as_me:10059: \"$ac_compile\"") >&5
10060   (eval $ac_compile) 2>&5
10061   ac_status=$?
10062   echo "$as_me:10062: \$? = $ac_status" >&5
10063   (exit $ac_status); } &&
10064          { ac_try='test -s conftest.$ac_objext'
10065   { (eval echo "$as_me:10065: \"$ac_try\"") >&5
10066   (eval $ac_try) 2>&5
10067   ac_status=$?
10068   echo "$as_me:10068: \$? = $ac_status" >&5
10069   (exit $ac_status); }; }; then
10070   :
10071 else
10072   echo "$as_me: failed program was:" >&5
10073 cat conftest.$ac_ext >&5
10074 cf_have_incdir=yes
10075 fi
10076 rm -f conftest.$ac_objext conftest.$ac_ext
10077                           CPPFLAGS=$cf_save_CPPFLAGS
10078                         fi
10079                   fi
10080                 fi
10081
10082                 if test "$cf_have_incdir" = no ; then
10083                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10084
10085 echo "${as_me:-configure}:10085: testing adding $cf_add_incdir to include-path ..." 1>&5
10086
10087                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10088
10089                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10090                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10091                   cf_add_incdir="$cf_top_incdir"
10092                 else
10093                   break
10094                 fi
10095           else
10096                 break
10097           fi
10098         done
10099   done
10100 fi
10101
10102 fi
10103
10104 # Set definitions to allow ifdef'ing for ncurses.h
10105
10106 case $cf_cv_ncurses_header in
10107 (*ncurses.h)
10108
10109 cat >>confdefs.h <<\EOF
10110 #define HAVE_NCURSES_H 1
10111 EOF
10112
10113         ;;
10114 esac
10115
10116 case $cf_cv_ncurses_header in
10117 (ncurses/curses.h|ncurses/ncurses.h)
10118
10119 cat >>confdefs.h <<\EOF
10120 #define HAVE_NCURSES_NCURSES_H 1
10121 EOF
10122
10123         ;;
10124 (ncursesw/curses.h|ncursesw/ncurses.h)
10125
10126 cat >>confdefs.h <<\EOF
10127 #define HAVE_NCURSESW_NCURSES_H 1
10128 EOF
10129
10130         ;;
10131 esac
10132
10133 echo "$as_me:10133: checking for terminfo header" >&5
10134 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10135 if test "${cf_cv_term_header+set}" = set; then
10136   echo $ECHO_N "(cached) $ECHO_C" >&6
10137 else
10138
10139 case ${cf_cv_ncurses_header} in
10140 (*/ncurses.h|*/ncursesw.h)
10141         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10142         ;;
10143 (*)
10144         cf_term_header=term.h
10145         ;;
10146 esac
10147
10148 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10149 do
10150 cat >conftest.$ac_ext <<_ACEOF
10151 #line 10151 "configure"
10152 #include "confdefs.h"
10153 #include <stdio.h>
10154 #include <${cf_cv_ncurses_header:-curses.h}>
10155 #include <$cf_test>
10156
10157 int
10158 main (void)
10159 {
10160 int x = auto_left_margin; (void)x
10161   ;
10162   return 0;
10163 }
10164 _ACEOF
10165 rm -f conftest.$ac_objext
10166 if { (eval echo "$as_me:10166: \"$ac_compile\"") >&5
10167   (eval $ac_compile) 2>&5
10168   ac_status=$?
10169   echo "$as_me:10169: \$? = $ac_status" >&5
10170   (exit $ac_status); } &&
10171          { ac_try='test -s conftest.$ac_objext'
10172   { (eval echo "$as_me:10172: \"$ac_try\"") >&5
10173   (eval $ac_try) 2>&5
10174   ac_status=$?
10175   echo "$as_me:10175: \$? = $ac_status" >&5
10176   (exit $ac_status); }; }; then
10177
10178         cf_cv_term_header="$cf_test"
10179 else
10180   echo "$as_me: failed program was:" >&5
10181 cat conftest.$ac_ext >&5
10182
10183         cf_cv_term_header=unknown
10184
10185 fi
10186 rm -f conftest.$ac_objext conftest.$ac_ext
10187         test "$cf_cv_term_header" != unknown && break
10188 done
10189
10190 fi
10191 echo "$as_me:10191: result: $cf_cv_term_header" >&5
10192 echo "${ECHO_T}$cf_cv_term_header" >&6
10193
10194 # Set definitions to allow ifdef'ing to accommodate subdirectories
10195
10196 case $cf_cv_term_header in
10197 (*term.h)
10198
10199 cat >>confdefs.h <<\EOF
10200 #define HAVE_TERM_H 1
10201 EOF
10202
10203         ;;
10204 esac
10205
10206 case $cf_cv_term_header in
10207 (ncurses/term.h)
10208
10209 cat >>confdefs.h <<\EOF
10210 #define HAVE_NCURSES_TERM_H 1
10211 EOF
10212
10213         ;;
10214 (ncursesw/term.h)
10215
10216 cat >>confdefs.h <<\EOF
10217 #define HAVE_NCURSESW_TERM_H 1
10218 EOF
10219
10220         ;;
10221 esac
10222
10223 # some applications need this, but should check for NCURSES_VERSION
10224
10225 cat >>confdefs.h <<\EOF
10226 #define NCURSES 1
10227 EOF
10228
10229 echo "$as_me:10229: checking for ncurses version" >&5
10230 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10231 if test "${cf_cv_ncurses_version+set}" = set; then
10232   echo $ECHO_N "(cached) $ECHO_C" >&6
10233 else
10234
10235         cf_cv_ncurses_version=no
10236         cf_tempfile=out$$
10237         rm -f $cf_tempfile
10238         if test "$cross_compiling" = yes; then
10239
10240         # This will not work if the preprocessor splits the line after the
10241         # Autoconf token.  The 'unproto' program does that.
10242         cat > conftest.$ac_ext <<EOF
10243 #include <${cf_cv_ncurses_header:-curses.h}>
10244 #undef Autoconf
10245 #ifdef NCURSES_VERSION
10246 Autoconf NCURSES_VERSION
10247 #else
10248 #ifdef __NCURSES_H
10249 Autoconf "old"
10250 #endif
10251 ;
10252 #endif
10253 EOF
10254         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10255         { (eval echo "$as_me:10255: \"$cf_try\"") >&5
10256   (eval $cf_try) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); }
10260         if test -f conftest.out ; then
10261                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10262                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10263                 rm -f conftest.out
10264         fi
10265
10266 else
10267   cat >conftest.$ac_ext <<_ACEOF
10268 #line 10268 "configure"
10269 #include "confdefs.h"
10270
10271 #include <${cf_cv_ncurses_header:-curses.h}>
10272 #include <stdio.h>
10273 int main(void)
10274 {
10275         FILE *fp = fopen("$cf_tempfile", "w");
10276 #ifdef NCURSES_VERSION
10277 # ifdef NCURSES_VERSION_PATCH
10278         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10279 # else
10280         fprintf(fp, "%s\n", NCURSES_VERSION);
10281 # endif
10282 #else
10283 # ifdef __NCURSES_H
10284         fprintf(fp, "old\n");
10285 # else
10286         make an error
10287 # endif
10288 #endif
10289         ${cf_cv_main_return:-return}(0);
10290 }
10291 _ACEOF
10292 rm -f conftest$ac_exeext
10293 if { (eval echo "$as_me:10293: \"$ac_link\"") >&5
10294   (eval $ac_link) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10298   { (eval echo "$as_me:10298: \"$ac_try\"") >&5
10299   (eval $ac_try) 2>&5
10300   ac_status=$?
10301   echo "$as_me:10301: \$? = $ac_status" >&5
10302   (exit $ac_status); }; }; then
10303
10304         cf_cv_ncurses_version=`cat $cf_tempfile`
10305 else
10306   echo "$as_me: program exited with status $ac_status" >&5
10307 echo "$as_me: failed program was:" >&5
10308 cat conftest.$ac_ext >&5
10309 fi
10310 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10311 fi
10312         rm -f $cf_tempfile
10313
10314 fi
10315 echo "$as_me:10315: result: $cf_cv_ncurses_version" >&5
10316 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10317 test "$cf_cv_ncurses_version" = no ||
10318 cat >>confdefs.h <<\EOF
10319 #define NCURSES 1
10320 EOF
10321
10322 cf_nculib_root=ncurses
10323         # This works, except for the special case where we find gpm, but
10324         # ncurses is in a nonstandard location via $LIBS, and we really want
10325         # to link gpm.
10326 cf_ncurses_LIBS=""
10327 cf_ncurses_SAVE="$LIBS"
10328 echo "$as_me:10328: checking for Gpm_Open in -lgpm" >&5
10329 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10330 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10331   echo $ECHO_N "(cached) $ECHO_C" >&6
10332 else
10333   ac_check_lib_save_LIBS=$LIBS
10334 LIBS="-lgpm  $LIBS"
10335 cat >conftest.$ac_ext <<_ACEOF
10336 #line 10336 "configure"
10337 #include "confdefs.h"
10338
10339 /* Override any gcc2 internal prototype to avoid an error.  */
10340 #ifdef __cplusplus
10341 extern "C"
10342 #endif
10343 /* We use char because int might match the return type of a gcc2
10344    builtin and then its argument prototype would still apply.  */
10345 char Gpm_Open ();
10346 int
10347 main (void)
10348 {
10349 Gpm_Open ();
10350   ;
10351   return 0;
10352 }
10353 _ACEOF
10354 rm -f conftest.$ac_objext conftest$ac_exeext
10355 if { (eval echo "$as_me:10355: \"$ac_link\"") >&5
10356   (eval $ac_link) 2>&5
10357   ac_status=$?
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); } &&
10360          { ac_try='test -s conftest$ac_exeext'
10361   { (eval echo "$as_me:10361: \"$ac_try\"") >&5
10362   (eval $ac_try) 2>&5
10363   ac_status=$?
10364   echo "$as_me:10364: \$? = $ac_status" >&5
10365   (exit $ac_status); }; }; then
10366   ac_cv_lib_gpm_Gpm_Open=yes
10367 else
10368   echo "$as_me: failed program was:" >&5
10369 cat conftest.$ac_ext >&5
10370 ac_cv_lib_gpm_Gpm_Open=no
10371 fi
10372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10373 LIBS=$ac_check_lib_save_LIBS
10374 fi
10375 echo "$as_me:10375: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10376 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10377 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10378   echo "$as_me:10378: checking for initscr in -lgpm" >&5
10379 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10380 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10381   echo $ECHO_N "(cached) $ECHO_C" >&6
10382 else
10383   ac_check_lib_save_LIBS=$LIBS
10384 LIBS="-lgpm  $LIBS"
10385 cat >conftest.$ac_ext <<_ACEOF
10386 #line 10386 "configure"
10387 #include "confdefs.h"
10388
10389 /* Override any gcc2 internal prototype to avoid an error.  */
10390 #ifdef __cplusplus
10391 extern "C"
10392 #endif
10393 /* We use char because int might match the return type of a gcc2
10394    builtin and then its argument prototype would still apply.  */
10395 char initscr ();
10396 int
10397 main (void)
10398 {
10399 initscr ();
10400   ;
10401   return 0;
10402 }
10403 _ACEOF
10404 rm -f conftest.$ac_objext conftest$ac_exeext
10405 if { (eval echo "$as_me:10405: \"$ac_link\"") >&5
10406   (eval $ac_link) 2>&5
10407   ac_status=$?
10408   echo "$as_me:10408: \$? = $ac_status" >&5
10409   (exit $ac_status); } &&
10410          { ac_try='test -s conftest$ac_exeext'
10411   { (eval echo "$as_me:10411: \"$ac_try\"") >&5
10412   (eval $ac_try) 2>&5
10413   ac_status=$?
10414   echo "$as_me:10414: \$? = $ac_status" >&5
10415   (exit $ac_status); }; }; then
10416   ac_cv_lib_gpm_initscr=yes
10417 else
10418   echo "$as_me: failed program was:" >&5
10419 cat conftest.$ac_ext >&5
10420 ac_cv_lib_gpm_initscr=no
10421 fi
10422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10423 LIBS=$ac_check_lib_save_LIBS
10424 fi
10425 echo "$as_me:10425: result: $ac_cv_lib_gpm_initscr" >&5
10426 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10427 if test $ac_cv_lib_gpm_initscr = yes; then
10428   LIBS="$cf_ncurses_SAVE"
10429 else
10430   cf_ncurses_LIBS="-lgpm"
10431 fi
10432
10433 fi
10434
10435 case $host_os in
10436 (freebsd*)
10437         # This is only necessary if you are linking against an obsolete
10438         # version of ncurses (but it should do no harm, since it's static).
10439         if test "$cf_nculib_root" = ncurses ; then
10440                 echo "$as_me:10440: checking for tgoto in -lmytinfo" >&5
10441 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10442 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10443   echo $ECHO_N "(cached) $ECHO_C" >&6
10444 else
10445   ac_check_lib_save_LIBS=$LIBS
10446 LIBS="-lmytinfo  $LIBS"
10447 cat >conftest.$ac_ext <<_ACEOF
10448 #line 10448 "configure"
10449 #include "confdefs.h"
10450
10451 /* Override any gcc2 internal prototype to avoid an error.  */
10452 #ifdef __cplusplus
10453 extern "C"
10454 #endif
10455 /* We use char because int might match the return type of a gcc2
10456    builtin and then its argument prototype would still apply.  */
10457 char tgoto ();
10458 int
10459 main (void)
10460 {
10461 tgoto ();
10462   ;
10463   return 0;
10464 }
10465 _ACEOF
10466 rm -f conftest.$ac_objext conftest$ac_exeext
10467 if { (eval echo "$as_me:10467: \"$ac_link\"") >&5
10468   (eval $ac_link) 2>&5
10469   ac_status=$?
10470   echo "$as_me:10470: \$? = $ac_status" >&5
10471   (exit $ac_status); } &&
10472          { ac_try='test -s conftest$ac_exeext'
10473   { (eval echo "$as_me:10473: \"$ac_try\"") >&5
10474   (eval $ac_try) 2>&5
10475   ac_status=$?
10476   echo "$as_me:10476: \$? = $ac_status" >&5
10477   (exit $ac_status); }; }; then
10478   ac_cv_lib_mytinfo_tgoto=yes
10479 else
10480   echo "$as_me: failed program was:" >&5
10481 cat conftest.$ac_ext >&5
10482 ac_cv_lib_mytinfo_tgoto=no
10483 fi
10484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10485 LIBS=$ac_check_lib_save_LIBS
10486 fi
10487 echo "$as_me:10487: result: $ac_cv_lib_mytinfo_tgoto" >&5
10488 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10489 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10490   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10491 fi
10492
10493         fi
10494         ;;
10495 esac
10496
10497 cf_add_libs="$LIBS"
10498 # reverse order
10499 cf_add_0lib=
10500 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10501 # filter duplicates
10502 for cf_add_1lib in $cf_add_0lib; do
10503         for cf_add_2lib in $cf_add_libs; do
10504                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10505                         cf_add_1lib=
10506                         break
10507                 fi
10508         done
10509         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10510 done
10511 LIBS="$cf_add_libs"
10512
10513 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10514 then
10515
10516 cf_add_libs="$LIBS"
10517 # reverse order
10518 cf_add_0lib=
10519 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10520 # filter duplicates
10521 for cf_add_1lib in $cf_add_0lib; do
10522         for cf_add_2lib in $cf_add_libs; do
10523                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10524                         cf_add_1lib=
10525                         break
10526                 fi
10527         done
10528         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10529 done
10530 LIBS="$cf_add_libs"
10531
10532 else
10533
10534         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10535         cf_libdir=""
10536         echo "$as_me:10536: checking for initscr" >&5
10537 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10538 if test "${ac_cv_func_initscr+set}" = set; then
10539   echo $ECHO_N "(cached) $ECHO_C" >&6
10540 else
10541   cat >conftest.$ac_ext <<_ACEOF
10542 #line 10542 "configure"
10543 #include "confdefs.h"
10544 #define initscr autoconf_temporary
10545 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10546 #undef initscr
10547
10548 #ifdef __cplusplus
10549 extern "C"
10550 #endif
10551
10552 /* We use char because int might match the return type of a gcc2
10553    builtin and then its argument prototype would still apply.  */
10554 char initscr (void);
10555
10556 int
10557 main (void)
10558 {
10559
10560 /* The GNU C library defines stubs for functions which it implements
10561     to always fail with ENOSYS.  Some functions are actually named
10562     something starting with __ and the normal name is an alias.  */
10563 #if defined (__stub_initscr) || defined (__stub___initscr)
10564 #error found stub for initscr
10565 #endif
10566
10567         return initscr ();
10568   ;
10569   return 0;
10570 }
10571 _ACEOF
10572 rm -f conftest.$ac_objext conftest$ac_exeext
10573 if { (eval echo "$as_me:10573: \"$ac_link\"") >&5
10574   (eval $ac_link) 2>&5
10575   ac_status=$?
10576   echo "$as_me:10576: \$? = $ac_status" >&5
10577   (exit $ac_status); } &&
10578          { ac_try='test -s conftest$ac_exeext'
10579   { (eval echo "$as_me:10579: \"$ac_try\"") >&5
10580   (eval $ac_try) 2>&5
10581   ac_status=$?
10582   echo "$as_me:10582: \$? = $ac_status" >&5
10583   (exit $ac_status); }; }; then
10584   ac_cv_func_initscr=yes
10585 else
10586   echo "$as_me: failed program was:" >&5
10587 cat conftest.$ac_ext >&5
10588 ac_cv_func_initscr=no
10589 fi
10590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10591 fi
10592 echo "$as_me:10592: result: $ac_cv_func_initscr" >&5
10593 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10594 if test $ac_cv_func_initscr = yes; then
10595   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10596 else
10597
10598                 cf_save_LIBS="$LIBS"
10599                 echo "$as_me:10599: checking for initscr in -l$cf_nculib_root" >&5
10600 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10601                 LIBS="-l$cf_nculib_root $LIBS"
10602                 cat >conftest.$ac_ext <<_ACEOF
10603 #line 10603 "configure"
10604 #include "confdefs.h"
10605 #include <${cf_cv_ncurses_header:-curses.h}>
10606 int
10607 main (void)
10608 {
10609 initscr()
10610   ;
10611   return 0;
10612 }
10613 _ACEOF
10614 rm -f conftest.$ac_objext conftest$ac_exeext
10615 if { (eval echo "$as_me:10615: \"$ac_link\"") >&5
10616   (eval $ac_link) 2>&5
10617   ac_status=$?
10618   echo "$as_me:10618: \$? = $ac_status" >&5
10619   (exit $ac_status); } &&
10620          { ac_try='test -s conftest$ac_exeext'
10621   { (eval echo "$as_me:10621: \"$ac_try\"") >&5
10622   (eval $ac_try) 2>&5
10623   ac_status=$?
10624   echo "$as_me:10624: \$? = $ac_status" >&5
10625   (exit $ac_status); }; }; then
10626   echo "$as_me:10626: result: yes" >&5
10627 echo "${ECHO_T}yes" >&6
10628                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10629
10630 else
10631   echo "$as_me: failed program was:" >&5
10632 cat conftest.$ac_ext >&5
10633 echo "$as_me:10633: result: no" >&5
10634 echo "${ECHO_T}no" >&6
10635
10636 cf_search=
10637 cf_library_path_list=""
10638 if test -n "${LDFLAGS}${LIBS}" ; then
10639         for cf_library_path in $LDFLAGS $LIBS
10640         do
10641                 case $cf_library_path in
10642                 (-L*)
10643                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10644
10645 test "x$cf_library_path" != "xNONE" && \
10646 test -d "$cf_library_path" && \
10647  {
10648         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10649         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10650         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10651         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10652         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10653         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"
10654 }
10655
10656                         cf_library_path_list="$cf_library_path_list $cf_search"
10657                         ;;
10658                 esac
10659         done
10660 fi
10661
10662 cf_search=
10663
10664 test "x$prefix" != "xNONE" && \
10665 test -d "$prefix" && \
10666  {
10667         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10668         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10669         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10670         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10671         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10672         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10673 }
10674
10675 for cf_subdir_prefix in \
10676         /usr \
10677         /usr/local \
10678         /usr/pkg \
10679         /opt \
10680         /opt/local \
10681         $HOME
10682 do
10683
10684 test "x$cf_subdir_prefix" != "x$prefix" && \
10685 test -d "$cf_subdir_prefix" && \
10686 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10687         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10688         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10689         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10690         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10691         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10692         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"
10693 }
10694
10695 done
10696
10697 cf_search="$cf_library_path_list $cf_search"
10698
10699                         for cf_libdir in $cf_search
10700                         do
10701                                 echo "$as_me:10701: checking for -l$cf_nculib_root in $cf_libdir" >&5
10702 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10703                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10704                                 cat >conftest.$ac_ext <<_ACEOF
10705 #line 10705 "configure"
10706 #include "confdefs.h"
10707 #include <${cf_cv_ncurses_header:-curses.h}>
10708 int
10709 main (void)
10710 {
10711 initscr()
10712   ;
10713   return 0;
10714 }
10715 _ACEOF
10716 rm -f conftest.$ac_objext conftest$ac_exeext
10717 if { (eval echo "$as_me:10717: \"$ac_link\"") >&5
10718   (eval $ac_link) 2>&5
10719   ac_status=$?
10720   echo "$as_me:10720: \$? = $ac_status" >&5
10721   (exit $ac_status); } &&
10722          { ac_try='test -s conftest$ac_exeext'
10723   { (eval echo "$as_me:10723: \"$ac_try\"") >&5
10724   (eval $ac_try) 2>&5
10725   ac_status=$?
10726   echo "$as_me:10726: \$? = $ac_status" >&5
10727   (exit $ac_status); }; }; then
10728   echo "$as_me:10728: result: yes" >&5
10729 echo "${ECHO_T}yes" >&6
10730                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10731                                          break
10732 else
10733   echo "$as_me: failed program was:" >&5
10734 cat conftest.$ac_ext >&5
10735 echo "$as_me:10735: result: no" >&5
10736 echo "${ECHO_T}no" >&6
10737                                          LIBS="$cf_save_LIBS"
10738 fi
10739 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10740                         done
10741
10742 fi
10743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10744
10745 fi
10746
10747 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10748
10749 if test $cf_found_library = no ; then
10750         { { echo "$as_me:10750: error: Cannot link $cf_nculib_root library" >&5
10751 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10752    { (exit 1); exit 1; }; }
10753 fi
10754
10755 fi
10756
10757 if test -n "$cf_ncurses_LIBS" ; then
10758         echo "$as_me:10758: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10759 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10760         cf_ncurses_SAVE="$LIBS"
10761         for p in $cf_ncurses_LIBS ; do
10762                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10763                 if test "$q" != "$LIBS" ; then
10764                         LIBS="$q"
10765                 fi
10766         done
10767         cat >conftest.$ac_ext <<_ACEOF
10768 #line 10768 "configure"
10769 #include "confdefs.h"
10770 #include <${cf_cv_ncurses_header:-curses.h}>
10771 int
10772 main (void)
10773 {
10774 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10775   ;
10776   return 0;
10777 }
10778 _ACEOF
10779 rm -f conftest.$ac_objext conftest$ac_exeext
10780 if { (eval echo "$as_me:10780: \"$ac_link\"") >&5
10781   (eval $ac_link) 2>&5
10782   ac_status=$?
10783   echo "$as_me:10783: \$? = $ac_status" >&5
10784   (exit $ac_status); } &&
10785          { ac_try='test -s conftest$ac_exeext'
10786   { (eval echo "$as_me:10786: \"$ac_try\"") >&5
10787   (eval $ac_try) 2>&5
10788   ac_status=$?
10789   echo "$as_me:10789: \$? = $ac_status" >&5
10790   (exit $ac_status); }; }; then
10791   echo "$as_me:10791: result: yes" >&5
10792 echo "${ECHO_T}yes" >&6
10793 else
10794   echo "$as_me: failed program was:" >&5
10795 cat conftest.$ac_ext >&5
10796 echo "$as_me:10796: result: no" >&5
10797 echo "${ECHO_T}no" >&6
10798                  LIBS="$cf_ncurses_SAVE"
10799 fi
10800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10801 fi
10802
10803 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10804
10805 cat >>confdefs.h <<EOF
10806 #define $cf_nculib_ROOT 1
10807 EOF
10808
10809         fi
10810 else
10811         NCURSES_CONFIG=none
10812 fi
10813
10814 fi
10815
10816 if test "$NCURSES_CONFIG_PKG" != none ; then
10817         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10818
10819         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10820         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10821         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10822
10823         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10824         if test -z "$cf_cv_abi_version"
10825         then
10826                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10827         fi
10828
10829 elif test "$NCURSES_CONFIG" != none ; then
10830
10831         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10832
10833         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10834         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10835         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10836
10837         # ABI version is not available from headers
10838         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10839
10840 else
10841
10842         for cf_name in MAJOR MINOR PATCH
10843         do
10844         cat >conftest.$ac_ext <<CF_EOF
10845         #include <${cf_cv_ncurses_header:-curses.h}>
10846         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10847 CF_EOF
10848                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10849                 { (eval echo "$as_me:10849: \"$cf_try\"") >&5
10850   (eval $cf_try) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit $ac_status); }
10854                 if test -f conftest.out ; then
10855                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10856                         eval NCURSES_$cf_name=\"$cf_result\"
10857                         # cat conftest.$ac_ext
10858                         # cat conftest.out
10859                 fi
10860         done
10861
10862         cf_cv_abi_version=${NCURSES_MAJOR}
10863
10864 fi
10865
10866 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10867
10868 cf_cv_timestamp=`date`
10869
10870 echo "$as_me:10870: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10871 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10872
10873 echo "$as_me:10873: checking if you want to have a library-prefix" >&5
10874 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10875
10876 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10877 if test "${with_lib_prefix+set}" = set; then
10878   withval="$with_lib_prefix"
10879   with_lib_prefix=$withval
10880 else
10881   with_lib_prefix=auto
10882 fi;
10883 echo "$as_me:10883: result: $with_lib_prefix" >&5
10884 echo "${ECHO_T}$with_lib_prefix" >&6
10885
10886 if test $with_lib_prefix = auto
10887 then
10888
10889         case $cf_cv_system_name in
10890         (OS/2*|os2*)
10891                 if test "$DFT_LWR_MODEL" = libtool; then
10892                         LIB_PREFIX='lib'
10893                 else
10894                         LIB_PREFIX=''
10895                 fi
10896                 ;;
10897         (*-msvc*)
10898                 LIB_PREFIX=''
10899                 ;;
10900         (*)     LIB_PREFIX='lib'
10901                 ;;
10902         esac
10903 cf_prefix=$LIB_PREFIX
10904
10905 elif test $with_lib_prefix = no
10906 then
10907         LIB_PREFIX=
10908 else
10909         LIB_PREFIX=$with_lib_prefix
10910 fi
10911
10912 LIB_SUFFIX=
10913
10914 ###############################################################################
10915
10916 if test X"$CC_G_OPT" = X"" ; then
10917         CC_G_OPT='-g'
10918         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10919 fi
10920
10921 echo "$as_me:10921: checking for default loader flags" >&5
10922 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10923 case $DFT_LWR_MODEL in
10924 (normal)  LD_MODEL=''   ;;
10925 (debug)   LD_MODEL=$CC_G_OPT ;;
10926 (profile) LD_MODEL='-pg';;
10927 (shared)  LD_MODEL=''   ;;
10928 esac
10929 echo "$as_me:10929: result: $LD_MODEL" >&5
10930 echo "${ECHO_T}$LD_MODEL" >&6
10931
10932 LD_RPATH_OPT=
10933 if test "x$cf_cv_enable_rpath" != xno
10934 then
10935         echo "$as_me:10935: checking for an rpath option" >&5
10936 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10937         case $cf_cv_system_name in
10938         (irix*)
10939                 if test "$GCC" = yes; then
10940                         LD_RPATH_OPT="-Wl,-rpath,"
10941                 else
10942                         LD_RPATH_OPT="-rpath "
10943                 fi
10944                 ;;
10945         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10946                 LD_RPATH_OPT="-Wl,-rpath,"
10947                 ;;
10948         (openbsd[2-9].*|mirbsd*)
10949                 LD_RPATH_OPT="-Wl,-rpath,"
10950                 ;;
10951         (dragonfly*)
10952                 LD_RPATH_OPT="-rpath "
10953                 ;;
10954         (netbsd*)
10955                 LD_RPATH_OPT="-Wl,-rpath,"
10956                 ;;
10957         (osf*|mls+*)
10958                 LD_RPATH_OPT="-rpath "
10959                 ;;
10960         (solaris2*)
10961                 LD_RPATH_OPT="-R"
10962                 ;;
10963         (*)
10964                 ;;
10965         esac
10966         echo "$as_me:10966: result: $LD_RPATH_OPT" >&5
10967 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10968
10969         case "x$LD_RPATH_OPT" in
10970         (x-R*)
10971                 echo "$as_me:10971: checking if we need a space after rpath option" >&5
10972 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10973                 cf_save_LIBS="$LIBS"
10974
10975 cf_add_libs="$LIBS"
10976 # reverse order
10977 cf_add_0lib=
10978 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10979 # filter duplicates
10980 for cf_add_1lib in $cf_add_0lib; do
10981         for cf_add_2lib in $cf_add_libs; do
10982                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10983                         cf_add_1lib=
10984                         break
10985                 fi
10986         done
10987         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10988 done
10989 LIBS="$cf_add_libs"
10990
10991                 cat >conftest.$ac_ext <<_ACEOF
10992 #line 10992 "configure"
10993 #include "confdefs.h"
10994
10995 int
10996 main (void)
10997 {
10998
10999   ;
11000   return 0;
11001 }
11002 _ACEOF
11003 rm -f conftest.$ac_objext conftest$ac_exeext
11004 if { (eval echo "$as_me:11004: \"$ac_link\"") >&5
11005   (eval $ac_link) 2>&5
11006   ac_status=$?
11007   echo "$as_me:11007: \$? = $ac_status" >&5
11008   (exit $ac_status); } &&
11009          { ac_try='test -s conftest$ac_exeext'
11010   { (eval echo "$as_me:11010: \"$ac_try\"") >&5
11011   (eval $ac_try) 2>&5
11012   ac_status=$?
11013   echo "$as_me:11013: \$? = $ac_status" >&5
11014   (exit $ac_status); }; }; then
11015   cf_rpath_space=no
11016 else
11017   echo "$as_me: failed program was:" >&5
11018 cat conftest.$ac_ext >&5
11019 cf_rpath_space=yes
11020 fi
11021 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11022                 LIBS="$cf_save_LIBS"
11023                 echo "$as_me:11023: result: $cf_rpath_space" >&5
11024 echo "${ECHO_T}$cf_rpath_space" >&6
11025                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11026                 ;;
11027         esac
11028 fi
11029
11030         RM_SHARED_OPTS=
11031         LOCAL_LDFLAGS=
11032         LOCAL_LDFLAGS2=
11033         LD_SHARED_OPTS=
11034         INSTALL_LIB="-m 644"
11035         : ${rel_builddir:=.}
11036
11037         shlibdir=$libdir
11038
11039         MAKE_DLLS="#"
11040
11041         cf_cv_do_symlinks=no
11042         cf_ld_rpath_opt=
11043         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11044
11045         echo "$as_me:11045: checking if release/abi version should be used for shared libs" >&5
11046 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11047
11048 # Check whether --with-shlib-version or --without-shlib-version was given.
11049 if test "${with_shlib_version+set}" = set; then
11050   withval="$with_shlib_version"
11051   test -z "$withval" && withval=auto
11052         case $withval in
11053         (yes)
11054                 cf_cv_shlib_version=auto
11055                 ;;
11056         (rel|abi|auto)
11057                 cf_cv_shlib_version=$withval
11058                 ;;
11059         (*)
11060                 echo "$as_me:11060: result: $withval" >&5
11061 echo "${ECHO_T}$withval" >&6
11062                 { { echo "$as_me:11062: error: option value must be one of: rel, abi, or auto" >&5
11063 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11064    { (exit 1); exit 1; }; }
11065                 ;;
11066         esac
11067
11068 else
11069   cf_cv_shlib_version=auto
11070 fi;
11071         echo "$as_me:11071: result: $cf_cv_shlib_version" >&5
11072 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11073
11074         cf_cv_rm_so_locs=no
11075         cf_try_cflags=
11076
11077         # Some less-capable ports of gcc support only -fpic
11078         CC_SHARED_OPTS=
11079
11080         cf_try_fPIC=no
11081         if test "$GCC" = yes
11082         then
11083                 cf_try_fPIC=yes
11084         else
11085                 case $cf_cv_system_name in
11086                 (*linux*)       # e.g., PGI compiler
11087                         cf_try_fPIC=yes
11088                         ;;
11089                 esac
11090         fi
11091
11092         if test "$cf_try_fPIC" = yes
11093         then
11094                 echo "$as_me:11094: checking which $CC option to use" >&5
11095 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11096                 cf_save_CFLAGS="$CFLAGS"
11097                 for CC_SHARED_OPTS in -fPIC -fpic ''
11098                 do
11099                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11100                         cat >conftest.$ac_ext <<_ACEOF
11101 #line 11101 "configure"
11102 #include "confdefs.h"
11103 #include <stdio.h>
11104 int
11105 main (void)
11106 {
11107 int x = 1
11108   ;
11109   return 0;
11110 }
11111 _ACEOF
11112 rm -f conftest.$ac_objext
11113 if { (eval echo "$as_me:11113: \"$ac_compile\"") >&5
11114   (eval $ac_compile) 2>&5
11115   ac_status=$?
11116   echo "$as_me:11116: \$? = $ac_status" >&5
11117   (exit $ac_status); } &&
11118          { ac_try='test -s conftest.$ac_objext'
11119   { (eval echo "$as_me:11119: \"$ac_try\"") >&5
11120   (eval $ac_try) 2>&5
11121   ac_status=$?
11122   echo "$as_me:11122: \$? = $ac_status" >&5
11123   (exit $ac_status); }; }; then
11124   break
11125 else
11126   echo "$as_me: failed program was:" >&5
11127 cat conftest.$ac_ext >&5
11128 fi
11129 rm -f conftest.$ac_objext conftest.$ac_ext
11130                 done
11131                 echo "$as_me:11131: result: $CC_SHARED_OPTS" >&5
11132 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11133                 CFLAGS="$cf_save_CFLAGS"
11134         fi
11135
11136         cf_cv_shlib_version_infix=no
11137
11138         case $cf_cv_system_name in
11139         (aix4.3-9*|aix[5-7]*)
11140                 if test "$GCC" = yes; then
11141                         CC_SHARED_OPTS='-Wl,-brtl'
11142                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11143                 else
11144                         CC_SHARED_OPTS='-brtl'
11145                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11146                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11147                 fi
11148                 ;;
11149         (beos*)
11150                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11151                 ;;
11152         (cygwin*)
11153                 CC_SHARED_OPTS=
11154                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11155                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11156                 cf_cv_shlib_version=cygdll
11157                 cf_cv_shlib_version_infix=cygdll
11158                 shlibdir=$bindir
11159                 MAKE_DLLS=
11160                 cat >mk_shared_lib.sh <<-CF_EOF
11161                 #!$SHELL
11162                 SHARED_LIB=\$1
11163                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11164                 shift
11165                 cat <<-EOF
11166                 Linking shared library
11167                 ** SHARED_LIB \$SHARED_LIB
11168                 ** IMPORT_LIB \$IMPORT_LIB
11169 EOF
11170                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11171 CF_EOF
11172                 chmod +x mk_shared_lib.sh
11173                 ;;
11174         (msys*)
11175                 CC_SHARED_OPTS=
11176                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11177                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11178                 cf_cv_shlib_version=msysdll
11179                 cf_cv_shlib_version_infix=msysdll
11180                 shlibdir=$bindir
11181                 MAKE_DLLS=
11182                 cat >mk_shared_lib.sh <<-CF_EOF
11183                 #!$SHELL
11184                 SHARED_LIB=\$1
11185                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11186                 shift
11187                 cat <<-EOF
11188                 Linking shared library
11189                 ** SHARED_LIB \$SHARED_LIB
11190                 ** IMPORT_LIB \$IMPORT_LIB
11191 EOF
11192                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11193 CF_EOF
11194                 chmod +x mk_shared_lib.sh
11195                 ;;
11196         (darwin*)
11197                 cf_try_cflags="no-cpp-precomp"
11198                 CC_SHARED_OPTS="-dynamic"
11199                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11200                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11201                 cf_cv_shlib_version_infix=yes
11202                 echo "$as_me:11202: checking if ld -search_paths_first works" >&5
11203 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11204 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11205   echo $ECHO_N "(cached) $ECHO_C" >&6
11206 else
11207
11208                         cf_save_LDFLAGS=$LDFLAGS
11209                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11210                         cat >conftest.$ac_ext <<_ACEOF
11211 #line 11211 "configure"
11212 #include "confdefs.h"
11213
11214 int
11215 main (void)
11216 {
11217 int i;
11218   ;
11219   return 0;
11220 }
11221 _ACEOF
11222 rm -f conftest.$ac_objext conftest$ac_exeext
11223 if { (eval echo "$as_me:11223: \"$ac_link\"") >&5
11224   (eval $ac_link) 2>&5
11225   ac_status=$?
11226   echo "$as_me:11226: \$? = $ac_status" >&5
11227   (exit $ac_status); } &&
11228          { ac_try='test -s conftest$ac_exeext'
11229   { (eval echo "$as_me:11229: \"$ac_try\"") >&5
11230   (eval $ac_try) 2>&5
11231   ac_status=$?
11232   echo "$as_me:11232: \$? = $ac_status" >&5
11233   (exit $ac_status); }; }; then
11234   cf_cv_ldflags_search_paths_first=yes
11235 else
11236   echo "$as_me: failed program was:" >&5
11237 cat conftest.$ac_ext >&5
11238 cf_cv_ldflags_search_paths_first=no
11239 fi
11240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11241                                 LDFLAGS=$cf_save_LDFLAGS
11242 fi
11243 echo "$as_me:11243: result: $cf_cv_ldflags_search_paths_first" >&5
11244 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11245                 if test $cf_cv_ldflags_search_paths_first = yes; then
11246                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11247                 fi
11248                 ;;
11249         (hpux[7-8]*)
11250                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11251                 if test "$GCC" != yes; then
11252                         CC_SHARED_OPTS='+Z'
11253                 fi
11254                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11255                 INSTALL_LIB="-m 555"
11256                 ;;
11257         (hpux*)
11258                 # (tested with gcc 2.7.2 -- I don't have c89)
11259                 if test "$GCC" = yes; then
11260                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11261                 else
11262                         CC_SHARED_OPTS='+Z'
11263                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11264                 fi
11265                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11266                 # HP-UX shared libraries must be executable, and should be
11267                 # readonly to exploit a quirk in the memory manager.
11268                 INSTALL_LIB="-m 555"
11269                 ;;
11270         (interix*)
11271                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11272                 if test "$cf_cv_shlib_version" = rel; then
11273                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11274                 else
11275                         cf_shared_soname='`basename $@`'
11276                 fi
11277                 CC_SHARED_OPTS=
11278                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11279                 ;;
11280         (irix*)
11281                 if test "$cf_cv_enable_rpath" = yes ; then
11282                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11283                 fi
11284                 # tested with IRIX 5.2 and 'cc'.
11285                 if test "$GCC" != yes; then
11286                         CC_SHARED_OPTS='-KPIC'
11287                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11288                 else
11289                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11290                 fi
11291                 cf_cv_rm_so_locs=yes
11292                 ;;
11293         (linux*|gnu*|k*bsd*-gnu)
11294                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11295                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11296                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11297                 fi
11298                 if test "$cf_cv_enable_rpath" = yes ; then
11299                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11300                 fi
11301
11302         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11303         if test "$cf_cv_shlib_version" = rel; then
11304                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11305         else
11306                 cf_cv_shared_soname='`basename $@`'
11307         fi
11308
11309                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11310                 ;;
11311         (mingw*msvc*)
11312                 cf_cv_shlib_version=msvcdll
11313                 cf_cv_shlib_version_infix=msvcdll
11314                 shlibdir=$bindir
11315                 MAKE_DLLS=
11316                 if test "$DFT_LWR_MODEL" = "shared" ; then
11317                         LOCAL_LDFLAGS="-link -dll"
11318                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11319                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11320                 fi
11321                 CC_SHARED_OPTS=
11322                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11323                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11324                 cat >mk_shared_lib.sh <<-CF_EOF
11325                 #!$SHELL
11326                 SHARED_LIB=\$1
11327                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11328                 shift
11329                 my_ld=\$1
11330                 shift
11331                 cat <<-EOF
11332                 Linking shared library
11333                 ** SHARED LIB \$SHARED_LIB
11334                 ** IMPORT_LIB \$IMPORT_LIB
11335 EOF
11336                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11337                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11338                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11339 CF_EOF
11340                 chmod +x mk_shared_lib.sh
11341                 cat >mk_prog.sh <<-CF_EOF
11342                 #!$SHELL
11343                 shift
11344                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11345                 LD="$LD"
11346                 clopts=()
11347                 ldopts=()
11348                 libs=()
11349                 isdll=0
11350                 while test \$# -gt 0; do
11351                         case "\$1" in
11352                                 -link)
11353                                         # ignore -link argument
11354                                         ;;
11355                                 -dll)
11356                                         isdll=1
11357                                         ;;
11358                                 -W* | -w*)
11359                                         # ignore warnings
11360                                         ;;
11361                                 -D*)
11362                                         clopts+=("\$1")
11363                                         ;;
11364                                 -I*)
11365                                         clopts+=("\$1")
11366                                         ;;
11367                                 -l*)
11368                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11369                                         ;;
11370                                 -L*)
11371                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11372                                         ;;
11373                                 *.obj | *.o)
11374                                         ldopts+=("\$1")
11375                                         ;;
11376                                 -Wl,*)
11377                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11378                                                 ldopts+=("\${linkarg}")
11379                                         done
11380                                         ;;
11381                                 *.lib)
11382                                         ldopts+=("\$1")
11383                                         ;;
11384                                 -o)
11385                                         shift
11386                                         ldopts+=("-out:\$1")
11387                                         ;;
11388                                 *)
11389                                         clopts+=("\$1")
11390                                         ldopts+=("\$1")
11391                                         ;;
11392                         esac
11393                         shift
11394                 done
11395                 if [ "\$isdll" -ne 0 ]; then
11396                         for lib in \${libs[*]}; do
11397                                 ldopts+=("\$lib.dll.lib")
11398                         done
11399                 else
11400                         for lib in \${libs[*]}; do
11401                                 ldopts+=("\$lib.lib")
11402                         done
11403                 fi
11404                 cat <<-EOF
11405                 Creating program
11406                 ** ld options:   "\${ldopts[@]}"
11407 EOF
11408                 exec \$LD \${ldopts[@]}
11409 CF_EOF
11410                 chmod +x mk_prog.sh
11411                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11412                 ;;
11413         (mingw*)
11414                 cf_cv_shlib_version=mingw
11415                 cf_cv_shlib_version_infix=mingw
11416                 shlibdir=$bindir
11417                 MAKE_DLLS=
11418                 if test "$DFT_LWR_MODEL" = "shared" ; then
11419                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11420                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11421                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11422                 fi
11423                 CC_SHARED_OPTS=
11424                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11425                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11426                 cat >mk_shared_lib.sh <<-CF_EOF
11427                 #!$SHELL
11428                 SHARED_LIB=\$1
11429                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11430                 shift
11431                 cat <<-EOF
11432                 Linking shared library
11433                 ** SHARED_LIB \$SHARED_LIB
11434                 ** IMPORT_LIB \$IMPORT_LIB
11435 EOF
11436                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11437 CF_EOF
11438                 chmod +x mk_shared_lib.sh
11439                 ;;
11440         (openbsd[2-9].*|mirbsd*)
11441                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11442                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11443                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11444                 fi
11445                 if test "$cf_cv_enable_rpath" = yes ; then
11446                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11447                 fi
11448                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11449
11450         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11451         if test "$cf_cv_shlib_version" = rel; then
11452                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11453         else
11454                 cf_cv_shared_soname='`basename $@`'
11455         fi
11456
11457                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11458                 ;;
11459         (nto-qnx*|openbsd*|freebsd[12].*)
11460                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11461                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11462                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11463                 ;;
11464         (dragonfly*|freebsd*)
11465                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11466                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11467                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11468                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11469                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11470                 fi
11471
11472         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11473         if test "$cf_cv_shlib_version" = rel; then
11474                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11475         else
11476                 cf_cv_shared_soname='`basename $@`'
11477         fi
11478
11479                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11480                 ;;
11481         (netbsd*)
11482                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11483                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11484                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11485                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11486                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11487                         if test "$cf_cv_shlib_version" = auto; then
11488                         if test -f /usr/libexec/ld.elf_so; then
11489                                 cf_cv_shlib_version=abi
11490                         else
11491                                 cf_cv_shlib_version=rel
11492                         fi
11493                         fi
11494
11495         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11496         if test "$cf_cv_shlib_version" = rel; then
11497                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11498         else
11499                 cf_cv_shared_soname='`basename $@`'
11500         fi
11501
11502                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11503                 else
11504                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
11505                 fi
11506                 ;;
11507         (osf*|mls+*)
11508                 # tested with OSF/1 V3.2 and 'cc'
11509                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11510                 # link with shared libs).
11511                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11512                 case $host_os in
11513                 (osf4*)
11514                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11515                         ;;
11516                 esac
11517                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11518                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11519                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11520                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11521                 fi
11522                 cf_cv_rm_so_locs=yes
11523                 ;;
11524         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11525                 # tested with osr5.0.5
11526                 if test "$GCC" != yes; then
11527                         CC_SHARED_OPTS='-belf -KPIC'
11528                 fi
11529                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11530                 if test "$cf_cv_enable_rpath" = yes ; then
11531                         # only way is to set LD_RUN_PATH but no switch for it
11532                         RUN_PATH=$libdir
11533                 fi
11534                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11535                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11536                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11537                 ;;
11538         (sunos4*)
11539                 # tested with SunOS 4.1.1 and gcc 2.7.0
11540                 if test "$GCC" != yes; then
11541                         CC_SHARED_OPTS='-KPIC'
11542                 fi
11543                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11544                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11545                 ;;
11546         (solaris2*)
11547                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11548                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11549                 if test "$DFT_LWR_MODEL" = "shared" ; then
11550                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11551                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11552                 fi
11553                 if test "$cf_cv_enable_rpath" = yes ; then
11554                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11555                 fi
11556
11557         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11558         if test "$cf_cv_shlib_version" = rel; then
11559                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11560         else
11561                 cf_cv_shared_soname='`basename $@`'
11562         fi
11563
11564                 if test "$GCC" != yes; then
11565                         cf_save_CFLAGS="$CFLAGS"
11566                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11567                         do
11568                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11569                                 cat >conftest.$ac_ext <<_ACEOF
11570 #line 11570 "configure"
11571 #include "confdefs.h"
11572 #include <stdio.h>
11573 int
11574 main (void)
11575 {
11576 printf("Hello\n");
11577   ;
11578   return 0;
11579 }
11580 _ACEOF
11581 rm -f conftest.$ac_objext
11582 if { (eval echo "$as_me:11582: \"$ac_compile\"") >&5
11583   (eval $ac_compile) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit $ac_status); } &&
11587          { ac_try='test -s conftest.$ac_objext'
11588   { (eval echo "$as_me:11588: \"$ac_try\"") >&5
11589   (eval $ac_try) 2>&5
11590   ac_status=$?
11591   echo "$as_me:11591: \$? = $ac_status" >&5
11592   (exit $ac_status); }; }; then
11593   break
11594 else
11595   echo "$as_me: failed program was:" >&5
11596 cat conftest.$ac_ext >&5
11597 fi
11598 rm -f conftest.$ac_objext conftest.$ac_ext
11599                         done
11600                         CFLAGS="$cf_save_CFLAGS"
11601                         CC_SHARED_OPTS=$cf_shared_opts
11602                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11603                 else
11604                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11605                 fi
11606                 ;;
11607         (sysv5uw7*|unix_sv*)
11608                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11609                 if test "$GCC" != yes; then
11610                         CC_SHARED_OPTS='-KPIC'
11611                 fi
11612                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11613                 ;;
11614         (*)
11615                 CC_SHARED_OPTS='unknown'
11616                 MK_SHARED_LIB='echo unknown'
11617                 ;;
11618         esac
11619
11620         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11621         case "$cf_cv_shlib_version" in
11622         (rel|abi)
11623                 case "$MK_SHARED_LIB" in
11624                 (*'-o $@')
11625                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11626                         ;;
11627                 (*)
11628                         { echo "$as_me:11628: WARNING: ignored --with-shlib-version" >&5
11629 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11630                         ;;
11631                 esac
11632                 ;;
11633         esac
11634
11635         if test -n "$cf_try_cflags"
11636         then
11637 cat > conftest.$ac_ext <<EOF
11638 #line 11638 "${as_me:-configure}"
11639 #include <stdio.h>
11640 int main(int argc, char *argv[])
11641 {
11642         printf("hello\n");
11643         return (argv[argc-1] == 0) ;
11644 }
11645 EOF
11646                 cf_save_CFLAGS="$CFLAGS"
11647                 for cf_opt in $cf_try_cflags
11648                 do
11649                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11650                         echo "$as_me:11650: checking if CFLAGS option -$cf_opt works" >&5
11651 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11652                         if { (eval echo "$as_me:11652: \"$ac_compile\"") >&5
11653   (eval $ac_compile) 2>&5
11654   ac_status=$?
11655   echo "$as_me:11655: \$? = $ac_status" >&5
11656   (exit $ac_status); }; then
11657                                 echo "$as_me:11657: result: yes" >&5
11658 echo "${ECHO_T}yes" >&6
11659                                 cf_save_CFLAGS="$CFLAGS"
11660                         else
11661                                 echo "$as_me:11661: result: no" >&5
11662 echo "${ECHO_T}no" >&6
11663                         fi
11664                 done
11665                 CFLAGS="$cf_save_CFLAGS"
11666         fi
11667
11668         # RPATH_LIST is a colon-separated list of directories
11669         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11670         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11671
11672         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11673
11674         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11675
11676 echo "${as_me:-configure}:11676: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11677
11678         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11679
11680 echo "${as_me:-configure}:11680: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11681
11682 # The test/sample programs in the original tree link using rpath option.
11683 # Make it optional for packagers.
11684 if test -n "$LOCAL_LDFLAGS"
11685 then
11686         echo "$as_me:11686: checking if you want to link sample programs with rpath option" >&5
11687 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11688
11689 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11690 if test "${enable_rpath_link+set}" = set; then
11691   enableval="$enable_rpath_link"
11692   with_rpath_link=$enableval
11693 else
11694   with_rpath_link=yes
11695 fi;
11696         echo "$as_me:11696: result: $with_rpath_link" >&5
11697 echo "${ECHO_T}$with_rpath_link" >&6
11698         if test "$with_rpath_link" = no
11699         then
11700                 LOCAL_LDFLAGS=
11701                 LOCAL_LDFLAGS2=
11702         fi
11703 fi
11704
11705 ###############################################################################
11706
11707 ###   use option --enable-broken-linker to force on use of broken-linker support
11708
11709 echo "$as_me:11709: checking if you want broken-linker support code" >&5
11710 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11711
11712 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11713 if test "${enable_broken_linker+set}" = set; then
11714   enableval="$enable_broken_linker"
11715   with_broken_linker=$enableval
11716 else
11717   with_broken_linker=no
11718 fi;
11719 echo "$as_me:11719: result: $with_broken_linker" >&5
11720 echo "${ECHO_T}$with_broken_linker" >&6
11721
11722 : ${BROKEN_LINKER:=0}
11723 if test "x$with_broken_linker" = xyes ; then
11724
11725 cat >>confdefs.h <<\EOF
11726 #define BROKEN_LINKER 1
11727 EOF
11728
11729         BROKEN_LINKER=1
11730 fi
11731
11732 # Check to define _XOPEN_SOURCE "automatically"
11733
11734 echo "$as_me:11734: checking if the POSIX test-macros are already defined" >&5
11735 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11736 if test "${cf_cv_posix_visible+set}" = set; then
11737   echo $ECHO_N "(cached) $ECHO_C" >&6
11738 else
11739
11740 cat >conftest.$ac_ext <<_ACEOF
11741 #line 11741 "configure"
11742 #include "confdefs.h"
11743 #include <stdio.h>
11744 int
11745 main (void)
11746 {
11747
11748 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11749         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11750         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11751         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11752 #error conflicting symbols found
11753 #endif
11754
11755   ;
11756   return 0;
11757 }
11758 _ACEOF
11759 rm -f conftest.$ac_objext
11760 if { (eval echo "$as_me:11760: \"$ac_compile\"") >&5
11761   (eval $ac_compile) 2>&5
11762   ac_status=$?
11763   echo "$as_me:11763: \$? = $ac_status" >&5
11764   (exit $ac_status); } &&
11765          { ac_try='test -s conftest.$ac_objext'
11766   { (eval echo "$as_me:11766: \"$ac_try\"") >&5
11767   (eval $ac_try) 2>&5
11768   ac_status=$?
11769   echo "$as_me:11769: \$? = $ac_status" >&5
11770   (exit $ac_status); }; }; then
11771   cf_cv_posix_visible=no
11772 else
11773   echo "$as_me: failed program was:" >&5
11774 cat conftest.$ac_ext >&5
11775 cf_cv_posix_visible=yes
11776 fi
11777 rm -f conftest.$ac_objext conftest.$ac_ext
11778
11779 fi
11780 echo "$as_me:11780: result: $cf_cv_posix_visible" >&5
11781 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11782
11783 if test "$cf_cv_posix_visible" = no; then
11784
11785 cf_XOPEN_SOURCE=600
11786 cf_POSIX_C_SOURCE=199506L
11787 cf_xopen_source=
11788
11789 case $host_os in
11790 (aix[4-7]*)
11791         cf_xopen_source="-D_ALL_SOURCE"
11792         ;;
11793 (msys)
11794         cf_XOPEN_SOURCE=600
11795         ;;
11796 (darwin[0-8].*)
11797         cf_xopen_source="-D_APPLE_C_SOURCE"
11798         ;;
11799 (darwin*)
11800         cf_xopen_source="-D_DARWIN_C_SOURCE"
11801         cf_XOPEN_SOURCE=
11802         ;;
11803 (freebsd*|dragonfly*|midnightbsd*)
11804         # 5.x headers associate
11805         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11806         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11807         cf_POSIX_C_SOURCE=200112L
11808         cf_XOPEN_SOURCE=600
11809         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11810         ;;
11811 (hpux11*)
11812         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11813         ;;
11814 (hpux*)
11815         cf_xopen_source="-D_HPUX_SOURCE"
11816         ;;
11817 (irix[56].*)
11818         cf_xopen_source="-D_SGI_SOURCE"
11819         cf_XOPEN_SOURCE=
11820         ;;
11821 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11822
11823 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11824
11825 echo "$as_me:11825: checking if this is the GNU C library" >&5
11826 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11827 if test "${cf_cv_gnu_library+set}" = set; then
11828   echo $ECHO_N "(cached) $ECHO_C" >&6
11829 else
11830
11831 cat >conftest.$ac_ext <<_ACEOF
11832 #line 11832 "configure"
11833 #include "confdefs.h"
11834 #include <sys/types.h>
11835 int
11836 main (void)
11837 {
11838
11839         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11840                 return 0;
11841         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11842                 return 0;
11843         #else
11844         #       error not GNU C library
11845         #endif
11846   ;
11847   return 0;
11848 }
11849 _ACEOF
11850 rm -f conftest.$ac_objext
11851 if { (eval echo "$as_me:11851: \"$ac_compile\"") >&5
11852   (eval $ac_compile) 2>&5
11853   ac_status=$?
11854   echo "$as_me:11854: \$? = $ac_status" >&5
11855   (exit $ac_status); } &&
11856          { ac_try='test -s conftest.$ac_objext'
11857   { (eval echo "$as_me:11857: \"$ac_try\"") >&5
11858   (eval $ac_try) 2>&5
11859   ac_status=$?
11860   echo "$as_me:11860: \$? = $ac_status" >&5
11861   (exit $ac_status); }; }; then
11862   cf_cv_gnu_library=yes
11863 else
11864   echo "$as_me: failed program was:" >&5
11865 cat conftest.$ac_ext >&5
11866 cf_cv_gnu_library=no
11867 fi
11868 rm -f conftest.$ac_objext conftest.$ac_ext
11869
11870 fi
11871 echo "$as_me:11871: result: $cf_cv_gnu_library" >&5
11872 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11873
11874 if test x$cf_cv_gnu_library = xyes; then
11875
11876         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11877         # was changed to help a little.  newlib incorporated the change about 4
11878         # years later.
11879         echo "$as_me:11879: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11880 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11881 if test "${cf_cv_gnu_library_219+set}" = set; then
11882   echo $ECHO_N "(cached) $ECHO_C" >&6
11883 else
11884
11885                 cf_save="$CPPFLAGS"
11886
11887         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11888         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11889
11890                 cat >conftest.$ac_ext <<_ACEOF
11891 #line 11891 "configure"
11892 #include "confdefs.h"
11893 #include <sys/types.h>
11894 int
11895 main (void)
11896 {
11897
11898                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11899                                 return 0;
11900                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11901                                 return 0;
11902                         #else
11903                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11904                         #endif
11905   ;
11906   return 0;
11907 }
11908 _ACEOF
11909 rm -f conftest.$ac_objext
11910 if { (eval echo "$as_me:11910: \"$ac_compile\"") >&5
11911   (eval $ac_compile) 2>&5
11912   ac_status=$?
11913   echo "$as_me:11913: \$? = $ac_status" >&5
11914   (exit $ac_status); } &&
11915          { ac_try='test -s conftest.$ac_objext'
11916   { (eval echo "$as_me:11916: \"$ac_try\"") >&5
11917   (eval $ac_try) 2>&5
11918   ac_status=$?
11919   echo "$as_me:11919: \$? = $ac_status" >&5
11920   (exit $ac_status); }; }; then
11921   cf_cv_gnu_library_219=yes
11922 else
11923   echo "$as_me: failed program was:" >&5
11924 cat conftest.$ac_ext >&5
11925 cf_cv_gnu_library_219=no
11926 fi
11927 rm -f conftest.$ac_objext conftest.$ac_ext
11928                 CPPFLAGS="$cf_save"
11929
11930 fi
11931 echo "$as_me:11931: result: $cf_cv_gnu_library_219" >&5
11932 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11933
11934         if test "x$cf_cv_gnu_library_219" = xyes; then
11935                 cf_save="$CPPFLAGS"
11936                 echo "$as_me:11936: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11937 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11938 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11939   echo $ECHO_N "(cached) $ECHO_C" >&6
11940 else
11941
11942 cf_fix_cppflags=no
11943 cf_new_cflags=
11944 cf_new_cppflags=
11945 cf_new_extra_cppflags=
11946
11947 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11948 do
11949 case $cf_fix_cppflags in
11950 (no)
11951         case $cf_add_cflags in
11952         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11953                 case $cf_add_cflags in
11954                 (-D*)
11955                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11956
11957                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11958                                 && test -z "${cf_tst_cflags}" \
11959                                 && cf_fix_cppflags=yes
11960
11961                         if test $cf_fix_cppflags = yes ; then
11962
11963         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11964         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11965
11966                                 continue
11967                         elif test "${cf_tst_cflags}" = "\"'" ; then
11968
11969         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11970         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11971
11972                                 continue
11973                         fi
11974                         ;;
11975                 esac
11976                 case "$CPPFLAGS" in
11977                 (*$cf_add_cflags)
11978                         ;;
11979                 (*)
11980                         case $cf_add_cflags in
11981                         (-D*)
11982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11983
11984 CPPFLAGS=`echo "$CPPFLAGS" | \
11985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11987
11988                                 ;;
11989                         esac
11990
11991         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11992         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11993
11994                         ;;
11995                 esac
11996                 ;;
11997         (*)
11998
11999         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12000         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12001
12002                 ;;
12003         esac
12004         ;;
12005 (yes)
12006
12007         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12008         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12009
12010         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12011
12012         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12013                 && test -z "${cf_tst_cflags}" \
12014                 && cf_fix_cppflags=no
12015         ;;
12016 esac
12017 done
12018
12019 if test -n "$cf_new_cflags" ; then
12020
12021         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12022         CFLAGS="${CFLAGS}$cf_new_cflags"
12023
12024 fi
12025
12026 if test -n "$cf_new_cppflags" ; then
12027
12028         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12029         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12030
12031 fi
12032
12033 if test -n "$cf_new_extra_cppflags" ; then
12034
12035         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12036         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12037
12038 fi
12039
12040                         cat >conftest.$ac_ext <<_ACEOF
12041 #line 12041 "configure"
12042 #include "confdefs.h"
12043
12044                                 #include <limits.h>
12045                                 #include <sys/types.h>
12046
12047 int
12048 main (void)
12049 {
12050
12051                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12052                                         return 0;
12053                                 #else
12054                                 #       error GNU C library is too old
12055                                 #endif
12056   ;
12057   return 0;
12058 }
12059 _ACEOF
12060 rm -f conftest.$ac_objext
12061 if { (eval echo "$as_me:12061: \"$ac_compile\"") >&5
12062   (eval $ac_compile) 2>&5
12063   ac_status=$?
12064   echo "$as_me:12064: \$? = $ac_status" >&5
12065   (exit $ac_status); } &&
12066          { ac_try='test -s conftest.$ac_objext'
12067   { (eval echo "$as_me:12067: \"$ac_try\"") >&5
12068   (eval $ac_try) 2>&5
12069   ac_status=$?
12070   echo "$as_me:12070: \$? = $ac_status" >&5
12071   (exit $ac_status); }; }; then
12072   cf_cv_gnu_dftsrc_219=yes
12073 else
12074   echo "$as_me: failed program was:" >&5
12075 cat conftest.$ac_ext >&5
12076 cf_cv_gnu_dftsrc_219=no
12077 fi
12078 rm -f conftest.$ac_objext conftest.$ac_ext
12079
12080 fi
12081 echo "$as_me:12081: result: $cf_cv_gnu_dftsrc_219" >&5
12082 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12083                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12084         else
12085                 cf_cv_gnu_dftsrc_219=maybe
12086         fi
12087
12088         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12089
12090                 echo "$as_me:12090: checking if we must define _GNU_SOURCE" >&5
12091 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12092 if test "${cf_cv_gnu_source+set}" = set; then
12093   echo $ECHO_N "(cached) $ECHO_C" >&6
12094 else
12095
12096                 cat >conftest.$ac_ext <<_ACEOF
12097 #line 12097 "configure"
12098 #include "confdefs.h"
12099 #include <sys/types.h>
12100 int
12101 main (void)
12102 {
12103
12104                         #ifndef _XOPEN_SOURCE
12105                         #error  expected _XOPEN_SOURCE to be defined
12106                         #endif
12107   ;
12108   return 0;
12109 }
12110 _ACEOF
12111 rm -f conftest.$ac_objext
12112 if { (eval echo "$as_me:12112: \"$ac_compile\"") >&5
12113   (eval $ac_compile) 2>&5
12114   ac_status=$?
12115   echo "$as_me:12115: \$? = $ac_status" >&5
12116   (exit $ac_status); } &&
12117          { ac_try='test -s conftest.$ac_objext'
12118   { (eval echo "$as_me:12118: \"$ac_try\"") >&5
12119   (eval $ac_try) 2>&5
12120   ac_status=$?
12121   echo "$as_me:12121: \$? = $ac_status" >&5
12122   (exit $ac_status); }; }; then
12123   cf_cv_gnu_source=no
12124 else
12125   echo "$as_me: failed program was:" >&5
12126 cat conftest.$ac_ext >&5
12127 cf_save="$CPPFLAGS"
12128
12129 cf_fix_cppflags=no
12130 cf_new_cflags=
12131 cf_new_cppflags=
12132 cf_new_extra_cppflags=
12133
12134 for cf_add_cflags in -D_GNU_SOURCE
12135 do
12136 case $cf_fix_cppflags in
12137 (no)
12138         case $cf_add_cflags in
12139         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12140                 case $cf_add_cflags in
12141                 (-D*)
12142                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12143
12144                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12145                                 && test -z "${cf_tst_cflags}" \
12146                                 && cf_fix_cppflags=yes
12147
12148                         if test $cf_fix_cppflags = yes ; then
12149
12150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12152
12153                                 continue
12154                         elif test "${cf_tst_cflags}" = "\"'" ; then
12155
12156         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12157         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12158
12159                                 continue
12160                         fi
12161                         ;;
12162                 esac
12163                 case "$CPPFLAGS" in
12164                 (*$cf_add_cflags)
12165                         ;;
12166                 (*)
12167                         case $cf_add_cflags in
12168                         (-D*)
12169                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12170
12171 CPPFLAGS=`echo "$CPPFLAGS" | \
12172         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12173                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12174
12175                                 ;;
12176                         esac
12177
12178         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12179         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12180
12181                         ;;
12182                 esac
12183                 ;;
12184         (*)
12185
12186         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12187         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12188
12189                 ;;
12190         esac
12191         ;;
12192 (yes)
12193
12194         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12195         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12196
12197         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12198
12199         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12200                 && test -z "${cf_tst_cflags}" \
12201                 && cf_fix_cppflags=no
12202         ;;
12203 esac
12204 done
12205
12206 if test -n "$cf_new_cflags" ; then
12207
12208         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12209         CFLAGS="${CFLAGS}$cf_new_cflags"
12210
12211 fi
12212
12213 if test -n "$cf_new_cppflags" ; then
12214
12215         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12216         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12217
12218 fi
12219
12220 if test -n "$cf_new_extra_cppflags" ; then
12221
12222         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12223         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12224
12225 fi
12226
12227                          cat >conftest.$ac_ext <<_ACEOF
12228 #line 12228 "configure"
12229 #include "confdefs.h"
12230 #include <sys/types.h>
12231 int
12232 main (void)
12233 {
12234
12235                                 #ifdef _XOPEN_SOURCE
12236                                 #error  expected _XOPEN_SOURCE to be undefined
12237                                 #endif
12238   ;
12239   return 0;
12240 }
12241 _ACEOF
12242 rm -f conftest.$ac_objext
12243 if { (eval echo "$as_me:12243: \"$ac_compile\"") >&5
12244   (eval $ac_compile) 2>&5
12245   ac_status=$?
12246   echo "$as_me:12246: \$? = $ac_status" >&5
12247   (exit $ac_status); } &&
12248          { ac_try='test -s conftest.$ac_objext'
12249   { (eval echo "$as_me:12249: \"$ac_try\"") >&5
12250   (eval $ac_try) 2>&5
12251   ac_status=$?
12252   echo "$as_me:12252: \$? = $ac_status" >&5
12253   (exit $ac_status); }; }; then
12254   cf_cv_gnu_source=no
12255 else
12256   echo "$as_me: failed program was:" >&5
12257 cat conftest.$ac_ext >&5
12258 cf_cv_gnu_source=yes
12259 fi
12260 rm -f conftest.$ac_objext conftest.$ac_ext
12261                         CPPFLAGS="$cf_save"
12262
12263 fi
12264 rm -f conftest.$ac_objext conftest.$ac_ext
12265
12266 fi
12267 echo "$as_me:12267: result: $cf_cv_gnu_source" >&5
12268 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12269
12270                 if test "$cf_cv_gnu_source" = yes
12271                 then
12272                 echo "$as_me:12272: checking if we should also define _DEFAULT_SOURCE" >&5
12273 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12274 if test "${cf_cv_default_source+set}" = set; then
12275   echo $ECHO_N "(cached) $ECHO_C" >&6
12276 else
12277
12278         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12279         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12280
12281                         cat >conftest.$ac_ext <<_ACEOF
12282 #line 12282 "configure"
12283 #include "confdefs.h"
12284 #include <sys/types.h>
12285 int
12286 main (void)
12287 {
12288
12289                                 #ifdef _DEFAULT_SOURCE
12290                                 #error  expected _DEFAULT_SOURCE to be undefined
12291                                 #endif
12292   ;
12293   return 0;
12294 }
12295 _ACEOF
12296 rm -f conftest.$ac_objext
12297 if { (eval echo "$as_me:12297: \"$ac_compile\"") >&5
12298   (eval $ac_compile) 2>&5
12299   ac_status=$?
12300   echo "$as_me:12300: \$? = $ac_status" >&5
12301   (exit $ac_status); } &&
12302          { ac_try='test -s conftest.$ac_objext'
12303   { (eval echo "$as_me:12303: \"$ac_try\"") >&5
12304   (eval $ac_try) 2>&5
12305   ac_status=$?
12306   echo "$as_me:12306: \$? = $ac_status" >&5
12307   (exit $ac_status); }; }; then
12308   cf_cv_default_source=no
12309 else
12310   echo "$as_me: failed program was:" >&5
12311 cat conftest.$ac_ext >&5
12312 cf_cv_default_source=yes
12313 fi
12314 rm -f conftest.$ac_objext conftest.$ac_ext
12315
12316 fi
12317 echo "$as_me:12317: result: $cf_cv_default_source" >&5
12318 echo "${ECHO_T}$cf_cv_default_source" >&6
12319                         if test "$cf_cv_default_source" = yes
12320                         then
12321
12322         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12323         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12324
12325                         fi
12326                 fi
12327         fi
12328
12329 fi
12330
12331         ;;
12332 (minix*)
12333         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12334         ;;
12335 (mirbsd*)
12336         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12337         cf_XOPEN_SOURCE=
12338
12339 if test "$cf_cv_posix_visible" = no; then
12340
12341 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12342
12343 cf_save_CFLAGS="$CFLAGS"
12344 cf_save_CPPFLAGS="$CPPFLAGS"
12345
12346 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12347         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12348                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12349
12350 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12351         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12352                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12353
12354 echo "$as_me:12354: checking if we should define _POSIX_C_SOURCE" >&5
12355 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12356 if test "${cf_cv_posix_c_source+set}" = set; then
12357   echo $ECHO_N "(cached) $ECHO_C" >&6
12358 else
12359
12360 echo "${as_me:-configure}:12360: testing if the symbol is already defined go no further ..." 1>&5
12361
12362         cat >conftest.$ac_ext <<_ACEOF
12363 #line 12363 "configure"
12364 #include "confdefs.h"
12365 #include <sys/types.h>
12366 int
12367 main (void)
12368 {
12369
12370 #ifndef _POSIX_C_SOURCE
12371 make an error
12372 #endif
12373   ;
12374   return 0;
12375 }
12376 _ACEOF
12377 rm -f conftest.$ac_objext
12378 if { (eval echo "$as_me:12378: \"$ac_compile\"") >&5
12379   (eval $ac_compile) 2>&5
12380   ac_status=$?
12381   echo "$as_me:12381: \$? = $ac_status" >&5
12382   (exit $ac_status); } &&
12383          { ac_try='test -s conftest.$ac_objext'
12384   { (eval echo "$as_me:12384: \"$ac_try\"") >&5
12385   (eval $ac_try) 2>&5
12386   ac_status=$?
12387   echo "$as_me:12387: \$? = $ac_status" >&5
12388   (exit $ac_status); }; }; then
12389   cf_cv_posix_c_source=no
12390 else
12391   echo "$as_me: failed program was:" >&5
12392 cat conftest.$ac_ext >&5
12393 cf_want_posix_source=no
12394          case .$cf_POSIX_C_SOURCE in
12395          (.[12]??*)
12396                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12397                 ;;
12398          (.2)
12399                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12400                 cf_want_posix_source=yes
12401                 ;;
12402          (.*)
12403                 cf_want_posix_source=yes
12404                 ;;
12405          esac
12406          if test "$cf_want_posix_source" = yes ; then
12407                 cat >conftest.$ac_ext <<_ACEOF
12408 #line 12408 "configure"
12409 #include "confdefs.h"
12410 #include <sys/types.h>
12411 int
12412 main (void)
12413 {
12414
12415 #ifdef _POSIX_SOURCE
12416 make an error
12417 #endif
12418   ;
12419   return 0;
12420 }
12421 _ACEOF
12422 rm -f conftest.$ac_objext
12423 if { (eval echo "$as_me:12423: \"$ac_compile\"") >&5
12424   (eval $ac_compile) 2>&5
12425   ac_status=$?
12426   echo "$as_me:12426: \$? = $ac_status" >&5
12427   (exit $ac_status); } &&
12428          { ac_try='test -s conftest.$ac_objext'
12429   { (eval echo "$as_me:12429: \"$ac_try\"") >&5
12430   (eval $ac_try) 2>&5
12431   ac_status=$?
12432   echo "$as_me:12432: \$? = $ac_status" >&5
12433   (exit $ac_status); }; }; then
12434   :
12435 else
12436   echo "$as_me: failed program was:" >&5
12437 cat conftest.$ac_ext >&5
12438 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12439 fi
12440 rm -f conftest.$ac_objext conftest.$ac_ext
12441          fi
12442
12443 echo "${as_me:-configure}:12443: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12444
12445          CFLAGS="$cf_trim_CFLAGS"
12446          CPPFLAGS="$cf_trim_CPPFLAGS"
12447
12448         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12449         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12450
12451 echo "${as_me:-configure}:12451: testing if the second compile does not leave our definition intact error ..." 1>&5
12452
12453          cat >conftest.$ac_ext <<_ACEOF
12454 #line 12454 "configure"
12455 #include "confdefs.h"
12456 #include <sys/types.h>
12457 int
12458 main (void)
12459 {
12460
12461 #ifndef _POSIX_C_SOURCE
12462 make an error
12463 #endif
12464   ;
12465   return 0;
12466 }
12467 _ACEOF
12468 rm -f conftest.$ac_objext
12469 if { (eval echo "$as_me:12469: \"$ac_compile\"") >&5
12470   (eval $ac_compile) 2>&5
12471   ac_status=$?
12472   echo "$as_me:12472: \$? = $ac_status" >&5
12473   (exit $ac_status); } &&
12474          { ac_try='test -s conftest.$ac_objext'
12475   { (eval echo "$as_me:12475: \"$ac_try\"") >&5
12476   (eval $ac_try) 2>&5
12477   ac_status=$?
12478   echo "$as_me:12478: \$? = $ac_status" >&5
12479   (exit $ac_status); }; }; then
12480   :
12481 else
12482   echo "$as_me: failed program was:" >&5
12483 cat conftest.$ac_ext >&5
12484 cf_cv_posix_c_source=no
12485 fi
12486 rm -f conftest.$ac_objext conftest.$ac_ext
12487          CFLAGS="$cf_save_CFLAGS"
12488          CPPFLAGS="$cf_save_CPPFLAGS"
12489
12490 fi
12491 rm -f conftest.$ac_objext conftest.$ac_ext
12492
12493 fi
12494 echo "$as_me:12494: result: $cf_cv_posix_c_source" >&5
12495 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12496
12497 if test "$cf_cv_posix_c_source" != no ; then
12498         CFLAGS="$cf_trim_CFLAGS"
12499         CPPFLAGS="$cf_trim_CPPFLAGS"
12500
12501 cf_fix_cppflags=no
12502 cf_new_cflags=
12503 cf_new_cppflags=
12504 cf_new_extra_cppflags=
12505
12506 for cf_add_cflags in $cf_cv_posix_c_source
12507 do
12508 case $cf_fix_cppflags in
12509 (no)
12510         case $cf_add_cflags in
12511         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12512                 case $cf_add_cflags in
12513                 (-D*)
12514                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12515
12516                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12517                                 && test -z "${cf_tst_cflags}" \
12518                                 && cf_fix_cppflags=yes
12519
12520                         if test $cf_fix_cppflags = yes ; then
12521
12522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12524
12525                                 continue
12526                         elif test "${cf_tst_cflags}" = "\"'" ; then
12527
12528         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12529         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12530
12531                                 continue
12532                         fi
12533                         ;;
12534                 esac
12535                 case "$CPPFLAGS" in
12536                 (*$cf_add_cflags)
12537                         ;;
12538                 (*)
12539                         case $cf_add_cflags in
12540                         (-D*)
12541                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12542
12543 CPPFLAGS=`echo "$CPPFLAGS" | \
12544         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12545                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12546
12547                                 ;;
12548                         esac
12549
12550         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12551         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12552
12553                         ;;
12554                 esac
12555                 ;;
12556         (*)
12557
12558         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12559         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12560
12561                 ;;
12562         esac
12563         ;;
12564 (yes)
12565
12566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12568
12569         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12570
12571         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12572                 && test -z "${cf_tst_cflags}" \
12573                 && cf_fix_cppflags=no
12574         ;;
12575 esac
12576 done
12577
12578 if test -n "$cf_new_cflags" ; then
12579
12580         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12581         CFLAGS="${CFLAGS}$cf_new_cflags"
12582
12583 fi
12584
12585 if test -n "$cf_new_cppflags" ; then
12586
12587         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12588         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12589
12590 fi
12591
12592 if test -n "$cf_new_extra_cppflags" ; then
12593
12594         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12595         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12596
12597 fi
12598
12599 fi
12600
12601 fi # cf_cv_posix_visible
12602
12603         ;;
12604 (netbsd*)
12605         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12606         ;;
12607 (openbsd[4-9]*)
12608         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12609         cf_xopen_source="-D_BSD_SOURCE"
12610         cf_XOPEN_SOURCE=600
12611         ;;
12612 (openbsd*)
12613         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12614         ;;
12615 (osf[45]*)
12616         cf_xopen_source="-D_OSF_SOURCE"
12617         ;;
12618 (nto-qnx*)
12619         cf_xopen_source="-D_QNX_SOURCE"
12620         ;;
12621 (sco*)
12622         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12623         ;;
12624 (solaris2.*)
12625         cf_xopen_source="-D__EXTENSIONS__"
12626         cf_cv_xopen_source=broken
12627         ;;
12628 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12629         cf_XOPEN_SOURCE=
12630         cf_POSIX_C_SOURCE=
12631         ;;
12632 (*)
12633
12634 echo "$as_me:12634: checking if we should define _XOPEN_SOURCE" >&5
12635 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12636 if test "${cf_cv_xopen_source+set}" = set; then
12637   echo $ECHO_N "(cached) $ECHO_C" >&6
12638 else
12639
12640         cat >conftest.$ac_ext <<_ACEOF
12641 #line 12641 "configure"
12642 #include "confdefs.h"
12643
12644 #include <stdlib.h>
12645 #include <string.h>
12646 #include <sys/types.h>
12647
12648 int
12649 main (void)
12650 {
12651
12652 #ifndef _XOPEN_SOURCE
12653 make an error
12654 #endif
12655   ;
12656   return 0;
12657 }
12658 _ACEOF
12659 rm -f conftest.$ac_objext
12660 if { (eval echo "$as_me:12660: \"$ac_compile\"") >&5
12661   (eval $ac_compile) 2>&5
12662   ac_status=$?
12663   echo "$as_me:12663: \$? = $ac_status" >&5
12664   (exit $ac_status); } &&
12665          { ac_try='test -s conftest.$ac_objext'
12666   { (eval echo "$as_me:12666: \"$ac_try\"") >&5
12667   (eval $ac_try) 2>&5
12668   ac_status=$?
12669   echo "$as_me:12669: \$? = $ac_status" >&5
12670   (exit $ac_status); }; }; then
12671   cf_cv_xopen_source=no
12672 else
12673   echo "$as_me: failed program was:" >&5
12674 cat conftest.$ac_ext >&5
12675 cf_save="$CPPFLAGS"
12676
12677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12678         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12679
12680          cat >conftest.$ac_ext <<_ACEOF
12681 #line 12681 "configure"
12682 #include "confdefs.h"
12683
12684 #include <stdlib.h>
12685 #include <string.h>
12686 #include <sys/types.h>
12687
12688 int
12689 main (void)
12690 {
12691
12692 #ifdef _XOPEN_SOURCE
12693 make an error
12694 #endif
12695   ;
12696   return 0;
12697 }
12698 _ACEOF
12699 rm -f conftest.$ac_objext
12700 if { (eval echo "$as_me:12700: \"$ac_compile\"") >&5
12701   (eval $ac_compile) 2>&5
12702   ac_status=$?
12703   echo "$as_me:12703: \$? = $ac_status" >&5
12704   (exit $ac_status); } &&
12705          { ac_try='test -s conftest.$ac_objext'
12706   { (eval echo "$as_me:12706: \"$ac_try\"") >&5
12707   (eval $ac_try) 2>&5
12708   ac_status=$?
12709   echo "$as_me:12709: \$? = $ac_status" >&5
12710   (exit $ac_status); }; }; then
12711   cf_cv_xopen_source=no
12712 else
12713   echo "$as_me: failed program was:" >&5
12714 cat conftest.$ac_ext >&5
12715 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12716 fi
12717 rm -f conftest.$ac_objext conftest.$ac_ext
12718         CPPFLAGS="$cf_save"
12719
12720 fi
12721 rm -f conftest.$ac_objext conftest.$ac_ext
12722
12723 fi
12724 echo "$as_me:12724: result: $cf_cv_xopen_source" >&5
12725 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12726
12727 if test "$cf_cv_xopen_source" != no ; then
12728
12729 CFLAGS=`echo "$CFLAGS" | \
12730         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12731                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12732
12733 CPPFLAGS=`echo "$CPPFLAGS" | \
12734         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12735                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12736
12737         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12738
12739 cf_fix_cppflags=no
12740 cf_new_cflags=
12741 cf_new_cppflags=
12742 cf_new_extra_cppflags=
12743
12744 for cf_add_cflags in $cf_temp_xopen_source
12745 do
12746 case $cf_fix_cppflags in
12747 (no)
12748         case $cf_add_cflags in
12749         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12750                 case $cf_add_cflags in
12751                 (-D*)
12752                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12753
12754                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12755                                 && test -z "${cf_tst_cflags}" \
12756                                 && cf_fix_cppflags=yes
12757
12758                         if test $cf_fix_cppflags = yes ; then
12759
12760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12762
12763                                 continue
12764                         elif test "${cf_tst_cflags}" = "\"'" ; then
12765
12766         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12767         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12768
12769                                 continue
12770                         fi
12771                         ;;
12772                 esac
12773                 case "$CPPFLAGS" in
12774                 (*$cf_add_cflags)
12775                         ;;
12776                 (*)
12777                         case $cf_add_cflags in
12778                         (-D*)
12779                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12780
12781 CPPFLAGS=`echo "$CPPFLAGS" | \
12782         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12783                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12784
12785                                 ;;
12786                         esac
12787
12788         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12789         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12790
12791                         ;;
12792                 esac
12793                 ;;
12794         (*)
12795
12796         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12797         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12798
12799                 ;;
12800         esac
12801         ;;
12802 (yes)
12803
12804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12806
12807         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12808
12809         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12810                 && test -z "${cf_tst_cflags}" \
12811                 && cf_fix_cppflags=no
12812         ;;
12813 esac
12814 done
12815
12816 if test -n "$cf_new_cflags" ; then
12817
12818         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12819         CFLAGS="${CFLAGS}$cf_new_cflags"
12820
12821 fi
12822
12823 if test -n "$cf_new_cppflags" ; then
12824
12825         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12826         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12827
12828 fi
12829
12830 if test -n "$cf_new_extra_cppflags" ; then
12831
12832         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12833         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12834
12835 fi
12836
12837 fi
12838
12839 if test "$cf_cv_posix_visible" = no; then
12840
12841 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12842
12843 cf_save_CFLAGS="$CFLAGS"
12844 cf_save_CPPFLAGS="$CPPFLAGS"
12845
12846 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12847         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12848                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12849
12850 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12851         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12852                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12853
12854 echo "$as_me:12854: checking if we should define _POSIX_C_SOURCE" >&5
12855 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12856 if test "${cf_cv_posix_c_source+set}" = set; then
12857   echo $ECHO_N "(cached) $ECHO_C" >&6
12858 else
12859
12860 echo "${as_me:-configure}:12860: testing if the symbol is already defined go no further ..." 1>&5
12861
12862         cat >conftest.$ac_ext <<_ACEOF
12863 #line 12863 "configure"
12864 #include "confdefs.h"
12865 #include <sys/types.h>
12866 int
12867 main (void)
12868 {
12869
12870 #ifndef _POSIX_C_SOURCE
12871 make an error
12872 #endif
12873   ;
12874   return 0;
12875 }
12876 _ACEOF
12877 rm -f conftest.$ac_objext
12878 if { (eval echo "$as_me:12878: \"$ac_compile\"") >&5
12879   (eval $ac_compile) 2>&5
12880   ac_status=$?
12881   echo "$as_me:12881: \$? = $ac_status" >&5
12882   (exit $ac_status); } &&
12883          { ac_try='test -s conftest.$ac_objext'
12884   { (eval echo "$as_me:12884: \"$ac_try\"") >&5
12885   (eval $ac_try) 2>&5
12886   ac_status=$?
12887   echo "$as_me:12887: \$? = $ac_status" >&5
12888   (exit $ac_status); }; }; then
12889   cf_cv_posix_c_source=no
12890 else
12891   echo "$as_me: failed program was:" >&5
12892 cat conftest.$ac_ext >&5
12893 cf_want_posix_source=no
12894          case .$cf_POSIX_C_SOURCE in
12895          (.[12]??*)
12896                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12897                 ;;
12898          (.2)
12899                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12900                 cf_want_posix_source=yes
12901                 ;;
12902          (.*)
12903                 cf_want_posix_source=yes
12904                 ;;
12905          esac
12906          if test "$cf_want_posix_source" = yes ; then
12907                 cat >conftest.$ac_ext <<_ACEOF
12908 #line 12908 "configure"
12909 #include "confdefs.h"
12910 #include <sys/types.h>
12911 int
12912 main (void)
12913 {
12914
12915 #ifdef _POSIX_SOURCE
12916 make an error
12917 #endif
12918   ;
12919   return 0;
12920 }
12921 _ACEOF
12922 rm -f conftest.$ac_objext
12923 if { (eval echo "$as_me:12923: \"$ac_compile\"") >&5
12924   (eval $ac_compile) 2>&5
12925   ac_status=$?
12926   echo "$as_me:12926: \$? = $ac_status" >&5
12927   (exit $ac_status); } &&
12928          { ac_try='test -s conftest.$ac_objext'
12929   { (eval echo "$as_me:12929: \"$ac_try\"") >&5
12930   (eval $ac_try) 2>&5
12931   ac_status=$?
12932   echo "$as_me:12932: \$? = $ac_status" >&5
12933   (exit $ac_status); }; }; then
12934   :
12935 else
12936   echo "$as_me: failed program was:" >&5
12937 cat conftest.$ac_ext >&5
12938 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12939 fi
12940 rm -f conftest.$ac_objext conftest.$ac_ext
12941          fi
12942
12943 echo "${as_me:-configure}:12943: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12944
12945          CFLAGS="$cf_trim_CFLAGS"
12946          CPPFLAGS="$cf_trim_CPPFLAGS"
12947
12948         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12949         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12950
12951 echo "${as_me:-configure}:12951: testing if the second compile does not leave our definition intact error ..." 1>&5
12952
12953          cat >conftest.$ac_ext <<_ACEOF
12954 #line 12954 "configure"
12955 #include "confdefs.h"
12956 #include <sys/types.h>
12957 int
12958 main (void)
12959 {
12960
12961 #ifndef _POSIX_C_SOURCE
12962 make an error
12963 #endif
12964   ;
12965   return 0;
12966 }
12967 _ACEOF
12968 rm -f conftest.$ac_objext
12969 if { (eval echo "$as_me:12969: \"$ac_compile\"") >&5
12970   (eval $ac_compile) 2>&5
12971   ac_status=$?
12972   echo "$as_me:12972: \$? = $ac_status" >&5
12973   (exit $ac_status); } &&
12974          { ac_try='test -s conftest.$ac_objext'
12975   { (eval echo "$as_me:12975: \"$ac_try\"") >&5
12976   (eval $ac_try) 2>&5
12977   ac_status=$?
12978   echo "$as_me:12978: \$? = $ac_status" >&5
12979   (exit $ac_status); }; }; then
12980   :
12981 else
12982   echo "$as_me: failed program was:" >&5
12983 cat conftest.$ac_ext >&5
12984 cf_cv_posix_c_source=no
12985 fi
12986 rm -f conftest.$ac_objext conftest.$ac_ext
12987          CFLAGS="$cf_save_CFLAGS"
12988          CPPFLAGS="$cf_save_CPPFLAGS"
12989
12990 fi
12991 rm -f conftest.$ac_objext conftest.$ac_ext
12992
12993 fi
12994 echo "$as_me:12994: result: $cf_cv_posix_c_source" >&5
12995 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12996
12997 if test "$cf_cv_posix_c_source" != no ; then
12998         CFLAGS="$cf_trim_CFLAGS"
12999         CPPFLAGS="$cf_trim_CPPFLAGS"
13000
13001 cf_fix_cppflags=no
13002 cf_new_cflags=
13003 cf_new_cppflags=
13004 cf_new_extra_cppflags=
13005
13006 for cf_add_cflags in $cf_cv_posix_c_source
13007 do
13008 case $cf_fix_cppflags in
13009 (no)
13010         case $cf_add_cflags in
13011         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13012                 case $cf_add_cflags in
13013                 (-D*)
13014                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13015
13016                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13017                                 && test -z "${cf_tst_cflags}" \
13018                                 && cf_fix_cppflags=yes
13019
13020                         if test $cf_fix_cppflags = yes ; then
13021
13022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13024
13025                                 continue
13026                         elif test "${cf_tst_cflags}" = "\"'" ; then
13027
13028         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13029         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13030
13031                                 continue
13032                         fi
13033                         ;;
13034                 esac
13035                 case "$CPPFLAGS" in
13036                 (*$cf_add_cflags)
13037                         ;;
13038                 (*)
13039                         case $cf_add_cflags in
13040                         (-D*)
13041                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13042
13043 CPPFLAGS=`echo "$CPPFLAGS" | \
13044         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13045                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13046
13047                                 ;;
13048                         esac
13049
13050         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13051         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13052
13053                         ;;
13054                 esac
13055                 ;;
13056         (*)
13057
13058         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13059         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13060
13061                 ;;
13062         esac
13063         ;;
13064 (yes)
13065
13066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13068
13069         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13070
13071         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13072                 && test -z "${cf_tst_cflags}" \
13073                 && cf_fix_cppflags=no
13074         ;;
13075 esac
13076 done
13077
13078 if test -n "$cf_new_cflags" ; then
13079
13080         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13081         CFLAGS="${CFLAGS}$cf_new_cflags"
13082
13083 fi
13084
13085 if test -n "$cf_new_cppflags" ; then
13086
13087         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13088         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13089
13090 fi
13091
13092 if test -n "$cf_new_extra_cppflags" ; then
13093
13094         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13095         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13096
13097 fi
13098
13099 fi
13100
13101 fi # cf_cv_posix_visible
13102
13103         ;;
13104 esac
13105
13106 if test -n "$cf_xopen_source" ; then
13107
13108 cf_fix_cppflags=no
13109 cf_new_cflags=
13110 cf_new_cppflags=
13111 cf_new_extra_cppflags=
13112
13113 for cf_add_cflags in $cf_xopen_source
13114 do
13115 case $cf_fix_cppflags in
13116 (no)
13117         case $cf_add_cflags in
13118         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13119                 case $cf_add_cflags in
13120                 (-D*)
13121                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13122
13123                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13124                                 && test -z "${cf_tst_cflags}" \
13125                                 && cf_fix_cppflags=yes
13126
13127                         if test $cf_fix_cppflags = yes ; then
13128
13129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13131
13132                                 continue
13133                         elif test "${cf_tst_cflags}" = "\"'" ; then
13134
13135         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13136         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13137
13138                                 continue
13139                         fi
13140                         ;;
13141                 esac
13142                 case "$CPPFLAGS" in
13143                 (*$cf_add_cflags)
13144                         ;;
13145                 (*)
13146                         case $cf_add_cflags in
13147                         (-D*)
13148                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13149
13150 CPPFLAGS=`echo "$CPPFLAGS" | \
13151         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13152                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13153
13154                                 ;;
13155                         esac
13156
13157         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13158         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13159
13160                         ;;
13161                 esac
13162                 ;;
13163         (*)
13164
13165         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13166         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13167
13168                 ;;
13169         esac
13170         ;;
13171 (yes)
13172
13173         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13174         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13175
13176         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13177
13178         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13179                 && test -z "${cf_tst_cflags}" \
13180                 && cf_fix_cppflags=no
13181         ;;
13182 esac
13183 done
13184
13185 if test -n "$cf_new_cflags" ; then
13186         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13187
13188 echo "${as_me:-configure}:13188: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13189
13190         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13191         CFLAGS="${CFLAGS}$cf_new_cflags"
13192
13193 fi
13194
13195 if test -n "$cf_new_cppflags" ; then
13196         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13197
13198 echo "${as_me:-configure}:13198: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13199
13200         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13201         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13202
13203 fi
13204
13205 if test -n "$cf_new_extra_cppflags" ; then
13206         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13207
13208 echo "${as_me:-configure}:13208: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13209
13210         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13211         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13212
13213 fi
13214
13215 fi
13216
13217 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13218         echo "$as_me:13218: checking if _XOPEN_SOURCE really is set" >&5
13219 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13220         cat >conftest.$ac_ext <<_ACEOF
13221 #line 13221 "configure"
13222 #include "confdefs.h"
13223 #include <stdlib.h>
13224 int
13225 main (void)
13226 {
13227
13228 #ifndef _XOPEN_SOURCE
13229 make an error
13230 #endif
13231   ;
13232   return 0;
13233 }
13234 _ACEOF
13235 rm -f conftest.$ac_objext
13236 if { (eval echo "$as_me:13236: \"$ac_compile\"") >&5
13237   (eval $ac_compile) 2>&5
13238   ac_status=$?
13239   echo "$as_me:13239: \$? = $ac_status" >&5
13240   (exit $ac_status); } &&
13241          { ac_try='test -s conftest.$ac_objext'
13242   { (eval echo "$as_me:13242: \"$ac_try\"") >&5
13243   (eval $ac_try) 2>&5
13244   ac_status=$?
13245   echo "$as_me:13245: \$? = $ac_status" >&5
13246   (exit $ac_status); }; }; then
13247   cf_XOPEN_SOURCE_set=yes
13248 else
13249   echo "$as_me: failed program was:" >&5
13250 cat conftest.$ac_ext >&5
13251 cf_XOPEN_SOURCE_set=no
13252 fi
13253 rm -f conftest.$ac_objext conftest.$ac_ext
13254         echo "$as_me:13254: result: $cf_XOPEN_SOURCE_set" >&5
13255 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13256         if test $cf_XOPEN_SOURCE_set = yes
13257         then
13258                 cat >conftest.$ac_ext <<_ACEOF
13259 #line 13259 "configure"
13260 #include "confdefs.h"
13261 #include <stdlib.h>
13262 int
13263 main (void)
13264 {
13265
13266 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13267 make an error
13268 #endif
13269   ;
13270   return 0;
13271 }
13272 _ACEOF
13273 rm -f conftest.$ac_objext
13274 if { (eval echo "$as_me:13274: \"$ac_compile\"") >&5
13275   (eval $ac_compile) 2>&5
13276   ac_status=$?
13277   echo "$as_me:13277: \$? = $ac_status" >&5
13278   (exit $ac_status); } &&
13279          { ac_try='test -s conftest.$ac_objext'
13280   { (eval echo "$as_me:13280: \"$ac_try\"") >&5
13281   (eval $ac_try) 2>&5
13282   ac_status=$?
13283   echo "$as_me:13283: \$? = $ac_status" >&5
13284   (exit $ac_status); }; }; then
13285   cf_XOPEN_SOURCE_set_ok=yes
13286 else
13287   echo "$as_me: failed program was:" >&5
13288 cat conftest.$ac_ext >&5
13289 cf_XOPEN_SOURCE_set_ok=no
13290 fi
13291 rm -f conftest.$ac_objext conftest.$ac_ext
13292                 if test $cf_XOPEN_SOURCE_set_ok = no
13293                 then
13294                         { echo "$as_me:13294: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13295 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13296                 fi
13297         else
13298
13299 echo "$as_me:13299: checking if we should define _XOPEN_SOURCE" >&5
13300 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13301 if test "${cf_cv_xopen_source+set}" = set; then
13302   echo $ECHO_N "(cached) $ECHO_C" >&6
13303 else
13304
13305         cat >conftest.$ac_ext <<_ACEOF
13306 #line 13306 "configure"
13307 #include "confdefs.h"
13308
13309 #include <stdlib.h>
13310 #include <string.h>
13311 #include <sys/types.h>
13312
13313 int
13314 main (void)
13315 {
13316
13317 #ifndef _XOPEN_SOURCE
13318 make an error
13319 #endif
13320   ;
13321   return 0;
13322 }
13323 _ACEOF
13324 rm -f conftest.$ac_objext
13325 if { (eval echo "$as_me:13325: \"$ac_compile\"") >&5
13326   (eval $ac_compile) 2>&5
13327   ac_status=$?
13328   echo "$as_me:13328: \$? = $ac_status" >&5
13329   (exit $ac_status); } &&
13330          { ac_try='test -s conftest.$ac_objext'
13331   { (eval echo "$as_me:13331: \"$ac_try\"") >&5
13332   (eval $ac_try) 2>&5
13333   ac_status=$?
13334   echo "$as_me:13334: \$? = $ac_status" >&5
13335   (exit $ac_status); }; }; then
13336   cf_cv_xopen_source=no
13337 else
13338   echo "$as_me: failed program was:" >&5
13339 cat conftest.$ac_ext >&5
13340 cf_save="$CPPFLAGS"
13341
13342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13343         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13344
13345          cat >conftest.$ac_ext <<_ACEOF
13346 #line 13346 "configure"
13347 #include "confdefs.h"
13348
13349 #include <stdlib.h>
13350 #include <string.h>
13351 #include <sys/types.h>
13352
13353 int
13354 main (void)
13355 {
13356
13357 #ifdef _XOPEN_SOURCE
13358 make an error
13359 #endif
13360   ;
13361   return 0;
13362 }
13363 _ACEOF
13364 rm -f conftest.$ac_objext
13365 if { (eval echo "$as_me:13365: \"$ac_compile\"") >&5
13366   (eval $ac_compile) 2>&5
13367   ac_status=$?
13368   echo "$as_me:13368: \$? = $ac_status" >&5
13369   (exit $ac_status); } &&
13370          { ac_try='test -s conftest.$ac_objext'
13371   { (eval echo "$as_me:13371: \"$ac_try\"") >&5
13372   (eval $ac_try) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit $ac_status); }; }; then
13376   cf_cv_xopen_source=no
13377 else
13378   echo "$as_me: failed program was:" >&5
13379 cat conftest.$ac_ext >&5
13380 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13381 fi
13382 rm -f conftest.$ac_objext conftest.$ac_ext
13383         CPPFLAGS="$cf_save"
13384
13385 fi
13386 rm -f conftest.$ac_objext conftest.$ac_ext
13387
13388 fi
13389 echo "$as_me:13389: result: $cf_cv_xopen_source" >&5
13390 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13391
13392 if test "$cf_cv_xopen_source" != no ; then
13393
13394 CFLAGS=`echo "$CFLAGS" | \
13395         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13396                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13397
13398 CPPFLAGS=`echo "$CPPFLAGS" | \
13399         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13400                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13401
13402         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13403
13404 cf_fix_cppflags=no
13405 cf_new_cflags=
13406 cf_new_cppflags=
13407 cf_new_extra_cppflags=
13408
13409 for cf_add_cflags in $cf_temp_xopen_source
13410 do
13411 case $cf_fix_cppflags in
13412 (no)
13413         case $cf_add_cflags in
13414         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13415                 case $cf_add_cflags in
13416                 (-D*)
13417                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13418
13419                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13420                                 && test -z "${cf_tst_cflags}" \
13421                                 && cf_fix_cppflags=yes
13422
13423                         if test $cf_fix_cppflags = yes ; then
13424
13425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13427
13428                                 continue
13429                         elif test "${cf_tst_cflags}" = "\"'" ; then
13430
13431         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13432         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13433
13434                                 continue
13435                         fi
13436                         ;;
13437                 esac
13438                 case "$CPPFLAGS" in
13439                 (*$cf_add_cflags)
13440                         ;;
13441                 (*)
13442                         case $cf_add_cflags in
13443                         (-D*)
13444                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13445
13446 CPPFLAGS=`echo "$CPPFLAGS" | \
13447         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13448                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13449
13450                                 ;;
13451                         esac
13452
13453         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13454         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13455
13456                         ;;
13457                 esac
13458                 ;;
13459         (*)
13460
13461         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13462         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13463
13464                 ;;
13465         esac
13466         ;;
13467 (yes)
13468
13469         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13470         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13471
13472         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13473
13474         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13475                 && test -z "${cf_tst_cflags}" \
13476                 && cf_fix_cppflags=no
13477         ;;
13478 esac
13479 done
13480
13481 if test -n "$cf_new_cflags" ; then
13482
13483         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13484         CFLAGS="${CFLAGS}$cf_new_cflags"
13485
13486 fi
13487
13488 if test -n "$cf_new_cppflags" ; then
13489
13490         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13491         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13492
13493 fi
13494
13495 if test -n "$cf_new_extra_cppflags" ; then
13496
13497         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13498         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13499
13500 fi
13501
13502 fi
13503
13504         fi
13505 fi
13506 fi # cf_cv_posix_visible
13507
13508 # Check whether --enable-largefile or --disable-largefile was given.
13509 if test "${enable_largefile+set}" = set; then
13510   enableval="$enable_largefile"
13511
13512 fi;
13513 if test "$enable_largefile" != no; then
13514
13515   echo "$as_me:13515: checking for special C compiler options needed for large files" >&5
13516 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13517 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13518   echo $ECHO_N "(cached) $ECHO_C" >&6
13519 else
13520   ac_cv_sys_largefile_CC=no
13521      if test "$GCC" != yes; then
13522        ac_save_CC=$CC
13523        while :; do
13524          # IRIX 6.2 and later do not support large files by default,
13525          # so use the C compiler's -n32 option if that helps.
13526          cat >conftest.$ac_ext <<_ACEOF
13527 #line 13527 "configure"
13528 #include "confdefs.h"
13529 #include <sys/types.h>
13530  /* Check that off_t can represent 2**63 - 1 correctly.
13531     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13532     since some C++ compilers masquerading as C compilers
13533     incorrectly reject 9223372036854775807.  */
13534 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13535   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13536                        && LARGE_OFF_T % 2147483647 == 1)
13537                       ? 1 : -1];
13538 int
13539 main (void)
13540 {
13541
13542   ;
13543   return 0;
13544 }
13545 _ACEOF
13546          rm -f conftest.$ac_objext
13547 if { (eval echo "$as_me:13547: \"$ac_compile\"") >&5
13548   (eval $ac_compile) 2>&5
13549   ac_status=$?
13550   echo "$as_me:13550: \$? = $ac_status" >&5
13551   (exit $ac_status); } &&
13552          { ac_try='test -s conftest.$ac_objext'
13553   { (eval echo "$as_me:13553: \"$ac_try\"") >&5
13554   (eval $ac_try) 2>&5
13555   ac_status=$?
13556   echo "$as_me:13556: \$? = $ac_status" >&5
13557   (exit $ac_status); }; }; then
13558   break
13559 else
13560   echo "$as_me: failed program was:" >&5
13561 cat conftest.$ac_ext >&5
13562 fi
13563 rm -f conftest.$ac_objext
13564          CC="$CC -n32"
13565          rm -f conftest.$ac_objext
13566 if { (eval echo "$as_me:13566: \"$ac_compile\"") >&5
13567   (eval $ac_compile) 2>&5
13568   ac_status=$?
13569   echo "$as_me:13569: \$? = $ac_status" >&5
13570   (exit $ac_status); } &&
13571          { ac_try='test -s conftest.$ac_objext'
13572   { (eval echo "$as_me:13572: \"$ac_try\"") >&5
13573   (eval $ac_try) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit $ac_status); }; }; then
13577   ac_cv_sys_largefile_CC=' -n32'; break
13578 else
13579   echo "$as_me: failed program was:" >&5
13580 cat conftest.$ac_ext >&5
13581 fi
13582 rm -f conftest.$ac_objext
13583          break
13584        done
13585        CC=$ac_save_CC
13586        rm -f conftest.$ac_ext
13587     fi
13588 fi
13589 echo "$as_me:13589: result: $ac_cv_sys_largefile_CC" >&5
13590 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13591   if test "$ac_cv_sys_largefile_CC" != no; then
13592     CC=$CC$ac_cv_sys_largefile_CC
13593   fi
13594
13595   echo "$as_me:13595: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13596 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13597 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13598   echo $ECHO_N "(cached) $ECHO_C" >&6
13599 else
13600   while :; do
13601   ac_cv_sys_file_offset_bits=no
13602   cat >conftest.$ac_ext <<_ACEOF
13603 #line 13603 "configure"
13604 #include "confdefs.h"
13605 #include <sys/types.h>
13606  /* Check that off_t can represent 2**63 - 1 correctly.
13607     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13608     since some C++ compilers masquerading as C compilers
13609     incorrectly reject 9223372036854775807.  */
13610 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13611   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13612                        && LARGE_OFF_T % 2147483647 == 1)
13613                       ? 1 : -1];
13614 int
13615 main (void)
13616 {
13617
13618   ;
13619   return 0;
13620 }
13621 _ACEOF
13622 rm -f conftest.$ac_objext
13623 if { (eval echo "$as_me:13623: \"$ac_compile\"") >&5
13624   (eval $ac_compile) 2>&5
13625   ac_status=$?
13626   echo "$as_me:13626: \$? = $ac_status" >&5
13627   (exit $ac_status); } &&
13628          { ac_try='test -s conftest.$ac_objext'
13629   { (eval echo "$as_me:13629: \"$ac_try\"") >&5
13630   (eval $ac_try) 2>&5
13631   ac_status=$?
13632   echo "$as_me:13632: \$? = $ac_status" >&5
13633   (exit $ac_status); }; }; then
13634   break
13635 else
13636   echo "$as_me: failed program was:" >&5
13637 cat conftest.$ac_ext >&5
13638 fi
13639 rm -f conftest.$ac_objext conftest.$ac_ext
13640   cat >conftest.$ac_ext <<_ACEOF
13641 #line 13641 "configure"
13642 #include "confdefs.h"
13643 #define _FILE_OFFSET_BITS 64
13644 #include <sys/types.h>
13645  /* Check that off_t can represent 2**63 - 1 correctly.
13646     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13647     since some C++ compilers masquerading as C compilers
13648     incorrectly reject 9223372036854775807.  */
13649 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13650   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13651                        && LARGE_OFF_T % 2147483647 == 1)
13652                       ? 1 : -1];
13653 int
13654 main (void)
13655 {
13656
13657   ;
13658   return 0;
13659 }
13660 _ACEOF
13661 rm -f conftest.$ac_objext
13662 if { (eval echo "$as_me:13662: \"$ac_compile\"") >&5
13663   (eval $ac_compile) 2>&5
13664   ac_status=$?
13665   echo "$as_me:13665: \$? = $ac_status" >&5
13666   (exit $ac_status); } &&
13667          { ac_try='test -s conftest.$ac_objext'
13668   { (eval echo "$as_me:13668: \"$ac_try\"") >&5
13669   (eval $ac_try) 2>&5
13670   ac_status=$?
13671   echo "$as_me:13671: \$? = $ac_status" >&5
13672   (exit $ac_status); }; }; then
13673   ac_cv_sys_file_offset_bits=64; break
13674 else
13675   echo "$as_me: failed program was:" >&5
13676 cat conftest.$ac_ext >&5
13677 fi
13678 rm -f conftest.$ac_objext conftest.$ac_ext
13679   break
13680 done
13681 fi
13682 echo "$as_me:13682: result: $ac_cv_sys_file_offset_bits" >&5
13683 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13684 if test "$ac_cv_sys_file_offset_bits" != no; then
13685
13686 cat >>confdefs.h <<EOF
13687 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13688 EOF
13689
13690 fi
13691 rm -rf conftest*
13692   echo "$as_me:13692: checking for _LARGE_FILES value needed for large files" >&5
13693 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13694 if test "${ac_cv_sys_large_files+set}" = set; then
13695   echo $ECHO_N "(cached) $ECHO_C" >&6
13696 else
13697   while :; do
13698   ac_cv_sys_large_files=no
13699   cat >conftest.$ac_ext <<_ACEOF
13700 #line 13700 "configure"
13701 #include "confdefs.h"
13702 #include <sys/types.h>
13703  /* Check that off_t can represent 2**63 - 1 correctly.
13704     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13705     since some C++ compilers masquerading as C compilers
13706     incorrectly reject 9223372036854775807.  */
13707 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13708   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13709                        && LARGE_OFF_T % 2147483647 == 1)
13710                       ? 1 : -1];
13711 int
13712 main (void)
13713 {
13714
13715   ;
13716   return 0;
13717 }
13718 _ACEOF
13719 rm -f conftest.$ac_objext
13720 if { (eval echo "$as_me:13720: \"$ac_compile\"") >&5
13721   (eval $ac_compile) 2>&5
13722   ac_status=$?
13723   echo "$as_me:13723: \$? = $ac_status" >&5
13724   (exit $ac_status); } &&
13725          { ac_try='test -s conftest.$ac_objext'
13726   { (eval echo "$as_me:13726: \"$ac_try\"") >&5
13727   (eval $ac_try) 2>&5
13728   ac_status=$?
13729   echo "$as_me:13729: \$? = $ac_status" >&5
13730   (exit $ac_status); }; }; then
13731   break
13732 else
13733   echo "$as_me: failed program was:" >&5
13734 cat conftest.$ac_ext >&5
13735 fi
13736 rm -f conftest.$ac_objext conftest.$ac_ext
13737   cat >conftest.$ac_ext <<_ACEOF
13738 #line 13738 "configure"
13739 #include "confdefs.h"
13740 #define _LARGE_FILES 1
13741 #include <sys/types.h>
13742  /* Check that off_t can represent 2**63 - 1 correctly.
13743     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13744     since some C++ compilers masquerading as C compilers
13745     incorrectly reject 9223372036854775807.  */
13746 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13747   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13748                        && LARGE_OFF_T % 2147483647 == 1)
13749                       ? 1 : -1];
13750 int
13751 main (void)
13752 {
13753
13754   ;
13755   return 0;
13756 }
13757 _ACEOF
13758 rm -f conftest.$ac_objext
13759 if { (eval echo "$as_me:13759: \"$ac_compile\"") >&5
13760   (eval $ac_compile) 2>&5
13761   ac_status=$?
13762   echo "$as_me:13762: \$? = $ac_status" >&5
13763   (exit $ac_status); } &&
13764          { ac_try='test -s conftest.$ac_objext'
13765   { (eval echo "$as_me:13765: \"$ac_try\"") >&5
13766   (eval $ac_try) 2>&5
13767   ac_status=$?
13768   echo "$as_me:13768: \$? = $ac_status" >&5
13769   (exit $ac_status); }; }; then
13770   ac_cv_sys_large_files=1; break
13771 else
13772   echo "$as_me: failed program was:" >&5
13773 cat conftest.$ac_ext >&5
13774 fi
13775 rm -f conftest.$ac_objext conftest.$ac_ext
13776   break
13777 done
13778 fi
13779 echo "$as_me:13779: result: $ac_cv_sys_large_files" >&5
13780 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13781 if test "$ac_cv_sys_large_files" != no; then
13782
13783 cat >>confdefs.h <<EOF
13784 #define _LARGE_FILES $ac_cv_sys_large_files
13785 EOF
13786
13787 fi
13788 rm -rf conftest*
13789 fi
13790
13791         if test "$enable_largefile" != no ; then
13792         echo "$as_me:13792: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13793 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13794 if test "${ac_cv_sys_largefile_source+set}" = set; then
13795   echo $ECHO_N "(cached) $ECHO_C" >&6
13796 else
13797   while :; do
13798   ac_cv_sys_largefile_source=no
13799   cat >conftest.$ac_ext <<_ACEOF
13800 #line 13800 "configure"
13801 #include "confdefs.h"
13802 #include <stdio.h>
13803 int
13804 main (void)
13805 {
13806 return !fseeko;
13807   ;
13808   return 0;
13809 }
13810 _ACEOF
13811 rm -f conftest.$ac_objext
13812 if { (eval echo "$as_me:13812: \"$ac_compile\"") >&5
13813   (eval $ac_compile) 2>&5
13814   ac_status=$?
13815   echo "$as_me:13815: \$? = $ac_status" >&5
13816   (exit $ac_status); } &&
13817          { ac_try='test -s conftest.$ac_objext'
13818   { (eval echo "$as_me:13818: \"$ac_try\"") >&5
13819   (eval $ac_try) 2>&5
13820   ac_status=$?
13821   echo "$as_me:13821: \$? = $ac_status" >&5
13822   (exit $ac_status); }; }; then
13823   break
13824 else
13825   echo "$as_me: failed program was:" >&5
13826 cat conftest.$ac_ext >&5
13827 fi
13828 rm -f conftest.$ac_objext conftest.$ac_ext
13829   cat >conftest.$ac_ext <<_ACEOF
13830 #line 13830 "configure"
13831 #include "confdefs.h"
13832 #define _LARGEFILE_SOURCE 1
13833 #include <stdio.h>
13834 int
13835 main (void)
13836 {
13837 return !fseeko;
13838   ;
13839   return 0;
13840 }
13841 _ACEOF
13842 rm -f conftest.$ac_objext
13843 if { (eval echo "$as_me:13843: \"$ac_compile\"") >&5
13844   (eval $ac_compile) 2>&5
13845   ac_status=$?
13846   echo "$as_me:13846: \$? = $ac_status" >&5
13847   (exit $ac_status); } &&
13848          { ac_try='test -s conftest.$ac_objext'
13849   { (eval echo "$as_me:13849: \"$ac_try\"") >&5
13850   (eval $ac_try) 2>&5
13851   ac_status=$?
13852   echo "$as_me:13852: \$? = $ac_status" >&5
13853   (exit $ac_status); }; }; then
13854   ac_cv_sys_largefile_source=1; break
13855 else
13856   echo "$as_me: failed program was:" >&5
13857 cat conftest.$ac_ext >&5
13858 fi
13859 rm -f conftest.$ac_objext conftest.$ac_ext
13860   break
13861 done
13862 fi
13863 echo "$as_me:13863: result: $ac_cv_sys_largefile_source" >&5
13864 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13865 if test "$ac_cv_sys_largefile_source" != no; then
13866
13867 cat >>confdefs.h <<EOF
13868 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13869 EOF
13870
13871 fi
13872 rm -rf conftest*
13873
13874 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13875 # in glibc 2.1.3, but that breaks too many other things.
13876 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13877 echo "$as_me:13877: checking for fseeko" >&5
13878 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13879 if test "${ac_cv_func_fseeko+set}" = set; then
13880   echo $ECHO_N "(cached) $ECHO_C" >&6
13881 else
13882   cat >conftest.$ac_ext <<_ACEOF
13883 #line 13883 "configure"
13884 #include "confdefs.h"
13885 #include <stdio.h>
13886 int
13887 main (void)
13888 {
13889 return fseeko && fseeko (stdin, 0, 0);
13890   ;
13891   return 0;
13892 }
13893 _ACEOF
13894 rm -f conftest.$ac_objext conftest$ac_exeext
13895 if { (eval echo "$as_me:13895: \"$ac_link\"") >&5
13896   (eval $ac_link) 2>&5
13897   ac_status=$?
13898   echo "$as_me:13898: \$? = $ac_status" >&5
13899   (exit $ac_status); } &&
13900          { ac_try='test -s conftest$ac_exeext'
13901   { (eval echo "$as_me:13901: \"$ac_try\"") >&5
13902   (eval $ac_try) 2>&5
13903   ac_status=$?
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit $ac_status); }; }; then
13906   ac_cv_func_fseeko=yes
13907 else
13908   echo "$as_me: failed program was:" >&5
13909 cat conftest.$ac_ext >&5
13910 ac_cv_func_fseeko=no
13911 fi
13912 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13913 fi
13914 echo "$as_me:13914: result: $ac_cv_func_fseeko" >&5
13915 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13916 if test $ac_cv_func_fseeko = yes; then
13917
13918 cat >>confdefs.h <<\EOF
13919 #define HAVE_FSEEKO 1
13920 EOF
13921
13922 fi
13923
13924         # Normally we would collect these definitions in the config.h,
13925         # but (like _XOPEN_SOURCE), some environments rely on having these
13926         # defined before any of the system headers are included.  Another
13927         # case comes up with C++, e.g., on AIX the compiler compiles the
13928         # header files by themselves before looking at the body files it is
13929         # told to compile.  For ncurses, those header files do not include
13930         # the config.h
13931         if test "$ac_cv_sys_large_files" != no
13932         then
13933
13934         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13935         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13936
13937         fi
13938         if test "$ac_cv_sys_largefile_source" != no
13939         then
13940
13941         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13942         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13943
13944         fi
13945         if test "$ac_cv_sys_file_offset_bits" != no
13946         then
13947
13948         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13949         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13950
13951         fi
13952
13953         echo "$as_me:13953: checking whether to use struct dirent64" >&5
13954 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13955 if test "${cf_cv_struct_dirent64+set}" = set; then
13956   echo $ECHO_N "(cached) $ECHO_C" >&6
13957 else
13958
13959                 cat >conftest.$ac_ext <<_ACEOF
13960 #line 13960 "configure"
13961 #include "confdefs.h"
13962
13963 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13964 #include <sys/types.h>
13965 #include <dirent.h>
13966
13967 int
13968 main (void)
13969 {
13970
13971                 /* if transitional largefile support is setup, this is true */
13972                 extern struct dirent64 * readdir(DIR *);
13973                 struct dirent64 *x = readdir((DIR *)0);
13974                 struct dirent *y = readdir((DIR *)0);
13975                 int z = x - y;
13976                 (void)z;
13977
13978   ;
13979   return 0;
13980 }
13981 _ACEOF
13982 rm -f conftest.$ac_objext
13983 if { (eval echo "$as_me:13983: \"$ac_compile\"") >&5
13984   (eval $ac_compile) 2>&5
13985   ac_status=$?
13986   echo "$as_me:13986: \$? = $ac_status" >&5
13987   (exit $ac_status); } &&
13988          { ac_try='test -s conftest.$ac_objext'
13989   { (eval echo "$as_me:13989: \"$ac_try\"") >&5
13990   (eval $ac_try) 2>&5
13991   ac_status=$?
13992   echo "$as_me:13992: \$? = $ac_status" >&5
13993   (exit $ac_status); }; }; then
13994   cf_cv_struct_dirent64=yes
13995 else
13996   echo "$as_me: failed program was:" >&5
13997 cat conftest.$ac_ext >&5
13998 cf_cv_struct_dirent64=no
13999 fi
14000 rm -f conftest.$ac_objext conftest.$ac_ext
14001
14002 fi
14003 echo "$as_me:14003: result: $cf_cv_struct_dirent64" >&5
14004 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14005         test "$cf_cv_struct_dirent64" = yes &&
14006 cat >>confdefs.h <<\EOF
14007 #define HAVE_STRUCT_DIRENT64 1
14008 EOF
14009
14010         fi
14011
14012 ### Enable compiling-in rcs id's
14013 echo "$as_me:14013: checking if RCS identifiers should be compiled-in" >&5
14014 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14015
14016 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14017 if test "${with_rcs_ids+set}" = set; then
14018   withval="$with_rcs_ids"
14019   with_rcs_ids=$withval
14020 else
14021   with_rcs_ids=no
14022 fi;
14023 echo "$as_me:14023: result: $with_rcs_ids" >&5
14024 echo "${ECHO_T}$with_rcs_ids" >&6
14025 test "$with_rcs_ids" = yes &&
14026 cat >>confdefs.h <<\EOF
14027 #define USE_RCS_IDS 1
14028 EOF
14029
14030 ###############################################################################
14031
14032 ### Note that some functions (such as const) are normally disabled anyway.
14033 echo "$as_me:14033: checking if you want to build with function extensions" >&5
14034 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14035
14036 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14037 if test "${enable_ext_funcs+set}" = set; then
14038   enableval="$enable_ext_funcs"
14039   with_ext_funcs=$enableval
14040 else
14041   with_ext_funcs=yes
14042 fi;
14043 echo "$as_me:14043: result: $with_ext_funcs" >&5
14044 echo "${ECHO_T}$with_ext_funcs" >&6
14045 if test "$with_ext_funcs" = yes ; then
14046         NCURSES_EXT_FUNCS=1
14047
14048 cat >>confdefs.h <<\EOF
14049 #define HAVE_USE_DEFAULT_COLORS 1
14050 EOF
14051
14052 cat >>confdefs.h <<\EOF
14053 #define NCURSES_EXT_FUNCS 1
14054 EOF
14055
14056 else
14057         NCURSES_EXT_FUNCS=0
14058 fi
14059
14060 ###   use option --enable-const to turn on use of const beyond that in XSI.
14061 echo "$as_me:14061: checking for extended use of const keyword" >&5
14062 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14063
14064 # Check whether --enable-const or --disable-const was given.
14065 if test "${enable_const+set}" = set; then
14066   enableval="$enable_const"
14067   with_ext_const=$enableval
14068 else
14069   with_ext_const=no
14070 fi;
14071 echo "$as_me:14071: result: $with_ext_const" >&5
14072 echo "${ECHO_T}$with_ext_const" >&6
14073 NCURSES_CONST='/*nothing*/'
14074 if test "$with_ext_const" = yes ; then
14075         NCURSES_CONST=const
14076 fi
14077
14078 ###############################################################################
14079 # These options are relatively safe to experiment with.
14080
14081 echo "$as_me:14081: checking if you want all development code" >&5
14082 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14083
14084 # Check whether --with-develop or --without-develop was given.
14085 if test "${with_develop+set}" = set; then
14086   withval="$with_develop"
14087   with_develop=$withval
14088 else
14089   with_develop=no
14090 fi;
14091 echo "$as_me:14091: result: $with_develop" >&5
14092 echo "${ECHO_T}$with_develop" >&6
14093
14094 ###############################################################################
14095 # These are just experimental, probably should not be in a package:
14096
14097 # This is still experimental (20080329), but should ultimately be moved to
14098 # the script-block --with-normal, etc.
14099
14100 echo "$as_me:14100: checking if you want to link with the pthread library" >&5
14101 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14102
14103 # Check whether --with-pthread or --without-pthread was given.
14104 if test "${with_pthread+set}" = set; then
14105   withval="$with_pthread"
14106   with_pthread=$withval
14107 else
14108   with_pthread=no
14109 fi;
14110 echo "$as_me:14110: result: $with_pthread" >&5
14111 echo "${ECHO_T}$with_pthread" >&6
14112
14113 if test "$with_pthread" != no ; then
14114         echo "$as_me:14114: checking for pthread.h" >&5
14115 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14116 if test "${ac_cv_header_pthread_h+set}" = set; then
14117   echo $ECHO_N "(cached) $ECHO_C" >&6
14118 else
14119   cat >conftest.$ac_ext <<_ACEOF
14120 #line 14120 "configure"
14121 #include "confdefs.h"
14122 #include <pthread.h>
14123 _ACEOF
14124 if { (eval echo "$as_me:14124: \"$ac_cpp conftest.$ac_ext\"") >&5
14125   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14126   ac_status=$?
14127   egrep -v '^ *\+' conftest.er1 >conftest.err
14128   rm -f conftest.er1
14129   cat conftest.err >&5
14130   echo "$as_me:14130: \$? = $ac_status" >&5
14131   (exit $ac_status); } >/dev/null; then
14132   if test -s conftest.err; then
14133     ac_cpp_err=$ac_c_preproc_warn_flag
14134   else
14135     ac_cpp_err=
14136   fi
14137 else
14138   ac_cpp_err=yes
14139 fi
14140 if test -z "$ac_cpp_err"; then
14141   ac_cv_header_pthread_h=yes
14142 else
14143   echo "$as_me: failed program was:" >&5
14144   cat conftest.$ac_ext >&5
14145   ac_cv_header_pthread_h=no
14146 fi
14147 rm -f conftest.err conftest.$ac_ext
14148 fi
14149 echo "$as_me:14149: result: $ac_cv_header_pthread_h" >&5
14150 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14151 if test $ac_cv_header_pthread_h = yes; then
14152
14153 cat >>confdefs.h <<\EOF
14154 #define HAVE_PTHREADS_H 1
14155 EOF
14156
14157         for cf_lib_pthread in pthread c_r
14158         do
14159             echo "$as_me:14159: checking if we can link with the $cf_lib_pthread library" >&5
14160 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14161             cf_save_LIBS="$LIBS"
14162
14163 cf_add_libs="$LIBS"
14164 # reverse order
14165 cf_add_0lib=
14166 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14167 # filter duplicates
14168 for cf_add_1lib in $cf_add_0lib; do
14169         for cf_add_2lib in $cf_add_libs; do
14170                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14171                         cf_add_1lib=
14172                         break
14173                 fi
14174         done
14175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14176 done
14177 LIBS="$cf_add_libs"
14178
14179             cat >conftest.$ac_ext <<_ACEOF
14180 #line 14180 "configure"
14181 #include "confdefs.h"
14182
14183 #include <pthread.h>
14184
14185 int
14186 main (void)
14187 {
14188
14189                 int rc = pthread_create(0,0,0,0);
14190                 int r2 = pthread_mutexattr_settype(0, 0);
14191
14192   ;
14193   return 0;
14194 }
14195 _ACEOF
14196 rm -f conftest.$ac_objext conftest$ac_exeext
14197 if { (eval echo "$as_me:14197: \"$ac_link\"") >&5
14198   (eval $ac_link) 2>&5
14199   ac_status=$?
14200   echo "$as_me:14200: \$? = $ac_status" >&5
14201   (exit $ac_status); } &&
14202          { ac_try='test -s conftest$ac_exeext'
14203   { (eval echo "$as_me:14203: \"$ac_try\"") >&5
14204   (eval $ac_try) 2>&5
14205   ac_status=$?
14206   echo "$as_me:14206: \$? = $ac_status" >&5
14207   (exit $ac_status); }; }; then
14208   with_pthread=yes
14209 else
14210   echo "$as_me: failed program was:" >&5
14211 cat conftest.$ac_ext >&5
14212 with_pthread=no
14213 fi
14214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14215             LIBS="$cf_save_LIBS"
14216             echo "$as_me:14216: result: $with_pthread" >&5
14217 echo "${ECHO_T}$with_pthread" >&6
14218             test "$with_pthread" = yes && break
14219         done
14220
14221         if test "$with_pthread" = yes ; then
14222
14223 cf_add_libs="$LIBS"
14224 # reverse order
14225 cf_add_0lib=
14226 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14227 # filter duplicates
14228 for cf_add_1lib in $cf_add_0lib; do
14229         for cf_add_2lib in $cf_add_libs; do
14230                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14231                         cf_add_1lib=
14232                         break
14233                 fi
14234         done
14235         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14236 done
14237 LIBS="$cf_add_libs"
14238
14239 cat >>confdefs.h <<\EOF
14240 #define HAVE_LIBPTHREADS 1
14241 EOF
14242
14243         else
14244             { { echo "$as_me:14244: error: Cannot link with pthread library" >&5
14245 echo "$as_me: error: Cannot link with pthread library" >&2;}
14246    { (exit 1); exit 1; }; }
14247         fi
14248
14249 fi
14250
14251 fi
14252
14253 echo "$as_me:14253: checking if you want to use weak-symbols for pthreads" >&5
14254 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14255
14256 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14257 if test "${enable_weak_symbols+set}" = set; then
14258   enableval="$enable_weak_symbols"
14259   use_weak_symbols=$withval
14260 else
14261   use_weak_symbols=no
14262 fi;
14263 echo "$as_me:14263: result: $use_weak_symbols" >&5
14264 echo "${ECHO_T}$use_weak_symbols" >&6
14265 if test "$use_weak_symbols" = yes ; then
14266
14267 echo "$as_me:14267: checking if $CC supports weak symbols" >&5
14268 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14269 if test "${cf_cv_weak_symbols+set}" = set; then
14270   echo $ECHO_N "(cached) $ECHO_C" >&6
14271 else
14272
14273 cat >conftest.$ac_ext <<_ACEOF
14274 #line 14274 "configure"
14275 #include "confdefs.h"
14276
14277 #include <stdio.h>
14278 int
14279 main (void)
14280 {
14281
14282 #if defined(__GNUC__)
14283 #  if defined __USE_ISOC99
14284 #    define _cat_pragma(exp)    _Pragma(#exp)
14285 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14286 #  else
14287 #    define _weak_pragma(exp)
14288 #  endif
14289 #  define _declare(name)        __extension__ extern __typeof__(name) name
14290 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14291 #endif
14292
14293 weak_symbol(fopen);
14294
14295   ;
14296   return 0;
14297 }
14298 _ACEOF
14299 rm -f conftest.$ac_objext
14300 if { (eval echo "$as_me:14300: \"$ac_compile\"") >&5
14301   (eval $ac_compile) 2>&5
14302   ac_status=$?
14303   echo "$as_me:14303: \$? = $ac_status" >&5
14304   (exit $ac_status); } &&
14305          { ac_try='test -s conftest.$ac_objext'
14306   { (eval echo "$as_me:14306: \"$ac_try\"") >&5
14307   (eval $ac_try) 2>&5
14308   ac_status=$?
14309   echo "$as_me:14309: \$? = $ac_status" >&5
14310   (exit $ac_status); }; }; then
14311   cf_cv_weak_symbols=yes
14312 else
14313   echo "$as_me: failed program was:" >&5
14314 cat conftest.$ac_ext >&5
14315 cf_cv_weak_symbols=no
14316 fi
14317 rm -f conftest.$ac_objext conftest.$ac_ext
14318
14319 fi
14320 echo "$as_me:14320: result: $cf_cv_weak_symbols" >&5
14321 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14322
14323 else
14324         cf_cv_weak_symbols=no
14325 fi
14326
14327 if test $cf_cv_weak_symbols = yes ; then
14328
14329 cat >>confdefs.h <<\EOF
14330 #define USE_WEAK_SYMBOLS 1
14331 EOF
14332
14333 fi
14334
14335 PTHREAD=
14336 if test "$with_pthread" = "yes" ; then
14337
14338 cat >>confdefs.h <<\EOF
14339 #define USE_PTHREADS 1
14340 EOF
14341
14342         enable_reentrant=yes
14343         if test $cf_cv_weak_symbols = yes ; then
14344                 PTHREAD=-lpthread
14345         fi
14346 fi
14347
14348 # OpenSUSE is installing ncurses6, using reentrant option.
14349 echo "$as_me:14349: checking for _nc_TABSIZE" >&5
14350 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14351 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14352   echo $ECHO_N "(cached) $ECHO_C" >&6
14353 else
14354   cat >conftest.$ac_ext <<_ACEOF
14355 #line 14355 "configure"
14356 #include "confdefs.h"
14357 #define _nc_TABSIZE autoconf_temporary
14358 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14359 #undef _nc_TABSIZE
14360
14361 #ifdef __cplusplus
14362 extern "C"
14363 #endif
14364
14365 /* We use char because int might match the return type of a gcc2
14366    builtin and then its argument prototype would still apply.  */
14367 char _nc_TABSIZE (void);
14368
14369 int
14370 main (void)
14371 {
14372
14373 /* The GNU C library defines stubs for functions which it implements
14374     to always fail with ENOSYS.  Some functions are actually named
14375     something starting with __ and the normal name is an alias.  */
14376 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14377 #error found stub for _nc_TABSIZE
14378 #endif
14379
14380         return _nc_TABSIZE ();
14381   ;
14382   return 0;
14383 }
14384 _ACEOF
14385 rm -f conftest.$ac_objext conftest$ac_exeext
14386 if { (eval echo "$as_me:14386: \"$ac_link\"") >&5
14387   (eval $ac_link) 2>&5
14388   ac_status=$?
14389   echo "$as_me:14389: \$? = $ac_status" >&5
14390   (exit $ac_status); } &&
14391          { ac_try='test -s conftest$ac_exeext'
14392   { (eval echo "$as_me:14392: \"$ac_try\"") >&5
14393   (eval $ac_try) 2>&5
14394   ac_status=$?
14395   echo "$as_me:14395: \$? = $ac_status" >&5
14396   (exit $ac_status); }; }; then
14397   ac_cv_func__nc_TABSIZE=yes
14398 else
14399   echo "$as_me: failed program was:" >&5
14400 cat conftest.$ac_ext >&5
14401 ac_cv_func__nc_TABSIZE=no
14402 fi
14403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14404 fi
14405 echo "$as_me:14405: result: $ac_cv_func__nc_TABSIZE" >&5
14406 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14407 if test $ac_cv_func__nc_TABSIZE = yes; then
14408   assume_reentrant=yes
14409 else
14410   assume_reentrant=no
14411 fi
14412
14413 # Reentrant code has to be opaque; there's little advantage to making ncurses
14414 # opaque outside of that, so there is no --enable-opaque option.  We can use
14415 # this option without --with-pthreads, but this will be always set for
14416 # pthreads.
14417 echo "$as_me:14417: checking if you want experimental reentrant code" >&5
14418 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14419
14420 # Check whether --enable-reentrant or --disable-reentrant was given.
14421 if test "${enable_reentrant+set}" = set; then
14422   enableval="$enable_reentrant"
14423   with_reentrant=$enableval
14424 else
14425   with_reentrant=$assume_reentrant
14426 fi;
14427 echo "$as_me:14427: result: $with_reentrant" >&5
14428 echo "${ECHO_T}$with_reentrant" >&6
14429 if test "$with_reentrant" = yes ; then
14430         cf_cv_enable_reentrant=1
14431         if test $cf_cv_weak_symbols = yes ; then
14432
14433 # remove pthread library from $LIBS
14434 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14435
14436         elif test "$assume_reentrant" = no ; then
14437                 LIB_SUFFIX="t${LIB_SUFFIX}"
14438         fi
14439
14440 cat >>confdefs.h <<\EOF
14441 #define USE_REENTRANT 1
14442 EOF
14443
14444 else
14445         cf_cv_enable_reentrant=0
14446 fi
14447
14448 ### Allow using a different wrap-prefix
14449 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14450         echo "$as_me:14450: checking for prefix used to wrap public variables" >&5
14451 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14452
14453 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14454 if test "${with_wrap_prefix+set}" = set; then
14455   withval="$with_wrap_prefix"
14456   NCURSES_WRAP_PREFIX=$withval
14457 else
14458   NCURSES_WRAP_PREFIX=_nc_
14459 fi;
14460         echo "$as_me:14460: result: $NCURSES_WRAP_PREFIX" >&5
14461 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14462 else
14463         NCURSES_WRAP_PREFIX=_nc_
14464 fi
14465
14466 cat >>confdefs.h <<EOF
14467 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14468 EOF
14469
14470 ###############################################################################
14471
14472 ###     use option --disable-echo to suppress full display compiling commands
14473
14474 echo "$as_me:14474: checking if you want to see long compiling messages" >&5
14475 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14476
14477 # Check whether --enable-echo or --disable-echo was given.
14478 if test "${enable_echo+set}" = set; then
14479   enableval="$enable_echo"
14480   test "$enableval" != no && enableval=yes
14481         if test "$enableval" != "yes" ; then
14482
14483         ECHO_LT='--silent'
14484         ECHO_LD='@echo linking $@;'
14485         RULE_CC='@echo compiling $<'
14486         SHOW_CC='@echo compiling $@'
14487         ECHO_CC='@'
14488
14489         else
14490
14491         ECHO_LT=''
14492         ECHO_LD=''
14493         RULE_CC=''
14494         SHOW_CC=''
14495         ECHO_CC=''
14496
14497         fi
14498 else
14499   enableval=yes
14500
14501         ECHO_LT=''
14502         ECHO_LD=''
14503         RULE_CC=''
14504         SHOW_CC=''
14505         ECHO_CC=''
14506
14507 fi;
14508 echo "$as_me:14508: result: $enableval" >&5
14509 echo "${ECHO_T}$enableval" >&6
14510
14511 ###     use option --enable-warnings to turn on all gcc warnings
14512 echo "$as_me:14512: checking if you want to see compiler warnings" >&5
14513 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14514
14515 # Check whether --enable-warnings or --disable-warnings was given.
14516 if test "${enable_warnings+set}" = set; then
14517   enableval="$enable_warnings"
14518   with_warnings=$enableval
14519 fi;
14520 echo "$as_me:14520: result: $with_warnings" >&5
14521 echo "${ECHO_T}$with_warnings" >&6
14522
14523 if test "x$with_warnings" = "xyes"; then
14524
14525         ADAFLAGS="$ADAFLAGS -gnatg"
14526
14527 if test "x$have_x" = xyes; then
14528
14529 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14530 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14531 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14532 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14533 for cf_X_CFLAGS in $X_CFLAGS
14534 do
14535         case "x$cf_X_CFLAGS" in
14536         x-[IUD]*)
14537                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14538                 ;;
14539         *)
14540                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14541                 ;;
14542         esac
14543 done
14544
14545 cat >conftest.$ac_ext <<_ACEOF
14546 #line 14546 "configure"
14547 #include "confdefs.h"
14548
14549 #include <stdlib.h>
14550 #include <X11/Intrinsic.h>
14551
14552 int
14553 main (void)
14554 {
14555 String foo = malloc(1); (void)foo
14556   ;
14557   return 0;
14558 }
14559 _ACEOF
14560 rm -f conftest.$ac_objext
14561 if { (eval echo "$as_me:14561: \"$ac_compile\"") >&5
14562   (eval $ac_compile) 2>&5
14563   ac_status=$?
14564   echo "$as_me:14564: \$? = $ac_status" >&5
14565   (exit $ac_status); } &&
14566          { ac_try='test -s conftest.$ac_objext'
14567   { (eval echo "$as_me:14567: \"$ac_try\"") >&5
14568   (eval $ac_try) 2>&5
14569   ac_status=$?
14570   echo "$as_me:14570: \$? = $ac_status" >&5
14571   (exit $ac_status); }; }; then
14572
14573 echo "$as_me:14573: checking for X11/Xt const-feature" >&5
14574 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14575 if test "${cf_cv_const_x_string+set}" = set; then
14576   echo $ECHO_N "(cached) $ECHO_C" >&6
14577 else
14578
14579         cat >conftest.$ac_ext <<_ACEOF
14580 #line 14580 "configure"
14581 #include "confdefs.h"
14582
14583 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14584 #undef  XTSTRINGDEFINES /* X11R5 and later */
14585 #include <stdlib.h>
14586 #include <X11/Intrinsic.h>
14587
14588 int
14589 main (void)
14590 {
14591 String foo = malloc(1); *foo = 0
14592   ;
14593   return 0;
14594 }
14595 _ACEOF
14596 rm -f conftest.$ac_objext
14597 if { (eval echo "$as_me:14597: \"$ac_compile\"") >&5
14598   (eval $ac_compile) 2>&5
14599   ac_status=$?
14600   echo "$as_me:14600: \$? = $ac_status" >&5
14601   (exit $ac_status); } &&
14602          { ac_try='test -s conftest.$ac_objext'
14603   { (eval echo "$as_me:14603: \"$ac_try\"") >&5
14604   (eval $ac_try) 2>&5
14605   ac_status=$?
14606   echo "$as_me:14606: \$? = $ac_status" >&5
14607   (exit $ac_status); }; }; then
14608
14609                         cf_cv_const_x_string=no
14610
14611 else
14612   echo "$as_me: failed program was:" >&5
14613 cat conftest.$ac_ext >&5
14614
14615                         cf_cv_const_x_string=yes
14616
14617 fi
14618 rm -f conftest.$ac_objext conftest.$ac_ext
14619
14620 fi
14621 echo "$as_me:14621: result: $cf_cv_const_x_string" >&5
14622 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14623
14624 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14625 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14626 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14627
14628 case $cf_cv_const_x_string in
14629 (no)
14630
14631         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14632         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14633
14634         ;;
14635 (*)
14636
14637         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14638         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14639
14640         ;;
14641 esac
14642
14643 else
14644   echo "$as_me: failed program was:" >&5
14645 cat conftest.$ac_ext >&5
14646 fi
14647 rm -f conftest.$ac_objext conftest.$ac_ext
14648  fi
14649 cat > conftest.$ac_ext <<EOF
14650 #line 14650 "${as_me:-configure}"
14651 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14652 EOF
14653 if test "$INTEL_COMPILER" = yes
14654 then
14655 # The "-wdXXX" options suppress warnings:
14656 # remark #1419: external declaration in primary source file
14657 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14658 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14659 # remark #193: zero used for undefined preprocessing identifier
14660 # remark #593: variable "curs_sb_left_arrow" was set but never used
14661 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14662 # remark #869: parameter "tw" was never referenced
14663 # remark #981: operands are evaluated in unspecified order
14664 # warning #279: controlling expression is constant
14665
14666         { echo "$as_me:14666: checking for $CC warning options..." >&5
14667 echo "$as_me: checking for $CC warning options..." >&6;}
14668         cf_save_CFLAGS="$CFLAGS"
14669         EXTRA_CFLAGS="-Wall"
14670         for cf_opt in \
14671                 wd1419 \
14672                 wd1683 \
14673                 wd1684 \
14674                 wd193 \
14675                 wd593 \
14676                 wd279 \
14677                 wd810 \
14678                 wd869 \
14679                 wd981
14680         do
14681                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14682                 if { (eval echo "$as_me:14682: \"$ac_compile\"") >&5
14683   (eval $ac_compile) 2>&5
14684   ac_status=$?
14685   echo "$as_me:14685: \$? = $ac_status" >&5
14686   (exit $ac_status); }; then
14687                         test -n "$verbose" && echo "$as_me:14687: result: ... -$cf_opt" >&5
14688 echo "${ECHO_T}... -$cf_opt" >&6
14689                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14690                 fi
14691         done
14692         CFLAGS="$cf_save_CFLAGS"
14693 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14694 then
14695         { echo "$as_me:14695: checking for $CC warning options..." >&5
14696 echo "$as_me: checking for $CC warning options..." >&6;}
14697         cf_save_CFLAGS="$CFLAGS"
14698         EXTRA_CFLAGS=
14699         cf_warn_CONST=""
14700         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14701         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14702         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14703         for cf_opt in W Wall \
14704                 Wbad-function-cast \
14705                 Wcast-align \
14706                 Wcast-qual \
14707                 Wdeclaration-after-statement \
14708                 Wextra \
14709                 Winline \
14710                 Wmissing-declarations \
14711                 Wmissing-prototypes \
14712                 Wnested-externs \
14713                 Wpointer-arith \
14714                 Wshadow \
14715                 Wstrict-prototypes \
14716                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14717         do
14718                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
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); }; then
14724                         test -n "$verbose" && echo "$as_me:14724: result: ... -$cf_opt" >&5
14725 echo "${ECHO_T}... -$cf_opt" >&6
14726                         case $cf_opt in
14727                         (Winline)
14728                                 case $GCC_VERSION in
14729                                 ([34].*)
14730                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14731
14732 echo "${as_me:-configure}:14732: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14733
14734                                         continue;;
14735                                 esac
14736                                 ;;
14737                         (Wpointer-arith)
14738                                 case $GCC_VERSION in
14739                                 ([12].*)
14740                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14741
14742 echo "${as_me:-configure}:14742: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14743
14744                                         continue;;
14745                                 esac
14746                                 ;;
14747                         esac
14748                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14749                 fi
14750         done
14751         CFLAGS="$cf_save_CFLAGS"
14752 fi
14753 rm -rf conftest*
14754
14755 fi
14756
14757 if test "$GCC" = yes
14758 then
14759 cat > conftest.i <<EOF
14760 #ifndef GCC_PRINTF
14761 #define GCC_PRINTF 0
14762 #endif
14763 #ifndef GCC_SCANF
14764 #define GCC_SCANF 0
14765 #endif
14766 #ifndef GCC_NORETURN
14767 #define GCC_NORETURN /* nothing */
14768 #endif
14769 #ifndef GCC_UNUSED
14770 #define GCC_UNUSED /* nothing */
14771 #endif
14772 EOF
14773 if test "$GCC" = yes
14774 then
14775         { echo "$as_me:14775: checking for $CC __attribute__ directives..." >&5
14776 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14777 cat > conftest.$ac_ext <<EOF
14778 #line 14778 "${as_me:-configure}"
14779 #include "confdefs.h"
14780 #include "conftest.h"
14781 #include "conftest.i"
14782 #if     GCC_PRINTF
14783 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14784 #else
14785 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14786 #endif
14787 #if     GCC_SCANF
14788 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14789 #else
14790 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14791 #endif
14792 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14793 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14794 extern void foo(void) GCC_NORETURN;
14795 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
14796 EOF
14797         cf_printf_attribute=no
14798         cf_scanf_attribute=no
14799         for cf_attribute in scanf printf unused noreturn
14800         do
14801
14802 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14803
14804                 cf_directive="__attribute__(($cf_attribute))"
14805                 echo "checking for $CC $cf_directive" 1>&5
14806
14807                 case $cf_attribute in
14808                 (printf)
14809                         cf_printf_attribute=yes
14810                         cat >conftest.h <<EOF
14811 #define GCC_$cf_ATTRIBUTE 1
14812 EOF
14813                         ;;
14814                 (scanf)
14815                         cf_scanf_attribute=yes
14816                         cat >conftest.h <<EOF
14817 #define GCC_$cf_ATTRIBUTE 1
14818 EOF
14819                         ;;
14820                 (*)
14821                         cat >conftest.h <<EOF
14822 #define GCC_$cf_ATTRIBUTE $cf_directive
14823 EOF
14824                         ;;
14825                 esac
14826
14827                 if { (eval echo "$as_me:14827: \"$ac_compile\"") >&5
14828   (eval $ac_compile) 2>&5
14829   ac_status=$?
14830   echo "$as_me:14830: \$? = $ac_status" >&5
14831   (exit $ac_status); }; then
14832                         test -n "$verbose" && echo "$as_me:14832: result: ... $cf_attribute" >&5
14833 echo "${ECHO_T}... $cf_attribute" >&6
14834                         cat conftest.h >>confdefs.h
14835                         case $cf_attribute in
14836                         (noreturn)
14837
14838 cat >>confdefs.h <<EOF
14839 #define GCC_NORETURN $cf_directive
14840 EOF
14841
14842                                 ;;
14843                         (printf)
14844                                 cf_value='/* nothing */'
14845                                 if test "$cf_printf_attribute" != no ; then
14846                                         cf_value='__attribute__((format(printf,fmt,var)))'
14847
14848 cat >>confdefs.h <<\EOF
14849 #define GCC_PRINTF 1
14850 EOF
14851
14852                                 fi
14853
14854 cat >>confdefs.h <<EOF
14855 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14856 EOF
14857
14858                                 ;;
14859                         (scanf)
14860                                 cf_value='/* nothing */'
14861                                 if test "$cf_scanf_attribute" != no ; then
14862                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14863
14864 cat >>confdefs.h <<\EOF
14865 #define GCC_SCANF 1
14866 EOF
14867
14868                                 fi
14869
14870 cat >>confdefs.h <<EOF
14871 #define GCC_SCANFLIKE(fmt,var) $cf_value
14872 EOF
14873
14874                                 ;;
14875                         (unused)
14876
14877 cat >>confdefs.h <<EOF
14878 #define GCC_UNUSED $cf_directive
14879 EOF
14880
14881                                 ;;
14882                         esac
14883                 fi
14884         done
14885 else
14886         fgrep define conftest.i >>confdefs.h
14887 fi
14888 rm -rf conftest*
14889 fi
14890
14891 ###     use option --enable-assertions to turn on generation of assertion code
14892 echo "$as_me:14892: checking if you want to enable runtime assertions" >&5
14893 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
14894
14895 # Check whether --enable-assertions or --disable-assertions was given.
14896 if test "${enable_assertions+set}" = set; then
14897   enableval="$enable_assertions"
14898   with_assertions=$enableval
14899 else
14900   with_assertions=no
14901 fi;
14902 echo "$as_me:14902: result: $with_assertions" >&5
14903 echo "${ECHO_T}$with_assertions" >&6
14904 if test -n "$GCC"
14905 then
14906         if test "$with_assertions" = no
14907         then
14908                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14909         else
14910
14911         ADAFLAGS="$ADAFLAGS -gnata"
14912
14913         fi
14914 fi
14915
14916 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14917
14918 cat >>confdefs.h <<\EOF
14919 #define HAVE_NC_ALLOC_H 1
14920 EOF
14921
14922 ###     use option --enable-expanded to generate certain macros as functions
14923
14924 # Check whether --enable-expanded or --disable-expanded was given.
14925 if test "${enable_expanded+set}" = set; then
14926   enableval="$enable_expanded"
14927   test "$enableval" = yes &&
14928 cat >>confdefs.h <<\EOF
14929 #define NCURSES_EXPANDED 1
14930 EOF
14931
14932 fi;
14933
14934 ###     use option --disable-macros to suppress macros in favor of functions
14935
14936 # Check whether --enable-macros or --disable-macros was given.
14937 if test "${enable_macros+set}" = set; then
14938   enableval="$enable_macros"
14939   test "$enableval" = no &&
14940 cat >>confdefs.h <<\EOF
14941 #define NCURSES_NOMACROS 1
14942 EOF
14943
14944 fi;
14945
14946 # Normally we only add trace() to the debug-library.  Allow this to be
14947 # extended to all models of the ncurses library:
14948 cf_all_traces=no
14949 case "$CFLAGS $CPPFLAGS" in
14950 (*-DTRACE*)
14951         cf_all_traces=yes
14952         ;;
14953 esac
14954
14955 echo "$as_me:14955: checking whether to add trace feature to all models" >&5
14956 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14957
14958 # Check whether --with-trace or --without-trace was given.
14959 if test "${with_trace+set}" = set; then
14960   withval="$with_trace"
14961   cf_with_trace=$withval
14962 else
14963   cf_with_trace=$cf_all_traces
14964 fi;
14965 echo "$as_me:14965: result: $cf_with_trace" >&5
14966 echo "${ECHO_T}$cf_with_trace" >&6
14967
14968 if test "$cf_with_trace" = yes ; then
14969         ADA_TRACE=TRUE
14970
14971 cf_fix_cppflags=no
14972 cf_new_cflags=
14973 cf_new_cppflags=
14974 cf_new_extra_cppflags=
14975
14976 for cf_add_cflags in -DTRACE
14977 do
14978 case $cf_fix_cppflags in
14979 (no)
14980         case $cf_add_cflags in
14981         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14982                 case $cf_add_cflags in
14983                 (-D*)
14984                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14985
14986                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14987                                 && test -z "${cf_tst_cflags}" \
14988                                 && cf_fix_cppflags=yes
14989
14990                         if test $cf_fix_cppflags = yes ; then
14991
14992         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14993         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14994
14995                                 continue
14996                         elif test "${cf_tst_cflags}" = "\"'" ; then
14997
14998         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14999         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15000
15001                                 continue
15002                         fi
15003                         ;;
15004                 esac
15005                 case "$CPPFLAGS" in
15006                 (*$cf_add_cflags)
15007                         ;;
15008                 (*)
15009                         case $cf_add_cflags in
15010                         (-D*)
15011                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15012
15013 CPPFLAGS=`echo "$CPPFLAGS" | \
15014         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15015                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15016
15017                                 ;;
15018                         esac
15019
15020         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15021         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15022
15023                         ;;
15024                 esac
15025                 ;;
15026         (*)
15027
15028         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15029         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15030
15031                 ;;
15032         esac
15033         ;;
15034 (yes)
15035
15036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15038
15039         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15040
15041         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15042                 && test -z "${cf_tst_cflags}" \
15043                 && cf_fix_cppflags=no
15044         ;;
15045 esac
15046 done
15047
15048 if test -n "$cf_new_cflags" ; then
15049
15050         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15051         CFLAGS="${CFLAGS}$cf_new_cflags"
15052
15053 fi
15054
15055 if test -n "$cf_new_cppflags" ; then
15056
15057         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15058         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15059
15060 fi
15061
15062 if test -n "$cf_new_extra_cppflags" ; then
15063
15064         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15065         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15066
15067 fi
15068
15069 else
15070         ADA_TRACE=FALSE
15071 fi
15072
15073 echo "$as_me:15073: checking if we want to use GNAT projects" >&5
15074 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15075
15076 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15077 if test "${enable_gnat_projects+set}" = set; then
15078   enableval="$enable_gnat_projects"
15079   test "$enableval" != no && enableval=yes
15080         if test "$enableval" != "yes" ; then
15081     enable_gnat_projects=no
15082         else
15083                 enable_gnat_projects=yes
15084         fi
15085 else
15086   enableval=yes
15087         enable_gnat_projects=yes
15088
15089 fi;
15090 echo "$as_me:15090: result: $enable_gnat_projects" >&5
15091 echo "${ECHO_T}$enable_gnat_projects" >&6
15092
15093 ###     Checks for libraries.
15094 case $cf_cv_system_name in
15095 (*mingw32*)
15096         ;;
15097 (*)
15098 echo "$as_me:15098: checking for gettimeofday" >&5
15099 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15100 if test "${ac_cv_func_gettimeofday+set}" = set; then
15101   echo $ECHO_N "(cached) $ECHO_C" >&6
15102 else
15103   cat >conftest.$ac_ext <<_ACEOF
15104 #line 15104 "configure"
15105 #include "confdefs.h"
15106 #define gettimeofday autoconf_temporary
15107 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15108 #undef gettimeofday
15109
15110 #ifdef __cplusplus
15111 extern "C"
15112 #endif
15113
15114 /* We use char because int might match the return type of a gcc2
15115    builtin and then its argument prototype would still apply.  */
15116 char gettimeofday (void);
15117
15118 int
15119 main (void)
15120 {
15121
15122 /* The GNU C library defines stubs for functions which it implements
15123     to always fail with ENOSYS.  Some functions are actually named
15124     something starting with __ and the normal name is an alias.  */
15125 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15126 #error found stub for gettimeofday
15127 #endif
15128
15129         return gettimeofday ();
15130   ;
15131   return 0;
15132 }
15133 _ACEOF
15134 rm -f conftest.$ac_objext conftest$ac_exeext
15135 if { (eval echo "$as_me:15135: \"$ac_link\"") >&5
15136   (eval $ac_link) 2>&5
15137   ac_status=$?
15138   echo "$as_me:15138: \$? = $ac_status" >&5
15139   (exit $ac_status); } &&
15140          { ac_try='test -s conftest$ac_exeext'
15141   { (eval echo "$as_me:15141: \"$ac_try\"") >&5
15142   (eval $ac_try) 2>&5
15143   ac_status=$?
15144   echo "$as_me:15144: \$? = $ac_status" >&5
15145   (exit $ac_status); }; }; then
15146   ac_cv_func_gettimeofday=yes
15147 else
15148   echo "$as_me: failed program was:" >&5
15149 cat conftest.$ac_ext >&5
15150 ac_cv_func_gettimeofday=no
15151 fi
15152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15153 fi
15154 echo "$as_me:15154: result: $ac_cv_func_gettimeofday" >&5
15155 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15156 if test $ac_cv_func_gettimeofday = yes; then
15157   cat >>confdefs.h <<\EOF
15158 #define HAVE_GETTIMEOFDAY 1
15159 EOF
15160
15161 else
15162
15163 echo "$as_me:15163: checking for gettimeofday in -lbsd" >&5
15164 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15165 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15166   echo $ECHO_N "(cached) $ECHO_C" >&6
15167 else
15168   ac_check_lib_save_LIBS=$LIBS
15169 LIBS="-lbsd  $LIBS"
15170 cat >conftest.$ac_ext <<_ACEOF
15171 #line 15171 "configure"
15172 #include "confdefs.h"
15173
15174 /* Override any gcc2 internal prototype to avoid an error.  */
15175 #ifdef __cplusplus
15176 extern "C"
15177 #endif
15178 /* We use char because int might match the return type of a gcc2
15179    builtin and then its argument prototype would still apply.  */
15180 char gettimeofday ();
15181 int
15182 main (void)
15183 {
15184 gettimeofday ();
15185   ;
15186   return 0;
15187 }
15188 _ACEOF
15189 rm -f conftest.$ac_objext conftest$ac_exeext
15190 if { (eval echo "$as_me:15190: \"$ac_link\"") >&5
15191   (eval $ac_link) 2>&5
15192   ac_status=$?
15193   echo "$as_me:15193: \$? = $ac_status" >&5
15194   (exit $ac_status); } &&
15195          { ac_try='test -s conftest$ac_exeext'
15196   { (eval echo "$as_me:15196: \"$ac_try\"") >&5
15197   (eval $ac_try) 2>&5
15198   ac_status=$?
15199   echo "$as_me:15199: \$? = $ac_status" >&5
15200   (exit $ac_status); }; }; then
15201   ac_cv_lib_bsd_gettimeofday=yes
15202 else
15203   echo "$as_me: failed program was:" >&5
15204 cat conftest.$ac_ext >&5
15205 ac_cv_lib_bsd_gettimeofday=no
15206 fi
15207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15208 LIBS=$ac_check_lib_save_LIBS
15209 fi
15210 echo "$as_me:15210: result: $ac_cv_lib_bsd_gettimeofday" >&5
15211 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15212 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15213
15214 cat >>confdefs.h <<\EOF
15215 #define HAVE_GETTIMEOFDAY 1
15216 EOF
15217
15218         LIBS="$LIBS -lbsd"
15219 fi
15220
15221 fi
15222         ;;
15223 esac
15224
15225 ###     Checks for header files.
15226 echo "$as_me:15226: checking for ANSI C header files" >&5
15227 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15228 if test "${ac_cv_header_stdc+set}" = set; then
15229   echo $ECHO_N "(cached) $ECHO_C" >&6
15230 else
15231   cat >conftest.$ac_ext <<_ACEOF
15232 #line 15232 "configure"
15233 #include "confdefs.h"
15234 #include <stdlib.h>
15235 #include <stdarg.h>
15236 #include <string.h>
15237 #include <float.h>
15238
15239 _ACEOF
15240 if { (eval echo "$as_me:15240: \"$ac_cpp conftest.$ac_ext\"") >&5
15241   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15242   ac_status=$?
15243   egrep -v '^ *\+' conftest.er1 >conftest.err
15244   rm -f conftest.er1
15245   cat conftest.err >&5
15246   echo "$as_me:15246: \$? = $ac_status" >&5
15247   (exit $ac_status); } >/dev/null; then
15248   if test -s conftest.err; then
15249     ac_cpp_err=$ac_c_preproc_warn_flag
15250   else
15251     ac_cpp_err=
15252   fi
15253 else
15254   ac_cpp_err=yes
15255 fi
15256 if test -z "$ac_cpp_err"; then
15257   ac_cv_header_stdc=yes
15258 else
15259   echo "$as_me: failed program was:" >&5
15260   cat conftest.$ac_ext >&5
15261   ac_cv_header_stdc=no
15262 fi
15263 rm -f conftest.err conftest.$ac_ext
15264
15265 if test $ac_cv_header_stdc = yes; then
15266   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15267   cat >conftest.$ac_ext <<_ACEOF
15268 #line 15268 "configure"
15269 #include "confdefs.h"
15270 #include <string.h>
15271
15272 _ACEOF
15273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15274   egrep "memchr" >/dev/null 2>&1; then
15275   :
15276 else
15277   ac_cv_header_stdc=no
15278 fi
15279 rm -rf conftest*
15280
15281 fi
15282
15283 if test $ac_cv_header_stdc = yes; then
15284   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15285   cat >conftest.$ac_ext <<_ACEOF
15286 #line 15286 "configure"
15287 #include "confdefs.h"
15288 #include <stdlib.h>
15289
15290 _ACEOF
15291 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15292   egrep "free" >/dev/null 2>&1; then
15293   :
15294 else
15295   ac_cv_header_stdc=no
15296 fi
15297 rm -rf conftest*
15298
15299 fi
15300
15301 if test $ac_cv_header_stdc = yes; then
15302   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15303   if test "$cross_compiling" = yes; then
15304   :
15305 else
15306   cat >conftest.$ac_ext <<_ACEOF
15307 #line 15307 "configure"
15308 #include "confdefs.h"
15309 #include <ctype.h>
15310 #if ((' ' & 0x0FF) == 0x020)
15311 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15312 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15313 #else
15314 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15315                      || ('j' <= (c) && (c) <= 'r') \
15316                      || ('s' <= (c) && (c) <= 'z'))
15317 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15318 #endif
15319
15320 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15321 int
15322 main (void)
15323 {
15324   int i;
15325   for (i = 0; i < 256; i++)
15326     if (XOR (islower (i), ISLOWER (i))
15327         || toupper (i) != TOUPPER (i))
15328       $ac_main_return(2);
15329   $ac_main_return (0);
15330 }
15331 _ACEOF
15332 rm -f conftest$ac_exeext
15333 if { (eval echo "$as_me:15333: \"$ac_link\"") >&5
15334   (eval $ac_link) 2>&5
15335   ac_status=$?
15336   echo "$as_me:15336: \$? = $ac_status" >&5
15337   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15338   { (eval echo "$as_me:15338: \"$ac_try\"") >&5
15339   (eval $ac_try) 2>&5
15340   ac_status=$?
15341   echo "$as_me:15341: \$? = $ac_status" >&5
15342   (exit $ac_status); }; }; then
15343   :
15344 else
15345   echo "$as_me: program exited with status $ac_status" >&5
15346 echo "$as_me: failed program was:" >&5
15347 cat conftest.$ac_ext >&5
15348 ac_cv_header_stdc=no
15349 fi
15350 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15351 fi
15352 fi
15353 fi
15354 echo "$as_me:15354: result: $ac_cv_header_stdc" >&5
15355 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15356 if test $ac_cv_header_stdc = yes; then
15357
15358 cat >>confdefs.h <<\EOF
15359 #define STDC_HEADERS 1
15360 EOF
15361
15362 fi
15363
15364 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15365
15366 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15367                   inttypes.h stdint.h unistd.h
15368 do
15369 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15370 echo "$as_me:15370: checking for $ac_header" >&5
15371 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15372 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15373   echo $ECHO_N "(cached) $ECHO_C" >&6
15374 else
15375   cat >conftest.$ac_ext <<_ACEOF
15376 #line 15376 "configure"
15377 #include "confdefs.h"
15378 $ac_includes_default
15379 #include <$ac_header>
15380 _ACEOF
15381 rm -f conftest.$ac_objext
15382 if { (eval echo "$as_me:15382: \"$ac_compile\"") >&5
15383   (eval $ac_compile) 2>&5
15384   ac_status=$?
15385   echo "$as_me:15385: \$? = $ac_status" >&5
15386   (exit $ac_status); } &&
15387          { ac_try='test -s conftest.$ac_objext'
15388   { (eval echo "$as_me:15388: \"$ac_try\"") >&5
15389   (eval $ac_try) 2>&5
15390   ac_status=$?
15391   echo "$as_me:15391: \$? = $ac_status" >&5
15392   (exit $ac_status); }; }; then
15393   eval "$as_ac_Header=yes"
15394 else
15395   echo "$as_me: failed program was:" >&5
15396 cat conftest.$ac_ext >&5
15397 eval "$as_ac_Header=no"
15398 fi
15399 rm -f conftest.$ac_objext conftest.$ac_ext
15400 fi
15401 echo "$as_me:15401: result: `eval echo '${'$as_ac_Header'}'`" >&5
15402 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15403 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15404   cat >>confdefs.h <<EOF
15405 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15406 EOF
15407
15408 fi
15409 done
15410
15411 echo "$as_me:15411: checking for signed char" >&5
15412 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15413 if test "${ac_cv_type_signed_char+set}" = set; then
15414   echo $ECHO_N "(cached) $ECHO_C" >&6
15415 else
15416   cat >conftest.$ac_ext <<_ACEOF
15417 #line 15417 "configure"
15418 #include "confdefs.h"
15419 $ac_includes_default
15420 int
15421 main (void)
15422 {
15423 if ((signed char *) 0)
15424   return 0;
15425 if (sizeof (signed char))
15426   return 0;
15427   ;
15428   return 0;
15429 }
15430 _ACEOF
15431 rm -f conftest.$ac_objext
15432 if { (eval echo "$as_me:15432: \"$ac_compile\"") >&5
15433   (eval $ac_compile) 2>&5
15434   ac_status=$?
15435   echo "$as_me:15435: \$? = $ac_status" >&5
15436   (exit $ac_status); } &&
15437          { ac_try='test -s conftest.$ac_objext'
15438   { (eval echo "$as_me:15438: \"$ac_try\"") >&5
15439   (eval $ac_try) 2>&5
15440   ac_status=$?
15441   echo "$as_me:15441: \$? = $ac_status" >&5
15442   (exit $ac_status); }; }; then
15443   ac_cv_type_signed_char=yes
15444 else
15445   echo "$as_me: failed program was:" >&5
15446 cat conftest.$ac_ext >&5
15447 ac_cv_type_signed_char=no
15448 fi
15449 rm -f conftest.$ac_objext conftest.$ac_ext
15450 fi
15451 echo "$as_me:15451: result: $ac_cv_type_signed_char" >&5
15452 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15453
15454 echo "$as_me:15454: checking size of signed char" >&5
15455 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15456 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15457   echo $ECHO_N "(cached) $ECHO_C" >&6
15458 else
15459   if test "$ac_cv_type_signed_char" = yes; then
15460   if test "$cross_compiling" = yes; then
15461   # Depending upon the size, compute the lo and hi bounds.
15462 cat >conftest.$ac_ext <<_ACEOF
15463 #line 15463 "configure"
15464 #include "confdefs.h"
15465 $ac_includes_default
15466 int
15467 main (void)
15468 {
15469 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15470   ;
15471   return 0;
15472 }
15473 _ACEOF
15474 rm -f conftest.$ac_objext
15475 if { (eval echo "$as_me:15475: \"$ac_compile\"") >&5
15476   (eval $ac_compile) 2>&5
15477   ac_status=$?
15478   echo "$as_me:15478: \$? = $ac_status" >&5
15479   (exit $ac_status); } &&
15480          { ac_try='test -s conftest.$ac_objext'
15481   { (eval echo "$as_me:15481: \"$ac_try\"") >&5
15482   (eval $ac_try) 2>&5
15483   ac_status=$?
15484   echo "$as_me:15484: \$? = $ac_status" >&5
15485   (exit $ac_status); }; }; then
15486   ac_lo=0 ac_mid=0
15487   while :; do
15488     cat >conftest.$ac_ext <<_ACEOF
15489 #line 15489 "configure"
15490 #include "confdefs.h"
15491 $ac_includes_default
15492 int
15493 main (void)
15494 {
15495 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15496   ;
15497   return 0;
15498 }
15499 _ACEOF
15500 rm -f conftest.$ac_objext
15501 if { (eval echo "$as_me:15501: \"$ac_compile\"") >&5
15502   (eval $ac_compile) 2>&5
15503   ac_status=$?
15504   echo "$as_me:15504: \$? = $ac_status" >&5
15505   (exit $ac_status); } &&
15506          { ac_try='test -s conftest.$ac_objext'
15507   { (eval echo "$as_me:15507: \"$ac_try\"") >&5
15508   (eval $ac_try) 2>&5
15509   ac_status=$?
15510   echo "$as_me:15510: \$? = $ac_status" >&5
15511   (exit $ac_status); }; }; then
15512   ac_hi=$ac_mid; break
15513 else
15514   echo "$as_me: failed program was:" >&5
15515 cat conftest.$ac_ext >&5
15516 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15517 fi
15518 rm -f conftest.$ac_objext conftest.$ac_ext
15519   done
15520 else
15521   echo "$as_me: failed program was:" >&5
15522 cat conftest.$ac_ext >&5
15523 ac_hi=-1 ac_mid=-1
15524   while :; do
15525     cat >conftest.$ac_ext <<_ACEOF
15526 #line 15526 "configure"
15527 #include "confdefs.h"
15528 $ac_includes_default
15529 int
15530 main (void)
15531 {
15532 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15533   ;
15534   return 0;
15535 }
15536 _ACEOF
15537 rm -f conftest.$ac_objext
15538 if { (eval echo "$as_me:15538: \"$ac_compile\"") >&5
15539   (eval $ac_compile) 2>&5
15540   ac_status=$?
15541   echo "$as_me:15541: \$? = $ac_status" >&5
15542   (exit $ac_status); } &&
15543          { ac_try='test -s conftest.$ac_objext'
15544   { (eval echo "$as_me:15544: \"$ac_try\"") >&5
15545   (eval $ac_try) 2>&5
15546   ac_status=$?
15547   echo "$as_me:15547: \$? = $ac_status" >&5
15548   (exit $ac_status); }; }; then
15549   ac_lo=$ac_mid; break
15550 else
15551   echo "$as_me: failed program was:" >&5
15552 cat conftest.$ac_ext >&5
15553 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15554 fi
15555 rm -f conftest.$ac_objext conftest.$ac_ext
15556   done
15557 fi
15558 rm -f conftest.$ac_objext conftest.$ac_ext
15559 # Binary search between lo and hi bounds.
15560 while test "x$ac_lo" != "x$ac_hi"; do
15561   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15562   cat >conftest.$ac_ext <<_ACEOF
15563 #line 15563 "configure"
15564 #include "confdefs.h"
15565 $ac_includes_default
15566 int
15567 main (void)
15568 {
15569 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15570   ;
15571   return 0;
15572 }
15573 _ACEOF
15574 rm -f conftest.$ac_objext
15575 if { (eval echo "$as_me:15575: \"$ac_compile\"") >&5
15576   (eval $ac_compile) 2>&5
15577   ac_status=$?
15578   echo "$as_me:15578: \$? = $ac_status" >&5
15579   (exit $ac_status); } &&
15580          { ac_try='test -s conftest.$ac_objext'
15581   { (eval echo "$as_me:15581: \"$ac_try\"") >&5
15582   (eval $ac_try) 2>&5
15583   ac_status=$?
15584   echo "$as_me:15584: \$? = $ac_status" >&5
15585   (exit $ac_status); }; }; then
15586   ac_hi=$ac_mid
15587 else
15588   echo "$as_me: failed program was:" >&5
15589 cat conftest.$ac_ext >&5
15590 ac_lo=`expr $ac_mid + 1`
15591 fi
15592 rm -f conftest.$ac_objext conftest.$ac_ext
15593 done
15594 ac_cv_sizeof_signed_char=$ac_lo
15595 else
15596   if test "$cross_compiling" = yes; then
15597   { { echo "$as_me:15597: error: cannot run test program while cross compiling" >&5
15598 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15599    { (exit 1); exit 1; }; }
15600 else
15601   cat >conftest.$ac_ext <<_ACEOF
15602 #line 15602 "configure"
15603 #include "confdefs.h"
15604 $ac_includes_default
15605 int
15606 main (void)
15607 {
15608 FILE *f = fopen ("conftest.val", "w");
15609 if (!f)
15610   $ac_main_return (1);
15611 fprintf (f, "%d", (sizeof (signed char)));
15612 fclose (f);
15613   ;
15614   return 0;
15615 }
15616 _ACEOF
15617 rm -f conftest$ac_exeext
15618 if { (eval echo "$as_me:15618: \"$ac_link\"") >&5
15619   (eval $ac_link) 2>&5
15620   ac_status=$?
15621   echo "$as_me:15621: \$? = $ac_status" >&5
15622   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15623   { (eval echo "$as_me:15623: \"$ac_try\"") >&5
15624   (eval $ac_try) 2>&5
15625   ac_status=$?
15626   echo "$as_me:15626: \$? = $ac_status" >&5
15627   (exit $ac_status); }; }; then
15628   ac_cv_sizeof_signed_char=`cat conftest.val`
15629 else
15630   echo "$as_me: program exited with status $ac_status" >&5
15631 echo "$as_me: failed program was:" >&5
15632 cat conftest.$ac_ext >&5
15633 fi
15634 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15635 fi
15636 fi
15637 rm -f conftest.val
15638 else
15639   ac_cv_sizeof_signed_char=0
15640 fi
15641 fi
15642 echo "$as_me:15642: result: $ac_cv_sizeof_signed_char" >&5
15643 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15644 cat >>confdefs.h <<EOF
15645 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15646 EOF
15647
15648 echo "$as_me:15648: checking for ANSI C header files" >&5
15649 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15650 if test "${ac_cv_header_stdc+set}" = set; then
15651   echo $ECHO_N "(cached) $ECHO_C" >&6
15652 else
15653   cat >conftest.$ac_ext <<_ACEOF
15654 #line 15654 "configure"
15655 #include "confdefs.h"
15656 #include <stdlib.h>
15657 #include <stdarg.h>
15658 #include <string.h>
15659 #include <float.h>
15660
15661 _ACEOF
15662 if { (eval echo "$as_me:15662: \"$ac_cpp conftest.$ac_ext\"") >&5
15663   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15664   ac_status=$?
15665   egrep -v '^ *\+' conftest.er1 >conftest.err
15666   rm -f conftest.er1
15667   cat conftest.err >&5
15668   echo "$as_me:15668: \$? = $ac_status" >&5
15669   (exit $ac_status); } >/dev/null; then
15670   if test -s conftest.err; then
15671     ac_cpp_err=$ac_c_preproc_warn_flag
15672   else
15673     ac_cpp_err=
15674   fi
15675 else
15676   ac_cpp_err=yes
15677 fi
15678 if test -z "$ac_cpp_err"; then
15679   ac_cv_header_stdc=yes
15680 else
15681   echo "$as_me: failed program was:" >&5
15682   cat conftest.$ac_ext >&5
15683   ac_cv_header_stdc=no
15684 fi
15685 rm -f conftest.err conftest.$ac_ext
15686
15687 if test $ac_cv_header_stdc = yes; then
15688   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15689   cat >conftest.$ac_ext <<_ACEOF
15690 #line 15690 "configure"
15691 #include "confdefs.h"
15692 #include <string.h>
15693
15694 _ACEOF
15695 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15696   egrep "memchr" >/dev/null 2>&1; then
15697   :
15698 else
15699   ac_cv_header_stdc=no
15700 fi
15701 rm -rf conftest*
15702
15703 fi
15704
15705 if test $ac_cv_header_stdc = yes; then
15706   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15707   cat >conftest.$ac_ext <<_ACEOF
15708 #line 15708 "configure"
15709 #include "confdefs.h"
15710 #include <stdlib.h>
15711
15712 _ACEOF
15713 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15714   egrep "free" >/dev/null 2>&1; then
15715   :
15716 else
15717   ac_cv_header_stdc=no
15718 fi
15719 rm -rf conftest*
15720
15721 fi
15722
15723 if test $ac_cv_header_stdc = yes; then
15724   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15725   if test "$cross_compiling" = yes; then
15726   :
15727 else
15728   cat >conftest.$ac_ext <<_ACEOF
15729 #line 15729 "configure"
15730 #include "confdefs.h"
15731 #include <ctype.h>
15732 #if ((' ' & 0x0FF) == 0x020)
15733 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15734 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15735 #else
15736 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15737                      || ('j' <= (c) && (c) <= 'r') \
15738                      || ('s' <= (c) && (c) <= 'z'))
15739 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15740 #endif
15741
15742 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15743 int
15744 main (void)
15745 {
15746   int i;
15747   for (i = 0; i < 256; i++)
15748     if (XOR (islower (i), ISLOWER (i))
15749         || toupper (i) != TOUPPER (i))
15750       $ac_main_return(2);
15751   $ac_main_return (0);
15752 }
15753 _ACEOF
15754 rm -f conftest$ac_exeext
15755 if { (eval echo "$as_me:15755: \"$ac_link\"") >&5
15756   (eval $ac_link) 2>&5
15757   ac_status=$?
15758   echo "$as_me:15758: \$? = $ac_status" >&5
15759   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15760   { (eval echo "$as_me:15760: \"$ac_try\"") >&5
15761   (eval $ac_try) 2>&5
15762   ac_status=$?
15763   echo "$as_me:15763: \$? = $ac_status" >&5
15764   (exit $ac_status); }; }; then
15765   :
15766 else
15767   echo "$as_me: program exited with status $ac_status" >&5
15768 echo "$as_me: failed program was:" >&5
15769 cat conftest.$ac_ext >&5
15770 ac_cv_header_stdc=no
15771 fi
15772 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15773 fi
15774 fi
15775 fi
15776 echo "$as_me:15776: result: $ac_cv_header_stdc" >&5
15777 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15778 if test $ac_cv_header_stdc = yes; then
15779
15780 cat >>confdefs.h <<\EOF
15781 #define STDC_HEADERS 1
15782 EOF
15783
15784 fi
15785
15786 ac_header_dirent=no
15787 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
15788   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
15789 echo "$as_me:15789: checking for $ac_hdr that defines DIR" >&5
15790 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
15791 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15792   echo $ECHO_N "(cached) $ECHO_C" >&6
15793 else
15794   cat >conftest.$ac_ext <<_ACEOF
15795 #line 15795 "configure"
15796 #include "confdefs.h"
15797 #include <sys/types.h>
15798 #include <$ac_hdr>
15799
15800 int
15801 main (void)
15802 {
15803 if ((DIR *) 0)
15804 return 0;
15805   ;
15806   return 0;
15807 }
15808 _ACEOF
15809 rm -f conftest.$ac_objext
15810 if { (eval echo "$as_me:15810: \"$ac_compile\"") >&5
15811   (eval $ac_compile) 2>&5
15812   ac_status=$?
15813   echo "$as_me:15813: \$? = $ac_status" >&5
15814   (exit $ac_status); } &&
15815          { ac_try='test -s conftest.$ac_objext'
15816   { (eval echo "$as_me:15816: \"$ac_try\"") >&5
15817   (eval $ac_try) 2>&5
15818   ac_status=$?
15819   echo "$as_me:15819: \$? = $ac_status" >&5
15820   (exit $ac_status); }; }; then
15821   eval "$as_ac_Header=yes"
15822 else
15823   echo "$as_me: failed program was:" >&5
15824 cat conftest.$ac_ext >&5
15825 eval "$as_ac_Header=no"
15826 fi
15827 rm -f conftest.$ac_objext conftest.$ac_ext
15828 fi
15829 echo "$as_me:15829: result: `eval echo '${'$as_ac_Header'}'`" >&5
15830 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15831 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15832   cat >>confdefs.h <<EOF
15833 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
15834 EOF
15835
15836 ac_header_dirent=$ac_hdr; break
15837 fi
15838
15839 done
15840 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
15841 if test $ac_header_dirent = dirent.h; then
15842   echo "$as_me:15842: checking for opendir in -ldir" >&5
15843 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
15844 if test "${ac_cv_lib_dir_opendir+set}" = set; then
15845   echo $ECHO_N "(cached) $ECHO_C" >&6
15846 else
15847   ac_check_lib_save_LIBS=$LIBS
15848 LIBS="-ldir  $LIBS"
15849 cat >conftest.$ac_ext <<_ACEOF
15850 #line 15850 "configure"
15851 #include "confdefs.h"
15852
15853 /* Override any gcc2 internal prototype to avoid an error.  */
15854 #ifdef __cplusplus
15855 extern "C"
15856 #endif
15857 /* We use char because int might match the return type of a gcc2
15858    builtin and then its argument prototype would still apply.  */
15859 char opendir ();
15860 int
15861 main (void)
15862 {
15863 opendir ();
15864   ;
15865   return 0;
15866 }
15867 _ACEOF
15868 rm -f conftest.$ac_objext conftest$ac_exeext
15869 if { (eval echo "$as_me:15869: \"$ac_link\"") >&5
15870   (eval $ac_link) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit $ac_status); } &&
15874          { ac_try='test -s conftest$ac_exeext'
15875   { (eval echo "$as_me:15875: \"$ac_try\"") >&5
15876   (eval $ac_try) 2>&5
15877   ac_status=$?
15878   echo "$as_me:15878: \$? = $ac_status" >&5
15879   (exit $ac_status); }; }; then
15880   ac_cv_lib_dir_opendir=yes
15881 else
15882   echo "$as_me: failed program was:" >&5
15883 cat conftest.$ac_ext >&5
15884 ac_cv_lib_dir_opendir=no
15885 fi
15886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15887 LIBS=$ac_check_lib_save_LIBS
15888 fi
15889 echo "$as_me:15889: result: $ac_cv_lib_dir_opendir" >&5
15890 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
15891 if test $ac_cv_lib_dir_opendir = yes; then
15892   LIBS="$LIBS -ldir"
15893 fi
15894
15895 else
15896   echo "$as_me:15896: checking for opendir in -lx" >&5
15897 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15898 if test "${ac_cv_lib_x_opendir+set}" = set; then
15899   echo $ECHO_N "(cached) $ECHO_C" >&6
15900 else
15901   ac_check_lib_save_LIBS=$LIBS
15902 LIBS="-lx  $LIBS"
15903 cat >conftest.$ac_ext <<_ACEOF
15904 #line 15904 "configure"
15905 #include "confdefs.h"
15906
15907 /* Override any gcc2 internal prototype to avoid an error.  */
15908 #ifdef __cplusplus
15909 extern "C"
15910 #endif
15911 /* We use char because int might match the return type of a gcc2
15912    builtin and then its argument prototype would still apply.  */
15913 char opendir ();
15914 int
15915 main (void)
15916 {
15917 opendir ();
15918   ;
15919   return 0;
15920 }
15921 _ACEOF
15922 rm -f conftest.$ac_objext conftest$ac_exeext
15923 if { (eval echo "$as_me:15923: \"$ac_link\"") >&5
15924   (eval $ac_link) 2>&5
15925   ac_status=$?
15926   echo "$as_me:15926: \$? = $ac_status" >&5
15927   (exit $ac_status); } &&
15928          { ac_try='test -s conftest$ac_exeext'
15929   { (eval echo "$as_me:15929: \"$ac_try\"") >&5
15930   (eval $ac_try) 2>&5
15931   ac_status=$?
15932   echo "$as_me:15932: \$? = $ac_status" >&5
15933   (exit $ac_status); }; }; then
15934   ac_cv_lib_x_opendir=yes
15935 else
15936   echo "$as_me: failed program was:" >&5
15937 cat conftest.$ac_ext >&5
15938 ac_cv_lib_x_opendir=no
15939 fi
15940 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15941 LIBS=$ac_check_lib_save_LIBS
15942 fi
15943 echo "$as_me:15943: result: $ac_cv_lib_x_opendir" >&5
15944 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15945 if test $ac_cv_lib_x_opendir = yes; then
15946   LIBS="$LIBS -lx"
15947 fi
15948
15949 fi
15950
15951 echo "$as_me:15951: checking whether time.h and sys/time.h may both be included" >&5
15952 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15953 if test "${ac_cv_header_time+set}" = set; then
15954   echo $ECHO_N "(cached) $ECHO_C" >&6
15955 else
15956   cat >conftest.$ac_ext <<_ACEOF
15957 #line 15957 "configure"
15958 #include "confdefs.h"
15959 #include <sys/types.h>
15960 #include <sys/time.h>
15961 #include <time.h>
15962
15963 int
15964 main (void)
15965 {
15966 if ((struct tm *) 0)
15967 return 0;
15968   ;
15969   return 0;
15970 }
15971 _ACEOF
15972 rm -f conftest.$ac_objext
15973 if { (eval echo "$as_me:15973: \"$ac_compile\"") >&5
15974   (eval $ac_compile) 2>&5
15975   ac_status=$?
15976   echo "$as_me:15976: \$? = $ac_status" >&5
15977   (exit $ac_status); } &&
15978          { ac_try='test -s conftest.$ac_objext'
15979   { (eval echo "$as_me:15979: \"$ac_try\"") >&5
15980   (eval $ac_try) 2>&5
15981   ac_status=$?
15982   echo "$as_me:15982: \$? = $ac_status" >&5
15983   (exit $ac_status); }; }; then
15984   ac_cv_header_time=yes
15985 else
15986   echo "$as_me: failed program was:" >&5
15987 cat conftest.$ac_ext >&5
15988 ac_cv_header_time=no
15989 fi
15990 rm -f conftest.$ac_objext conftest.$ac_ext
15991 fi
15992 echo "$as_me:15992: result: $ac_cv_header_time" >&5
15993 echo "${ECHO_T}$ac_cv_header_time" >&6
15994 if test $ac_cv_header_time = yes; then
15995
15996 cat >>confdefs.h <<\EOF
15997 #define TIME_WITH_SYS_TIME 1
15998 EOF
15999
16000 fi
16001
16002 ###     checks for compiler characteristics
16003 ac_ext=c
16004 ac_cpp='$CPP $CPPFLAGS'
16005 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16006 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16007 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16008 ac_main_return=return
16009
16010 echo "$as_me:16010: checking for an ANSI C-conforming const" >&5
16011 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16012 if test "${ac_cv_c_const+set}" = set; then
16013   echo $ECHO_N "(cached) $ECHO_C" >&6
16014 else
16015   cat >conftest.$ac_ext <<_ACEOF
16016 #line 16016 "configure"
16017 #include "confdefs.h"
16018
16019 int
16020 main (void)
16021 {
16022 /* FIXME: Include the comments suggested by Paul. */
16023 #ifndef __cplusplus
16024   /* Ultrix mips cc rejects this.  */
16025   typedef int charset[2];
16026   const charset x;
16027   /* SunOS 4.1.1 cc rejects this.  */
16028   char const *const *ccp;
16029   char **p;
16030   /* NEC SVR4.0.2 mips cc rejects this.  */
16031   struct point {int x, y;};
16032   static struct point const zero = {0,0};
16033   /* AIX XL C 1.02.0.0 rejects this.
16034      It does not let you subtract one const X* pointer from another in
16035      an arm of an if-expression whose if-part is not a constant
16036      expression */
16037   const char *g = "string";
16038   ccp = &g + (g ? g-g : 0);
16039   /* HPUX 7.0 cc rejects these. */
16040   ++ccp;
16041   p = (char**) ccp;
16042   ccp = (char const *const *) p;
16043   { /* SCO 3.2v4 cc rejects this.  */
16044     char *t;
16045     char const *s = 0 ? (char *) 0 : (char const *) 0;
16046
16047     *t++ = 0;
16048   }
16049   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16050     int x[] = {25, 17};
16051     const int *foo = &x[0];
16052     ++foo;
16053   }
16054   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16055     typedef const int *iptr;
16056     iptr p = 0;
16057     ++p;
16058   }
16059   { /* AIX XL C 1.02.0.0 rejects this saying
16060        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16061     struct s { int j; const int *ap[3]; };
16062     struct s *b; b->j = 5;
16063   }
16064   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16065     const int foo = 10;
16066   }
16067 #endif
16068
16069   ;
16070   return 0;
16071 }
16072 _ACEOF
16073 rm -f conftest.$ac_objext
16074 if { (eval echo "$as_me:16074: \"$ac_compile\"") >&5
16075   (eval $ac_compile) 2>&5
16076   ac_status=$?
16077   echo "$as_me:16077: \$? = $ac_status" >&5
16078   (exit $ac_status); } &&
16079          { ac_try='test -s conftest.$ac_objext'
16080   { (eval echo "$as_me:16080: \"$ac_try\"") >&5
16081   (eval $ac_try) 2>&5
16082   ac_status=$?
16083   echo "$as_me:16083: \$? = $ac_status" >&5
16084   (exit $ac_status); }; }; then
16085   ac_cv_c_const=yes
16086 else
16087   echo "$as_me: failed program was:" >&5
16088 cat conftest.$ac_ext >&5
16089 ac_cv_c_const=no
16090 fi
16091 rm -f conftest.$ac_objext conftest.$ac_ext
16092 fi
16093 echo "$as_me:16093: result: $ac_cv_c_const" >&5
16094 echo "${ECHO_T}$ac_cv_c_const" >&6
16095 if test $ac_cv_c_const = no; then
16096
16097 cat >>confdefs.h <<\EOF
16098 #define const
16099 EOF
16100
16101 fi
16102
16103 ###     Checks for external-data
16104
16105 echo "$as_me:16105: checking if data-only library module links" >&5
16106 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16107 if test "${cf_cv_link_dataonly+set}" = set; then
16108   echo $ECHO_N "(cached) $ECHO_C" >&6
16109 else
16110
16111         rm -f conftest.a
16112         cat >conftest.$ac_ext <<EOF
16113 #line 16113 "configure"
16114 int     testdata[3] = { 123, 456, 789 };
16115 EOF
16116         if { (eval echo "$as_me:16116: \"$ac_compile\"") >&5
16117   (eval $ac_compile) 2>&5
16118   ac_status=$?
16119   echo "$as_me:16119: \$? = $ac_status" >&5
16120   (exit $ac_status); } ; then
16121                 mv conftest.o data.o && \
16122                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16123         fi
16124         rm -f conftest.$ac_ext data.o
16125         cat >conftest.$ac_ext <<EOF
16126 #line 16126 "configure"
16127 int     testfunc(void)
16128 {
16129 #if defined(NeXT)
16130         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16131 #else
16132         extern int testdata[3];
16133         return testdata[0] == 123
16134            &&  testdata[1] == 456
16135            &&  testdata[2] == 789;
16136 #endif
16137 }
16138 EOF
16139         if { (eval echo "$as_me:16139: \"$ac_compile\"") >&5
16140   (eval $ac_compile) 2>&5
16141   ac_status=$?
16142   echo "$as_me:16142: \$? = $ac_status" >&5
16143   (exit $ac_status); }; then
16144                 mv conftest.o func.o && \
16145                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16146         fi
16147         rm -f conftest.$ac_ext func.o
16148         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16149         cf_saveLIBS="$LIBS"
16150         LIBS="conftest.a $LIBS"
16151         if test "$cross_compiling" = yes; then
16152   cf_cv_link_dataonly=unknown
16153 else
16154   cat >conftest.$ac_ext <<_ACEOF
16155 #line 16155 "configure"
16156 #include "confdefs.h"
16157
16158         int main(void)
16159         {
16160                 extern int testfunc();
16161                 ${cf_cv_main_return:-return} (!testfunc());
16162         }
16163
16164 _ACEOF
16165 rm -f conftest$ac_exeext
16166 if { (eval echo "$as_me:16166: \"$ac_link\"") >&5
16167   (eval $ac_link) 2>&5
16168   ac_status=$?
16169   echo "$as_me:16169: \$? = $ac_status" >&5
16170   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16171   { (eval echo "$as_me:16171: \"$ac_try\"") >&5
16172   (eval $ac_try) 2>&5
16173   ac_status=$?
16174   echo "$as_me:16174: \$? = $ac_status" >&5
16175   (exit $ac_status); }; }; then
16176   cf_cv_link_dataonly=yes
16177 else
16178   echo "$as_me: program exited with status $ac_status" >&5
16179 echo "$as_me: failed program was:" >&5
16180 cat conftest.$ac_ext >&5
16181 cf_cv_link_dataonly=no
16182 fi
16183 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16184 fi
16185         LIBS="$cf_saveLIBS"
16186
16187 fi
16188
16189 echo "$as_me:16189: result: $cf_cv_link_dataonly" >&5
16190 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16191
16192 if test "$cf_cv_link_dataonly" = no ; then
16193
16194 cat >>confdefs.h <<\EOF
16195 #define BROKEN_LINKER 1
16196 EOF
16197
16198         BROKEN_LINKER=1
16199 fi
16200
16201 ###     Checks for library functions.
16202
16203 for ac_header in \
16204 unistd.h \
16205
16206 do
16207 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16208 echo "$as_me:16208: checking for $ac_header" >&5
16209 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16210 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16211   echo $ECHO_N "(cached) $ECHO_C" >&6
16212 else
16213   cat >conftest.$ac_ext <<_ACEOF
16214 #line 16214 "configure"
16215 #include "confdefs.h"
16216 #include <$ac_header>
16217 _ACEOF
16218 if { (eval echo "$as_me:16218: \"$ac_cpp conftest.$ac_ext\"") >&5
16219   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16220   ac_status=$?
16221   egrep -v '^ *\+' conftest.er1 >conftest.err
16222   rm -f conftest.er1
16223   cat conftest.err >&5
16224   echo "$as_me:16224: \$? = $ac_status" >&5
16225   (exit $ac_status); } >/dev/null; then
16226   if test -s conftest.err; then
16227     ac_cpp_err=$ac_c_preproc_warn_flag
16228   else
16229     ac_cpp_err=
16230   fi
16231 else
16232   ac_cpp_err=yes
16233 fi
16234 if test -z "$ac_cpp_err"; then
16235   eval "$as_ac_Header=yes"
16236 else
16237   echo "$as_me: failed program was:" >&5
16238   cat conftest.$ac_ext >&5
16239   eval "$as_ac_Header=no"
16240 fi
16241 rm -f conftest.err conftest.$ac_ext
16242 fi
16243 echo "$as_me:16243: result: `eval echo '${'$as_ac_Header'}'`" >&5
16244 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16245 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16246   cat >>confdefs.h <<EOF
16247 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16248 EOF
16249
16250 fi
16251 done
16252
16253 echo "$as_me:16253: checking for working mkstemp" >&5
16254 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16255 if test "${cf_cv_func_mkstemp+set}" = set; then
16256   echo $ECHO_N "(cached) $ECHO_C" >&6
16257 else
16258
16259 rm -rf conftest*
16260 if test "$cross_compiling" = yes; then
16261   cf_cv_func_mkstemp=maybe
16262 else
16263   cat >conftest.$ac_ext <<_ACEOF
16264 #line 16264 "configure"
16265 #include "confdefs.h"
16266
16267 #include <sys/types.h>
16268 #ifdef HAVE_UNISTD_H
16269 #include <unistd.h>
16270 #endif
16271 #include <stdlib.h>
16272 #include <stdio.h>
16273 #include <string.h>
16274 #include <sys/stat.h>
16275 int main(void)
16276 {
16277         char *tmpl = "conftestXXXXXX";
16278         char name[2][80];
16279         int n;
16280         int result = 0;
16281         int fd;
16282         struct stat sb;
16283
16284         umask(077);
16285         for (n = 0; n < 2; ++n) {
16286                 strcpy(name[n], tmpl);
16287                 if ((fd = mkstemp(name[n])) >= 0) {
16288                         if (!strcmp(name[n], tmpl)
16289                          || stat(name[n], &sb) != 0
16290                          || (sb.st_mode & S_IFMT) != S_IFREG
16291                          || (sb.st_mode & 077) != 0) {
16292                                 result = 1;
16293                         }
16294                         close(fd);
16295                 }
16296         }
16297         if (result == 0
16298          && !strcmp(name[0], name[1]))
16299                 result = 1;
16300         ${cf_cv_main_return:-return}(result);
16301 }
16302
16303 _ACEOF
16304 rm -f conftest$ac_exeext
16305 if { (eval echo "$as_me:16305: \"$ac_link\"") >&5
16306   (eval $ac_link) 2>&5
16307   ac_status=$?
16308   echo "$as_me:16308: \$? = $ac_status" >&5
16309   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16310   { (eval echo "$as_me:16310: \"$ac_try\"") >&5
16311   (eval $ac_try) 2>&5
16312   ac_status=$?
16313   echo "$as_me:16313: \$? = $ac_status" >&5
16314   (exit $ac_status); }; }; then
16315   cf_cv_func_mkstemp=yes
16316
16317 else
16318   echo "$as_me: program exited with status $ac_status" >&5
16319 echo "$as_me: failed program was:" >&5
16320 cat conftest.$ac_ext >&5
16321 cf_cv_func_mkstemp=no
16322
16323 fi
16324 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16325 fi
16326
16327 fi
16328 echo "$as_me:16328: result: $cf_cv_func_mkstemp" >&5
16329 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16330 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16331         echo "$as_me:16331: checking for mkstemp" >&5
16332 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16333 if test "${ac_cv_func_mkstemp+set}" = set; then
16334   echo $ECHO_N "(cached) $ECHO_C" >&6
16335 else
16336   cat >conftest.$ac_ext <<_ACEOF
16337 #line 16337 "configure"
16338 #include "confdefs.h"
16339 #define mkstemp autoconf_temporary
16340 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16341 #undef mkstemp
16342
16343 #ifdef __cplusplus
16344 extern "C"
16345 #endif
16346
16347 /* We use char because int might match the return type of a gcc2
16348    builtin and then its argument prototype would still apply.  */
16349 char mkstemp (void);
16350
16351 int
16352 main (void)
16353 {
16354
16355 /* The GNU C library defines stubs for functions which it implements
16356     to always fail with ENOSYS.  Some functions are actually named
16357     something starting with __ and the normal name is an alias.  */
16358 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16359 #error found stub for mkstemp
16360 #endif
16361
16362         return mkstemp ();
16363   ;
16364   return 0;
16365 }
16366 _ACEOF
16367 rm -f conftest.$ac_objext conftest$ac_exeext
16368 if { (eval echo "$as_me:16368: \"$ac_link\"") >&5
16369   (eval $ac_link) 2>&5
16370   ac_status=$?
16371   echo "$as_me:16371: \$? = $ac_status" >&5
16372   (exit $ac_status); } &&
16373          { ac_try='test -s conftest$ac_exeext'
16374   { (eval echo "$as_me:16374: \"$ac_try\"") >&5
16375   (eval $ac_try) 2>&5
16376   ac_status=$?
16377   echo "$as_me:16377: \$? = $ac_status" >&5
16378   (exit $ac_status); }; }; then
16379   ac_cv_func_mkstemp=yes
16380 else
16381   echo "$as_me: failed program was:" >&5
16382 cat conftest.$ac_ext >&5
16383 ac_cv_func_mkstemp=no
16384 fi
16385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16386 fi
16387 echo "$as_me:16387: result: $ac_cv_func_mkstemp" >&5
16388 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16389
16390 fi
16391 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16392
16393 cat >>confdefs.h <<\EOF
16394 #define HAVE_MKSTEMP 1
16395 EOF
16396
16397 fi
16398
16399 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16400         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16401         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16402 fi
16403
16404 cf_with_ada=yes
16405 if test "$cf_with_ada" != "no" ; then
16406
16407 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16408 do
16409
16410 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16411
16412         unset ac_cv_path_cf_TEMP_gnat
16413         unset cf_TEMP_gnat
16414         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16415 set dummy $cf_prog_gnat; ac_word=$2
16416 echo "$as_me:16416: checking for $ac_word" >&5
16417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16418 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16419   echo $ECHO_N "(cached) $ECHO_C" >&6
16420 else
16421   case $cf_TEMP_gnat in
16422   [\\/]* | ?:[\\/]*)
16423   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16424   ;;
16425   *)
16426   ac_save_IFS=$IFS; IFS=$ac_path_separator
16427 ac_dummy="$PATH"
16428 for ac_dir in $ac_dummy; do
16429   IFS=$ac_save_IFS
16430   test -z "$ac_dir" && ac_dir=.
16431   if $as_executable_p "$ac_dir/$ac_word"; then
16432    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16433    echo "$as_me:16433: found $ac_dir/$ac_word" >&5
16434    break
16435 fi
16436 done
16437
16438   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16439   ;;
16440 esac
16441 fi
16442 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16443
16444 if test -n "$cf_TEMP_gnat"; then
16445   echo "$as_me:16445: result: $cf_TEMP_gnat" >&5
16446 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16447 else
16448   echo "$as_me:16448: result: no" >&5
16449 echo "${ECHO_T}no" >&6
16450 fi
16451
16452         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16453
16454         if test "x$cf_TEMP_gnat" != xno; then
16455                 unset cf_cv_gnat_version
16456                 unset cf_TEMP_gnat
16457
16458 echo "$as_me:16458: checking for $cf_prog_gnat version" >&5
16459 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16460 if test "${cf_cv_gnat_version+set}" = set; then
16461   echo $ECHO_N "(cached) $ECHO_C" >&6
16462 else
16463
16464 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16465         grep '[0-9].[0-9][0-9]*' |\
16466         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16467
16468 fi
16469 echo "$as_me:16469: result: $cf_cv_gnat_version" >&5
16470 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16471 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16472 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16473
16474         fi
16475         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16476
16477         unset cf_TEMP_gnat
16478         unset cf_cv_gnat_version
16479         unset ac_cv_path_cf_TEMP_gnat
16480 done
16481
16482 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16483         cf_ada_make=
16484         cf_cv_prog_gnat_correct=no
16485 else
16486         cf_ada_make=gnatmake
16487         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16488                 # gprconfig is newer than gnatmake; we can continue...
16489                 cf_ada_config="##"
16490         else
16491                 rm -rf conftest* *~conftest*
16492                 if mkdir conftest.src
16493                 then
16494                         cf_ada_config=""
16495                         cd conftest.src
16496                         for cf_gprconfig in Ada C
16497                         do
16498                                 echo "$as_me:16498: checking for gprconfig name for $cf_gprconfig" >&5
16499 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16500                                 if test $cf_gprconfig = C
16501                                 then
16502                                         for cf_gprconfig_param in \
16503                                                 $cf_gprconfig,,,,GNATGCC \
16504                                                 $cf_gprconfig,,,,GCC \
16505                                                 $cf_gprconfig
16506                                         do
16507                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16508                                                 test -n "$cf_gprconfig_value" && break
16509                                         done
16510                                 else
16511                                         cf_gprconfig_param=$cf_gprconfig
16512                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16513                                 fi
16514                                 if test -n "$cf_gprconfig_value"
16515                                 then
16516                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16517                                         echo "$as_me:16517: result: $cf_gprconfig_value" >&5
16518 echo "${ECHO_T}$cf_gprconfig_value" >&6
16519                                 else
16520                                         echo "$as_me:16520: result: missing" >&5
16521 echo "${ECHO_T}missing" >&6
16522                                         cf_ada_config="#"
16523                                         break
16524                                 fi
16525                         done
16526                         cd ..
16527                         rm -rf conftest* *~conftest*
16528                 fi
16529         fi
16530         if test "x$cf_ada_config" != "x#"
16531         then
16532
16533 echo "$as_me:16533: checking for gnat version" >&5
16534 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16535 if test "${cf_cv_gnat_version+set}" = set; then
16536   echo $ECHO_N "(cached) $ECHO_C" >&6
16537 else
16538
16539 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16540         grep '[0-9].[0-9][0-9]*' |\
16541         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16542
16543 fi
16544 echo "$as_me:16544: result: $cf_cv_gnat_version" >&5
16545 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16546 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16547
16548 case $cf_cv_gnat_version in
16549 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16550         cf_cv_prog_gnat_correct=yes
16551         ;;
16552 (*)
16553         { echo "$as_me:16553: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16554 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16555         cf_cv_prog_gnat_correct=no
16556         ;;
16557 esac
16558
16559                 # Extract the first word of "m4", so it can be a program name with args.
16560 set dummy m4; ac_word=$2
16561 echo "$as_me:16561: checking for $ac_word" >&5
16562 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16563 if test "${ac_cv_prog_M4_exists+set}" = set; then
16564   echo $ECHO_N "(cached) $ECHO_C" >&6
16565 else
16566   if test -n "$M4_exists"; then
16567   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16568 else
16569   ac_save_IFS=$IFS; IFS=$ac_path_separator
16570 ac_dummy="$PATH"
16571 for ac_dir in $ac_dummy; do
16572   IFS=$ac_save_IFS
16573   test -z "$ac_dir" && ac_dir=.
16574   $as_executable_p "$ac_dir/$ac_word" || continue
16575 ac_cv_prog_M4_exists="yes"
16576 echo "$as_me:16576: found $ac_dir/$ac_word" >&5
16577 break
16578 done
16579
16580   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16581 fi
16582 fi
16583 M4_exists=$ac_cv_prog_M4_exists
16584 if test -n "$M4_exists"; then
16585   echo "$as_me:16585: result: $M4_exists" >&5
16586 echo "${ECHO_T}$M4_exists" >&6
16587 else
16588   echo "$as_me:16588: result: no" >&5
16589 echo "${ECHO_T}no" >&6
16590 fi
16591
16592                 if test "$ac_cv_prog_M4_exists" = no; then
16593                         cf_cv_prog_gnat_correct=no
16594                         { echo "$as_me:16594: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16595 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16596                 fi
16597                 if test "$cf_cv_prog_gnat_correct" = yes; then
16598                         echo "$as_me:16598: checking if GNAT works" >&5
16599 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16600
16601 rm -rf conftest* *~conftest*
16602 cat >>conftest.ads <<CF_EOF
16603 procedure conftest;
16604 CF_EOF
16605 cat >>conftest.adb <<CF_EOF
16606 with Text_IO;
16607 with GNAT.OS_Lib;
16608 procedure conftest is
16609 begin
16610    Text_IO.Put ("Hello World");
16611    Text_IO.New_Line;
16612    GNAT.OS_Lib.OS_Exit (0);
16613 end conftest;
16614 CF_EOF
16615 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16616    if ( ./conftest 1>&5 2>&1 ) ; then
16617       cf_cv_prog_gnat_correct=yes
16618    else
16619       cf_cv_prog_gnat_correct=no
16620    fi
16621 else
16622    cf_cv_prog_gnat_correct=no
16623 fi
16624 rm -rf conftest* *~conftest*
16625
16626                         echo "$as_me:16626: result: $cf_cv_prog_gnat_correct" >&5
16627 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16628                 fi
16629         else
16630                 cf_cv_prog_gnat_correct=no
16631         fi
16632 fi
16633
16634         if test "$cf_cv_prog_gnat_correct" = yes; then
16635
16636         echo "$as_me:16636: checking optimization options for ADAFLAGS" >&5
16637 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16638         case "$CFLAGS" in
16639         (*-g*)
16640
16641         ADAFLAGS="$ADAFLAGS -g"
16642
16643                 ;;
16644         esac
16645         case "$CFLAGS" in
16646         (*-O*)
16647                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16648
16649         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16650
16651                 ;;
16652         esac
16653         echo "$as_me:16653: result: $ADAFLAGS" >&5
16654 echo "${ECHO_T}$ADAFLAGS" >&6
16655
16656 echo "$as_me:16656: checking if GNATPREP supports -T option" >&5
16657 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16658 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16659   echo $ECHO_N "(cached) $ECHO_C" >&6
16660 else
16661
16662 cf_cv_gnatprep_opt_t=no
16663 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16664
16665 fi
16666 echo "$as_me:16666: result: $cf_cv_gnatprep_opt_t" >&5
16667 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16668 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16669
16670 echo "$as_me:16670: checking if GNAT supports generics" >&5
16671 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16672 case $cf_cv_gnat_version in
16673 (3.[1-9]*|[4-9].*|[1-9][0-9].*)
16674         cf_gnat_generics=yes
16675         ;;
16676 (*)
16677         cf_gnat_generics=no
16678         ;;
16679 esac
16680 echo "$as_me:16680: result: $cf_gnat_generics" >&5
16681 echo "${ECHO_T}$cf_gnat_generics" >&6
16682
16683 if test "$cf_gnat_generics" = yes
16684 then
16685         cf_compile_generics=generics
16686         cf_generic_objects="\${GENOBJS}"
16687 else
16688         cf_compile_generics=
16689         cf_generic_objects=
16690 fi
16691
16692 echo "$as_me:16692: checking if GNAT supports SIGINT" >&5
16693 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16694 if test "${cf_cv_gnat_sigint+set}" = set; then
16695   echo $ECHO_N "(cached) $ECHO_C" >&6
16696 else
16697
16698 rm -rf conftest* *~conftest*
16699 cat >>conftest.ads <<CF_EOF
16700 with Ada.Interrupts.Names;
16701
16702 package ConfTest is
16703
16704    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16705    pragma Unreserve_All_Interrupts;
16706    pragma Warnings (On);
16707
16708    protected Process is
16709       procedure Stop;
16710       function Continue return Boolean;
16711       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16712    private
16713       Done : Boolean := False;
16714    end Process;
16715
16716 end ConfTest;
16717 CF_EOF
16718 cat >>conftest.adb <<CF_EOF
16719 package body ConfTest is
16720    protected body Process is
16721       procedure Stop is
16722       begin
16723          Done := True;
16724       end Stop;
16725       function Continue return Boolean is
16726       begin
16727          return not Done;
16728       end Continue;
16729    end Process;
16730 end ConfTest;
16731 CF_EOF
16732 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16733       cf_cv_gnat_sigint=yes
16734 else
16735    cf_cv_gnat_sigint=no
16736 fi
16737 rm -rf conftest* *~conftest*
16738
16739 fi
16740 echo "$as_me:16740: result: $cf_cv_gnat_sigint" >&5
16741 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16742
16743 if test $cf_cv_gnat_sigint = yes ; then
16744         USE_GNAT_SIGINT=""
16745 else
16746         USE_GNAT_SIGINT="#"
16747 fi
16748
16749 cf_gnat_libraries=no
16750 cf_gnat_projects=no
16751
16752 if test "$enable_gnat_projects" != no ; then
16753 echo "$as_me:16753: checking if GNAT supports project files" >&5
16754 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16755 case $cf_cv_gnat_version in
16756 (3.[0-9]*)
16757         ;;
16758 (*)
16759         case $cf_cv_system_name in
16760         (cygwin*|msys*)
16761                 ;;
16762         (*)
16763                 rm -rf conftest* *~conftest*
16764                 if mkdir conftest.src conftest.bin conftest.lib
16765                 then
16766                         cd conftest.src
16767                         rm -rf conftest* *~conftest*
16768                         cat >>library.gpr <<CF_EOF
16769 project Library is
16770   Kind := External ("LIB_KIND");
16771   for Library_Name use "ConfTest";
16772   for Object_Dir use ".";
16773   for Library_ALI_Dir use External("LIBRARY_DIR");
16774   for Library_Version use External ("SONAME");
16775   for Library_Kind use Kind;
16776   for Library_Dir use External("BUILD_DIR");
16777   Source_Dir := External ("SOURCE_DIR");
16778   for Source_Dirs use (Source_Dir);
16779 end Library;
16780 CF_EOF
16781                         cat >>confpackage.ads <<CF_EOF
16782 package ConfPackage is
16783    procedure conftest;
16784 end ConfPackage;
16785 CF_EOF
16786                         cat >>confpackage.adb <<CF_EOF
16787 with Text_IO;
16788 package body ConfPackage is
16789    procedure conftest is
16790    begin
16791       Text_IO.Put ("Hello World");
16792       Text_IO.New_Line;
16793    end conftest;
16794 end ConfPackage;
16795 CF_EOF
16796                         if ( $cf_ada_make $ADAFLAGS \
16797                                         -Plibrary.gpr \
16798                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
16799                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
16800                                         -XSOURCE_DIR=`pwd` \
16801                                         -XSONAME=libConfTest.so.1 \
16802                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
16803                                 cf_gnat_projects=yes
16804                         fi
16805                         cd ..
16806                 fi
16807                 if test -f conftest.lib/confpackage.ali
16808                 then
16809                         cf_gnat_libraries=yes
16810                 fi
16811                 rm -rf conftest* *~conftest*
16812                 ;;
16813         esac
16814         ;;
16815 esac
16816 echo "$as_me:16816: result: $cf_gnat_projects" >&5
16817 echo "${ECHO_T}$cf_gnat_projects" >&6
16818 fi # enable_gnat_projects
16819
16820 if test $cf_gnat_projects = yes
16821 then
16822         echo "$as_me:16822: checking if GNAT supports libraries" >&5
16823 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
16824         echo "$as_me:16824: result: $cf_gnat_libraries" >&5
16825 echo "${ECHO_T}$cf_gnat_libraries" >&6
16826 fi
16827
16828 if test "$cf_gnat_projects" = yes
16829 then
16830         USE_OLD_MAKERULES="#"
16831         USE_GNAT_PROJECTS=""
16832 else
16833         USE_OLD_MAKERULES=""
16834         USE_GNAT_PROJECTS="#"
16835 fi
16836
16837 if test "$cf_gnat_libraries" = yes
16838 then
16839         USE_GNAT_LIBRARIES=""
16840 else
16841         USE_GNAT_LIBRARIES="#"
16842 fi
16843
16844 echo "$as_me:16844: checking for ada-compiler" >&5
16845 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
16846
16847 # Check whether --with-ada-compiler or --without-ada-compiler was given.
16848 if test "${with_ada_compiler+set}" = set; then
16849   withval="$with_ada_compiler"
16850   cf_ada_compiler=$withval
16851 else
16852   cf_ada_compiler=gnatmake
16853 fi;
16854
16855 echo "$as_me:16855: result: $cf_ada_compiler" >&5
16856 echo "${ECHO_T}$cf_ada_compiler" >&6
16857
16858                 cf_ada_package=terminal_interface
16859
16860 echo "$as_me:16860: checking for ada-include" >&5
16861 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
16862
16863 # Check whether --with-ada-include or --without-ada-include was given.
16864 if test "${with_ada_include+set}" = set; then
16865   withval="$with_ada_include"
16866
16867 else
16868   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
16869 fi; if test -n "$prefix/share/ada/adainclude" ; then
16870
16871 if test "x$prefix" != xNONE; then
16872         cf_path_syntax="$prefix"
16873 else
16874         cf_path_syntax="$ac_default_prefix"
16875 fi
16876
16877 case ".$withval" in
16878 (.\$\(*\)*|.\'*\'*)
16879         ;;
16880 (..|./*|.\\*)
16881         ;;
16882 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16883         ;;
16884 (.\${*prefix}*|.\${*dir}*)
16885         eval withval="$withval"
16886         case ".$withval" in
16887         (.NONE/*)
16888                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16889                 ;;
16890         esac
16891         ;;
16892 (.no|.NONE/*)
16893         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16894         ;;
16895 (*)
16896         { { echo "$as_me:16896: error: expected a pathname, not \"$withval\"" >&5
16897 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16898    { (exit 1); exit 1; }; }
16899         ;;
16900 esac
16901
16902 fi
16903 eval ADA_INCLUDE="$withval"
16904
16905 echo "$as_me:16905: result: $ADA_INCLUDE" >&5
16906 echo "${ECHO_T}$ADA_INCLUDE" >&6
16907
16908 echo "$as_me:16908: checking for ada-objects" >&5
16909 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
16910
16911 # Check whether --with-ada-objects or --without-ada-objects was given.
16912 if test "${with_ada_objects+set}" = set; then
16913   withval="$with_ada_objects"
16914
16915 else
16916   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
16917 fi; if test -n "$prefix/lib/ada/adalib" ; then
16918
16919 if test "x$prefix" != xNONE; then
16920         cf_path_syntax="$prefix"
16921 else
16922         cf_path_syntax="$ac_default_prefix"
16923 fi
16924
16925 case ".$withval" in
16926 (.\$\(*\)*|.\'*\'*)
16927         ;;
16928 (..|./*|.\\*)
16929         ;;
16930 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16931         ;;
16932 (.\${*prefix}*|.\${*dir}*)
16933         eval withval="$withval"
16934         case ".$withval" in
16935         (.NONE/*)
16936                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16937                 ;;
16938         esac
16939         ;;
16940 (.no|.NONE/*)
16941         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16942         ;;
16943 (*)
16944         { { echo "$as_me:16944: error: expected a pathname, not \"$withval\"" >&5
16945 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16946    { (exit 1); exit 1; }; }
16947         ;;
16948 esac
16949
16950 fi
16951 eval ADA_OBJECTS="$withval"
16952
16953 echo "$as_me:16953: result: $ADA_OBJECTS" >&5
16954 echo "${ECHO_T}$ADA_OBJECTS" >&6
16955
16956 echo "$as_me:16956: checking if an Ada95 shared-library should be built" >&5
16957 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16958
16959 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16960 if test "${with_ada_sharedlib+set}" = set; then
16961   withval="$with_ada_sharedlib"
16962   with_ada_sharedlib=$withval
16963 else
16964   with_ada_sharedlib=no
16965 fi;
16966 echo "$as_me:16966: result: $with_ada_sharedlib" >&5
16967 echo "${ECHO_T}$with_ada_sharedlib" >&6
16968
16969 if test "x$with_ada_sharedlib" != xno
16970 then
16971         if test "x$cf_gnat_projects" != xyes
16972         then
16973                 { echo "$as_me:16973: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16974 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16975                 with_ada_sharedlib=no
16976         fi
16977 fi
16978
16979 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16980 MAKE_ADA_SHAREDLIB="#"
16981
16982 if test "x$with_ada_sharedlib" != xno
16983 then
16984         MAKE_ADA_SHAREDLIB=
16985         if test "x$with_ada_sharedlib" != xyes
16986         then
16987                 ADA_SHAREDLIB="$with_ada_sharedlib"
16988         fi
16989 fi
16990
16991                 # allow the Ada binding to be renamed
16992
16993 echo "$as_me:16993: checking for ada-libname" >&5
16994 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
16995
16996 # Check whether --with-ada-libname or --without-ada-libname was given.
16997 if test "${with_ada_libname+set}" = set; then
16998   withval="$with_ada_libname"
16999   ADA_LIBNAME=$withval
17000 else
17001   ADA_LIBNAME=AdaCurses
17002 fi;
17003 case "x$ADA_LIBNAME" in
17004 (x|xyes|xno)
17005         ADA_LIBNAME=AdaCurses
17006         ;;
17007 esac
17008
17009 echo "$as_me:17009: result: $ADA_LIBNAME" >&5
17010 echo "${ECHO_T}$ADA_LIBNAME" >&6
17011
17012         else
17013                 { { echo "$as_me:17013: error: No usable Ada compiler found" >&5
17014 echo "$as_me: error: No usable Ada compiler found" >&2;}
17015    { (exit 1); exit 1; }; }
17016         fi
17017 else
17018         { { echo "$as_me:17018: error: The Ada compiler is needed for this package" >&5
17019 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17020    { (exit 1); exit 1; }; }
17021 fi
17022
17023 ################################################################################
17024
17025 # not needed
17026 TINFO_LDFLAGS2=
17027
17028 TINFO_LIBS=
17029
17030 ### Construct the list of include-directories to be generated
17031
17032 if test "$srcdir" != "."; then
17033         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17034 fi
17035 CPPFLAGS="-I../include $CPPFLAGS"
17036 if test "$srcdir" != "."; then
17037         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17038 fi
17039 CPPFLAGS="-I. $CPPFLAGS"
17040
17041 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17042 if test "$srcdir" != "."; then
17043         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17044 fi
17045 if test "$GCC" != yes; then
17046         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17047 elif test "$includedir" != "/usr/include"; then
17048         if test "$includedir" = '${prefix}/include' ; then
17049                 if test x$prefix != x/usr ; then
17050                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17051                 fi
17052         else
17053                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17054         fi
17055 fi
17056
17057 ### Build up pieces for makefile rules
17058 echo "$as_me:17058: checking default library suffix" >&5
17059 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17060
17061         case $DFT_LWR_MODEL in
17062         (libtool) DFT_ARG_SUFFIX=''   ;;
17063         (normal)  DFT_ARG_SUFFIX=''   ;;
17064         (debug)   DFT_ARG_SUFFIX='_g' ;;
17065         (profile) DFT_ARG_SUFFIX='_p' ;;
17066         (shared)  DFT_ARG_SUFFIX=''   ;;
17067         esac
17068         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17069 echo "$as_me:17069: result: $DFT_ARG_SUFFIX" >&5
17070 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17071
17072 echo "$as_me:17072: checking default library-dependency suffix" >&5
17073 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17074
17075         case X$DFT_LWR_MODEL in
17076         (Xlibtool)
17077                 DFT_LIB_SUFFIX='.la'
17078                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17079                 ;;
17080         (Xdebug)
17081                 case $cf_cv_system_name in
17082                 (*-msvc*)
17083                         DFT_LIB_SUFFIX='_g.lib'
17084                         ;;
17085                 (*)
17086                         DFT_LIB_SUFFIX='_g.a'
17087                         ;;
17088                 esac
17089                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17090                 ;;
17091         (Xprofile)
17092                 case $cf_cv_system_name in
17093                 (*-msvc*)
17094                         DFT_LIB_SUFFIX='_p.lib'
17095                         ;;
17096                 (*)
17097                         DFT_LIB_SUFFIX='_p.a'
17098                         ;;
17099                 esac
17100                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17101                 ;;
17102         (Xshared)
17103                 case $cf_cv_system_name in
17104                 (aix[5-7]*)
17105                         DFT_LIB_SUFFIX='.so'
17106                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17107                         ;;
17108                 (*-msvc*)
17109                         DFT_LIB_SUFFIX='.dll'
17110                         DFT_DEP_SUFFIX='.dll.lib'
17111                         ;;
17112                 (cygwin*|msys*|mingw*)
17113                         DFT_LIB_SUFFIX='.dll'
17114                         DFT_DEP_SUFFIX='.dll.a'
17115                         ;;
17116                 (darwin*)
17117                         DFT_LIB_SUFFIX='.dylib'
17118                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17119                         ;;
17120                 (hpux*)
17121                         case $target in
17122                         (ia64*)
17123                                 DFT_LIB_SUFFIX='.so'
17124                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17125                                 ;;
17126                         (*)
17127                                 DFT_LIB_SUFFIX='.sl'
17128                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17129                                 ;;
17130                         esac
17131                         ;;
17132                 (*)
17133                         DFT_LIB_SUFFIX='.so'
17134                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17135                         ;;
17136                 esac
17137                 ;;
17138         (*)
17139                 case $target in
17140                 (*-msvc*)
17141                         DFT_LIB_SUFFIX='.lib'
17142                         ;;
17143                 (*)
17144                         DFT_LIB_SUFFIX='.a'
17145                         ;;
17146                 esac
17147                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17148                 ;;
17149         esac
17150         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17151         then
17152                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17153                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17154         fi
17155 echo "$as_me:17155: result: $DFT_DEP_SUFFIX" >&5
17156 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17157
17158 echo "$as_me:17158: checking default object directory" >&5
17159 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17160
17161         case $DFT_LWR_MODEL in
17162         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17163         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17164         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17165         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17166         (shared)
17167                 case $cf_cv_system_name in
17168                 (cygwin|msys)
17169                         DFT_OBJ_SUBDIR='objects' ;;
17170                 (*)
17171                         DFT_OBJ_SUBDIR='obj_s' ;;
17172                 esac
17173         esac
17174 echo "$as_me:17174: result: $DFT_OBJ_SUBDIR" >&5
17175 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17176
17177 ### Set up low-level terminfo dependencies for makefiles.
17178
17179 if test "$DFT_LWR_MODEL" = shared ; then
17180         case $cf_cv_system_name in
17181         (cygwin*)
17182                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17183                 ;;
17184         (msys*)
17185                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17186                 ;;
17187         esac
17188 fi
17189
17190 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17191
17192 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17193
17194 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17195
17196 ### Construct the list of subdirectories for which we'll customize makefiles
17197 ### with the appropriate compile-rules.
17198
17199 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17200
17201 cat >>confdefs.h <<EOF
17202 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17203 EOF
17204
17205 ### Now that we're done running tests, add the compiler-warnings, if any
17206
17207 cf_fix_cppflags=no
17208 cf_new_cflags=
17209 cf_new_cppflags=
17210 cf_new_extra_cppflags=
17211
17212 for cf_add_cflags in $EXTRA_CFLAGS
17213 do
17214 case $cf_fix_cppflags in
17215 (no)
17216         case $cf_add_cflags in
17217         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17218                 case $cf_add_cflags in
17219                 (-D*)
17220                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17221
17222                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17223                                 && test -z "${cf_tst_cflags}" \
17224                                 && cf_fix_cppflags=yes
17225
17226                         if test $cf_fix_cppflags = yes ; then
17227
17228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17230
17231                                 continue
17232                         elif test "${cf_tst_cflags}" = "\"'" ; then
17233
17234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17236
17237                                 continue
17238                         fi
17239                         ;;
17240                 esac
17241                 case "$CPPFLAGS" in
17242                 (*$cf_add_cflags)
17243                         ;;
17244                 (*)
17245                         case $cf_add_cflags in
17246                         (-D*)
17247                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17248
17249 CPPFLAGS=`echo "$CPPFLAGS" | \
17250         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17251                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17252
17253                                 ;;
17254                         esac
17255
17256         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17257         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17258
17259                         ;;
17260                 esac
17261                 ;;
17262         (*)
17263
17264         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17265         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17266
17267                 ;;
17268         esac
17269         ;;
17270 (yes)
17271
17272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17274
17275         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17276
17277         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17278                 && test -z "${cf_tst_cflags}" \
17279                 && cf_fix_cppflags=no
17280         ;;
17281 esac
17282 done
17283
17284 if test -n "$cf_new_cflags" ; then
17285
17286         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17287         CFLAGS="${CFLAGS}$cf_new_cflags"
17288
17289 fi
17290
17291 if test -n "$cf_new_cppflags" ; then
17292
17293         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17294         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17295
17296 fi
17297
17298 if test -n "$cf_new_extra_cppflags" ; then
17299
17300         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17301         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17302
17303 fi
17304
17305 ################################################################################
17306
17307 TEST_ARG2=
17308
17309 TEST_LIBS2=
17310
17311 NCURSES_SHLIB2="sh -c"
17312
17313 ADA_SUBDIRS="include gen src doc"
17314 if test "x$cf_with_tests" != "xno" ; then
17315         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17316 fi
17317 for cf_dir in $ADA_SUBDIRS
17318 do
17319         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17320 done
17321
17322 NCURSES_TREE="#"
17323
17324 EXTERNAL_TREE=
17325
17326 # match layout used by make-tar.sh
17327 ADAHTML_DIR=../doc/ada
17328
17329 if test "x$cross_compiling" = xyes ; then
17330         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17331 else
17332         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17333 fi
17334
17335 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"
17336 ac_config_commands="$ac_config_commands default"
17337 cat >confcache <<\_ACEOF
17338 # This file is a shell script that caches the results of configure
17339 # tests run on this system so they can be shared between configure
17340 # scripts and configure runs, see configure's option --config-cache.
17341 # It is not useful on other systems.  If it contains results you don't
17342 # want to keep, you may remove or edit it.
17343 #
17344 # config.status only pays attention to the cache file if you give it
17345 # the --recheck option to rerun configure.
17346 #
17347 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17348 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17349 # following values.
17350
17351 _ACEOF
17352
17353 # The following way of writing the cache mishandles newlines in values,
17354 # but we know of no workaround that is simple, portable, and efficient.
17355 # So, don't put newlines in cache variables' values.
17356 # Ultrix sh set writes to stderr and can't be redirected directly,
17357 # and sets the high bit in the cache file unless we assign to the vars.
17358 {
17359   (set) 2>&1 |
17360     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17361     *ac_space=\ *)
17362       # `set' does not quote correctly, so add quotes (double-quote
17363       # substitution turns \\\\ into \\, and sed turns \\ into \).
17364       sed -n \
17365         "s/'/'\\\\''/g;
17366           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17367       ;;
17368     *)
17369       # `set' quotes correctly as required by POSIX, so do not add quotes.
17370       sed -n \
17371         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17372       ;;
17373     esac;
17374 } |
17375   sed '
17376      t clear
17377      : clear
17378      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17379      t end
17380      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17381      : end' >>confcache
17382 if cmp -s $cache_file confcache; then :; else
17383   if test -w $cache_file; then
17384     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17385     cat confcache >$cache_file
17386   else
17387     echo "not updating unwritable cache $cache_file"
17388   fi
17389 fi
17390 rm -f confcache
17391
17392 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17393 # Let make expand exec_prefix.
17394 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17395
17396 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17397 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17398 # trailing colons and then remove the whole line if VPATH becomes empty
17399 # (actually we leave an empty line to preserve line numbers).
17400 if test "x$srcdir" = x.; then
17401   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17402 s/:*\$(srcdir):*/:/;
17403 s/:*\${srcdir}:*/:/;
17404 s/:*@srcdir@:*/:/;
17405 s/^\([^=]*=[    ]*\):*/\1/;
17406 s/:*$//;
17407 s/^[^=]*=[      ]*$//;
17408 }'
17409 fi
17410
17411 DEFS=-DHAVE_CONFIG_H
17412
17413 : ${CONFIG_STATUS=./config.status}
17414 ac_clean_files_save=$ac_clean_files
17415 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17416 { echo "$as_me:17416: creating $CONFIG_STATUS" >&5
17417 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17418 cat >$CONFIG_STATUS <<_ACEOF
17419 #! $SHELL
17420 # Generated automatically by configure.
17421 # Run this file to recreate the current configuration.
17422 # Compiler output produced by configure, useful for debugging
17423 # configure, is in config.log if it exists.
17424
17425 debug=false
17426 SHELL=\${CONFIG_SHELL-$SHELL}
17427 ac_cs_invocation="\$0 \$@"
17428
17429 _ACEOF
17430
17431 cat >>$CONFIG_STATUS <<\_ACEOF
17432 # Be Bourne compatible
17433 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17434   emulate sh
17435   NULLCMD=:
17436 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17437   set -o posix
17438 fi
17439
17440 # Name of the executable.
17441 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17442
17443 if expr a : '\(a\)' >/dev/null 2>&1; then
17444   as_expr=expr
17445 else
17446   as_expr=false
17447 fi
17448
17449 rm -f conf$$ conf$$.exe conf$$.file
17450 echo >conf$$.file
17451 if ln -s conf$$.file conf$$ 2>/dev/null; then
17452   # We could just check for DJGPP; but this test a) works b) is more generic
17453   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17454   if test -f conf$$.exe; then
17455     # Don't use ln at all; we don't have any links
17456     as_ln_s='cp -p'
17457   else
17458     as_ln_s='ln -s'
17459   fi
17460 elif ln conf$$.file conf$$ 2>/dev/null; then
17461   as_ln_s=ln
17462 else
17463   as_ln_s='cp -p'
17464 fi
17465 rm -f conf$$ conf$$.exe conf$$.file
17466
17467 as_executable_p="test -f"
17468
17469 # Support unset when possible.
17470 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17471   as_unset=unset
17472 else
17473   as_unset=false
17474 fi
17475
17476 # NLS nuisances.
17477 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17478 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17479 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17480 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17481 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17482 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17483 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17484 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17485
17486 # IFS
17487 # We need space, tab and new line, in precisely that order.
17488 as_nl='
17489 '
17490 IFS="   $as_nl"
17491
17492 # CDPATH.
17493 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17494
17495 exec 6>&1
17496
17497 _ACEOF
17498
17499 # Files that config.status was made for.
17500 if test -n "$ac_config_files"; then
17501   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17502 fi
17503
17504 if test -n "$ac_config_headers"; then
17505   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17506 fi
17507
17508 if test -n "$ac_config_links"; then
17509   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17510 fi
17511
17512 if test -n "$ac_config_commands"; then
17513   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17514 fi
17515
17516 cat >>$CONFIG_STATUS <<\EOF
17517
17518 ac_cs_usage="\
17519 \`$as_me' instantiates files from templates according to the
17520 current configuration.
17521
17522 Usage: $0 [OPTIONS] [FILE]...
17523
17524   -h, --help       print this help, then exit
17525   -V, --version    print version number, then exit
17526   -d, --debug      don't remove temporary files
17527       --recheck    update $as_me by reconfiguring in the same conditions
17528   --file=FILE[:TEMPLATE]
17529                    instantiate the configuration file FILE
17530   --header=FILE[:TEMPLATE]
17531                    instantiate the configuration header FILE
17532
17533 Configuration files:
17534 $config_files
17535
17536 Configuration headers:
17537 $config_headers
17538
17539 Configuration commands:
17540 $config_commands
17541
17542 Report bugs to <dickey@invisible-island.net>."
17543 EOF
17544
17545 cat >>$CONFIG_STATUS <<EOF
17546 ac_cs_version="\\
17547 config.status
17548 configured by $0, generated by GNU Autoconf 2.52.20200111,
17549   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17550
17551 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17552 Free Software Foundation, Inc.
17553 This config.status script is free software; the Free Software Foundation
17554 gives unlimited permission to copy, distribute and modify it."
17555 srcdir=$srcdir
17556 INSTALL="$INSTALL"
17557 EOF
17558
17559 cat >>$CONFIG_STATUS <<\EOF
17560 # If no file are specified by the user, then we need to provide default
17561 # value.  By we need to know if files were specified by the user.
17562 ac_need_defaults=:
17563 while test $# != 0
17564 do
17565   case $1 in
17566   --*=*)
17567     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17568     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17569     shift
17570     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17571     shift
17572     ;;
17573   -*);;
17574   *) # This is not an option, so the user has probably given explicit
17575      # arguments.
17576      ac_need_defaults=false;;
17577   esac
17578
17579   case $1 in
17580   # Handling of the options.
17581 EOF
17582 cat >>$CONFIG_STATUS <<EOF
17583   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17584     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17585     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17586 EOF
17587 cat >>$CONFIG_STATUS <<\EOF
17588   --version | --vers* | -V )
17589     echo "$ac_cs_version"; exit 0 ;;
17590   --he | --h)
17591     # Conflict between --help and --header
17592     { { echo "$as_me:17592: error: ambiguous option: $1
17593 Try \`$0 --help' for more information." >&5
17594 echo "$as_me: error: ambiguous option: $1
17595 Try \`$0 --help' for more information." >&2;}
17596    { (exit 1); exit 1; }; };;
17597   --help | --hel | -h )
17598     echo "$ac_cs_usage"; exit 0 ;;
17599   --debug | --d* | -d )
17600     debug=: ;;
17601   --file | --fil | --fi | --f )
17602     shift
17603     CONFIG_FILES="$CONFIG_FILES $1"
17604     ac_need_defaults=false;;
17605   --header | --heade | --head | --hea )
17606     shift
17607     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17608     ac_need_defaults=false;;
17609
17610   # This is an error.
17611   -*) { { echo "$as_me:17611: error: unrecognized option: $1
17612 Try \`$0 --help' for more information." >&5
17613 echo "$as_me: error: unrecognized option: $1
17614 Try \`$0 --help' for more information." >&2;}
17615    { (exit 1); exit 1; }; } ;;
17616
17617   *) ac_config_targets="$ac_config_targets $1" ;;
17618
17619   esac
17620   shift
17621 done
17622
17623 exec 5>>config.log
17624 cat >&5 << _ACEOF
17625
17626 ## ----------------------- ##
17627 ## Running config.status.  ##
17628 ## ----------------------- ##
17629
17630 This file was extended by $as_me 2.52.20200111, executed with
17631   CONFIG_FILES    = $CONFIG_FILES
17632   CONFIG_HEADERS  = $CONFIG_HEADERS
17633   CONFIG_LINKS    = $CONFIG_LINKS
17634   CONFIG_COMMANDS = $CONFIG_COMMANDS
17635   > $ac_cs_invocation
17636 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17637
17638 _ACEOF
17639 EOF
17640
17641 cat >>$CONFIG_STATUS <<EOF
17642 #
17643 # INIT-COMMANDS section.
17644 #
17645
17646 ### Special initialization commands, used to pass information from the
17647 ### configuration-run into config.status
17648
17649 AWK="$AWK"
17650 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17651 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17652 LIB_NAME="$LIB_NAME"
17653 LIB_PREFIX="$LIB_PREFIX"
17654 LIB_SUFFIX="$LIB_SUFFIX"
17655 LN_S="$LN_S"
17656 NCURSES_MAJOR="$NCURSES_MAJOR"
17657 NCURSES_MINOR="$NCURSES_MINOR"
17658 NCURSES_PATCH="$NCURSES_PATCH"
17659 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17660 cf_cv_abi_version="$cf_cv_abi_version"
17661 cf_cv_rel_version="$cf_cv_rel_version"
17662 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17663 cf_cv_shared_soname='$cf_cv_shared_soname'
17664 cf_cv_shlib_version="$cf_cv_shlib_version"
17665 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17666 cf_cv_system_name="$cf_cv_system_name"
17667 host="$host"
17668 target="$target"
17669
17670 EOF
17671
17672 cat >>$CONFIG_STATUS <<\EOF
17673 for ac_config_target in $ac_config_targets
17674 do
17675   case "$ac_config_target" in
17676   # Handling of arguments.
17677   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17678   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17679   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17680   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17681   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17682   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17683   *) { { echo "$as_me:17683: error: invalid argument: $ac_config_target" >&5
17684 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17685    { (exit 1); exit 1; }; };;
17686   esac
17687 done
17688
17689 # If the user did not use the arguments to specify the items to instantiate,
17690 # then the envvar interface is used.  Set only those that are not.
17691 # We use the long form for the default assignment because of an extremely
17692 # bizarre bug on SunOS 4.1.3.
17693 if $ac_need_defaults; then
17694   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17695   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17696   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17697 fi
17698
17699 # Create a temporary directory, and hook for its removal unless debugging.
17700 $debug ||
17701 {
17702   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17703   trap '{ (exit 1); exit 1; }' 1 2 13 15
17704 }
17705
17706 # Create a (secure) tmp directory for tmp files.
17707 : ${TMPDIR=/tmp}
17708 {
17709   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17710   test -n "$tmp" && test -d "$tmp"
17711 }  ||
17712 {
17713   tmp=$TMPDIR/cs$$-$RANDOM
17714   (umask 077 && mkdir $tmp)
17715 } ||
17716 {
17717    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17718    { (exit 1); exit 1; }
17719 }
17720
17721 EOF
17722
17723 cat >>$CONFIG_STATUS <<EOF
17724
17725 #
17726 # CONFIG_FILES section.
17727 #
17728
17729 # No need to generate the scripts if there are no CONFIG_FILES.
17730 # This happens for instance when ./config.status config.h
17731 if test -n "\$CONFIG_FILES"; then
17732   # Protect against being on the right side of a sed subst in config.status.
17733   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17734    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17735 s,@SHELL@,$SHELL,;t t
17736 s,@exec_prefix@,$exec_prefix,;t t
17737 s,@prefix@,$prefix,;t t
17738 s,@program_transform_name@,$program_transform_name,;t t
17739 s,@bindir@,$bindir,;t t
17740 s,@sbindir@,$sbindir,;t t
17741 s,@libexecdir@,$libexecdir,;t t
17742 s,@datarootdir@,$datarootdir,;t t
17743 s,@datadir@,$datadir,;t t
17744 s,@sysconfdir@,$sysconfdir,;t t
17745 s,@sharedstatedir@,$sharedstatedir,;t t
17746 s,@localstatedir@,$localstatedir,;t t
17747 s,@runstatedir@,$runstatedir,;t t
17748 s,@libdir@,$libdir,;t t
17749 s,@includedir@,$includedir,;t t
17750 s,@oldincludedir@,$oldincludedir,;t t
17751 s,@infodir@,$infodir,;t t
17752 s,@mandir@,$mandir,;t t
17753 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17754 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17755 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17756 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17757 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17758 s,@build_alias@,$build_alias,;t t
17759 s,@host_alias@,$host_alias,;t t
17760 s,@target_alias@,$target_alias,;t t
17761 s,@ECHO_C@,$ECHO_C,;t t
17762 s,@ECHO_N@,$ECHO_N,;t t
17763 s,@ECHO_T@,$ECHO_T,;t t
17764 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17765 s,@DEFS@,$DEFS,;t t
17766 s,@LIBS@,$LIBS,;t t
17767 s,@top_builddir@,$top_builddir,;t t
17768 s,@build@,$build,;t t
17769 s,@build_cpu@,$build_cpu,;t t
17770 s,@build_vendor@,$build_vendor,;t t
17771 s,@build_os@,$build_os,;t t
17772 s,@host@,$host,;t t
17773 s,@host_cpu@,$host_cpu,;t t
17774 s,@host_vendor@,$host_vendor,;t t
17775 s,@host_os@,$host_os,;t t
17776 s,@target@,$target,;t t
17777 s,@target_cpu@,$target_cpu,;t t
17778 s,@target_vendor@,$target_vendor,;t t
17779 s,@target_os@,$target_os,;t t
17780 s,@CC@,$CC,;t t
17781 s,@CFLAGS@,$CFLAGS,;t t
17782 s,@LDFLAGS@,$LDFLAGS,;t t
17783 s,@CPPFLAGS@,$CPPFLAGS,;t t
17784 s,@ac_ct_CC@,$ac_ct_CC,;t t
17785 s,@EXEEXT@,$EXEEXT,;t t
17786 s,@OBJEXT@,$OBJEXT,;t t
17787 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17788 s,@CPP@,$CPP,;t t
17789 s,@AWK@,$AWK,;t t
17790 s,@EGREP@,$EGREP,;t t
17791 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17792 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17793 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17794 s,@LN_S@,$LN_S,;t t
17795 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17796 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17797 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17798 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17799 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17800 s,@SET_MAKE@,$SET_MAKE,;t t
17801 s,@CTAGS@,$CTAGS,;t t
17802 s,@ETAGS@,$ETAGS,;t t
17803 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17804 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17805 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17806 s,@RANLIB@,$RANLIB,;t t
17807 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17808 s,@LD@,$LD,;t t
17809 s,@ac_ct_LD@,$ac_ct_LD,;t t
17810 s,@AR@,$AR,;t t
17811 s,@ac_ct_AR@,$ac_ct_AR,;t t
17812 s,@ARFLAGS@,$ARFLAGS,;t t
17813 s,@DESTDIR@,$DESTDIR,;t t
17814 s,@BUILD_CC@,$BUILD_CC,;t t
17815 s,@BUILD_CPP@,$BUILD_CPP,;t t
17816 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17817 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17818 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17819 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17820 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17821 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17822 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17823 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17824 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17825 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17826 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17827 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17828 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17829 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17830 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17831 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17832 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17833 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17834 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17835 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17836 s,@CC_G_OPT@,$CC_G_OPT,;t t
17837 s,@LD_MODEL@,$LD_MODEL,;t t
17838 s,@shlibdir@,$shlibdir,;t t
17839 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17840 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17841 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17842 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17843 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17844 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17845 s,@LINK_PROGS@,$LINK_PROGS,;t t
17846 s,@LINK_TESTS@,$LINK_TESTS,;t t
17847 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17848 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17849 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17850 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17851 s,@RPATH_LIST@,$RPATH_LIST,;t t
17852 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17853 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17854 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17855 s,@PTHREAD@,$PTHREAD,;t t
17856 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17857 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17858 s,@ECHO_LT@,$ECHO_LT,;t t
17859 s,@ECHO_LD@,$ECHO_LD,;t t
17860 s,@RULE_CC@,$RULE_CC,;t t
17861 s,@SHOW_CC@,$SHOW_CC,;t t
17862 s,@ECHO_CC@,$ECHO_CC,;t t
17863 s,@ADAFLAGS@,$ADAFLAGS,;t t
17864 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17865 s,@ADA_TRACE@,$ADA_TRACE,;t t
17866 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17867 s,@M4_exists@,$M4_exists,;t t
17868 s,@cf_ada_make@,$cf_ada_make,;t t
17869 s,@cf_ada_config@,$cf_ada_config,;t t
17870 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17871 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17872 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17873 s,@cf_compile_generics@,$cf_compile_generics,;t t
17874 s,@cf_generic_objects@,$cf_generic_objects,;t t
17875 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17876 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17877 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17878 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17879 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17880 s,@cf_ada_package@,$cf_ada_package,;t t
17881 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17882 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17883 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17884 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17885 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
17886 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
17887 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17888 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
17889 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
17890 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17891 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17892 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
17893 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
17894 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
17895 s,@TEST_ARG2@,$TEST_ARG2,;t t
17896 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
17897 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
17898 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
17899 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
17900 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
17901 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
17902 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
17903 CEOF
17904
17905 EOF
17906
17907   cat >>$CONFIG_STATUS <<\EOF
17908   # Split the substitutions into bite-sized pieces for seds with
17909   # small command number limits, like on Digital OSF/1 and HP-UX.
17910   ac_max_sed_lines=48
17911   ac_sed_frag=1 # Number of current file.
17912   ac_beg=1 # First line for current file.
17913   ac_end=$ac_max_sed_lines # Line after last line for current file.
17914   ac_more_lines=:
17915   ac_sed_cmds=
17916   while $ac_more_lines; do
17917     if test $ac_beg -gt 1; then
17918       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17919     else
17920       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17921     fi
17922     if test ! -s $tmp/subs.frag; then
17923       ac_more_lines=false
17924     else
17925       # The purpose of the label and of the branching condition is to
17926       # speed up the sed processing (if there are no `@' at all, there
17927       # is no need to browse any of the substitutions).
17928       # These are the two extra sed commands mentioned above.
17929       (echo ':t
17930   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17931       # It is possible to make a multiline substitution using escaped newlines.
17932       # Ensure that we do not split the substitution between script fragments.
17933       ac_BEG=$ac_end
17934       ac_END=`expr $ac_end + $ac_max_sed_lines`
17935       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
17936       if test -s $tmp/subs.next; then
17937         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
17938         if test ! -s $tmp/subs.edit; then
17939           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
17940           if test ! -s $tmp/subs.edit; then
17941             if test $ac_beg -gt 1; then
17942               ac_end=`expr $ac_end - 1`
17943               continue
17944             fi
17945           fi
17946         fi
17947       fi
17948
17949       if test -z "$ac_sed_cmds"; then
17950         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17951       else
17952         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17953       fi
17954       ac_sed_frag=`expr $ac_sed_frag + 1`
17955       ac_beg=$ac_end
17956       ac_end=`expr $ac_end + $ac_max_sed_lines`
17957     fi
17958   done
17959   if test -z "$ac_sed_cmds"; then
17960     ac_sed_cmds=cat
17961   fi
17962 fi # test -n "$CONFIG_FILES"
17963
17964 EOF
17965 cat >>$CONFIG_STATUS <<\EOF
17966 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17967   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17968   case $ac_file in
17969   - | *:- | *:-:* ) # input from stdin
17970         cat >$tmp/stdin
17971         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17972         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17973   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17974         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17975   * )   ac_file_in=$ac_file.in ;;
17976   esac
17977
17978   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17979   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17980          X"$ac_file" : 'X\(//\)[^/]' \| \
17981          X"$ac_file" : 'X\(//\)$' \| \
17982          X"$ac_file" : 'X\(/\)' \| \
17983          .     : '\(.\)' 2>/dev/null ||
17984 echo X"$ac_file" |
17985     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17986           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17987           /^X\(\/\/\)$/{ s//\1/; q; }
17988           /^X\(\/\).*/{ s//\1/; q; }
17989           s/.*/./; q'`
17990   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17991     { case "$ac_dir" in
17992   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17993   *)                      as_incr_dir=.;;
17994 esac
17995 as_dummy="$ac_dir"
17996 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17997   case $as_mkdir_dir in
17998     # Skip DOS drivespec
17999     ?:) as_incr_dir=$as_mkdir_dir ;;
18000     *)
18001       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18002       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18003     ;;
18004   esac
18005 done; }
18006
18007     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18008     # A "../" for each directory in $ac_dir_suffix.
18009     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18010   else
18011     ac_dir_suffix= ac_dots=
18012   fi
18013
18014   case $srcdir in
18015   .)  ac_srcdir=.
18016       if test -z "$ac_dots"; then
18017          ac_top_srcdir=.
18018       else
18019          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18020       fi ;;
18021   [\\/]* | ?:[\\/]* )
18022       ac_srcdir=$srcdir$ac_dir_suffix;
18023       ac_top_srcdir=$srcdir ;;
18024   *) # Relative path.
18025     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18026     ac_top_srcdir=$ac_dots$srcdir ;;
18027   esac
18028
18029   case $INSTALL in
18030   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18031   *) ac_INSTALL=$ac_dots$INSTALL ;;
18032   esac
18033
18034   if test x"$ac_file" != x-; then
18035     { echo "$as_me:18035: creating $ac_file" >&5
18036 echo "$as_me: creating $ac_file" >&6;}
18037     rm -f "$ac_file"
18038   fi
18039   # Let's still pretend it is `configure' which instantiates (i.e., don't
18040   # use $as_me), people would be surprised to read:
18041   #    /* config.h.  Generated automatically by config.status.  */
18042   configure_input="Generated automatically from `echo $ac_file_in |
18043                                                  sed 's,.*/,,'` by configure."
18044
18045   # First look for the input files in the build tree, otherwise in the
18046   # src tree.
18047   ac_file_inputs=`IFS=:
18048     for f in $ac_file_in; do
18049       case $f in
18050       -) echo $tmp/stdin ;;
18051       [\\/$]*)
18052          # Absolute (can't be DOS-style, as IFS=:)
18053          test -f "$f" || { { echo "$as_me:18053: error: cannot find input file: $f" >&5
18054 echo "$as_me: error: cannot find input file: $f" >&2;}
18055    { (exit 1); exit 1; }; }
18056          echo $f;;
18057       *) # Relative
18058          if test -f "$f"; then
18059            # Build tree
18060            echo $f
18061          elif test -f "$srcdir/$f"; then
18062            # Source tree
18063            echo $srcdir/$f
18064          else
18065            # /dev/null tree
18066            { { echo "$as_me:18066: error: cannot find input file: $f" >&5
18067 echo "$as_me: error: cannot find input file: $f" >&2;}
18068    { (exit 1); exit 1; }; }
18069          fi;;
18070       esac
18071     done` || { (exit 1); exit 1; }
18072 EOF
18073 cat >>$CONFIG_STATUS <<\EOF
18074   ac_warn_datarootdir=no
18075   if test x"$ac_file" != x-; then
18076     for ac_item in $ac_file_inputs
18077     do
18078       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18079       if test -n "$ac_seen"; then
18080         ac_used=`grep '@datarootdir@' $ac_item`
18081         if test -z "$ac_used"; then
18082           { echo "$as_me:18082: WARNING: datarootdir was used implicitly but not set:
18083 $ac_seen" >&5
18084 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18085 $ac_seen" >&2;}
18086           ac_warn_datarootdir=yes
18087         fi
18088       fi
18089       ac_seen=`grep '${datarootdir}' $ac_item`
18090       if test -n "$ac_seen"; then
18091         { echo "$as_me:18091: WARNING: datarootdir was used explicitly but not set:
18092 $ac_seen" >&5
18093 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18094 $ac_seen" >&2;}
18095         ac_warn_datarootdir=yes
18096       fi
18097     done
18098   fi
18099
18100 if test "x$ac_warn_datarootdir" = xyes; then
18101   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18102 fi
18103
18104 EOF
18105 cat >>$CONFIG_STATUS <<EOF
18106   sed "$ac_vpsub
18107 $extrasub
18108 EOF
18109 cat >>$CONFIG_STATUS <<\EOF
18110 :t
18111 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18112 s,@configure_input@,$configure_input,;t t
18113 s,@srcdir@,$ac_srcdir,;t t
18114 s,@top_srcdir@,$ac_top_srcdir,;t t
18115 s,@INSTALL@,$ac_INSTALL,;t t
18116 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18117   rm -f $tmp/stdin
18118   if test x"$ac_file" != x-; then
18119     cp $tmp/out $ac_file
18120
18121     for ac_name in prefix exec_prefix datarootdir
18122     do
18123         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18124         if test -n "$ac_seen"; then
18125             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18126             if test -z "$ac_init"; then
18127               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18128               { echo "$as_me:18128: WARNING: Variable $ac_name is used but was not set:
18129 $ac_seen" >&5
18130 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18131 $ac_seen" >&2;}
18132             fi
18133         fi
18134     done
18135     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18136     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18137     if test -s $tmp/out; then
18138       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18139       { echo "$as_me:18139: WARNING: Some variables may not be substituted:
18140 $ac_seen" >&5
18141 echo "$as_me: WARNING: Some variables may not be substituted:
18142 $ac_seen" >&2;}
18143     fi
18144   else
18145     cat $tmp/out
18146   fi
18147   rm -f $tmp/out
18148
18149 done
18150 EOF
18151 cat >>$CONFIG_STATUS <<\EOF
18152
18153 #
18154 # CONFIG_HEADER section.
18155 #
18156
18157 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18158 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18159 #
18160 # ac_d sets the value in "#define NAME VALUE" lines.
18161 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18162 ac_dB='[        ].*$,\1#\2'
18163 ac_dC=' '
18164 ac_dD=',;t'
18165 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18166 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18167 ac_iB='\([      ]\),\1#\2define\3'
18168 ac_iC=' '
18169 ac_iD='\4,;t'
18170 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18171 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18172 ac_uB='$,\1#\2define\3'
18173 ac_uC=' '
18174 ac_uD=',;t'
18175
18176 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18177   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18178   case $ac_file in
18179   - | *:- | *:-:* ) # input from stdin
18180         cat >$tmp/stdin
18181         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18182         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18183   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18184         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18185   * )   ac_file_in=$ac_file.in ;;
18186   esac
18187
18188   test x"$ac_file" != x- && { echo "$as_me:18188: creating $ac_file" >&5
18189 echo "$as_me: creating $ac_file" >&6;}
18190
18191   # First look for the input files in the build tree, otherwise in the
18192   # src tree.
18193   ac_file_inputs=`IFS=:
18194     for f in $ac_file_in; do
18195       case $f in
18196       -) echo $tmp/stdin ;;
18197       [\\/$]*)
18198          # Absolute (can't be DOS-style, as IFS=:)
18199          test -f "$f" || { { echo "$as_me:18199: error: cannot find input file: $f" >&5
18200 echo "$as_me: error: cannot find input file: $f" >&2;}
18201    { (exit 1); exit 1; }; }
18202          echo $f;;
18203       *) # Relative
18204          if test -f "$f"; then
18205            # Build tree
18206            echo $f
18207          elif test -f "$srcdir/$f"; then
18208            # Source tree
18209            echo $srcdir/$f
18210          else
18211            # /dev/null tree
18212            { { echo "$as_me:18212: error: cannot find input file: $f" >&5
18213 echo "$as_me: error: cannot find input file: $f" >&2;}
18214    { (exit 1); exit 1; }; }
18215          fi;;
18216       esac
18217     done` || { (exit 1); exit 1; }
18218   # Remove the trailing spaces.
18219   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18220
18221 EOF
18222
18223 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18224 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18225 # be either 'cat' or 'sort'.
18226 cat confdefs.h | uniq >conftest.vals
18227
18228 # Break up conftest.vals because some shells have a limit on
18229 # the size of here documents, and old seds have small limits too.
18230
18231 rm -f conftest.tail
18232 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18233 while grep . conftest.vals >/dev/null
18234 do
18235   # Write chunks of a limited-size here document to conftest.frag.
18236   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18237   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18238   echo 'CEOF' >> $CONFIG_STATUS
18239   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18240   rm -f conftest.vals
18241   mv conftest.tail conftest.vals
18242 done
18243 rm -f conftest.vals
18244
18245 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18246 # marker @DEFS@.
18247 echo '  cat >> conftest.edit <<CEOF
18248 /@DEFS@/r conftest.frag
18249 /@DEFS@/d
18250 CEOF
18251 sed -f conftest.edit $tmp/in > $tmp/out
18252 rm -f $tmp/in
18253 mv $tmp/out $tmp/in
18254 rm -f conftest.edit conftest.frag
18255 ' >> $CONFIG_STATUS
18256
18257 cat >>$CONFIG_STATUS <<\EOF
18258   # Let's still pretend it is `configure' which instantiates (i.e., don't
18259   # use $as_me), people would be surprised to read:
18260   #    /* config.h.  Generated automatically by config.status.  */
18261   if test x"$ac_file" = x-; then
18262     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18263   else
18264     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18265   fi
18266   cat $tmp/in >>$tmp/config.h
18267   rm -f $tmp/in
18268   if test x"$ac_file" != x-; then
18269     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18270       { echo "$as_me:18270: $ac_file is unchanged" >&5
18271 echo "$as_me: $ac_file is unchanged" >&6;}
18272     else
18273       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18274          X"$ac_file" : 'X\(//\)[^/]' \| \
18275          X"$ac_file" : 'X\(//\)$' \| \
18276          X"$ac_file" : 'X\(/\)' \| \
18277          .     : '\(.\)' 2>/dev/null ||
18278 echo X"$ac_file" |
18279     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18280           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18281           /^X\(\/\/\)$/{ s//\1/; q; }
18282           /^X\(\/\).*/{ s//\1/; q; }
18283           s/.*/./; q'`
18284       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18285         { case "$ac_dir" in
18286   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18287   *)                      as_incr_dir=.;;
18288 esac
18289 as_dummy="$ac_dir"
18290 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18291   case $as_mkdir_dir in
18292     # Skip DOS drivespec
18293     ?:) as_incr_dir=$as_mkdir_dir ;;
18294     *)
18295       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18296       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18297     ;;
18298   esac
18299 done; }
18300
18301       fi
18302       rm -f $ac_file
18303       mv $tmp/config.h $ac_file
18304     fi
18305   else
18306     cat $tmp/config.h
18307     rm -f $tmp/config.h
18308   fi
18309 done
18310 EOF
18311 cat >>$CONFIG_STATUS <<\EOF
18312 #
18313 # CONFIG_COMMANDS section.
18314 #
18315 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18316   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18317   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18318
18319   case $ac_dest in
18320     default )
18321 if test -z "$USE_OLD_MAKERULES" ; then
18322         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18323 fi
18324  ;;
18325   esac
18326 done
18327 EOF
18328
18329 cat >>$CONFIG_STATUS <<\EOF
18330
18331 { (exit 0); exit 0; }
18332 EOF
18333 chmod +x $CONFIG_STATUS
18334 ac_clean_files=$ac_clean_files_save
18335
18336 # configure is writing to config.log, and then calls config.status.
18337 # config.status does its own redirection, appending to config.log.
18338 # Unfortunately, on DOS this fails, as config.log is still kept open
18339 # by configure, so config.status won't be able to write to it; its
18340 # output is simply discarded.  So we exec the FD to /dev/null,
18341 # effectively closing config.log, so it can be properly (re)opened and
18342 # appended to by config.status.  When coming back to configure, we
18343 # need to make the FD available again.
18344 if test "$no_create" != yes; then
18345   ac_cs_success=:
18346   exec 5>/dev/null
18347   $SHELL $CONFIG_STATUS || ac_cs_success=false
18348   exec 5>>config.log
18349   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18350   # would make configure fail if this is the last instruction.
18351   $ac_cs_success || { (exit 1); exit 1; }
18352 fi
18353 ${MAKE:-make} preinstall