]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20201121
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.78 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20200802.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 runstatedir='${localstatedir}/run'
180 libdir='${exec_prefix}/lib'
181 includedir='${prefix}/include'
182 oldincludedir='/usr/include'
183 infodir='${datarootdir}/info'
184 mandir='${datarootdir}/man'
185
186 # Identity of this package.
187 PACKAGE_NAME=
188 PACKAGE_TARNAME=
189 PACKAGE_VERSION=
190 PACKAGE_STRING=
191 PACKAGE_BUGREPORT=
192
193 ac_prev=
194 for ac_option
195 do
196   # If the previous option needs an argument, assign it.
197   if test -n "$ac_prev"; then
198     eval "$ac_prev=\$ac_option"
199     ac_prev=
200     continue
201   fi
202
203   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
204
205   # Accept the important Cygnus configure options, so we can diagnose typos.
206
207   case $ac_option in
208
209   -bindir | --bindir | --bindi | --bind | --bin | --bi)
210     ac_prev=bindir ;;
211   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
212     bindir=$ac_optarg ;;
213
214   -build | --build | --buil | --bui | --bu)
215     ac_prev=build_alias ;;
216   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
217     build_alias=$ac_optarg ;;
218
219   -cache-file | --cache-file | --cache-fil | --cache-fi \
220   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
221     ac_prev=cache_file ;;
222   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
223   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
224     cache_file=$ac_optarg ;;
225
226   --config-cache | -C)
227     cache_file=config.cache ;;
228
229   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
230     ac_prev=datadir ;;
231   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
232   | --da=*)
233     datadir=$ac_optarg ;;
234
235   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
236   | --dataroo | --dataro | --datar)
237     ac_prev=datarootdir ;;
238   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
239   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
240     datarootdir=$ac_optarg ;;
241
242   -disable-* | --disable-*)
243     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
244     # Reject names that are not valid shell variable names.
245     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
246       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
247    { (exit 1); exit 1; }; }
248     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
249     eval "enable_$ac_feature=no" ;;
250
251   -enable-* | --enable-*)
252     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
253     # Reject names that are not valid shell variable names.
254     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
255       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
256    { (exit 1); exit 1; }; }
257     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
258     case $ac_option in
259       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
260       *) ac_optarg=yes ;;
261     esac
262     eval "enable_$ac_feature='$ac_optarg'" ;;
263
264   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
265   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
266   | --exec | --exe | --ex)
267     ac_prev=exec_prefix ;;
268   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
269   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
270   | --exec=* | --exe=* | --ex=*)
271     exec_prefix=$ac_optarg ;;
272
273   -gas | --gas | --ga | --g)
274     # Obsolete; use --with-gas.
275     with_gas=yes ;;
276
277   -help | --help | --hel | --he | -h)
278     ac_init_help=long ;;
279   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
280     ac_init_help=recursive ;;
281   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
282     ac_init_help=short ;;
283
284   -host | --host | --hos | --ho)
285     ac_prev=host_alias ;;
286   -host=* | --host=* | --hos=* | --ho=*)
287     host_alias=$ac_optarg ;;
288
289   -includedir | --includedir | --includedi | --included | --include \
290   | --includ | --inclu | --incl | --inc)
291     ac_prev=includedir ;;
292   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
293   | --includ=* | --inclu=* | --incl=* | --inc=*)
294     includedir=$ac_optarg ;;
295
296   -infodir | --infodir | --infodi | --infod | --info | --inf)
297     ac_prev=infodir ;;
298   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
299     infodir=$ac_optarg ;;
300
301   -libdir | --libdir | --libdi | --libd)
302     ac_prev=libdir ;;
303   -libdir=* | --libdir=* | --libdi=* | --libd=*)
304     libdir=$ac_optarg ;;
305
306   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
307   | --libexe | --libex | --libe)
308     ac_prev=libexecdir ;;
309   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
310   | --libexe=* | --libex=* | --libe=*)
311     libexecdir=$ac_optarg ;;
312
313   -localstatedir | --localstatedir | --localstatedi | --localstated \
314   | --localstate | --localstat | --localsta | --localst \
315   | --locals | --local | --loca | --loc | --lo)
316     ac_prev=localstatedir ;;
317   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
318   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
319   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
320     localstatedir=$ac_optarg ;;
321
322   -runstatedir | --runstatedir | --runstatedi | --runstated \
323   | --runstate | --runstat | --runsta | --runst \
324   | --runs | --run | --ru)
325     ac_prev=runstatedir ;;
326   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
327   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
328   | --runs=* | --run=* | --ru=*)
329     runstatedir=$ac_optarg ;;
330
331   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
332     ac_prev=mandir ;;
333   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
334     mandir=$ac_optarg ;;
335
336   -nfp | --nfp | --nf)
337     # Obsolete; use --without-fp.
338     with_fp=no ;;
339
340   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
341   | --no-cr | --no-c)
342     no_create=yes ;;
343
344   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
345   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
346     no_recursion=yes ;;
347
348   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
349   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
350   | --oldin | --oldi | --old | --ol | --o)
351     ac_prev=oldincludedir ;;
352   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
353   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
354   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
355     oldincludedir=$ac_optarg ;;
356
357   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
358     ac_prev=prefix ;;
359   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
360     prefix=$ac_optarg ;;
361
362   -program-prefix | --program-prefix | --program-prefi | --program-pref \
363   | --program-pre | --program-pr | --program-p)
364     ac_prev=program_prefix ;;
365   -program-prefix=* | --program-prefix=* | --program-prefi=* \
366   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
367     program_prefix=$ac_optarg ;;
368
369   -program-suffix | --program-suffix | --program-suffi | --program-suff \
370   | --program-suf | --program-su | --program-s)
371     ac_prev=program_suffix ;;
372   -program-suffix=* | --program-suffix=* | --program-suffi=* \
373   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
374     program_suffix=$ac_optarg ;;
375
376   -program-transform-name | --program-transform-name \
377   | --program-transform-nam | --program-transform-na \
378   | --program-transform-n | --program-transform- \
379   | --program-transform | --program-transfor \
380   | --program-transfo | --program-transf \
381   | --program-trans | --program-tran \
382   | --progr-tra | --program-tr | --program-t)
383     ac_prev=program_transform_name ;;
384   -program-transform-name=* | --program-transform-name=* \
385   | --program-transform-nam=* | --program-transform-na=* \
386   | --program-transform-n=* | --program-transform-=* \
387   | --program-transform=* | --program-transfor=* \
388   | --program-transfo=* | --program-transf=* \
389   | --program-trans=* | --program-tran=* \
390   | --progr-tra=* | --program-tr=* | --program-t=*)
391     program_transform_name=$ac_optarg ;;
392
393   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
394   | -silent | --silent | --silen | --sile | --sil)
395     silent=yes ;;
396
397   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
398     ac_prev=sbindir ;;
399   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
400   | --sbi=* | --sb=*)
401     sbindir=$ac_optarg ;;
402
403   -sharedstatedir | --sharedstatedir | --sharedstatedi \
404   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
405   | --sharedst | --shareds | --shared | --share | --shar \
406   | --sha | --sh)
407     ac_prev=sharedstatedir ;;
408   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
409   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
410   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
411   | --sha=* | --sh=*)
412     sharedstatedir=$ac_optarg ;;
413
414   -site | --site | --sit)
415     ac_prev=site ;;
416   -site=* | --site=* | --sit=*)
417     site=$ac_optarg ;;
418
419   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
420     ac_prev=srcdir ;;
421   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
422     srcdir=$ac_optarg ;;
423
424   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
425   | --syscon | --sysco | --sysc | --sys | --sy)
426     ac_prev=sysconfdir ;;
427   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
428   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
429     sysconfdir=$ac_optarg ;;
430
431   -target | --target | --targe | --targ | --tar | --ta | --t)
432     ac_prev=target_alias ;;
433   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
434     target_alias=$ac_optarg ;;
435
436   -v | -verbose | --verbose | --verbos | --verbo | --verb)
437     verbose=yes ;;
438
439   -version | --version | --versio | --versi | --vers | -V)
440     ac_init_version=: ;;
441
442   -with-* | --with-*)
443     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
444     # Reject names that are not valid shell variable names.
445     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
446       { echo "$as_me: error: invalid package name: $ac_package" >&2
447    { (exit 1); exit 1; }; }
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     case $ac_option in
450       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
451       *) ac_optarg=yes ;;
452     esac
453     eval "with_$ac_package='$ac_optarg'" ;;
454
455   -without-* | --without-*)
456     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
457     # Reject names that are not valid shell variable names.
458     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
459       { echo "$as_me: error: invalid package name: $ac_package" >&2
460    { (exit 1); exit 1; }; }
461     ac_package=`echo $ac_package | sed 's/-/_/g'`
462     eval "with_$ac_package=no" ;;
463
464   --x)
465     # Obsolete; use --with-x.
466     with_x=yes ;;
467
468   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
469   | --x-incl | --x-inc | --x-in | --x-i)
470     ac_prev=x_includes ;;
471   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
472   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
473     x_includes=$ac_optarg ;;
474
475   -x-libraries | --x-libraries | --x-librarie | --x-librari \
476   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
477     ac_prev=x_libraries ;;
478   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
479   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
480     x_libraries=$ac_optarg ;;
481
482   -*) { echo "$as_me: error: unrecognized option: $ac_option
483 Try \`$0 --help' for more information." >&2
484    { (exit 1); exit 1; }; }
485     ;;
486
487   *=*)
488     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
489     # Reject names that are not valid shell variable names.
490     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
491       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
492    { (exit 1); exit 1; }; }
493     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
494     eval "$ac_envvar='$ac_optarg'"
495     export $ac_envvar ;;
496
497   *)
498     # FIXME: should be removed in autoconf 3.0.
499     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
500     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
501       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
502     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
503     ;;
504
505   esac
506 done
507
508 if test -n "$ac_prev"; then
509   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
510   { echo "$as_me: error: missing argument to $ac_option" >&2
511    { (exit 1); exit 1; }; }
512 fi
513
514 # Be sure to have absolute paths.
515 for ac_var in exec_prefix prefix
516 do
517   eval ac_val=$`echo $ac_var`
518   case $ac_val in
519     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
520     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
521    { (exit 1); exit 1; }; };;
522   esac
523 done
524
525 # Be sure to have absolute paths.
526 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
527               localstatedir libdir includedir oldincludedir infodir mandir
528 do
529   eval ac_val=$`echo $ac_var`
530   case $ac_val in
531     [\\/$]* | ?:[\\/]* ) ;;
532     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
533    { (exit 1); exit 1; }; };;
534   esac
535 done
536
537 # There might be people who depend on the old broken behavior: `$host'
538 # used to hold the argument of --host etc.
539 build=$build_alias
540 host=$host_alias
541 target=$target_alias
542
543 # FIXME: should be removed in autoconf 3.0.
544 if test "x$host_alias" != x; then
545   if test "x$build_alias" = x; then
546     cross_compiling=maybe
547     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
548     If a cross compiler is detected then cross compile mode will be used." >&2
549   elif test "x$build_alias" != "x$host_alias"; then
550     cross_compiling=yes
551   fi
552 fi
553
554 ac_tool_prefix=
555 test -n "$host_alias" && ac_tool_prefix=$host_alias-
556
557 test "$silent" = yes && exec 6>/dev/null
558
559 # Find the source files, if location was not specified.
560 if test -z "$srcdir"; then
561   ac_srcdir_defaulted=yes
562   # Try the directory containing this script, then its parent.
563   ac_prog=$0
564   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
565   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
566   srcdir=$ac_confdir
567   if test ! -r $srcdir/$ac_unique_file; then
568     srcdir=..
569   fi
570 else
571   ac_srcdir_defaulted=no
572 fi
573 if test ! -r $srcdir/$ac_unique_file; then
574   if test "$ac_srcdir_defaulted" = yes; then
575     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
576    { (exit 1); exit 1; }; }
577   else
578     { echo "$as_me: error: cannot find sources in $srcdir" >&2
579    { (exit 1); exit 1; }; }
580   fi
581 fi
582 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
583 ac_env_build_alias_set=${build_alias+set}
584 ac_env_build_alias_value=$build_alias
585 ac_cv_env_build_alias_set=${build_alias+set}
586 ac_cv_env_build_alias_value=$build_alias
587 ac_env_host_alias_set=${host_alias+set}
588 ac_env_host_alias_value=$host_alias
589 ac_cv_env_host_alias_set=${host_alias+set}
590 ac_cv_env_host_alias_value=$host_alias
591 ac_env_target_alias_set=${target_alias+set}
592 ac_env_target_alias_value=$target_alias
593 ac_cv_env_target_alias_set=${target_alias+set}
594 ac_cv_env_target_alias_value=$target_alias
595 ac_env_CC_set=${CC+set}
596 ac_env_CC_value=$CC
597 ac_cv_env_CC_set=${CC+set}
598 ac_cv_env_CC_value=$CC
599 ac_env_CFLAGS_set=${CFLAGS+set}
600 ac_env_CFLAGS_value=$CFLAGS
601 ac_cv_env_CFLAGS_set=${CFLAGS+set}
602 ac_cv_env_CFLAGS_value=$CFLAGS
603 ac_env_LDFLAGS_set=${LDFLAGS+set}
604 ac_env_LDFLAGS_value=$LDFLAGS
605 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_cv_env_LDFLAGS_value=$LDFLAGS
607 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
608 ac_env_CPPFLAGS_value=$CPPFLAGS
609 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
611 ac_env_CPP_set=${CPP+set}
612 ac_env_CPP_value=$CPP
613 ac_cv_env_CPP_set=${CPP+set}
614 ac_cv_env_CPP_value=$CPP
615
616 #
617 # Report the --help message.
618 #
619 if test "$ac_init_help" = "long"; then
620   # Omit some internal or obsolete options to make the list less imposing.
621   # This message is too long to be a string in the A/UX 3.1 sh.
622   cat <<EOF
623 \`configure' configures this package to adapt to many kinds of systems.
624
625 Usage: $0 [OPTION]... [VAR=VALUE]...
626
627 To assign environment variables (e.g., CC, CFLAGS...), specify them as
628 VAR=VALUE.  See below for descriptions of some of the useful variables.
629
630 Defaults for the options are specified in brackets.
631
632 Configuration:
633   -h, --help              display this help and exit
634       --help=short        display options specific to this package
635       --help=recursive    display the short help of all the included packages
636   -V, --version           display version information and exit
637   -q, --quiet, --silent   do not print \`checking...' messages
638       --cache-file=FILE   cache test results in FILE [disabled]
639   -C, --config-cache      alias for \`--cache-file=config.cache'
640   -n, --no-create         do not create output files
641       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
642
643 EOF
644
645   cat <<EOF
646 Installation directories:
647   --prefix=PREFIX         install architecture-independent files in PREFIX
648                           [$ac_default_prefix]
649   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
650                           [PREFIX]
651
652 By default, \`make install' will install all the files in
653 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
654 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
655 for instance \`--prefix=\$HOME'.
656
657 For better control, use the options below.
658
659 Fine tuning of the installation directories:
660   --bindir=DIR            user executables [EPREFIX/bin]
661   --sbindir=DIR           system admin executables [EPREFIX/sbin]
662   --libexecdir=DIR        program executables [EPREFIX/libexec]
663   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
664   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
665   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
666   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
667   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
668   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
669   --libdir=DIR            object code libraries [EPREFIX/lib]
670   --includedir=DIR        C header files [PREFIX/include]
671   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
672   --infodir=DIR           info documentation [DATAROOTDIR/info]
673   --mandir=DIR            man documentation [DATAROOTDIR/man]
674 EOF
675
676   cat <<\EOF
677
678 Program names:
679   --program-prefix=PREFIX            prepend PREFIX to installed program names
680   --program-suffix=SUFFIX            append SUFFIX to installed program names
681   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
682
683 System types:
684   --build=BUILD           configure for building on BUILD [guessed]
685   --host=HOST       build programs to run on HOST [BUILD]
686   --target=TARGET   configure for building compilers for TARGET [HOST]
687 EOF
688 fi
689
690 if test -n "$ac_init_help"; then
691
692   cat <<\EOF
693
694 Optional Packages:
695   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
696   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
697
698 Optional Features:
699   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
700   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
701
702 General Options:
703   --with-system-type=XXX  test: override derived host system-type
704   --disable-stripping     do not strip (debug info) installed executables
705   --with-pkg-config{=path} enable/disable use of pkg-config
706   --with-pkg-config-libdir=XXX use given directory for installing pc-files
707   --without-tests         suppress build with test-programs
708   --enable-mixed-case     tic should assume mixed-case filenames
709   --with-install-prefix   prefixes actual install-location ($DESTDIR)
710 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
711   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
712   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
713   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
714   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
715   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
716   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
717 Options to Specify the Libraries Built/Used:
718   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
719   --with-curses-dir=DIR   directory in which (n)curses is installed
720   --enable-widec          compile with wide-char/UTF-8 code
721   --with-lib-prefix       override library-prefix
722   --with-shlib-version=X  Specify rel or abi version for shared libs
723   --enable-rpath-link     link sample programs with rpath option
724 Fine-Tuning Your Configuration:
725   --enable-broken_linker  compile with broken-linker support code
726   --disable-largefile     omit support for large files
727   --with-rcs-ids          compile-in RCS identifiers
728 Extensions:
729   --disable-ext-funcs     disable function-extensions
730   --enable-const          compile with extra/non-standard const
731 Development Code:
732   --without-develop       disable development options
733 Experimental Code:
734   --with-pthread          use POSIX thread library
735   --enable-weak-symbols   enable weak-symbols for pthreads
736   --enable-reentrant      compile with experimental reentrant code
737   --with-wrap-prefix=XXX  override prefix used for public variables
738 Testing/development Options:
739   --disable-echo          do not display "compiling" commands
740   --enable-warnings       build: turn on GCC compiler warnings
741   --enable-warnings       test: turn on gcc compiler warnings
742   --enable-assertions     test: turn on generation of assertion code
743   --enable-expanded       test: generate functions for certain macros
744   --disable-macros        test: use functions rather than macros
745   --with-trace            test: add trace() function to all models of ncurses
746   --disable-gnat-projects test: disable GNAT projects even if usable
747 Ada95 Binding Options:
748   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
749   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
750   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
751   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
752   --with-ada-libname=XXX  override default Ada library-name
753
754 Some influential environment variables:
755   CC          C compiler command
756   CFLAGS      C compiler flags
757   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
758               nonstandard directory <lib dir>
759   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
760               headers in a nonstandard directory <include dir>
761   CPP         C preprocessor
762
763 Use these variables to override the choices made by `configure' or to help
764 it to find libraries and programs with nonstandard names/locations.
765
766 EOF
767 fi
768
769 if test "$ac_init_help" = "recursive"; then
770   # If there are subdirs, report their specific --help.
771   ac_popdir=`pwd`
772   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
773     cd $ac_subdir
774     # A "../" for each directory in /$ac_subdir.
775     ac_dots=`echo $ac_subdir |
776              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
777
778     case $srcdir in
779     .) # No --srcdir option.  We are building in place.
780       ac_sub_srcdir=$srcdir ;;
781     [\\/]* | ?:[\\/]* ) # Absolute path.
782       ac_sub_srcdir=$srcdir/$ac_subdir ;;
783     *) # Relative path.
784       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
785     esac
786
787     # Check for guested configure; otherwise get Cygnus style configure.
788     if test -f $ac_sub_srcdir/configure.gnu; then
789       echo
790       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
791     elif test -f $ac_sub_srcdir/configure; then
792       echo
793       $SHELL $ac_sub_srcdir/configure  --help=recursive
794     elif test -f $ac_sub_srcdir/configure.ac ||
795            test -f $ac_sub_srcdir/configure.in; then
796       echo
797       $ac_configure --help
798     else
799       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
800     fi
801     cd $ac_popdir
802   done
803 fi
804
805 test -n "$ac_init_help" && exit 0
806 if $ac_init_version; then
807   cat <<\EOF
808
809 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
810 Free Software Foundation, Inc.
811 This configure script is free software; the Free Software Foundation
812 gives unlimited permission to copy, distribute and modify it.
813 EOF
814   exit 0
815 fi
816 exec 5>config.log
817 cat >&5 <<EOF
818 This file contains any messages produced by compilers while
819 running configure, to aid debugging if configure makes a mistake.
820
821 It was created by $as_me, which was
822 generated by GNU Autoconf 2.52.20200802.  Invocation command line was
823
824   $ $0 $@
825
826 EOF
827 {
828 cat <<_ASUNAME
829 ## ---------- ##
830 ## Platform.  ##
831 ## ---------- ##
832
833 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
834 uname -m = `(uname -m) 2>/dev/null || echo unknown`
835 uname -r = `(uname -r) 2>/dev/null || echo unknown`
836 uname -s = `(uname -s) 2>/dev/null || echo unknown`
837 uname -v = `(uname -v) 2>/dev/null || echo unknown`
838
839 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
840 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
841
842 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
843 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
844 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
845 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
846 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
847 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
848 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
849
850 PATH = $PATH
851
852 _ASUNAME
853 } >&5
854
855 cat >&5 <<EOF
856 ## ------------ ##
857 ## Core tests.  ##
858 ## ------------ ##
859
860 EOF
861
862 # Keep a trace of the command line.
863 # Strip out --no-create and --no-recursion so they do not pile up.
864 # Also quote any args containing shell meta-characters.
865 ac_configure_args=
866 ac_sep=
867 for ac_arg
868 do
869   case $ac_arg in
870   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
871   | --no-cr | --no-c) ;;
872   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
873   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
874   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
875     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
876     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
877     ac_sep=" " ;;
878   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
879      ac_sep=" " ;;
880   esac
881   # Get rid of the leading space.
882 done
883
884 # When interrupted or exit'd, cleanup temporary files, and complete
885 # config.log.  We remove comments because anyway the quotes in there
886 # would cause problems or look ugly.
887 trap 'exit_status=$?
888   # Save into config.log some information that might help in debugging.
889   echo >&5
890   echo "## ----------------- ##" >&5
891   echo "## Cache variables.  ##" >&5
892   echo "## ----------------- ##" >&5
893   echo >&5
894   # The following way of writing the cache mishandles newlines in values,
895 {
896   (set) 2>&1 |
897     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
898     *ac_space=\ *)
899       sed -n \
900         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
901           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
902       ;;
903     *)
904       sed -n \
905         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
906       ;;
907     esac;
908 } >&5
909   sed "/^$/d" confdefs.h >conftest.log
910   if test -s conftest.log; then
911     echo >&5
912     echo "## ------------ ##" >&5
913     echo "## confdefs.h.  ##" >&5
914     echo "## ------------ ##" >&5
915     echo >&5
916     cat conftest.log >&5
917   fi
918   (echo; echo) >&5
919   test "$ac_signal" != 0 &&
920     echo "$as_me: caught signal $ac_signal" >&5
921   echo "$as_me: exit $exit_status" >&5
922   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
923     exit $exit_status
924      ' 0
925 for ac_signal in 1 2 13 15; do
926   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
927 done
928 ac_signal=0
929
930 # confdefs.h avoids OS command line length limits that DEFS can exceed.
931 rm -rf conftest* confdefs.h
932 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
933 echo >confdefs.h
934
935 # Let the site file select an alternate cache file if it wants to.
936 # Prefer explicitly selected file to automatically selected ones.
937 if test -z "$CONFIG_SITE"; then
938   if test "x$prefix" != xNONE; then
939     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
940   else
941     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
942   fi
943 fi
944 for ac_site_file in $CONFIG_SITE; do
945   if test -r "$ac_site_file"; then
946     { echo "$as_me:946: loading site script $ac_site_file" >&5
947 echo "$as_me: loading site script $ac_site_file" >&6;}
948     cat "$ac_site_file" >&5
949     . "$ac_site_file"
950   fi
951 done
952
953 if test -r "$cache_file"; then
954   # Some versions of bash will fail to source /dev/null (special
955   # files actually), so we avoid doing that.
956   if test -f "$cache_file"; then
957     { echo "$as_me:957: loading cache $cache_file" >&5
958 echo "$as_me: loading cache $cache_file" >&6;}
959     case $cache_file in
960       [\\/]* | ?:[\\/]* ) . $cache_file;;
961       *)                      . ./$cache_file;;
962     esac
963   fi
964 else
965   { echo "$as_me:965: creating cache $cache_file" >&5
966 echo "$as_me: creating cache $cache_file" >&6;}
967   >$cache_file
968 fi
969
970 # Check that the precious variables saved in the cache have kept the same
971 # value.
972 ac_cache_corrupted=false
973 for ac_var in `(set) 2>&1 |
974                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
975   eval ac_old_set=\$ac_cv_env_${ac_var}_set
976   eval ac_new_set=\$ac_env_${ac_var}_set
977   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
978   eval ac_new_val="\$ac_env_${ac_var}_value"
979   case $ac_old_set,$ac_new_set in
980     set,)
981       { echo "$as_me:981: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
982 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
983       ac_cache_corrupted=: ;;
984     ,set)
985       { echo "$as_me:985: error: \`$ac_var' was not set in the previous run" >&5
986 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
987       ac_cache_corrupted=: ;;
988     ,);;
989     *)
990       if test "x$ac_old_val" != "x$ac_new_val"; then
991         { echo "$as_me:991: error: \`$ac_var' has changed since the previous run:" >&5
992 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
993         { echo "$as_me:993:   former value:  $ac_old_val" >&5
994 echo "$as_me:   former value:  $ac_old_val" >&2;}
995         { echo "$as_me:995:   current value: $ac_new_val" >&5
996 echo "$as_me:   current value: $ac_new_val" >&2;}
997         ac_cache_corrupted=:
998       fi;;
999   esac
1000   # Pass precious variables to config.status.  It doesn't matter if
1001   # we pass some twice (in addition to the command line arguments).
1002   if test "$ac_new_set" = set; then
1003     case $ac_new_val in
1004     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1005       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1006       ac_configure_args="$ac_configure_args '$ac_arg'"
1007       ;;
1008     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1009        ;;
1010     esac
1011   fi
1012 done
1013 if $ac_cache_corrupted; then
1014   { echo "$as_me:1014: error: changes in the environment can compromise the build" >&5
1015 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1016   { { echo "$as_me:1016: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1017 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1018    { (exit 1); exit 1; }; }
1019 fi
1020
1021 ac_ext=c
1022 ac_cpp='$CPP $CPPFLAGS'
1023 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1024 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1025 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1026 ac_main_return=return
1027
1028 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1029   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1030                    ECHO_T='     ' ;;
1031   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1032   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1033 esac
1034 echo "#! $SHELL" >conftest.sh
1035 echo  "exit 0"   >>conftest.sh
1036 chmod +x conftest.sh
1037 if { (echo "$as_me:1037: PATH=\".;.\"; conftest.sh") >&5
1038   (PATH=".;."; conftest.sh) 2>&5
1039   ac_status=$?
1040   echo "$as_me:1040: \$? = $ac_status" >&5
1041   (exit $ac_status); }; then
1042   ac_path_separator=';'
1043 else
1044   ac_path_separator=:
1045 fi
1046 PATH_SEPARATOR="$ac_path_separator"
1047 rm -f conftest.sh
1048
1049 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1050
1051 top_builddir=`pwd`
1052
1053 ac_aux_dir=
1054 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1055   if test -f $ac_dir/install-sh; then
1056     ac_aux_dir=$ac_dir
1057     ac_install_sh="$ac_aux_dir/install-sh -c"
1058     break
1059   elif test -f $ac_dir/install.sh; then
1060     ac_aux_dir=$ac_dir
1061     ac_install_sh="$ac_aux_dir/install.sh -c"
1062     break
1063   elif test -f $ac_dir/shtool; then
1064     ac_aux_dir=$ac_dir
1065     ac_install_sh="$ac_aux_dir/shtool install -c"
1066     break
1067   fi
1068 done
1069 if test -z "$ac_aux_dir"; then
1070   { { echo "$as_me:1070: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1071 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1072    { (exit 1); exit 1; }; }
1073 fi
1074 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1075 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1076 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1077
1078 # Make sure we can run config.sub.
1079 $ac_config_sub sun4 >/dev/null 2>&1 ||
1080   { { echo "$as_me:1080: error: cannot run $ac_config_sub" >&5
1081 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1082    { (exit 1); exit 1; }; }
1083
1084 echo "$as_me:1084: checking build system type" >&5
1085 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1086 if test "${ac_cv_build+set}" = set; then
1087   echo $ECHO_N "(cached) $ECHO_C" >&6
1088 else
1089   ac_cv_build_alias=$build_alias
1090 test -z "$ac_cv_build_alias" &&
1091   ac_cv_build_alias=`$ac_config_guess`
1092 test -z "$ac_cv_build_alias" &&
1093   { { echo "$as_me:1093: error: cannot guess build type; you must specify one" >&5
1094 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1095    { (exit 1); exit 1; }; }
1096 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1097   { { echo "$as_me:1097: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1098 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1099    { (exit 1); exit 1; }; }
1100
1101 fi
1102 echo "$as_me:1102: result: $ac_cv_build" >&5
1103 echo "${ECHO_T}$ac_cv_build" >&6
1104 build=$ac_cv_build
1105 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1106 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1107 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1108
1109 echo "$as_me:1109: checking host system type" >&5
1110 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1111 if test "${ac_cv_host+set}" = set; then
1112   echo $ECHO_N "(cached) $ECHO_C" >&6
1113 else
1114   ac_cv_host_alias=$host_alias
1115 test -z "$ac_cv_host_alias" &&
1116   ac_cv_host_alias=$ac_cv_build_alias
1117 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1118   { { echo "$as_me:1118: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1119 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1120    { (exit 1); exit 1; }; }
1121
1122 fi
1123 echo "$as_me:1123: result: $ac_cv_host" >&5
1124 echo "${ECHO_T}$ac_cv_host" >&6
1125 host=$ac_cv_host
1126 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1127 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1128 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1129
1130 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1131         echo "$as_me:1131: checking target system type" >&5
1132 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1133 if test "${ac_cv_target+set}" = set; then
1134   echo $ECHO_N "(cached) $ECHO_C" >&6
1135 else
1136   ac_cv_target_alias=$target_alias
1137 test "x$ac_cv_target_alias" = "x" &&
1138   ac_cv_target_alias=$ac_cv_host_alias
1139 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1140   { { echo "$as_me:1140: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1141 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1142    { (exit 1); exit 1; }; }
1143
1144 fi
1145 echo "$as_me:1145: result: $ac_cv_target" >&5
1146 echo "${ECHO_T}$ac_cv_target" >&6
1147 target=$ac_cv_target
1148 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1149 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1150 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1151
1152 # The aliases save the names the user supplied, while $host etc.
1153 # will get canonicalized.
1154 test -n "$target_alias" &&
1155   test "$program_prefix$program_suffix$program_transform_name" = \
1156     NONENONEs,x,x, &&
1157   program_prefix=${target_alias}-
1158         system_name="$host_os"
1159 else
1160         system_name="`(uname -s -r) 2>/dev/null`"
1161         if test -z "$system_name" ; then
1162                 system_name="`(hostname) 2>/dev/null`"
1163         fi
1164 fi
1165 test -n "$system_name" &&
1166 cat >>confdefs.h <<EOF
1167 #define SYSTEM_NAME "$system_name"
1168 EOF
1169
1170 if test "${cf_cv_system_name+set}" = set; then
1171   echo $ECHO_N "(cached) $ECHO_C" >&6
1172 else
1173   cf_cv_system_name="$system_name"
1174 fi
1175
1176 test -z "$system_name" && system_name="$cf_cv_system_name"
1177 test -n "$cf_cv_system_name" && echo "$as_me:1177: result: Configuring for $cf_cv_system_name" >&5
1178 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1179
1180 if test ".$system_name" != ".$cf_cv_system_name" ; then
1181         echo "$as_me:1181: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1182 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1183         { { echo "$as_me:1183: error: \"Please remove config.cache and try again.\"" >&5
1184 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1185    { (exit 1); exit 1; }; }
1186 fi
1187
1188 # Check whether --with-system-type or --without-system-type was given.
1189 if test "${with_system_type+set}" = set; then
1190   withval="$with_system_type"
1191   { echo "$as_me:1191: WARNING: overriding system type to $withval" >&5
1192 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1193         cf_cv_system_name=$withval
1194         host_os=$withval
1195
1196 fi;
1197
1198 ###     Save the given $CFLAGS to allow user-override.
1199 cf_user_CFLAGS="$CFLAGS"
1200
1201 ###     Default install-location
1202
1203 echo "$as_me:1203: checking for prefix" >&5
1204 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1205 if test "x$prefix" = "xNONE" ; then
1206         case "$cf_cv_system_name" in
1207                 # non-vendor systems don't have a conflict
1208         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1209                 prefix=/usr
1210                 ;;
1211         (*)     prefix=$ac_default_prefix
1212                 ;;
1213         esac
1214 fi
1215 echo "$as_me:1215: result: $prefix" >&5
1216 echo "${ECHO_T}$prefix" >&6
1217
1218 if test "x$prefix" = "xNONE" ; then
1219 echo "$as_me:1219: checking for default include-directory" >&5
1220 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1221 test -n "$verbose" && echo 1>&6
1222 for cf_symbol in \
1223         $includedir \
1224         $includedir/ncurses \
1225         $prefix/include \
1226         $prefix/include/ncurses \
1227         /usr/local/include \
1228         /usr/local/include/ncurses \
1229         /usr/include \
1230         /usr/include/ncurses
1231 do
1232         cf_dir=`eval echo $cf_symbol`
1233         if test -f $cf_dir/curses.h ; then
1234         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1235                 includedir="$cf_symbol"
1236                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1237                 break
1238         fi
1239         fi
1240         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1241 done
1242 echo "$as_me:1242: result: $includedir" >&5
1243 echo "${ECHO_T}$includedir" >&6
1244 fi
1245
1246 ###     Checks for programs.
1247
1248 ac_ext=c
1249 ac_cpp='$CPP $CPPFLAGS'
1250 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1251 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1252 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1253 ac_main_return=return
1254 if test -n "$ac_tool_prefix"; then
1255   for ac_prog in gnatgcc gcc cc
1256   do
1257     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1258 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1259 echo "$as_me:1259: checking for $ac_word" >&5
1260 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1261 if test "${ac_cv_prog_CC+set}" = set; then
1262   echo $ECHO_N "(cached) $ECHO_C" >&6
1263 else
1264   if test -n "$CC"; then
1265   ac_cv_prog_CC="$CC" # Let the user override the test.
1266 else
1267   ac_save_IFS=$IFS; IFS=$ac_path_separator
1268 ac_dummy="$PATH"
1269 for ac_dir in $ac_dummy; do
1270   IFS=$ac_save_IFS
1271   test -z "$ac_dir" && ac_dir=.
1272   $as_executable_p "$ac_dir/$ac_word" || continue
1273 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1274 echo "$as_me:1274: found $ac_dir/$ac_word" >&5
1275 break
1276 done
1277
1278 fi
1279 fi
1280 CC=$ac_cv_prog_CC
1281 if test -n "$CC"; then
1282   echo "$as_me:1282: result: $CC" >&5
1283 echo "${ECHO_T}$CC" >&6
1284 else
1285   echo "$as_me:1285: result: no" >&5
1286 echo "${ECHO_T}no" >&6
1287 fi
1288
1289     test -n "$CC" && break
1290   done
1291 fi
1292 if test -z "$CC"; then
1293   ac_ct_CC=$CC
1294   for ac_prog in gnatgcc gcc cc
1295 do
1296   # Extract the first word of "$ac_prog", so it can be a program name with args.
1297 set dummy $ac_prog; ac_word=$2
1298 echo "$as_me:1298: checking for $ac_word" >&5
1299 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1300 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1301   echo $ECHO_N "(cached) $ECHO_C" >&6
1302 else
1303   if test -n "$ac_ct_CC"; then
1304   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1305 else
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 ac_cv_prog_ac_ct_CC="$ac_prog"
1313 echo "$as_me:1313: found $ac_dir/$ac_word" >&5
1314 break
1315 done
1316
1317 fi
1318 fi
1319 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1320 if test -n "$ac_ct_CC"; then
1321   echo "$as_me:1321: result: $ac_ct_CC" >&5
1322 echo "${ECHO_T}$ac_ct_CC" >&6
1323 else
1324   echo "$as_me:1324: result: no" >&5
1325 echo "${ECHO_T}no" >&6
1326 fi
1327
1328   test -n "$ac_ct_CC" && break
1329 done
1330
1331   CC=$ac_ct_CC
1332 fi
1333
1334 test -z "$CC" && { { echo "$as_me:1334: error: no acceptable cc found in \$PATH" >&5
1335 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1336    { (exit 1); exit 1; }; }
1337
1338 # Provide some information about the compiler.
1339 echo "$as_me:1339:" \
1340      "checking for C compiler version" >&5
1341 ac_compiler=`set X $ac_compile; echo $2`
1342 { (eval echo "$as_me:1342: \"$ac_compiler --version </dev/null >&5\"") >&5
1343   (eval $ac_compiler --version </dev/null >&5) 2>&5
1344   ac_status=$?
1345   echo "$as_me:1345: \$? = $ac_status" >&5
1346   (exit $ac_status); }
1347 { (eval echo "$as_me:1347: \"$ac_compiler -v </dev/null >&5\"") >&5
1348   (eval $ac_compiler -v </dev/null >&5) 2>&5
1349   ac_status=$?
1350   echo "$as_me:1350: \$? = $ac_status" >&5
1351   (exit $ac_status); }
1352 { (eval echo "$as_me:1352: \"$ac_compiler -V </dev/null >&5\"") >&5
1353   (eval $ac_compiler -V </dev/null >&5) 2>&5
1354   ac_status=$?
1355   echo "$as_me:1355: \$? = $ac_status" >&5
1356   (exit $ac_status); }
1357
1358 cat >conftest.$ac_ext <<_ACEOF
1359 #line 1359 "configure"
1360 #include "confdefs.h"
1361
1362 int
1363 main (void)
1364 {
1365
1366   ;
1367   return 0;
1368 }
1369 _ACEOF
1370 ac_clean_files_save=$ac_clean_files
1371 ac_clean_files="$ac_clean_files a.out a.exe"
1372 # Try to create an executable without -o first, disregard a.out.
1373 # It will help us diagnose broken compilers, and finding out an intuition
1374 # of exeext.
1375 echo "$as_me:1375: checking for C compiler default output" >&5
1376 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1377 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1378 if { (eval echo "$as_me:1378: \"$ac_link_default\"") >&5
1379   (eval $ac_link_default) 2>&5
1380   ac_status=$?
1381   echo "$as_me:1381: \$? = $ac_status" >&5
1382   (exit $ac_status); }; then
1383   # Find the output, starting from the most likely.  This scheme is
1384 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1385 # resort.
1386 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1387                 ls a.out conftest 2>/dev/null;
1388                 ls a.* conftest.* 2>/dev/null`; do
1389   case $ac_file in
1390     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1391     a.out ) # We found the default executable, but exeext='' is most
1392             # certainly right.
1393             break;;
1394     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1395           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1396           export ac_cv_exeext
1397           break;;
1398     * ) break;;
1399   esac
1400 done
1401 else
1402   echo "$as_me: failed program was:" >&5
1403 cat conftest.$ac_ext >&5
1404 { { echo "$as_me:1404: error: C compiler cannot create executables" >&5
1405 echo "$as_me: error: C compiler cannot create executables" >&2;}
1406    { (exit 77); exit 77; }; }
1407 fi
1408
1409 ac_exeext=$ac_cv_exeext
1410 echo "$as_me:1410: result: $ac_file" >&5
1411 echo "${ECHO_T}$ac_file" >&6
1412
1413 # Check the compiler produces executables we can run.  If not, either
1414 # the compiler is broken, or we cross compile.
1415 echo "$as_me:1415: checking whether the C compiler works" >&5
1416 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1417 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1418 # If not cross compiling, check that we can run a simple program.
1419 if test "$cross_compiling" != yes; then
1420   if { ac_try='./$ac_file'
1421   { (eval echo "$as_me:1421: \"$ac_try\"") >&5
1422   (eval $ac_try) 2>&5
1423   ac_status=$?
1424   echo "$as_me:1424: \$? = $ac_status" >&5
1425   (exit $ac_status); }; }; then
1426     cross_compiling=no
1427   else
1428     if test "$cross_compiling" = maybe; then
1429         cross_compiling=yes
1430     else
1431         { { echo "$as_me:1431: error: cannot run C compiled programs.
1432 If you meant to cross compile, use \`--host'." >&5
1433 echo "$as_me: error: cannot run C compiled programs.
1434 If you meant to cross compile, use \`--host'." >&2;}
1435    { (exit 1); exit 1; }; }
1436     fi
1437   fi
1438 fi
1439 echo "$as_me:1439: result: yes" >&5
1440 echo "${ECHO_T}yes" >&6
1441
1442 rm -f a.out a.exe conftest$ac_cv_exeext
1443 ac_clean_files=$ac_clean_files_save
1444 # Check the compiler produces executables we can run.  If not, either
1445 # the compiler is broken, or we cross compile.
1446 echo "$as_me:1446: checking whether we are cross compiling" >&5
1447 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1448 echo "$as_me:1448: result: $cross_compiling" >&5
1449 echo "${ECHO_T}$cross_compiling" >&6
1450
1451 echo "$as_me:1451: checking for executable suffix" >&5
1452 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1453 if { (eval echo "$as_me:1453: \"$ac_link\"") >&5
1454   (eval $ac_link) 2>&5
1455   ac_status=$?
1456   echo "$as_me:1456: \$? = $ac_status" >&5
1457   (exit $ac_status); }; then
1458   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1459 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1460 # work properly (i.e., refer to `conftest.exe'), while it won't with
1461 # `rm'.
1462 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1463   case $ac_file in
1464     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1465     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1466           export ac_cv_exeext
1467           break;;
1468     * ) break;;
1469   esac
1470 done
1471 else
1472   { { echo "$as_me:1472: error: cannot compute EXEEXT: cannot compile and link" >&5
1473 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1474    { (exit 1); exit 1; }; }
1475 fi
1476
1477 rm -f conftest$ac_cv_exeext
1478 echo "$as_me:1478: result: $ac_cv_exeext" >&5
1479 echo "${ECHO_T}$ac_cv_exeext" >&6
1480
1481 rm -f conftest.$ac_ext
1482 EXEEXT=$ac_cv_exeext
1483 ac_exeext=$EXEEXT
1484 echo "$as_me:1484: checking for object suffix" >&5
1485 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1486 if test "${ac_cv_objext+set}" = set; then
1487   echo $ECHO_N "(cached) $ECHO_C" >&6
1488 else
1489   cat >conftest.$ac_ext <<_ACEOF
1490 #line 1490 "configure"
1491 #include "confdefs.h"
1492
1493 int
1494 main (void)
1495 {
1496
1497   ;
1498   return 0;
1499 }
1500 _ACEOF
1501 rm -f conftest.o conftest.obj
1502 if { (eval echo "$as_me:1502: \"$ac_compile\"") >&5
1503   (eval $ac_compile) 2>&5
1504   ac_status=$?
1505   echo "$as_me:1505: \$? = $ac_status" >&5
1506   (exit $ac_status); }; then
1507   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1508   case $ac_file in
1509     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1510     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1511        break;;
1512   esac
1513 done
1514 else
1515   echo "$as_me: failed program was:" >&5
1516 cat conftest.$ac_ext >&5
1517 { { echo "$as_me:1517: error: cannot compute OBJEXT: cannot compile" >&5
1518 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1519    { (exit 1); exit 1; }; }
1520 fi
1521
1522 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1523 fi
1524 echo "$as_me:1524: result: $ac_cv_objext" >&5
1525 echo "${ECHO_T}$ac_cv_objext" >&6
1526 OBJEXT=$ac_cv_objext
1527 ac_objext=$OBJEXT
1528 echo "$as_me:1528: checking whether we are using the GNU C compiler" >&5
1529 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1530 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1531   echo $ECHO_N "(cached) $ECHO_C" >&6
1532 else
1533   cat >conftest.$ac_ext <<_ACEOF
1534 #line 1534 "configure"
1535 #include "confdefs.h"
1536
1537 int
1538 main (void)
1539 {
1540 #ifndef __GNUC__
1541        choke me
1542 #endif
1543
1544   ;
1545   return 0;
1546 }
1547 _ACEOF
1548 rm -f conftest.$ac_objext
1549 if { (eval echo "$as_me:1549: \"$ac_compile\"") >&5
1550   (eval $ac_compile) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); } &&
1554          { ac_try='test -s conftest.$ac_objext'
1555   { (eval echo "$as_me:1555: \"$ac_try\"") >&5
1556   (eval $ac_try) 2>&5
1557   ac_status=$?
1558   echo "$as_me:1558: \$? = $ac_status" >&5
1559   (exit $ac_status); }; }; then
1560   ac_compiler_gnu=yes
1561 else
1562   echo "$as_me: failed program was:" >&5
1563 cat conftest.$ac_ext >&5
1564 ac_compiler_gnu=no
1565 fi
1566 rm -f conftest.$ac_objext conftest.$ac_ext
1567 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1568
1569 fi
1570 echo "$as_me:1570: result: $ac_cv_c_compiler_gnu" >&5
1571 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1572 GCC=`test $ac_compiler_gnu = yes && echo yes`
1573 ac_test_CFLAGS=${CFLAGS+set}
1574 ac_save_CFLAGS=$CFLAGS
1575 CFLAGS="-g"
1576 echo "$as_me:1576: checking whether $CC accepts -g" >&5
1577 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1578 if test "${ac_cv_prog_cc_g+set}" = set; then
1579   echo $ECHO_N "(cached) $ECHO_C" >&6
1580 else
1581   cat >conftest.$ac_ext <<_ACEOF
1582 #line 1582 "configure"
1583 #include "confdefs.h"
1584
1585 int
1586 main (void)
1587 {
1588
1589   ;
1590   return 0;
1591 }
1592 _ACEOF
1593 rm -f conftest.$ac_objext
1594 if { (eval echo "$as_me:1594: \"$ac_compile\"") >&5
1595   (eval $ac_compile) 2>&5
1596   ac_status=$?
1597   echo "$as_me:1597: \$? = $ac_status" >&5
1598   (exit $ac_status); } &&
1599          { ac_try='test -s conftest.$ac_objext'
1600   { (eval echo "$as_me:1600: \"$ac_try\"") >&5
1601   (eval $ac_try) 2>&5
1602   ac_status=$?
1603   echo "$as_me:1603: \$? = $ac_status" >&5
1604   (exit $ac_status); }; }; then
1605   ac_cv_prog_cc_g=yes
1606 else
1607   echo "$as_me: failed program was:" >&5
1608 cat conftest.$ac_ext >&5
1609 ac_cv_prog_cc_g=no
1610 fi
1611 rm -f conftest.$ac_objext conftest.$ac_ext
1612 fi
1613 echo "$as_me:1613: result: $ac_cv_prog_cc_g" >&5
1614 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1615 if test "$ac_test_CFLAGS" = set; then
1616   CFLAGS=$ac_save_CFLAGS
1617 elif test $ac_cv_prog_cc_g = yes; then
1618   if test "$GCC" = yes; then
1619     CFLAGS="-g -O2"
1620   else
1621     CFLAGS="-g"
1622   fi
1623 else
1624   if test "$GCC" = yes; then
1625     CFLAGS="-O2"
1626   else
1627     CFLAGS=
1628   fi
1629 fi
1630 # Some people use a C++ compiler to compile C.  Since we use `exit',
1631 # in C++ we need to declare it.  In case someone uses the same compiler
1632 # for both compiling C and C++ we need to have the C++ compiler decide
1633 # the declaration of exit, since it's the most demanding environment.
1634 cat >conftest.$ac_ext <<_ACEOF
1635 #ifndef __cplusplus
1636   choke me
1637 #endif
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   for ac_declaration in \
1652    ''\
1653    '#include <stdlib.h>' \
1654    'extern "C" void std::exit (int) throw (); using std::exit;' \
1655    'extern "C" void std::exit (int); using std::exit;' \
1656    'extern "C" void exit (int) throw ();' \
1657    'extern "C" void exit (int);' \
1658    'void exit (int);'
1659 do
1660   cat >conftest.$ac_ext <<_ACEOF
1661 #line 1661 "configure"
1662 #include "confdefs.h"
1663 #include <stdlib.h>
1664 $ac_declaration
1665 int
1666 main (void)
1667 {
1668 exit (42);
1669   ;
1670   return 0;
1671 }
1672 _ACEOF
1673 rm -f conftest.$ac_objext
1674 if { (eval echo "$as_me:1674: \"$ac_compile\"") >&5
1675   (eval $ac_compile) 2>&5
1676   ac_status=$?
1677   echo "$as_me:1677: \$? = $ac_status" >&5
1678   (exit $ac_status); } &&
1679          { ac_try='test -s conftest.$ac_objext'
1680   { (eval echo "$as_me:1680: \"$ac_try\"") >&5
1681   (eval $ac_try) 2>&5
1682   ac_status=$?
1683   echo "$as_me:1683: \$? = $ac_status" >&5
1684   (exit $ac_status); }; }; then
1685   :
1686 else
1687   echo "$as_me: failed program was:" >&5
1688 cat conftest.$ac_ext >&5
1689 continue
1690 fi
1691 rm -f conftest.$ac_objext conftest.$ac_ext
1692   cat >conftest.$ac_ext <<_ACEOF
1693 #line 1693 "configure"
1694 #include "confdefs.h"
1695 $ac_declaration
1696 int
1697 main (void)
1698 {
1699 exit (42);
1700   ;
1701   return 0;
1702 }
1703 _ACEOF
1704 rm -f conftest.$ac_objext
1705 if { (eval echo "$as_me:1705: \"$ac_compile\"") >&5
1706   (eval $ac_compile) 2>&5
1707   ac_status=$?
1708   echo "$as_me:1708: \$? = $ac_status" >&5
1709   (exit $ac_status); } &&
1710          { ac_try='test -s conftest.$ac_objext'
1711   { (eval echo "$as_me:1711: \"$ac_try\"") >&5
1712   (eval $ac_try) 2>&5
1713   ac_status=$?
1714   echo "$as_me:1714: \$? = $ac_status" >&5
1715   (exit $ac_status); }; }; then
1716   break
1717 else
1718   echo "$as_me: failed program was:" >&5
1719 cat conftest.$ac_ext >&5
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 done
1723 rm -rf conftest*
1724 if test -n "$ac_declaration"; then
1725   echo '#ifdef __cplusplus' >>confdefs.h
1726   echo $ac_declaration      >>confdefs.h
1727   echo '#endif'             >>confdefs.h
1728 fi
1729
1730 else
1731   echo "$as_me: failed program was:" >&5
1732 cat conftest.$ac_ext >&5
1733 fi
1734 rm -f conftest.$ac_objext conftest.$ac_ext
1735 ac_ext=c
1736 ac_cpp='$CPP $CPPFLAGS'
1737 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1738 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1739 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1740 ac_main_return=return
1741
1742 GCC_VERSION=none
1743 if test "$GCC" = yes ; then
1744         echo "$as_me:1744: checking version of $CC" >&5
1745 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1746         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1747         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1748         echo "$as_me:1748: result: $GCC_VERSION" >&5
1749 echo "${ECHO_T}$GCC_VERSION" >&6
1750 fi
1751
1752 INTEL_COMPILER=no
1753
1754 if test "$GCC" = yes ; then
1755         case $host_os in
1756         (linux*|gnu*)
1757                 echo "$as_me:1757: checking if this is really Intel C compiler" >&5
1758 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1759                 cf_save_CFLAGS="$CFLAGS"
1760                 CFLAGS="$CFLAGS -no-gcc"
1761                 cat >conftest.$ac_ext <<_ACEOF
1762 #line 1762 "configure"
1763 #include "confdefs.h"
1764
1765 int
1766 main (void)
1767 {
1768
1769 #ifdef __INTEL_COMPILER
1770 #else
1771 make an error
1772 #endif
1773
1774   ;
1775   return 0;
1776 }
1777 _ACEOF
1778 rm -f conftest.$ac_objext
1779 if { (eval echo "$as_me:1779: \"$ac_compile\"") >&5
1780   (eval $ac_compile) 2>&5
1781   ac_status=$?
1782   echo "$as_me:1782: \$? = $ac_status" >&5
1783   (exit $ac_status); } &&
1784          { ac_try='test -s conftest.$ac_objext'
1785   { (eval echo "$as_me:1785: \"$ac_try\"") >&5
1786   (eval $ac_try) 2>&5
1787   ac_status=$?
1788   echo "$as_me:1788: \$? = $ac_status" >&5
1789   (exit $ac_status); }; }; then
1790   INTEL_COMPILER=yes
1791 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1792
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 fi
1797 rm -f conftest.$ac_objext conftest.$ac_ext
1798                 CFLAGS="$cf_save_CFLAGS"
1799                 echo "$as_me:1799: result: $INTEL_COMPILER" >&5
1800 echo "${ECHO_T}$INTEL_COMPILER" >&6
1801                 ;;
1802         esac
1803 fi
1804
1805 CLANG_COMPILER=no
1806
1807 if test "$GCC" = yes ; then
1808         echo "$as_me:1808: checking if this is really Clang C compiler" >&5
1809 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1810         cf_save_CFLAGS="$CFLAGS"
1811         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
1842 else
1843   echo "$as_me: failed program was:" >&5
1844 cat conftest.$ac_ext >&5
1845 fi
1846 rm -f conftest.$ac_objext conftest.$ac_ext
1847         CFLAGS="$cf_save_CFLAGS"
1848         echo "$as_me:1848: result: $CLANG_COMPILER" >&5
1849 echo "${ECHO_T}$CLANG_COMPILER" >&6
1850 fi
1851
1852 if test "x$CLANG_COMPILER" = "xyes" ; then
1853         for cf_clang_opt in \
1854                 -Qunused-arguments \
1855                 -Wno-error=implicit-function-declaration
1856         do
1857                 echo "$as_me:1857: checking if option $cf_clang_opt works" >&5
1858 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1859                 cf_save_CFLAGS="$CFLAGS"
1860                 CFLAGS="$CFLAGS $cf_clang_opt"
1861                 cat >conftest.$ac_ext <<_ACEOF
1862 #line 1862 "configure"
1863 #include "confdefs.h"
1864
1865                         #include <stdio.h>
1866 int
1867 main (void)
1868 {
1869
1870                         printf("hello!\n");
1871   ;
1872   return 0;
1873 }
1874 _ACEOF
1875 rm -f conftest.$ac_objext conftest$ac_exeext
1876 if { (eval echo "$as_me:1876: \"$ac_link\"") >&5
1877   (eval $ac_link) 2>&5
1878   ac_status=$?
1879   echo "$as_me:1879: \$? = $ac_status" >&5
1880   (exit $ac_status); } &&
1881          { ac_try='test -s conftest$ac_exeext'
1882   { (eval echo "$as_me:1882: \"$ac_try\"") >&5
1883   (eval $ac_try) 2>&5
1884   ac_status=$?
1885   echo "$as_me:1885: \$? = $ac_status" >&5
1886   (exit $ac_status); }; }; then
1887
1888                         cf_clang_optok=yes
1889 else
1890   echo "$as_me: failed program was:" >&5
1891 cat conftest.$ac_ext >&5
1892
1893                         cf_clang_optok=no
1894 fi
1895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
1896                 echo "$as_me:1896: result: $cf_clang_optok" >&5
1897 echo "${ECHO_T}$cf_clang_optok" >&6
1898                 CFLAGS="$cf_save_CFLAGS"
1899                 if test $cf_clang_optok = yes; then
1900                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
1901
1902 echo "${as_me:-configure}:1902: testing adding option $cf_clang_opt ..." 1>&5
1903
1904         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1905         CFLAGS="${CFLAGS}$cf_clang_opt"
1906
1907                 fi
1908         done
1909 fi
1910
1911 echo "$as_me:1911: checking for $CC option to accept ANSI C" >&5
1912 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1913 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1914   echo $ECHO_N "(cached) $ECHO_C" >&6
1915 else
1916   ac_cv_prog_cc_stdc=no
1917 ac_save_CC=$CC
1918 cat >conftest.$ac_ext <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921 #include <stdarg.h>
1922 #include <stdio.h>
1923 #include <sys/types.h>
1924 #include <sys/stat.h>
1925 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1926 struct buf { int x; };
1927 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1928 static char *e (p, i)
1929      char **p;
1930      int i;
1931 {
1932   return p[i];
1933 }
1934 static char *f (char * (*g) (char **, int), char **p, ...)
1935 {
1936   char *s;
1937   va_list v;
1938   va_start (v,p);
1939   s = g (p, va_arg (v,int));
1940   va_end (v);
1941   return s;
1942 }
1943 int test (int i, double x);
1944 struct s1 {int (*f) (int a);};
1945 struct s2 {int (*f) (double a);};
1946 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1947 int argc;
1948 char **argv;
1949 int
1950 main (void)
1951 {
1952 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1953   ;
1954   return 0;
1955 }
1956 _ACEOF
1957 # Don't try gcc -ansi; that turns off useful extensions and
1958 # breaks some systems' header files.
1959 # AIX                   -qlanglvl=ansi
1960 # Ultrix and OSF/1      -std1
1961 # HP-UX 10.20 and later -Ae
1962 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1963 # SVR4                  -Xc -D__EXTENSIONS__
1964 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1965 do
1966   CC="$ac_save_CC $ac_arg"
1967   rm -f conftest.$ac_objext
1968 if { (eval echo "$as_me:1968: \"$ac_compile\"") >&5
1969   (eval $ac_compile) 2>&5
1970   ac_status=$?
1971   echo "$as_me:1971: \$? = $ac_status" >&5
1972   (exit $ac_status); } &&
1973          { ac_try='test -s conftest.$ac_objext'
1974   { (eval echo "$as_me:1974: \"$ac_try\"") >&5
1975   (eval $ac_try) 2>&5
1976   ac_status=$?
1977   echo "$as_me:1977: \$? = $ac_status" >&5
1978   (exit $ac_status); }; }; then
1979   ac_cv_prog_cc_stdc=$ac_arg
1980 break
1981 else
1982   echo "$as_me: failed program was:" >&5
1983 cat conftest.$ac_ext >&5
1984 fi
1985 rm -f conftest.$ac_objext
1986 done
1987 rm -f conftest.$ac_ext conftest.$ac_objext
1988 CC=$ac_save_CC
1989
1990 fi
1991
1992 case "x$ac_cv_prog_cc_stdc" in
1993   x|xno)
1994     echo "$as_me:1994: result: none needed" >&5
1995 echo "${ECHO_T}none needed" >&6 ;;
1996   *)
1997     echo "$as_me:1997: result: $ac_cv_prog_cc_stdc" >&5
1998 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1999     CC="$CC $ac_cv_prog_cc_stdc" ;;
2000 esac
2001
2002 # This should have been defined by AC_PROG_CC
2003 : ${CC:=cc}
2004
2005 echo "$as_me:2005: checking \$CFLAGS variable" >&5
2006 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2007 case "x$CFLAGS" in
2008 (*-[IUD]*)
2009         echo "$as_me:2009: result: broken" >&5
2010 echo "${ECHO_T}broken" >&6
2011         { echo "$as_me:2011: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2012 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2013         cf_flags="$CFLAGS"
2014         CFLAGS=
2015         for cf_arg in $cf_flags
2016         do
2017
2018 cf_fix_cppflags=no
2019 cf_new_cflags=
2020 cf_new_cppflags=
2021 cf_new_extra_cppflags=
2022
2023 for cf_add_cflags in $cf_arg
2024 do
2025 case $cf_fix_cppflags in
2026 (no)
2027         case $cf_add_cflags in
2028         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2029                 case $cf_add_cflags in
2030                 (-D*)
2031                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2032
2033                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2034                                 && test -z "${cf_tst_cflags}" \
2035                                 && cf_fix_cppflags=yes
2036
2037                         if test $cf_fix_cppflags = yes ; then
2038
2039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2041
2042                                 continue
2043                         elif test "${cf_tst_cflags}" = "\"'" ; then
2044
2045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2047
2048                                 continue
2049                         fi
2050                         ;;
2051                 esac
2052                 case "$CPPFLAGS" in
2053                 (*$cf_add_cflags)
2054                         ;;
2055                 (*)
2056                         case $cf_add_cflags in
2057                         (-D*)
2058                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2059
2060 CPPFLAGS=`echo "$CPPFLAGS" | \
2061         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2062                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2063
2064                                 ;;
2065                         esac
2066
2067         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2068         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2069
2070                         ;;
2071                 esac
2072                 ;;
2073         (*)
2074
2075         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2076         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2077
2078                 ;;
2079         esac
2080         ;;
2081 (yes)
2082
2083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2085
2086         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2087
2088         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2089                 && test -z "${cf_tst_cflags}" \
2090                 && cf_fix_cppflags=no
2091         ;;
2092 esac
2093 done
2094
2095 if test -n "$cf_new_cflags" ; then
2096
2097         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2098         CFLAGS="${CFLAGS}$cf_new_cflags"
2099
2100 fi
2101
2102 if test -n "$cf_new_cppflags" ; then
2103
2104         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2105         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2106
2107 fi
2108
2109 if test -n "$cf_new_extra_cppflags" ; then
2110
2111         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2112         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2113
2114 fi
2115
2116         done
2117         ;;
2118 (*)
2119         echo "$as_me:2119: result: ok" >&5
2120 echo "${ECHO_T}ok" >&6
2121         ;;
2122 esac
2123
2124 echo "$as_me:2124: checking \$CC variable" >&5
2125 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2126 case "$CC" in
2127 (*[\ \  ]-*)
2128         echo "$as_me:2128: result: broken" >&5
2129 echo "${ECHO_T}broken" >&6
2130         { echo "$as_me:2130: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2131 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2132         # humor him...
2133         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2134         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2135         CC="$cf_prog"
2136         for cf_arg in $cf_flags
2137         do
2138                 case "x$cf_arg" in
2139                 (x-[IUDfgOW]*)
2140
2141 cf_fix_cppflags=no
2142 cf_new_cflags=
2143 cf_new_cppflags=
2144 cf_new_extra_cppflags=
2145
2146 for cf_add_cflags in $cf_arg
2147 do
2148 case $cf_fix_cppflags in
2149 (no)
2150         case $cf_add_cflags in
2151         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2152                 case $cf_add_cflags in
2153                 (-D*)
2154                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2155
2156                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2157                                 && test -z "${cf_tst_cflags}" \
2158                                 && cf_fix_cppflags=yes
2159
2160                         if test $cf_fix_cppflags = yes ; then
2161
2162         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2163         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2164
2165                                 continue
2166                         elif test "${cf_tst_cflags}" = "\"'" ; then
2167
2168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2170
2171                                 continue
2172                         fi
2173                         ;;
2174                 esac
2175                 case "$CPPFLAGS" in
2176                 (*$cf_add_cflags)
2177                         ;;
2178                 (*)
2179                         case $cf_add_cflags in
2180                         (-D*)
2181                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2182
2183 CPPFLAGS=`echo "$CPPFLAGS" | \
2184         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2185                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2186
2187                                 ;;
2188                         esac
2189
2190         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2191         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2192
2193                         ;;
2194                 esac
2195                 ;;
2196         (*)
2197
2198         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2199         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2200
2201                 ;;
2202         esac
2203         ;;
2204 (yes)
2205
2206         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2207         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2208
2209         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2210
2211         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2212                 && test -z "${cf_tst_cflags}" \
2213                 && cf_fix_cppflags=no
2214         ;;
2215 esac
2216 done
2217
2218 if test -n "$cf_new_cflags" ; then
2219
2220         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2221         CFLAGS="${CFLAGS}$cf_new_cflags"
2222
2223 fi
2224
2225 if test -n "$cf_new_cppflags" ; then
2226
2227         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2228         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2229
2230 fi
2231
2232 if test -n "$cf_new_extra_cppflags" ; then
2233
2234         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2235         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2236
2237 fi
2238
2239                         ;;
2240                 (*)
2241                         CC="$CC $cf_arg"
2242                         ;;
2243                 esac
2244         done
2245         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2246
2247 echo "${as_me:-configure}:2247: testing resulting CC: '$CC' ..." 1>&5
2248
2249         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2250
2251 echo "${as_me:-configure}:2251: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2252
2253         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2254
2255 echo "${as_me:-configure}:2255: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2256
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 ac_ext=c
2265 ac_cpp='$CPP $CPPFLAGS'
2266 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2267 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2268 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2269 ac_main_return=return
2270 echo "$as_me:2270: checking how to run the C preprocessor" >&5
2271 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2272 # On Suns, sometimes $CPP names a directory.
2273 if test -n "$CPP" && test -d "$CPP"; then
2274   CPP=
2275 fi
2276 if test -z "$CPP"; then
2277   if test "${ac_cv_prog_CPP+set}" = set; then
2278   echo $ECHO_N "(cached) $ECHO_C" >&6
2279 else
2280       # Double quotes because CPP needs to be expanded
2281     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2282     do
2283       ac_preproc_ok=false
2284 for ac_c_preproc_warn_flag in '' yes
2285 do
2286   # Use a header file that comes with gcc, so configuring glibc
2287   # with a fresh cross-compiler works.
2288   # On the NeXT, cc -E runs the code through the compiler's parser,
2289   # not just through cpp. "Syntax error" is here to catch this case.
2290   cat >conftest.$ac_ext <<_ACEOF
2291 #line 2291 "configure"
2292 #include "confdefs.h"
2293 #include <assert.h>
2294                      Syntax error
2295 _ACEOF
2296 if { (eval echo "$as_me:2296: \"$ac_cpp conftest.$ac_ext\"") >&5
2297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2298   ac_status=$?
2299   egrep -v '^ *\+' conftest.er1 >conftest.err
2300   rm -f conftest.er1
2301   cat conftest.err >&5
2302   echo "$as_me:2302: \$? = $ac_status" >&5
2303   (exit $ac_status); } >/dev/null; then
2304   if test -s conftest.err; then
2305     ac_cpp_err=$ac_c_preproc_warn_flag
2306   else
2307     ac_cpp_err=
2308   fi
2309 else
2310   ac_cpp_err=yes
2311 fi
2312 if test -z "$ac_cpp_err"; then
2313   :
2314 else
2315   echo "$as_me: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317   # Broken: fails on valid input.
2318 continue
2319 fi
2320 rm -f conftest.err conftest.$ac_ext
2321
2322   # OK, works on sane cases.  Now check whether non-existent headers
2323   # can be detected and how.
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #include <ac_nonexistent.h>
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   # Broken: success on invalid input.
2347 continue
2348 else
2349   echo "$as_me: failed program was:" >&5
2350   cat conftest.$ac_ext >&5
2351   # Passes both tests.
2352 ac_preproc_ok=:
2353 break
2354 fi
2355 rm -f conftest.err conftest.$ac_ext
2356
2357 done
2358 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2359 rm -f conftest.err conftest.$ac_ext
2360 if $ac_preproc_ok; then
2361   break
2362 fi
2363
2364     done
2365     ac_cv_prog_CPP=$CPP
2366
2367 fi
2368   CPP=$ac_cv_prog_CPP
2369 else
2370   ac_cv_prog_CPP=$CPP
2371 fi
2372 echo "$as_me:2372: result: $CPP" >&5
2373 echo "${ECHO_T}$CPP" >&6
2374 ac_preproc_ok=false
2375 for ac_c_preproc_warn_flag in '' yes
2376 do
2377   # Use a header file that comes with gcc, so configuring glibc
2378   # with a fresh cross-compiler works.
2379   # On the NeXT, cc -E runs the code through the compiler's parser,
2380   # not just through cpp. "Syntax error" is here to catch this case.
2381   cat >conftest.$ac_ext <<_ACEOF
2382 #line 2382 "configure"
2383 #include "confdefs.h"
2384 #include <assert.h>
2385                      Syntax error
2386 _ACEOF
2387 if { (eval echo "$as_me:2387: \"$ac_cpp conftest.$ac_ext\"") >&5
2388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2389   ac_status=$?
2390   egrep -v '^ *\+' conftest.er1 >conftest.err
2391   rm -f conftest.er1
2392   cat conftest.err >&5
2393   echo "$as_me:2393: \$? = $ac_status" >&5
2394   (exit $ac_status); } >/dev/null; then
2395   if test -s conftest.err; then
2396     ac_cpp_err=$ac_c_preproc_warn_flag
2397   else
2398     ac_cpp_err=
2399   fi
2400 else
2401   ac_cpp_err=yes
2402 fi
2403 if test -z "$ac_cpp_err"; then
2404   :
2405 else
2406   echo "$as_me: failed program was:" >&5
2407   cat conftest.$ac_ext >&5
2408   # Broken: fails on valid input.
2409 continue
2410 fi
2411 rm -f conftest.err conftest.$ac_ext
2412
2413   # OK, works on sane cases.  Now check whether non-existent headers
2414   # can be detected and how.
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <ac_nonexistent.h>
2419 _ACEOF
2420 if { (eval echo "$as_me:2420: \"$ac_cpp conftest.$ac_ext\"") >&5
2421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2422   ac_status=$?
2423   egrep -v '^ *\+' conftest.er1 >conftest.err
2424   rm -f conftest.er1
2425   cat conftest.err >&5
2426   echo "$as_me:2426: \$? = $ac_status" >&5
2427   (exit $ac_status); } >/dev/null; then
2428   if test -s conftest.err; then
2429     ac_cpp_err=$ac_c_preproc_warn_flag
2430   else
2431     ac_cpp_err=
2432   fi
2433 else
2434   ac_cpp_err=yes
2435 fi
2436 if test -z "$ac_cpp_err"; then
2437   # Broken: success on invalid input.
2438 continue
2439 else
2440   echo "$as_me: failed program was:" >&5
2441   cat conftest.$ac_ext >&5
2442   # Passes both tests.
2443 ac_preproc_ok=:
2444 break
2445 fi
2446 rm -f conftest.err conftest.$ac_ext
2447
2448 done
2449 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2450 rm -f conftest.err conftest.$ac_ext
2451 if $ac_preproc_ok; then
2452   :
2453 else
2454   { { echo "$as_me:2454: error: C preprocessor \"$CPP\" fails sanity check" >&5
2455 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2456    { (exit 1); exit 1; }; }
2457 fi
2458
2459 ac_ext=c
2460 ac_cpp='$CPP $CPPFLAGS'
2461 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2462 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2463 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2464 ac_main_return=return
2465
2466 if test $ac_cv_c_compiler_gnu = yes; then
2467     echo "$as_me:2467: checking whether $CC needs -traditional" >&5
2468 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2469 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2470   echo $ECHO_N "(cached) $ECHO_C" >&6
2471 else
2472     ac_pattern="Autoconf.*'x'"
2473   cat >conftest.$ac_ext <<_ACEOF
2474 #line 2474 "configure"
2475 #include "confdefs.h"
2476 #include <sgtty.h>
2477 int Autoconf = TIOCGETP;
2478 _ACEOF
2479 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2480   egrep "$ac_pattern" >/dev/null 2>&1; then
2481   ac_cv_prog_gcc_traditional=yes
2482 else
2483   ac_cv_prog_gcc_traditional=no
2484 fi
2485 rm -rf conftest*
2486
2487   if test $ac_cv_prog_gcc_traditional = no; then
2488     cat >conftest.$ac_ext <<_ACEOF
2489 #line 2489 "configure"
2490 #include "confdefs.h"
2491 #include <termio.h>
2492 int Autoconf = TCGETA;
2493 _ACEOF
2494 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2495   egrep "$ac_pattern" >/dev/null 2>&1; then
2496   ac_cv_prog_gcc_traditional=yes
2497 fi
2498 rm -rf conftest*
2499
2500   fi
2501 fi
2502 echo "$as_me:2502: result: $ac_cv_prog_gcc_traditional" >&5
2503 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2504   if test $ac_cv_prog_gcc_traditional = yes; then
2505     CC="$CC -traditional"
2506   fi
2507 fi
2508
2509 echo "$as_me:2509: checking whether $CC understands -c and -o together" >&5
2510 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2511 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2512   echo $ECHO_N "(cached) $ECHO_C" >&6
2513 else
2514
2515 cat > conftest.$ac_ext <<CF_EOF
2516 int main(void)
2517 {
2518         ${cf_cv_main_return:-return}(0);
2519 }
2520 CF_EOF
2521 # We do the test twice because some compilers refuse to overwrite an
2522 # existing .o file with -o, though they will create one.
2523 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2524 if { (eval echo "$as_me:2524: \"$ac_try\"") >&5
2525   (eval $ac_try) 2>&5
2526   ac_status=$?
2527   echo "$as_me:2527: \$? = $ac_status" >&5
2528   (exit $ac_status); } &&
2529   test -f conftest2.$ac_objext && { (eval echo "$as_me:2529: \"$ac_try\"") >&5
2530   (eval $ac_try) 2>&5
2531   ac_status=$?
2532   echo "$as_me:2532: \$? = $ac_status" >&5
2533   (exit $ac_status); };
2534 then
2535   eval cf_cv_prog_CC_c_o=yes
2536 else
2537   eval cf_cv_prog_CC_c_o=no
2538 fi
2539 rm -rf conftest*
2540
2541 fi
2542 if test $cf_cv_prog_CC_c_o = yes; then
2543   echo "$as_me:2543: result: yes" >&5
2544 echo "${ECHO_T}yes" >&6
2545 else
2546   echo "$as_me:2546: result: no" >&5
2547 echo "${ECHO_T}no" >&6
2548 fi
2549
2550 test "$program_prefix" != NONE &&
2551   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2552 # Use a double $ so make ignores it.
2553 test "$program_suffix" != NONE &&
2554   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2555 # Double any \ or $.  echo might interpret backslashes.
2556 # By default was `s,x,x', remove it if useless.
2557 cat <<\_ACEOF >conftest.sed
2558 s/[\\$]/&&/g;s/;s,x,x,$//
2559 _ACEOF
2560 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2561 rm conftest.sed
2562
2563 for ac_prog in mawk gawk nawk awk
2564 do
2565   # Extract the first word of "$ac_prog", so it can be a program name with args.
2566 set dummy $ac_prog; ac_word=$2
2567 echo "$as_me:2567: checking for $ac_word" >&5
2568 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2569 if test "${ac_cv_prog_AWK+set}" = set; then
2570   echo $ECHO_N "(cached) $ECHO_C" >&6
2571 else
2572   if test -n "$AWK"; then
2573   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2574 else
2575   ac_save_IFS=$IFS; IFS=$ac_path_separator
2576 ac_dummy="$PATH"
2577 for ac_dir in $ac_dummy; do
2578   IFS=$ac_save_IFS
2579   test -z "$ac_dir" && ac_dir=.
2580   $as_executable_p "$ac_dir/$ac_word" || continue
2581 ac_cv_prog_AWK="$ac_prog"
2582 echo "$as_me:2582: found $ac_dir/$ac_word" >&5
2583 break
2584 done
2585
2586 fi
2587 fi
2588 AWK=$ac_cv_prog_AWK
2589 if test -n "$AWK"; then
2590   echo "$as_me:2590: result: $AWK" >&5
2591 echo "${ECHO_T}$AWK" >&6
2592 else
2593   echo "$as_me:2593: result: no" >&5
2594 echo "${ECHO_T}no" >&6
2595 fi
2596
2597   test -n "$AWK" && break
2598 done
2599
2600 test -z "$AWK" && { { echo "$as_me:2600: error: No awk program found" >&5
2601 echo "$as_me: error: No awk program found" >&2;}
2602    { (exit 1); exit 1; }; }
2603
2604 echo "$as_me:2604: checking for egrep" >&5
2605 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2606 if test "${ac_cv_prog_egrep+set}" = set; then
2607   echo $ECHO_N "(cached) $ECHO_C" >&6
2608 else
2609   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2610                 then ac_cv_prog_egrep='grep -E'
2611                 else ac_cv_prog_egrep='egrep'
2612         fi
2613 fi
2614 echo "$as_me:2614: result: $ac_cv_prog_egrep" >&5
2615 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2616         EGREP=$ac_cv_prog_egrep
2617
2618         test -z "$EGREP" && { { echo "$as_me:2618: error: No egrep program found" >&5
2619 echo "$as_me: error: No egrep program found" >&2;}
2620    { (exit 1); exit 1; }; }
2621
2622 # Find a good install program.  We prefer a C program (faster),
2623 # so one script is as good as another.  But avoid the broken or
2624 # incompatible versions:
2625 # SysV /etc/install, /usr/sbin/install
2626 # SunOS /usr/etc/install
2627 # IRIX /sbin/install
2628 # AIX /bin/install
2629 # AmigaOS /C/install, which installs bootblocks on floppy discs
2630 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2631 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2632 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2633 # ./install, which can be erroneously created by make from ./install.sh.
2634 echo "$as_me:2634: checking for a BSD compatible install" >&5
2635 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2636 if test -z "$INSTALL"; then
2637 if test "${ac_cv_path_install+set}" = set; then
2638   echo $ECHO_N "(cached) $ECHO_C" >&6
2639 else
2640     ac_save_IFS=$IFS; IFS=$ac_path_separator
2641   for ac_dir in $PATH; do
2642     IFS=$ac_save_IFS
2643     # Account for people who put trailing slashes in PATH elements.
2644     case $ac_dir/ in
2645     / | ./ | .// | /cC/* \
2646     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2647     | /usr/ucb/* ) ;;
2648     *)
2649       # OSF1 and SCO ODT 3.0 have their own names for install.
2650       # Don't use installbsd from OSF since it installs stuff as root
2651       # by default.
2652       for ac_prog in ginstall scoinst install; do
2653         if $as_executable_p "$ac_dir/$ac_prog"; then
2654           if test $ac_prog = install &&
2655             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2656             # AIX install.  It has an incompatible calling convention.
2657             :
2658           elif test $ac_prog = install &&
2659             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2660             # program-specific install script used by HP pwplus--don't use.
2661             :
2662           else
2663             ac_cv_path_install="$ac_dir/$ac_prog -c"
2664             break 2
2665           fi
2666         fi
2667       done
2668       ;;
2669     esac
2670   done
2671
2672 fi
2673   if test "${ac_cv_path_install+set}" = set; then
2674     INSTALL=$ac_cv_path_install
2675   else
2676     # As a last resort, use the slow shell script.  We don't cache a
2677     # path for INSTALL within a source directory, because that will
2678     # break other packages using the cache if that directory is
2679     # removed, or if the path is relative.
2680     INSTALL=$ac_install_sh
2681   fi
2682 fi
2683 echo "$as_me:2683: result: $INSTALL" >&5
2684 echo "${ECHO_T}$INSTALL" >&6
2685
2686 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2687 # It thinks the first close brace ends the variable substitution.
2688 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2689
2690 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2691
2692 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2693
2694 echo "$as_me:2694: checking whether ln -s works" >&5
2695 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2696 LN_S=$as_ln_s
2697 if test "$LN_S" = "ln -s"; then
2698   echo "$as_me:2698: result: yes" >&5
2699 echo "${ECHO_T}yes" >&6
2700 else
2701   echo "$as_me:2701: result: no, using $LN_S" >&5
2702 echo "${ECHO_T}no, using $LN_S" >&6
2703 fi
2704
2705 echo "$as_me:2705: checking if $LN_S -f options work" >&5
2706 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2707
2708 rm -f conf$$.src conf$$dst
2709 echo >conf$$.dst
2710 echo first >conf$$.src
2711 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2712         cf_prog_ln_sf=yes
2713 else
2714         cf_prog_ln_sf=no
2715 fi
2716 rm -f conf$$.dst conf$$src
2717 echo "$as_me:2717: result: $cf_prog_ln_sf" >&5
2718 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2719
2720 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2721
2722 # Find a good install program.  We prefer a C program (faster),
2723 # so one script is as good as another.  But avoid the broken or
2724 # incompatible versions:
2725 # SysV /etc/install, /usr/sbin/install
2726 # SunOS /usr/etc/install
2727 # IRIX /sbin/install
2728 # AIX /bin/install
2729 # AmigaOS /C/install, which installs bootblocks on floppy discs
2730 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2731 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2732 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2733 # ./install, which can be erroneously created by make from ./install.sh.
2734 echo "$as_me:2734: checking for a BSD compatible install" >&5
2735 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2736 if test -z "$INSTALL"; then
2737 if test "${ac_cv_path_install+set}" = set; then
2738   echo $ECHO_N "(cached) $ECHO_C" >&6
2739 else
2740     ac_save_IFS=$IFS; IFS=$ac_path_separator
2741   for ac_dir in $PATH; do
2742     IFS=$ac_save_IFS
2743     # Account for people who put trailing slashes in PATH elements.
2744     case $ac_dir/ in
2745     / | ./ | .// | /cC/* \
2746     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2747     | /usr/ucb/* ) ;;
2748     *)
2749       # OSF1 and SCO ODT 3.0 have their own names for install.
2750       # Don't use installbsd from OSF since it installs stuff as root
2751       # by default.
2752       for ac_prog in ginstall scoinst install; do
2753         if $as_executable_p "$ac_dir/$ac_prog"; then
2754           if test $ac_prog = install &&
2755             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2756             # AIX install.  It has an incompatible calling convention.
2757             :
2758           elif test $ac_prog = install &&
2759             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2760             # program-specific install script used by HP pwplus--don't use.
2761             :
2762           else
2763             ac_cv_path_install="$ac_dir/$ac_prog -c"
2764             break 2
2765           fi
2766         fi
2767       done
2768       ;;
2769     esac
2770   done
2771
2772 fi
2773   if test "${ac_cv_path_install+set}" = set; then
2774     INSTALL=$ac_cv_path_install
2775   else
2776     # As a last resort, use the slow shell script.  We don't cache a
2777     # path for INSTALL within a source directory, because that will
2778     # break other packages using the cache if that directory is
2779     # removed, or if the path is relative.
2780     INSTALL=$ac_install_sh
2781   fi
2782 fi
2783 echo "$as_me:2783: result: $INSTALL" >&5
2784 echo "${ECHO_T}$INSTALL" >&6
2785
2786 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2787 # It thinks the first close brace ends the variable substitution.
2788 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2789
2790 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2791
2792 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2793
2794 case $INSTALL in
2795 (/*)
2796         ;;
2797 (*)
2798         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2799         test -z "$cf_dir" && cf_dir=.
2800         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2801         ;;
2802 esac
2803
2804 echo "$as_me:2804: checking if you want to install stripped executables" >&5
2805 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2806
2807 # Check whether --enable-stripping or --disable-stripping was given.
2808 if test "${enable_stripping+set}" = set; then
2809   enableval="$enable_stripping"
2810   test "$enableval" != no && enableval=yes
2811         if test "$enableval" != "yes" ; then
2812     with_stripping=no
2813         else
2814                 with_stripping=yes
2815         fi
2816 else
2817   enableval=yes
2818         with_stripping=yes
2819
2820 fi;
2821 echo "$as_me:2821: result: $with_stripping" >&5
2822 echo "${ECHO_T}$with_stripping" >&6
2823
2824 if test "$with_stripping" = yes
2825 then
2826         INSTALL_OPT_S="-s"
2827 else
2828         INSTALL_OPT_S=
2829 fi
2830
2831 : ${INSTALL:=install}
2832 echo "$as_me:2832: checking if install accepts -p option" >&5
2833 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2834 if test "${cf_cv_install_p+set}" = set; then
2835   echo $ECHO_N "(cached) $ECHO_C" >&6
2836 else
2837
2838         rm -rf conftest*
2839         date >conftest.in
2840         mkdir conftest.out
2841         sleep 3
2842         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2843         then
2844                 if test -f conftest.out/conftest.in
2845                 then
2846                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2847                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2848                         if test -s conftest.err
2849                         then
2850                                 cf_cv_install_p=no
2851                         else
2852                                 cf_cv_install_p=yes
2853                         fi
2854                 else
2855                         cf_cv_install_p=no
2856                 fi
2857         else
2858                 cf_cv_install_p=no
2859         fi
2860         rm -rf conftest*
2861
2862 fi
2863 echo "$as_me:2863: result: $cf_cv_install_p" >&5
2864 echo "${ECHO_T}$cf_cv_install_p" >&6
2865
2866 echo "$as_me:2866: checking if install needs to be told about ownership" >&5
2867 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2868 case `$ac_config_guess` in
2869 (*minix)
2870         with_install_o=yes
2871         ;;
2872 (*)
2873         with_install_o=no
2874         ;;
2875 esac
2876
2877 echo "$as_me:2877: result: $with_install_o" >&5
2878 echo "${ECHO_T}$with_install_o" >&6
2879 if test "x$with_install_o" = xyes
2880 then
2881         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'`
2882 else
2883         INSTALL_OPT_O=
2884 fi
2885
2886 echo "$as_me:2886: checking for long file names" >&5
2887 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2888 if test "${ac_cv_sys_long_file_names+set}" = set; then
2889   echo $ECHO_N "(cached) $ECHO_C" >&6
2890 else
2891   ac_cv_sys_long_file_names=yes
2892 # Test for long file names in all the places we know might matter:
2893 #      .                the current directory, where building will happen
2894 #      $prefix/lib      where we will be installing things
2895 #      $exec_prefix/lib likewise
2896 # eval it to expand exec_prefix.
2897 #      $TMPDIR          if set, where it might want to write temporary files
2898 # if $TMPDIR is not set:
2899 #      /tmp             where it might want to write temporary files
2900 #      /var/tmp         likewise
2901 #      /usr/tmp         likewise
2902 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2903   ac_tmpdirs=$TMPDIR
2904 else
2905   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2906 fi
2907 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2908   test -d $ac_dir || continue
2909   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2910   ac_xdir=$ac_dir/cf$$
2911   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2912   ac_tf1=$ac_xdir/conftest9012345
2913   ac_tf2=$ac_xdir/conftest9012346
2914   (echo 1 >$ac_tf1) 2>/dev/null
2915   (echo 2 >$ac_tf2) 2>/dev/null
2916   ac_val=`cat $ac_tf1 2>/dev/null`
2917   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2918     ac_cv_sys_long_file_names=no
2919     rm -rf $ac_xdir 2>/dev/null
2920     break
2921   fi
2922   rm -rf $ac_xdir 2>/dev/null
2923 done
2924 fi
2925 echo "$as_me:2925: result: $ac_cv_sys_long_file_names" >&5
2926 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2927 if test $ac_cv_sys_long_file_names = yes; then
2928
2929 cat >>confdefs.h <<\EOF
2930 #define HAVE_LONG_FILE_NAMES 1
2931 EOF
2932
2933 fi
2934
2935 # if we find pkg-config, check if we should install the ".pc" files.
2936
2937 echo "$as_me:2937: checking if you want to use pkg-config" >&5
2938 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2939
2940 # Check whether --with-pkg-config or --without-pkg-config was given.
2941 if test "${with_pkg_config+set}" = set; then
2942   withval="$with_pkg_config"
2943   cf_pkg_config=$withval
2944 else
2945   cf_pkg_config=yes
2946 fi;
2947 echo "$as_me:2947: result: $cf_pkg_config" >&5
2948 echo "${ECHO_T}$cf_pkg_config" >&6
2949
2950 case $cf_pkg_config in
2951 (no)
2952         PKG_CONFIG=none
2953         ;;
2954 (yes)
2955
2956 if test -n "$ac_tool_prefix"; then
2957   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2958 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2959 echo "$as_me:2959: checking for $ac_word" >&5
2960 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2961 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2962   echo $ECHO_N "(cached) $ECHO_C" >&6
2963 else
2964   case $PKG_CONFIG in
2965   [\\/]* | ?:[\\/]*)
2966   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2967   ;;
2968   *)
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   if $as_executable_p "$ac_dir/$ac_word"; then
2975    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2976    echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977    break
2978 fi
2979 done
2980
2981   ;;
2982 esac
2983 fi
2984 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2985
2986 if test -n "$PKG_CONFIG"; then
2987   echo "$as_me:2987: result: $PKG_CONFIG" >&5
2988 echo "${ECHO_T}$PKG_CONFIG" >&6
2989 else
2990   echo "$as_me:2990: result: no" >&5
2991 echo "${ECHO_T}no" >&6
2992 fi
2993
2994 fi
2995 if test -z "$ac_cv_path_PKG_CONFIG"; then
2996   ac_pt_PKG_CONFIG=$PKG_CONFIG
2997   # Extract the first word of "pkg-config", so it can be a program name with args.
2998 set dummy pkg-config; ac_word=$2
2999 echo "$as_me:2999: checking for $ac_word" >&5
3000 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3001 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3002   echo $ECHO_N "(cached) $ECHO_C" >&6
3003 else
3004   case $ac_pt_PKG_CONFIG in
3005   [\\/]* | ?:[\\/]*)
3006   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3007   ;;
3008   *)
3009   ac_save_IFS=$IFS; IFS=$ac_path_separator
3010 ac_dummy="$PATH"
3011 for ac_dir in $ac_dummy; do
3012   IFS=$ac_save_IFS
3013   test -z "$ac_dir" && ac_dir=.
3014   if $as_executable_p "$ac_dir/$ac_word"; then
3015    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3016    echo "$as_me:3016: found $ac_dir/$ac_word" >&5
3017    break
3018 fi
3019 done
3020
3021   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3022   ;;
3023 esac
3024 fi
3025 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3026
3027 if test -n "$ac_pt_PKG_CONFIG"; then
3028   echo "$as_me:3028: result: $ac_pt_PKG_CONFIG" >&5
3029 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3030 else
3031   echo "$as_me:3031: result: no" >&5
3032 echo "${ECHO_T}no" >&6
3033 fi
3034
3035   PKG_CONFIG=$ac_pt_PKG_CONFIG
3036 else
3037   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3038 fi
3039
3040         ;;
3041 (*)
3042         PKG_CONFIG=$withval
3043         ;;
3044 esac
3045
3046 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3047 if test "$PKG_CONFIG" != none ; then
3048
3049 if test "x$prefix" != xNONE; then
3050         cf_path_syntax="$prefix"
3051 else
3052         cf_path_syntax="$ac_default_prefix"
3053 fi
3054
3055 case ".$PKG_CONFIG" in
3056 (.\$\(*\)*|.\'*\'*)
3057         ;;
3058 (..|./*|.\\*)
3059         ;;
3060 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3061         ;;
3062 (.\${*prefix}*|.\${*dir}*)
3063         eval PKG_CONFIG="$PKG_CONFIG"
3064         case ".$PKG_CONFIG" in
3065         (.NONE/*)
3066                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3067                 ;;
3068         esac
3069         ;;
3070 (.no|.NONE/*)
3071         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3072         ;;
3073 (*)
3074         { { echo "$as_me:3074: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3075 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3076    { (exit 1); exit 1; }; }
3077         ;;
3078 esac
3079
3080 elif test "x$cf_pkg_config" != xno ; then
3081         { echo "$as_me:3081: WARNING: pkg-config is not installed" >&5
3082 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3083 fi
3084
3085 case $PKG_CONFIG in
3086 (no|none|yes)
3087         echo "$as_me:3087: checking for pkg-config library directory" >&5
3088 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3089         ;;
3090 (*)
3091         echo "$as_me:3091: checking for $PKG_CONFIG library directory" >&5
3092 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3093         ;;
3094 esac
3095
3096 PKG_CONFIG_LIBDIR=no
3097
3098 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3099 if test "${with_pkg_config_libdir+set}" = set; then
3100   withval="$with_pkg_config_libdir"
3101   PKG_CONFIG_LIBDIR=$withval
3102 else
3103   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3104 fi;
3105
3106 case x$PKG_CONFIG_LIBDIR in
3107 (x/*)
3108         ;;
3109 (xyes)
3110         # Look for the library directory using the same prefix as the executable
3111         if test "x$PKG_CONFIG" = xnone
3112         then
3113                 cf_path=$prefix
3114         else
3115                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3116         fi
3117
3118         # If you don't like using the default architecture, you have to specify the
3119         # intended library directory and corresponding compiler/linker options.
3120         #
3121         # This case allows for Debian's 2014-flavor of multiarch, along with the
3122         # most common variations before that point.  Some other variants spell the
3123         # directory differently, e.g., "pkg-config", and put it in unusual places.
3124         # pkg-config has always been poorly standardized, which is ironic...
3125         case x`(arch) 2>/dev/null` in
3126         (*64)
3127                 cf_search_path="\
3128                         $cf_path/lib/*64-linux-gnu \
3129                         $cf_path/share \
3130                         $cf_path/lib64 \
3131                         $cf_path/lib32 \
3132                         $cf_path/lib"
3133                 ;;
3134         (*)
3135                 cf_search_path="\
3136                         $cf_path/lib/*-linux-gnu \
3137                         $cf_path/share \
3138                         $cf_path/lib32 \
3139                         $cf_path/lib \
3140                         $cf_path/libdata"
3141                 ;;
3142         esac
3143
3144         test -n "$verbose" && echo "    list..." 1>&6
3145
3146 echo "${as_me:-configure}:3146: testing list... ..." 1>&5
3147
3148         for cf_config in $cf_search_path
3149         do
3150                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3151
3152 echo "${as_me:-configure}:3152: testing checking $cf_config/pkgconfig ..." 1>&5
3153
3154                 if test -d $cf_config/pkgconfig
3155                 then
3156                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3157                         echo "$as_me:3157: checking done" >&5
3158 echo $ECHO_N "checking done... $ECHO_C" >&6
3159                         break
3160                 fi
3161         done
3162         ;;
3163 (*)
3164         ;;
3165 esac
3166
3167 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3168         echo "$as_me:3168: result: $PKG_CONFIG_LIBDIR" >&5
3169 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3170 fi
3171
3172 echo "$as_me:3172: checking if you want to build test-programs" >&5
3173 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3174
3175 # Check whether --with-tests or --without-tests was given.
3176 if test "${with_tests+set}" = set; then
3177   withval="$with_tests"
3178   cf_with_tests=$withval
3179 else
3180   cf_with_tests=yes
3181 fi;
3182 echo "$as_me:3182: result: $cf_with_tests" >&5
3183 echo "${ECHO_T}$cf_with_tests" >&6
3184
3185 echo "$as_me:3185: checking if we should assume mixed-case filenames" >&5
3186 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3187
3188 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3189 if test "${enable_mixed_case+set}" = set; then
3190   enableval="$enable_mixed_case"
3191   enable_mixedcase=$enableval
3192 else
3193   enable_mixedcase=auto
3194 fi;
3195 echo "$as_me:3195: result: $enable_mixedcase" >&5
3196 echo "${ECHO_T}$enable_mixedcase" >&6
3197 if test "$enable_mixedcase" = "auto" ; then
3198
3199 echo "$as_me:3199: checking if filesystem supports mixed-case filenames" >&5
3200 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3201 if test "${cf_cv_mixedcase+set}" = set; then
3202   echo $ECHO_N "(cached) $ECHO_C" >&6
3203 else
3204
3205 if test "$cross_compiling" = yes ; then
3206         case $target_alias in
3207         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3208                 cf_cv_mixedcase=no
3209                 ;;
3210         (*)
3211                 cf_cv_mixedcase=yes
3212                 ;;
3213         esac
3214 else
3215         rm -f conftest CONFTEST
3216         echo test >conftest
3217         if test -f CONFTEST ; then
3218                 cf_cv_mixedcase=no
3219         else
3220                 cf_cv_mixedcase=yes
3221         fi
3222         rm -f conftest CONFTEST
3223 fi
3224
3225 fi
3226 echo "$as_me:3226: result: $cf_cv_mixedcase" >&5
3227 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3228 test "$cf_cv_mixedcase" = yes &&
3229 cat >>confdefs.h <<\EOF
3230 #define MIXEDCASE_FILENAMES 1
3231 EOF
3232
3233 else
3234         cf_cv_mixedcase=$enable_mixedcase
3235         if test "$enable_mixedcase" = "yes" ; then
3236                 cat >>confdefs.h <<\EOF
3237 #define MIXEDCASE_FILENAMES 1
3238 EOF
3239
3240         fi
3241 fi
3242
3243 # do this after mixed-case option (tags/TAGS is not as important as tic).
3244 echo "$as_me:3244: checking whether ${MAKE-make} sets \${MAKE}" >&5
3245 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3246 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3247 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3248   echo $ECHO_N "(cached) $ECHO_C" >&6
3249 else
3250   cat >conftest.make <<\EOF
3251 all:
3252         @echo 'ac_maketemp="${MAKE}"'
3253 EOF
3254 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3255 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3256 if test -n "$ac_maketemp"; then
3257   eval ac_cv_prog_make_${ac_make}_set=yes
3258 else
3259   eval ac_cv_prog_make_${ac_make}_set=no
3260 fi
3261 rm -f conftest.make
3262 fi
3263 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3264   echo "$as_me:3264: result: yes" >&5
3265 echo "${ECHO_T}yes" >&6
3266   SET_MAKE=
3267 else
3268   echo "$as_me:3268: result: no" >&5
3269 echo "${ECHO_T}no" >&6
3270   SET_MAKE="MAKE=${MAKE-make}"
3271 fi
3272
3273 for ac_prog in exctags ctags
3274 do
3275   # Extract the first word of "$ac_prog", so it can be a program name with args.
3276 set dummy $ac_prog; ac_word=$2
3277 echo "$as_me:3277: checking for $ac_word" >&5
3278 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3279 if test "${ac_cv_prog_CTAGS+set}" = set; then
3280   echo $ECHO_N "(cached) $ECHO_C" >&6
3281 else
3282   if test -n "$CTAGS"; then
3283   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3284 else
3285   ac_save_IFS=$IFS; IFS=$ac_path_separator
3286 ac_dummy="$PATH"
3287 for ac_dir in $ac_dummy; do
3288   IFS=$ac_save_IFS
3289   test -z "$ac_dir" && ac_dir=.
3290   $as_executable_p "$ac_dir/$ac_word" || continue
3291 ac_cv_prog_CTAGS="$ac_prog"
3292 echo "$as_me:3292: found $ac_dir/$ac_word" >&5
3293 break
3294 done
3295
3296 fi
3297 fi
3298 CTAGS=$ac_cv_prog_CTAGS
3299 if test -n "$CTAGS"; then
3300   echo "$as_me:3300: result: $CTAGS" >&5
3301 echo "${ECHO_T}$CTAGS" >&6
3302 else
3303   echo "$as_me:3303: result: no" >&5
3304 echo "${ECHO_T}no" >&6
3305 fi
3306
3307   test -n "$CTAGS" && break
3308 done
3309
3310 for ac_prog in exetags etags
3311 do
3312   # Extract the first word of "$ac_prog", so it can be a program name with args.
3313 set dummy $ac_prog; ac_word=$2
3314 echo "$as_me:3314: checking for $ac_word" >&5
3315 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3316 if test "${ac_cv_prog_ETAGS+set}" = set; then
3317   echo $ECHO_N "(cached) $ECHO_C" >&6
3318 else
3319   if test -n "$ETAGS"; then
3320   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3321 else
3322   ac_save_IFS=$IFS; IFS=$ac_path_separator
3323 ac_dummy="$PATH"
3324 for ac_dir in $ac_dummy; do
3325   IFS=$ac_save_IFS
3326   test -z "$ac_dir" && ac_dir=.
3327   $as_executable_p "$ac_dir/$ac_word" || continue
3328 ac_cv_prog_ETAGS="$ac_prog"
3329 echo "$as_me:3329: found $ac_dir/$ac_word" >&5
3330 break
3331 done
3332
3333 fi
3334 fi
3335 ETAGS=$ac_cv_prog_ETAGS
3336 if test -n "$ETAGS"; then
3337   echo "$as_me:3337: result: $ETAGS" >&5
3338 echo "${ECHO_T}$ETAGS" >&6
3339 else
3340   echo "$as_me:3340: result: no" >&5
3341 echo "${ECHO_T}no" >&6
3342 fi
3343
3344   test -n "$ETAGS" && break
3345 done
3346
3347 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3348 set dummy ${CTAGS:-ctags}; ac_word=$2
3349 echo "$as_me:3349: checking for $ac_word" >&5
3350 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3351 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3352   echo $ECHO_N "(cached) $ECHO_C" >&6
3353 else
3354   if test -n "$MAKE_LOWER_TAGS"; then
3355   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3356 else
3357   ac_save_IFS=$IFS; IFS=$ac_path_separator
3358 ac_dummy="$PATH"
3359 for ac_dir in $ac_dummy; do
3360   IFS=$ac_save_IFS
3361   test -z "$ac_dir" && ac_dir=.
3362   $as_executable_p "$ac_dir/$ac_word" || continue
3363 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3364 echo "$as_me:3364: found $ac_dir/$ac_word" >&5
3365 break
3366 done
3367
3368   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3369 fi
3370 fi
3371 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3372 if test -n "$MAKE_LOWER_TAGS"; then
3373   echo "$as_me:3373: result: $MAKE_LOWER_TAGS" >&5
3374 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3375 else
3376   echo "$as_me:3376: result: no" >&5
3377 echo "${ECHO_T}no" >&6
3378 fi
3379
3380 if test "$cf_cv_mixedcase" = yes ; then
3381         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3382 set dummy ${ETAGS:-etags}; ac_word=$2
3383 echo "$as_me:3383: checking for $ac_word" >&5
3384 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3385 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3386   echo $ECHO_N "(cached) $ECHO_C" >&6
3387 else
3388   if test -n "$MAKE_UPPER_TAGS"; then
3389   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3390 else
3391   ac_save_IFS=$IFS; IFS=$ac_path_separator
3392 ac_dummy="$PATH"
3393 for ac_dir in $ac_dummy; do
3394   IFS=$ac_save_IFS
3395   test -z "$ac_dir" && ac_dir=.
3396   $as_executable_p "$ac_dir/$ac_word" || continue
3397 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3398 echo "$as_me:3398: found $ac_dir/$ac_word" >&5
3399 break
3400 done
3401
3402   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3403 fi
3404 fi
3405 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3406 if test -n "$MAKE_UPPER_TAGS"; then
3407   echo "$as_me:3407: result: $MAKE_UPPER_TAGS" >&5
3408 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3409 else
3410   echo "$as_me:3410: result: no" >&5
3411 echo "${ECHO_T}no" >&6
3412 fi
3413
3414 else
3415         MAKE_UPPER_TAGS=no
3416 fi
3417
3418 if test "$MAKE_UPPER_TAGS" = yes ; then
3419         MAKE_UPPER_TAGS=
3420 else
3421         MAKE_UPPER_TAGS="#"
3422 fi
3423
3424 if test "$MAKE_LOWER_TAGS" = yes ; then
3425         MAKE_LOWER_TAGS=
3426 else
3427         MAKE_LOWER_TAGS="#"
3428 fi
3429
3430 echo "$as_me:3430: checking for makeflags variable" >&5
3431 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3432 if test "${cf_cv_makeflags+set}" = set; then
3433   echo $ECHO_N "(cached) $ECHO_C" >&6
3434 else
3435
3436         cf_cv_makeflags=''
3437         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3438         do
3439                 cat >cf_makeflags.tmp <<CF_EOF
3440 SHELL = $SHELL
3441 all :
3442         @ echo '.$cf_option'
3443 CF_EOF
3444                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3445                 case "$cf_result" in
3446                 (.*k|.*kw)
3447                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3448                         case "$cf_result" in
3449                         (.*CC=*)        cf_cv_makeflags=
3450                                 ;;
3451                         (*)     cf_cv_makeflags=$cf_option
3452                                 ;;
3453                         esac
3454                         break
3455                         ;;
3456                 (.-)
3457                         ;;
3458                 (*)
3459
3460 echo "${as_me:-configure}:3460: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3461
3462                         ;;
3463                 esac
3464         done
3465         rm -f cf_makeflags.tmp
3466
3467 fi
3468 echo "$as_me:3468: result: $cf_cv_makeflags" >&5
3469 echo "${ECHO_T}$cf_cv_makeflags" >&6
3470
3471 if test -n "$ac_tool_prefix"; then
3472   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3473 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3474 echo "$as_me:3474: checking for $ac_word" >&5
3475 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3476 if test "${ac_cv_prog_RANLIB+set}" = set; then
3477   echo $ECHO_N "(cached) $ECHO_C" >&6
3478 else
3479   if test -n "$RANLIB"; then
3480   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3481 else
3482   ac_save_IFS=$IFS; IFS=$ac_path_separator
3483 ac_dummy="$PATH"
3484 for ac_dir in $ac_dummy; do
3485   IFS=$ac_save_IFS
3486   test -z "$ac_dir" && ac_dir=.
3487   $as_executable_p "$ac_dir/$ac_word" || continue
3488 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3489 echo "$as_me:3489: found $ac_dir/$ac_word" >&5
3490 break
3491 done
3492
3493 fi
3494 fi
3495 RANLIB=$ac_cv_prog_RANLIB
3496 if test -n "$RANLIB"; then
3497   echo "$as_me:3497: result: $RANLIB" >&5
3498 echo "${ECHO_T}$RANLIB" >&6
3499 else
3500   echo "$as_me:3500: result: no" >&5
3501 echo "${ECHO_T}no" >&6
3502 fi
3503
3504 fi
3505 if test -z "$ac_cv_prog_RANLIB"; then
3506   ac_ct_RANLIB=$RANLIB
3507   # Extract the first word of "ranlib", so it can be a program name with args.
3508 set dummy ranlib; ac_word=$2
3509 echo "$as_me:3509: checking for $ac_word" >&5
3510 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3511 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3512   echo $ECHO_N "(cached) $ECHO_C" >&6
3513 else
3514   if test -n "$ac_ct_RANLIB"; then
3515   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3516 else
3517   ac_save_IFS=$IFS; IFS=$ac_path_separator
3518 ac_dummy="$PATH"
3519 for ac_dir in $ac_dummy; do
3520   IFS=$ac_save_IFS
3521   test -z "$ac_dir" && ac_dir=.
3522   $as_executable_p "$ac_dir/$ac_word" || continue
3523 ac_cv_prog_ac_ct_RANLIB="ranlib"
3524 echo "$as_me:3524: found $ac_dir/$ac_word" >&5
3525 break
3526 done
3527
3528   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3529 fi
3530 fi
3531 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3532 if test -n "$ac_ct_RANLIB"; then
3533   echo "$as_me:3533: result: $ac_ct_RANLIB" >&5
3534 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3535 else
3536   echo "$as_me:3536: result: no" >&5
3537 echo "${ECHO_T}no" >&6
3538 fi
3539
3540   RANLIB=$ac_ct_RANLIB
3541 else
3542   RANLIB="$ac_cv_prog_RANLIB"
3543 fi
3544
3545 if test -n "$ac_tool_prefix"; then
3546   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3547 set dummy ${ac_tool_prefix}ld; ac_word=$2
3548 echo "$as_me:3548: checking for $ac_word" >&5
3549 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3550 if test "${ac_cv_prog_LD+set}" = set; then
3551   echo $ECHO_N "(cached) $ECHO_C" >&6
3552 else
3553   if test -n "$LD"; then
3554   ac_cv_prog_LD="$LD" # Let the user override the test.
3555 else
3556   ac_save_IFS=$IFS; IFS=$ac_path_separator
3557 ac_dummy="$PATH"
3558 for ac_dir in $ac_dummy; do
3559   IFS=$ac_save_IFS
3560   test -z "$ac_dir" && ac_dir=.
3561   $as_executable_p "$ac_dir/$ac_word" || continue
3562 ac_cv_prog_LD="${ac_tool_prefix}ld"
3563 echo "$as_me:3563: found $ac_dir/$ac_word" >&5
3564 break
3565 done
3566
3567 fi
3568 fi
3569 LD=$ac_cv_prog_LD
3570 if test -n "$LD"; then
3571   echo "$as_me:3571: result: $LD" >&5
3572 echo "${ECHO_T}$LD" >&6
3573 else
3574   echo "$as_me:3574: result: no" >&5
3575 echo "${ECHO_T}no" >&6
3576 fi
3577
3578 fi
3579 if test -z "$ac_cv_prog_LD"; then
3580   ac_ct_LD=$LD
3581   # Extract the first word of "ld", so it can be a program name with args.
3582 set dummy ld; ac_word=$2
3583 echo "$as_me:3583: checking for $ac_word" >&5
3584 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3585 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3586   echo $ECHO_N "(cached) $ECHO_C" >&6
3587 else
3588   if test -n "$ac_ct_LD"; then
3589   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3590 else
3591   ac_save_IFS=$IFS; IFS=$ac_path_separator
3592 ac_dummy="$PATH"
3593 for ac_dir in $ac_dummy; do
3594   IFS=$ac_save_IFS
3595   test -z "$ac_dir" && ac_dir=.
3596   $as_executable_p "$ac_dir/$ac_word" || continue
3597 ac_cv_prog_ac_ct_LD="ld"
3598 echo "$as_me:3598: found $ac_dir/$ac_word" >&5
3599 break
3600 done
3601
3602   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3603 fi
3604 fi
3605 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3606 if test -n "$ac_ct_LD"; then
3607   echo "$as_me:3607: result: $ac_ct_LD" >&5
3608 echo "${ECHO_T}$ac_ct_LD" >&6
3609 else
3610   echo "$as_me:3610: result: no" >&5
3611 echo "${ECHO_T}no" >&6
3612 fi
3613
3614   LD=$ac_ct_LD
3615 else
3616   LD="$ac_cv_prog_LD"
3617 fi
3618
3619 if test -n "$ac_tool_prefix"; then
3620   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3621 set dummy ${ac_tool_prefix}ar; ac_word=$2
3622 echo "$as_me:3622: checking for $ac_word" >&5
3623 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3624 if test "${ac_cv_prog_AR+set}" = set; then
3625   echo $ECHO_N "(cached) $ECHO_C" >&6
3626 else
3627   if test -n "$AR"; then
3628   ac_cv_prog_AR="$AR" # Let the user override the test.
3629 else
3630   ac_save_IFS=$IFS; IFS=$ac_path_separator
3631 ac_dummy="$PATH"
3632 for ac_dir in $ac_dummy; do
3633   IFS=$ac_save_IFS
3634   test -z "$ac_dir" && ac_dir=.
3635   $as_executable_p "$ac_dir/$ac_word" || continue
3636 ac_cv_prog_AR="${ac_tool_prefix}ar"
3637 echo "$as_me:3637: found $ac_dir/$ac_word" >&5
3638 break
3639 done
3640
3641 fi
3642 fi
3643 AR=$ac_cv_prog_AR
3644 if test -n "$AR"; then
3645   echo "$as_me:3645: result: $AR" >&5
3646 echo "${ECHO_T}$AR" >&6
3647 else
3648   echo "$as_me:3648: result: no" >&5
3649 echo "${ECHO_T}no" >&6
3650 fi
3651
3652 fi
3653 if test -z "$ac_cv_prog_AR"; then
3654   ac_ct_AR=$AR
3655   # Extract the first word of "ar", so it can be a program name with args.
3656 set dummy ar; ac_word=$2
3657 echo "$as_me:3657: checking for $ac_word" >&5
3658 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3659 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3660   echo $ECHO_N "(cached) $ECHO_C" >&6
3661 else
3662   if test -n "$ac_ct_AR"; then
3663   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3664 else
3665   ac_save_IFS=$IFS; IFS=$ac_path_separator
3666 ac_dummy="$PATH"
3667 for ac_dir in $ac_dummy; do
3668   IFS=$ac_save_IFS
3669   test -z "$ac_dir" && ac_dir=.
3670   $as_executable_p "$ac_dir/$ac_word" || continue
3671 ac_cv_prog_ac_ct_AR="ar"
3672 echo "$as_me:3672: found $ac_dir/$ac_word" >&5
3673 break
3674 done
3675
3676   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3677 fi
3678 fi
3679 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3680 if test -n "$ac_ct_AR"; then
3681   echo "$as_me:3681: result: $ac_ct_AR" >&5
3682 echo "${ECHO_T}$ac_ct_AR" >&6
3683 else
3684   echo "$as_me:3684: result: no" >&5
3685 echo "${ECHO_T}no" >&6
3686 fi
3687
3688   AR=$ac_ct_AR
3689 else
3690   AR="$ac_cv_prog_AR"
3691 fi
3692
3693 if test -n "$ac_tool_prefix"; then
3694   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3695 set dummy ${ac_tool_prefix}ar; ac_word=$2
3696 echo "$as_me:3696: checking for $ac_word" >&5
3697 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3698 if test "${ac_cv_prog_AR+set}" = set; then
3699   echo $ECHO_N "(cached) $ECHO_C" >&6
3700 else
3701   if test -n "$AR"; then
3702   ac_cv_prog_AR="$AR" # Let the user override the test.
3703 else
3704   ac_save_IFS=$IFS; IFS=$ac_path_separator
3705 ac_dummy="$PATH"
3706 for ac_dir in $ac_dummy; do
3707   IFS=$ac_save_IFS
3708   test -z "$ac_dir" && ac_dir=.
3709   $as_executable_p "$ac_dir/$ac_word" || continue
3710 ac_cv_prog_AR="${ac_tool_prefix}ar"
3711 echo "$as_me:3711: found $ac_dir/$ac_word" >&5
3712 break
3713 done
3714
3715 fi
3716 fi
3717 AR=$ac_cv_prog_AR
3718 if test -n "$AR"; then
3719   echo "$as_me:3719: result: $AR" >&5
3720 echo "${ECHO_T}$AR" >&6
3721 else
3722   echo "$as_me:3722: result: no" >&5
3723 echo "${ECHO_T}no" >&6
3724 fi
3725
3726 fi
3727 if test -z "$ac_cv_prog_AR"; then
3728   ac_ct_AR=$AR
3729   # Extract the first word of "ar", so it can be a program name with args.
3730 set dummy ar; ac_word=$2
3731 echo "$as_me:3731: checking for $ac_word" >&5
3732 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3733 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3734   echo $ECHO_N "(cached) $ECHO_C" >&6
3735 else
3736   if test -n "$ac_ct_AR"; then
3737   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3738 else
3739   ac_save_IFS=$IFS; IFS=$ac_path_separator
3740 ac_dummy="$PATH"
3741 for ac_dir in $ac_dummy; do
3742   IFS=$ac_save_IFS
3743   test -z "$ac_dir" && ac_dir=.
3744   $as_executable_p "$ac_dir/$ac_word" || continue
3745 ac_cv_prog_ac_ct_AR="ar"
3746 echo "$as_me:3746: found $ac_dir/$ac_word" >&5
3747 break
3748 done
3749
3750   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3751 fi
3752 fi
3753 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3754 if test -n "$ac_ct_AR"; then
3755   echo "$as_me:3755: result: $ac_ct_AR" >&5
3756 echo "${ECHO_T}$ac_ct_AR" >&6
3757 else
3758   echo "$as_me:3758: result: no" >&5
3759 echo "${ECHO_T}no" >&6
3760 fi
3761
3762   AR=$ac_ct_AR
3763 else
3764   AR="$ac_cv_prog_AR"
3765 fi
3766
3767 echo "$as_me:3767: checking for options to update archives" >&5
3768 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3769 if test "${cf_cv_ar_flags+set}" = set; then
3770   echo $ECHO_N "(cached) $ECHO_C" >&6
3771 else
3772
3773         case $cf_cv_system_name in
3774         (*-msvc*)
3775                 cf_cv_ar_flags=''
3776                 cat >mk_static_lib.sh <<-EOF
3777                 #!$SHELL
3778                 MSVC_BIN="$AR"
3779                 out="\$1"
3780                 shift
3781                 exec \$MSVC_BIN -out:"\$out" \$@
3782                 EOF
3783                 chmod +x mk_static_lib.sh
3784                 AR=`pwd`/mk_static_lib.sh
3785                 ;;
3786         (*)
3787                 cf_cv_ar_flags=unknown
3788                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3789                 do
3790
3791                         # check if $ARFLAGS already contains this choice
3792                         if test "x$ARFLAGS" != "x" ; then
3793                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3794                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3795                                         cf_cv_ar_flags=
3796                                         break
3797                                 fi
3798                         fi
3799
3800                         rm -f conftest.$ac_cv_objext
3801                         rm -f conftest.a
3802
3803                         cat >conftest.$ac_ext <<EOF
3804 #line 3804 "configure"
3805 int     testdata[3] = { 123, 456, 789 };
3806 EOF
3807                         if { (eval echo "$as_me:3807: \"$ac_compile\"") >&5
3808   (eval $ac_compile) 2>&5
3809   ac_status=$?
3810   echo "$as_me:3810: \$? = $ac_status" >&5
3811   (exit $ac_status); } ; then
3812                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3813                                 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3814                                 if test -f conftest.a ; then
3815                                         cf_cv_ar_flags=$cf_ar_flags
3816                                         break
3817                                 fi
3818                         else
3819                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3820
3821 echo "${as_me:-configure}:3821: testing cannot compile test-program ..." 1>&5
3822
3823                                 break
3824                         fi
3825                 done
3826                 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3827                 ;;
3828         esac
3829
3830 fi
3831 echo "$as_me:3831: result: $cf_cv_ar_flags" >&5
3832 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3833
3834 if test -n "$ARFLAGS" ; then
3835         if test -n "$cf_cv_ar_flags" ; then
3836                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3837         fi
3838 else
3839         ARFLAGS=$cf_cv_ar_flags
3840 fi
3841
3842         echo "$as_me:3842: checking for PATH separator" >&5
3843 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3844         case $cf_cv_system_name in
3845         (os2*)  PATH_SEPARATOR=';'  ;;
3846         (*)     ${PATH_SEPARATOR:=':'}  ;;
3847         esac
3848
3849         echo "$as_me:3849: result: $PATH_SEPARATOR" >&5
3850 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3851
3852 echo "$as_me:3852: checking if you have specified an install-prefix" >&5
3853 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3854
3855 # Check whether --with-install-prefix or --without-install-prefix was given.
3856 if test "${with_install_prefix+set}" = set; then
3857   withval="$with_install_prefix"
3858   case "$withval" in
3859         (yes|no)
3860                 ;;
3861         (*)     DESTDIR="$withval"
3862                 ;;
3863         esac
3864 fi;
3865 echo "$as_me:3865: result: $DESTDIR" >&5
3866 echo "${ECHO_T}$DESTDIR" >&6
3867
3868 ###############################################################################
3869
3870 # If we're cross-compiling, allow the user to override the tools and their
3871 # options.  The configure script is oriented toward identifying the host
3872 # compiler, etc., but we need a build compiler to generate parts of the source.
3873
3874 if test "$cross_compiling" = yes ; then
3875
3876         # defaults that we might want to override
3877         : ${BUILD_CFLAGS:=''}
3878         : ${BUILD_CPPFLAGS:=''}
3879         : ${BUILD_LDFLAGS:=''}
3880         : ${BUILD_LIBS:=''}
3881         : ${BUILD_EXEEXT:='$x'}
3882         : ${BUILD_OBJEXT:='o'}
3883
3884 # Check whether --with-build-cc or --without-build-cc was given.
3885 if test "${with_build_cc+set}" = set; then
3886   withval="$with_build_cc"
3887   BUILD_CC="$withval"
3888 else
3889   for ac_prog in gcc clang c99 c89 cc cl
3890 do
3891   # Extract the first word of "$ac_prog", so it can be a program name with args.
3892 set dummy $ac_prog; ac_word=$2
3893 echo "$as_me:3893: checking for $ac_word" >&5
3894 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3895 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3896   echo $ECHO_N "(cached) $ECHO_C" >&6
3897 else
3898   if test -n "$BUILD_CC"; then
3899   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3900 else
3901   ac_save_IFS=$IFS; IFS=$ac_path_separator
3902 ac_dummy="$PATH"
3903 for ac_dir in $ac_dummy; do
3904   IFS=$ac_save_IFS
3905   test -z "$ac_dir" && ac_dir=.
3906   $as_executable_p "$ac_dir/$ac_word" || continue
3907 ac_cv_prog_BUILD_CC="$ac_prog"
3908 echo "$as_me:3908: found $ac_dir/$ac_word" >&5
3909 break
3910 done
3911
3912 fi
3913 fi
3914 BUILD_CC=$ac_cv_prog_BUILD_CC
3915 if test -n "$BUILD_CC"; then
3916   echo "$as_me:3916: result: $BUILD_CC" >&5
3917 echo "${ECHO_T}$BUILD_CC" >&6
3918 else
3919   echo "$as_me:3919: result: no" >&5
3920 echo "${ECHO_T}no" >&6
3921 fi
3922
3923   test -n "$BUILD_CC" && break
3924 done
3925 test -n "$BUILD_CC" || BUILD_CC="none"
3926
3927 fi;
3928         echo "$as_me:3928: checking for native build C compiler" >&5
3929 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3930         echo "$as_me:3930: result: $BUILD_CC" >&5
3931 echo "${ECHO_T}$BUILD_CC" >&6
3932
3933         echo "$as_me:3933: checking for native build C preprocessor" >&5
3934 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3935
3936 # Check whether --with-build-cpp or --without-build-cpp was given.
3937 if test "${with_build_cpp+set}" = set; then
3938   withval="$with_build_cpp"
3939   BUILD_CPP="$withval"
3940 else
3941   BUILD_CPP='${BUILD_CC} -E'
3942 fi;
3943         echo "$as_me:3943: result: $BUILD_CPP" >&5
3944 echo "${ECHO_T}$BUILD_CPP" >&6
3945
3946         echo "$as_me:3946: checking for native build C flags" >&5
3947 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3948
3949 # Check whether --with-build-cflags or --without-build-cflags was given.
3950 if test "${with_build_cflags+set}" = set; then
3951   withval="$with_build_cflags"
3952   BUILD_CFLAGS="$withval"
3953 fi;
3954         echo "$as_me:3954: result: $BUILD_CFLAGS" >&5
3955 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3956
3957         echo "$as_me:3957: checking for native build C preprocessor-flags" >&5
3958 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3959
3960 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3961 if test "${with_build_cppflags+set}" = set; then
3962   withval="$with_build_cppflags"
3963   BUILD_CPPFLAGS="$withval"
3964 fi;
3965         echo "$as_me:3965: result: $BUILD_CPPFLAGS" >&5
3966 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3967
3968         echo "$as_me:3968: checking for native build linker-flags" >&5
3969 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3970
3971 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3972 if test "${with_build_ldflags+set}" = set; then
3973   withval="$with_build_ldflags"
3974   BUILD_LDFLAGS="$withval"
3975 fi;
3976         echo "$as_me:3976: result: $BUILD_LDFLAGS" >&5
3977 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3978
3979         echo "$as_me:3979: checking for native build linker-libraries" >&5
3980 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3981
3982 # Check whether --with-build-libs or --without-build-libs was given.
3983 if test "${with_build_libs+set}" = set; then
3984   withval="$with_build_libs"
3985   BUILD_LIBS="$withval"
3986 fi;
3987         echo "$as_me:3987: result: $BUILD_LIBS" >&5
3988 echo "${ECHO_T}$BUILD_LIBS" >&6
3989
3990         # this assumes we're on Unix.
3991         BUILD_EXEEXT=
3992         BUILD_OBJEXT=o
3993
3994         : ${BUILD_CC:='${CC}'}
3995
3996         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3997                 { { echo "$as_me:3997: error: Cross-build requires two compilers.
3998 Use --with-build-cc to specify the native compiler." >&5
3999 echo "$as_me: error: Cross-build requires two compilers.
4000 Use --with-build-cc to specify the native compiler." >&2;}
4001    { (exit 1); exit 1; }; }
4002         fi
4003
4004 else
4005         : ${BUILD_CC:='${CC}'}
4006         : ${BUILD_CPP:='${CPP}'}
4007         : ${BUILD_CFLAGS:='${CFLAGS}'}
4008         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4009         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4010         : ${BUILD_LIBS:='${LIBS}'}
4011         : ${BUILD_EXEEXT:='$x'}
4012         : ${BUILD_OBJEXT:='o'}
4013 fi
4014
4015 ###############################################################################
4016
4017 ### Options to allow the user to specify the set of libraries which are used.
4018 ### Use "--without-normal --with-shared" to allow the default model to be
4019 ### shared, for example.
4020 cf_list_models=""
4021
4022 echo "$as_me:4022: checking if you want to build shared C-objects" >&5
4023 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4024
4025 # Check whether --with-shared or --without-shared was given.
4026 if test "${with_shared+set}" = set; then
4027   withval="$with_shared"
4028   with_shared=$withval
4029 else
4030   with_shared=no
4031 fi;
4032 echo "$as_me:4032: result: $with_shared" >&5
4033 echo "${ECHO_T}$with_shared" >&6
4034 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4035
4036 echo "$as_me:4036: checking for specified models" >&5
4037 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4038 test -z "$cf_list_models" && cf_list_models=normal
4039 echo "$as_me:4039: result: $cf_list_models" >&5
4040 echo "${ECHO_T}$cf_list_models" >&6
4041
4042 ### Use the first model as the default, and save its suffix for use in building
4043 ### up test-applications.
4044 echo "$as_me:4044: checking for default model" >&5
4045 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4046 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4047 echo "$as_me:4047: result: $DFT_LWR_MODEL" >&5
4048 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4049
4050 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4051
4052 echo "$as_me:4052: checking for specific curses-directory" >&5
4053 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4054
4055 # Check whether --with-curses-dir or --without-curses-dir was given.
4056 if test "${with_curses_dir+set}" = set; then
4057   withval="$with_curses_dir"
4058   cf_cv_curses_dir=$withval
4059 else
4060   cf_cv_curses_dir=no
4061 fi;
4062 echo "$as_me:4062: result: $cf_cv_curses_dir" >&5
4063 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4064
4065 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4066 then
4067
4068 if test "x$prefix" != xNONE; then
4069         cf_path_syntax="$prefix"
4070 else
4071         cf_path_syntax="$ac_default_prefix"
4072 fi
4073
4074 case ".$withval" in
4075 (.\$\(*\)*|.\'*\'*)
4076         ;;
4077 (..|./*|.\\*)
4078         ;;
4079 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4080         ;;
4081 (.\${*prefix}*|.\${*dir}*)
4082         eval withval="$withval"
4083         case ".$withval" in
4084         (.NONE/*)
4085                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4086                 ;;
4087         esac
4088         ;;
4089 (.no|.NONE/*)
4090         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4091         ;;
4092 (*)
4093         { { echo "$as_me:4093: error: expected a pathname, not \"$withval\"" >&5
4094 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4095    { (exit 1); exit 1; }; }
4096         ;;
4097 esac
4098
4099         if test -d "$cf_cv_curses_dir"
4100         then
4101
4102 if test -n "$cf_cv_curses_dir/include" ; then
4103   for cf_add_incdir in $cf_cv_curses_dir/include
4104   do
4105         while test $cf_add_incdir != /usr/include
4106         do
4107           if test -d $cf_add_incdir
4108           then
4109                 cf_have_incdir=no
4110                 if test -n "$CFLAGS$CPPFLAGS" ; then
4111                   # a loop is needed to ensure we can add subdirs of existing dirs
4112                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4113                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4114                           cf_have_incdir=yes; break
4115                         fi
4116                   done
4117                 fi
4118
4119                 if test "$cf_have_incdir" = no ; then
4120                   if test "$cf_add_incdir" = /usr/local/include ; then
4121                         if test "$GCC" = yes
4122                         then
4123                           cf_save_CPPFLAGS=$CPPFLAGS
4124
4125         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4126         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4127
4128                           cat >conftest.$ac_ext <<_ACEOF
4129 #line 4129 "configure"
4130 #include "confdefs.h"
4131 #include <stdio.h>
4132 int
4133 main (void)
4134 {
4135 printf("Hello")
4136   ;
4137   return 0;
4138 }
4139 _ACEOF
4140 rm -f conftest.$ac_objext
4141 if { (eval echo "$as_me:4141: \"$ac_compile\"") >&5
4142   (eval $ac_compile) 2>&5
4143   ac_status=$?
4144   echo "$as_me:4144: \$? = $ac_status" >&5
4145   (exit $ac_status); } &&
4146          { ac_try='test -s conftest.$ac_objext'
4147   { (eval echo "$as_me:4147: \"$ac_try\"") >&5
4148   (eval $ac_try) 2>&5
4149   ac_status=$?
4150   echo "$as_me:4150: \$? = $ac_status" >&5
4151   (exit $ac_status); }; }; then
4152   :
4153 else
4154   echo "$as_me: failed program was:" >&5
4155 cat conftest.$ac_ext >&5
4156 cf_have_incdir=yes
4157 fi
4158 rm -f conftest.$ac_objext conftest.$ac_ext
4159                           CPPFLAGS=$cf_save_CPPFLAGS
4160                         fi
4161                   fi
4162                 fi
4163
4164                 if test "$cf_have_incdir" = no ; then
4165                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4166
4167 echo "${as_me:-configure}:4167: testing adding $cf_add_incdir to include-path ..." 1>&5
4168
4169                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4170
4171                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4172                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4173                   cf_add_incdir="$cf_top_incdir"
4174                 else
4175                   break
4176                 fi
4177           else
4178                 break
4179           fi
4180         done
4181   done
4182 fi
4183
4184 if test -n "$cf_cv_curses_dir/lib" ; then
4185         for cf_add_libdir in $cf_cv_curses_dir/lib
4186         do
4187                 if test $cf_add_libdir = /usr/lib ; then
4188                         :
4189                 elif test -d $cf_add_libdir
4190                 then
4191                         cf_have_libdir=no
4192                         if test -n "$LDFLAGS$LIBS" ; then
4193                                 # a loop is needed to ensure we can add subdirs of existing dirs
4194                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4195                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4196                                                 cf_have_libdir=yes; break
4197                                         fi
4198                                 done
4199                         fi
4200                         if test "$cf_have_libdir" = no ; then
4201                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4202
4203 echo "${as_me:-configure}:4203: testing adding $cf_add_libdir to library-path ..." 1>&5
4204
4205                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4206                         fi
4207                 fi
4208         done
4209 fi
4210
4211         fi
4212 fi
4213
4214 cf_ncuconfig_root=ncurses
4215 cf_have_ncuconfig=no
4216
4217 if test "x${PKG_CONFIG:=none}" != xnone; then
4218         echo "$as_me:4218: checking pkg-config for $cf_ncuconfig_root" >&5
4219 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4220         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4221                 echo "$as_me:4221: result: yes" >&5
4222 echo "${ECHO_T}yes" >&6
4223
4224                 echo "$as_me:4224: checking if the $cf_ncuconfig_root package files work" >&5
4225 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4226                 cf_have_ncuconfig=unknown
4227
4228                 cf_save_CFLAGS="$CFLAGS"
4229                 cf_save_CPPFLAGS="$CPPFLAGS"
4230                 cf_save_LIBS="$LIBS"
4231
4232                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4233                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4234
4235                 # while -W for passing linker flags is prevalent, it is not "standard".
4236                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4237                 # incompatible _and_ non-standard -W option which gives an error.  Work
4238                 # around that pitfall.
4239                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4240                 (x*c[89]9@@*-W*)
4241
4242 cf_fix_cppflags=no
4243 cf_new_cflags=
4244 cf_new_cppflags=
4245 cf_new_extra_cppflags=
4246
4247 for cf_add_cflags in $cf_pkg_cflags
4248 do
4249 case $cf_fix_cppflags in
4250 (no)
4251         case $cf_add_cflags in
4252         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4253                 case $cf_add_cflags in
4254                 (-D*)
4255                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4256
4257                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4258                                 && test -z "${cf_tst_cflags}" \
4259                                 && cf_fix_cppflags=yes
4260
4261                         if test $cf_fix_cppflags = yes ; then
4262
4263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4265
4266                                 continue
4267                         elif test "${cf_tst_cflags}" = "\"'" ; then
4268
4269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4271
4272                                 continue
4273                         fi
4274                         ;;
4275                 esac
4276                 case "$CPPFLAGS" in
4277                 (*$cf_add_cflags)
4278                         ;;
4279                 (*)
4280                         case $cf_add_cflags in
4281                         (-D*)
4282                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4283
4284 CPPFLAGS=`echo "$CPPFLAGS" | \
4285         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4286                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4287
4288                                 ;;
4289                         esac
4290
4291         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4292         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4293
4294                         ;;
4295                 esac
4296                 ;;
4297         (*)
4298
4299         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4300         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4301
4302                 ;;
4303         esac
4304         ;;
4305 (yes)
4306
4307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4309
4310         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4311
4312         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4313                 && test -z "${cf_tst_cflags}" \
4314                 && cf_fix_cppflags=no
4315         ;;
4316 esac
4317 done
4318
4319 if test -n "$cf_new_cflags" ; then
4320
4321         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4322         CFLAGS="${CFLAGS}$cf_new_cflags"
4323
4324 fi
4325
4326 if test -n "$cf_new_cppflags" ; then
4327
4328         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4329         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4330
4331 fi
4332
4333 if test -n "$cf_new_extra_cppflags" ; then
4334
4335         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4336         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4337
4338 fi
4339
4340 cf_add_libs="$LIBS"
4341 # reverse order
4342 cf_add_0lib=
4343 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4344 # filter duplicates
4345 for cf_add_1lib in $cf_add_0lib; do
4346         for cf_add_2lib in $cf_add_libs; do
4347                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4348                         cf_add_1lib=
4349                         break
4350                 fi
4351         done
4352         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4353 done
4354 LIBS="$cf_add_libs"
4355
4356                         cat >conftest.$ac_ext <<_ACEOF
4357 #line 4357 "configure"
4358 #include "confdefs.h"
4359 #include <${cf_cv_ncurses_header:-curses.h}>
4360 int
4361 main (void)
4362 {
4363 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4364   ;
4365   return 0;
4366 }
4367 _ACEOF
4368 rm -f conftest.$ac_objext conftest$ac_exeext
4369 if { (eval echo "$as_me:4369: \"$ac_link\"") >&5
4370   (eval $ac_link) 2>&5
4371   ac_status=$?
4372   echo "$as_me:4372: \$? = $ac_status" >&5
4373   (exit $ac_status); } &&
4374          { ac_try='test -s conftest$ac_exeext'
4375   { (eval echo "$as_me:4375: \"$ac_try\"") >&5
4376   (eval $ac_try) 2>&5
4377   ac_status=$?
4378   echo "$as_me:4378: \$? = $ac_status" >&5
4379   (exit $ac_status); }; }; then
4380   if test "$cross_compiling" = yes; then
4381   cf_test_ncuconfig=maybe
4382 else
4383   cat >conftest.$ac_ext <<_ACEOF
4384 #line 4384 "configure"
4385 #include "confdefs.h"
4386 #include <${cf_cv_ncurses_header:-curses.h}>
4387                                         int main(void)
4388                                         { char *xx = curses_version(); return (xx == 0); }
4389 _ACEOF
4390 rm -f conftest$ac_exeext
4391 if { (eval echo "$as_me:4391: \"$ac_link\"") >&5
4392   (eval $ac_link) 2>&5
4393   ac_status=$?
4394   echo "$as_me:4394: \$? = $ac_status" >&5
4395   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4396   { (eval echo "$as_me:4396: \"$ac_try\"") >&5
4397   (eval $ac_try) 2>&5
4398   ac_status=$?
4399   echo "$as_me:4399: \$? = $ac_status" >&5
4400   (exit $ac_status); }; }; then
4401   cf_test_ncuconfig=yes
4402 else
4403   echo "$as_me: program exited with status $ac_status" >&5
4404 echo "$as_me: failed program was:" >&5
4405 cat conftest.$ac_ext >&5
4406 cf_test_ncuconfig=no
4407 fi
4408 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4409 fi
4410 else
4411   echo "$as_me: failed program was:" >&5
4412 cat conftest.$ac_ext >&5
4413 cf_test_ncuconfig=no
4414 fi
4415 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4416
4417                         CFLAGS="$cf_save_CFLAGS"
4418                         CPPFLAGS="$cf_save_CPPFLAGS"
4419                         LIBS="$cf_save_LIBS"
4420
4421                         if test "x$cf_test_ncuconfig" != xyes; then
4422                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4423                                 cf_pkg_cflags="$cf_temp"
4424                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4425                                 cf_pkg_libs="$cf_temp"
4426                         fi
4427                         ;;
4428                 esac
4429
4430 cf_fix_cppflags=no
4431 cf_new_cflags=
4432 cf_new_cppflags=
4433 cf_new_extra_cppflags=
4434
4435 for cf_add_cflags in $cf_pkg_cflags
4436 do
4437 case $cf_fix_cppflags in
4438 (no)
4439         case $cf_add_cflags in
4440         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4441                 case $cf_add_cflags in
4442                 (-D*)
4443                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4444
4445                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4446                                 && test -z "${cf_tst_cflags}" \
4447                                 && cf_fix_cppflags=yes
4448
4449                         if test $cf_fix_cppflags = yes ; then
4450
4451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4453
4454                                 continue
4455                         elif test "${cf_tst_cflags}" = "\"'" ; then
4456
4457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4459
4460                                 continue
4461                         fi
4462                         ;;
4463                 esac
4464                 case "$CPPFLAGS" in
4465                 (*$cf_add_cflags)
4466                         ;;
4467                 (*)
4468                         case $cf_add_cflags in
4469                         (-D*)
4470                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4471
4472 CPPFLAGS=`echo "$CPPFLAGS" | \
4473         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4474                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4475
4476                                 ;;
4477                         esac
4478
4479         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4480         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4481
4482                         ;;
4483                 esac
4484                 ;;
4485         (*)
4486
4487         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4488         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4489
4490                 ;;
4491         esac
4492         ;;
4493 (yes)
4494
4495         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4496         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4497
4498         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4499
4500         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4501                 && test -z "${cf_tst_cflags}" \
4502                 && cf_fix_cppflags=no
4503         ;;
4504 esac
4505 done
4506
4507 if test -n "$cf_new_cflags" ; then
4508
4509         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4510         CFLAGS="${CFLAGS}$cf_new_cflags"
4511
4512 fi
4513
4514 if test -n "$cf_new_cppflags" ; then
4515
4516         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4517         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4518
4519 fi
4520
4521 if test -n "$cf_new_extra_cppflags" ; then
4522
4523         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4524         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4525
4526 fi
4527
4528 cf_add_libs="$LIBS"
4529 # reverse order
4530 cf_add_0lib=
4531 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4532 # filter duplicates
4533 for cf_add_1lib in $cf_add_0lib; do
4534         for cf_add_2lib in $cf_add_libs; do
4535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4536                         cf_add_1lib=
4537                         break
4538                 fi
4539         done
4540         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4541 done
4542 LIBS="$cf_add_libs"
4543
4544                 cat >conftest.$ac_ext <<_ACEOF
4545 #line 4545 "configure"
4546 #include "confdefs.h"
4547 #include <${cf_cv_ncurses_header:-curses.h}>
4548 int
4549 main (void)
4550 {
4551 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4552   ;
4553   return 0;
4554 }
4555 _ACEOF
4556 rm -f conftest.$ac_objext conftest$ac_exeext
4557 if { (eval echo "$as_me:4557: \"$ac_link\"") >&5
4558   (eval $ac_link) 2>&5
4559   ac_status=$?
4560   echo "$as_me:4560: \$? = $ac_status" >&5
4561   (exit $ac_status); } &&
4562          { ac_try='test -s conftest$ac_exeext'
4563   { (eval echo "$as_me:4563: \"$ac_try\"") >&5
4564   (eval $ac_try) 2>&5
4565   ac_status=$?
4566   echo "$as_me:4566: \$? = $ac_status" >&5
4567   (exit $ac_status); }; }; then
4568   if test "$cross_compiling" = yes; then
4569   cf_have_ncuconfig=maybe
4570 else
4571   cat >conftest.$ac_ext <<_ACEOF
4572 #line 4572 "configure"
4573 #include "confdefs.h"
4574 #include <${cf_cv_ncurses_header:-curses.h}>
4575                                 int main(void)
4576                                 { char *xx = curses_version(); return (xx == 0); }
4577 _ACEOF
4578 rm -f conftest$ac_exeext
4579 if { (eval echo "$as_me:4579: \"$ac_link\"") >&5
4580   (eval $ac_link) 2>&5
4581   ac_status=$?
4582   echo "$as_me:4582: \$? = $ac_status" >&5
4583   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4584   { (eval echo "$as_me:4584: \"$ac_try\"") >&5
4585   (eval $ac_try) 2>&5
4586   ac_status=$?
4587   echo "$as_me:4587: \$? = $ac_status" >&5
4588   (exit $ac_status); }; }; then
4589   cf_have_ncuconfig=yes
4590 else
4591   echo "$as_me: program exited with status $ac_status" >&5
4592 echo "$as_me: failed program was:" >&5
4593 cat conftest.$ac_ext >&5
4594 cf_have_ncuconfig=no
4595 fi
4596 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4597 fi
4598 else
4599   echo "$as_me: failed program was:" >&5
4600 cat conftest.$ac_ext >&5
4601 cf_have_ncuconfig=no
4602 fi
4603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4604                 echo "$as_me:4604: result: $cf_have_ncuconfig" >&5
4605 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4606                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4607                 if test "$cf_have_ncuconfig" != "yes"
4608                 then
4609                         CPPFLAGS="$cf_save_CPPFLAGS"
4610                         LIBS="$cf_save_LIBS"
4611                         NCURSES_CONFIG_PKG=none
4612                 else
4613
4614 cat >>confdefs.h <<\EOF
4615 #define NCURSES 1
4616 EOF
4617
4618                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4619
4620 echo "$as_me:4620: checking for terminfo header" >&5
4621 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4622 if test "${cf_cv_term_header+set}" = set; then
4623   echo $ECHO_N "(cached) $ECHO_C" >&6
4624 else
4625
4626 case ${cf_cv_ncurses_header} in
4627 (*/ncurses.h|*/ncursesw.h)
4628         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4629         ;;
4630 (*)
4631         cf_term_header=term.h
4632         ;;
4633 esac
4634
4635 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4636 do
4637 cat >conftest.$ac_ext <<_ACEOF
4638 #line 4638 "configure"
4639 #include "confdefs.h"
4640 #include <stdio.h>
4641 #include <${cf_cv_ncurses_header:-curses.h}>
4642 #include <$cf_test>
4643
4644 int
4645 main (void)
4646 {
4647 int x = auto_left_margin; (void)x
4648   ;
4649   return 0;
4650 }
4651 _ACEOF
4652 rm -f conftest.$ac_objext
4653 if { (eval echo "$as_me:4653: \"$ac_compile\"") >&5
4654   (eval $ac_compile) 2>&5
4655   ac_status=$?
4656   echo "$as_me:4656: \$? = $ac_status" >&5
4657   (exit $ac_status); } &&
4658          { ac_try='test -s conftest.$ac_objext'
4659   { (eval echo "$as_me:4659: \"$ac_try\"") >&5
4660   (eval $ac_try) 2>&5
4661   ac_status=$?
4662   echo "$as_me:4662: \$? = $ac_status" >&5
4663   (exit $ac_status); }; }; then
4664
4665         cf_cv_term_header="$cf_test"
4666 else
4667   echo "$as_me: failed program was:" >&5
4668 cat conftest.$ac_ext >&5
4669
4670         cf_cv_term_header=unknown
4671
4672 fi
4673 rm -f conftest.$ac_objext conftest.$ac_ext
4674         test "$cf_cv_term_header" != unknown && break
4675 done
4676
4677 fi
4678 echo "$as_me:4678: result: $cf_cv_term_header" >&5
4679 echo "${ECHO_T}$cf_cv_term_header" >&6
4680
4681 # Set definitions to allow ifdef'ing to accommodate subdirectories
4682
4683 case $cf_cv_term_header in
4684 (*term.h)
4685
4686 cat >>confdefs.h <<\EOF
4687 #define HAVE_TERM_H 1
4688 EOF
4689
4690         ;;
4691 esac
4692
4693 case $cf_cv_term_header in
4694 (ncurses/term.h)
4695
4696 cat >>confdefs.h <<\EOF
4697 #define HAVE_NCURSES_TERM_H 1
4698 EOF
4699
4700         ;;
4701 (ncursesw/term.h)
4702
4703 cat >>confdefs.h <<\EOF
4704 #define HAVE_NCURSESW_TERM_H 1
4705 EOF
4706
4707         ;;
4708 esac
4709
4710                 fi
4711
4712         else
4713                 echo "$as_me:4713: result: no" >&5
4714 echo "${ECHO_T}no" >&6
4715                 NCURSES_CONFIG_PKG=none
4716         fi
4717 else
4718         NCURSES_CONFIG_PKG=none
4719 fi
4720
4721 if test "x$cf_have_ncuconfig" = "xno"; then
4722         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4723
4724 if test -n "$ac_tool_prefix"; then
4725   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4726   do
4727     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4728 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4729 echo "$as_me:4729: checking for $ac_word" >&5
4730 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4731 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4732   echo $ECHO_N "(cached) $ECHO_C" >&6
4733 else
4734   if test -n "$NCURSES_CONFIG"; then
4735   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4736 else
4737   ac_save_IFS=$IFS; IFS=$ac_path_separator
4738 ac_dummy="$PATH"
4739 for ac_dir in $ac_dummy; do
4740   IFS=$ac_save_IFS
4741   test -z "$ac_dir" && ac_dir=.
4742   $as_executable_p "$ac_dir/$ac_word" || continue
4743 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4744 echo "$as_me:4744: found $ac_dir/$ac_word" >&5
4745 break
4746 done
4747
4748 fi
4749 fi
4750 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4751 if test -n "$NCURSES_CONFIG"; then
4752   echo "$as_me:4752: result: $NCURSES_CONFIG" >&5
4753 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4754 else
4755   echo "$as_me:4755: result: no" >&5
4756 echo "${ECHO_T}no" >&6
4757 fi
4758
4759     test -n "$NCURSES_CONFIG" && break
4760   done
4761 fi
4762 if test -z "$NCURSES_CONFIG"; then
4763   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4764   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4765 do
4766   # Extract the first word of "$ac_prog", so it can be a program name with args.
4767 set dummy $ac_prog; ac_word=$2
4768 echo "$as_me:4768: checking for $ac_word" >&5
4769 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4770 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4771   echo $ECHO_N "(cached) $ECHO_C" >&6
4772 else
4773   if test -n "$ac_ct_NCURSES_CONFIG"; then
4774   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4775 else
4776   ac_save_IFS=$IFS; IFS=$ac_path_separator
4777 ac_dummy="$PATH"
4778 for ac_dir in $ac_dummy; do
4779   IFS=$ac_save_IFS
4780   test -z "$ac_dir" && ac_dir=.
4781   $as_executable_p "$ac_dir/$ac_word" || continue
4782 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4783 echo "$as_me:4783: found $ac_dir/$ac_word" >&5
4784 break
4785 done
4786
4787 fi
4788 fi
4789 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4790 if test -n "$ac_ct_NCURSES_CONFIG"; then
4791   echo "$as_me:4791: result: $ac_ct_NCURSES_CONFIG" >&5
4792 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4793 else
4794   echo "$as_me:4794: result: no" >&5
4795 echo "${ECHO_T}no" >&6
4796 fi
4797
4798   test -n "$ac_ct_NCURSES_CONFIG" && break
4799 done
4800 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4801
4802   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4803 fi
4804
4805         if test "$NCURSES_CONFIG" != none ; then
4806
4807 cf_fix_cppflags=no
4808 cf_new_cflags=
4809 cf_new_cppflags=
4810 cf_new_extra_cppflags=
4811
4812 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4813 do
4814 case $cf_fix_cppflags in
4815 (no)
4816         case $cf_add_cflags in
4817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4818                 case $cf_add_cflags in
4819                 (-D*)
4820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4821
4822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4823                                 && test -z "${cf_tst_cflags}" \
4824                                 && cf_fix_cppflags=yes
4825
4826                         if test $cf_fix_cppflags = yes ; then
4827
4828         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4829         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4830
4831                                 continue
4832                         elif test "${cf_tst_cflags}" = "\"'" ; then
4833
4834         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4835         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4836
4837                                 continue
4838                         fi
4839                         ;;
4840                 esac
4841                 case "$CPPFLAGS" in
4842                 (*$cf_add_cflags)
4843                         ;;
4844                 (*)
4845                         case $cf_add_cflags in
4846                         (-D*)
4847                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4848
4849 CPPFLAGS=`echo "$CPPFLAGS" | \
4850         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4851                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4852
4853                                 ;;
4854                         esac
4855
4856         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4857         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4858
4859                         ;;
4860                 esac
4861                 ;;
4862         (*)
4863
4864         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4865         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4866
4867                 ;;
4868         esac
4869         ;;
4870 (yes)
4871
4872         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4873         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4874
4875         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4876
4877         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4878                 && test -z "${cf_tst_cflags}" \
4879                 && cf_fix_cppflags=no
4880         ;;
4881 esac
4882 done
4883
4884 if test -n "$cf_new_cflags" ; then
4885
4886         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4887         CFLAGS="${CFLAGS}$cf_new_cflags"
4888
4889 fi
4890
4891 if test -n "$cf_new_cppflags" ; then
4892
4893         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4894         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4895
4896 fi
4897
4898 if test -n "$cf_new_extra_cppflags" ; then
4899
4900         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4901         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4902
4903 fi
4904
4905 cf_add_libs="$LIBS"
4906 # reverse order
4907 cf_add_0lib=
4908 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4909 # filter duplicates
4910 for cf_add_1lib in $cf_add_0lib; do
4911         for cf_add_2lib in $cf_add_libs; do
4912                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4913                         cf_add_1lib=
4914                         break
4915                 fi
4916         done
4917         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4918 done
4919 LIBS="$cf_add_libs"
4920
4921                 # even with config script, some packages use no-override for curses.h
4922
4923 echo "$as_me:4923: checking if we have identified curses headers" >&5
4924 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4925 if test "${cf_cv_ncurses_header+set}" = set; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928
4929 cf_cv_ncurses_header=none
4930 for cf_header in \
4931         ncurses.h ncurses/ncurses.h \
4932         curses.h ncurses/curses.h
4933 do
4934 cat >conftest.$ac_ext <<_ACEOF
4935 #line 4935 "configure"
4936 #include "confdefs.h"
4937 #include <${cf_header}>
4938 int
4939 main (void)
4940 {
4941 initscr(); tgoto("?", 0,0)
4942   ;
4943   return 0;
4944 }
4945 _ACEOF
4946 rm -f conftest.$ac_objext
4947 if { (eval echo "$as_me:4947: \"$ac_compile\"") >&5
4948   (eval $ac_compile) 2>&5
4949   ac_status=$?
4950   echo "$as_me:4950: \$? = $ac_status" >&5
4951   (exit $ac_status); } &&
4952          { ac_try='test -s conftest.$ac_objext'
4953   { (eval echo "$as_me:4953: \"$ac_try\"") >&5
4954   (eval $ac_try) 2>&5
4955   ac_status=$?
4956   echo "$as_me:4956: \$? = $ac_status" >&5
4957   (exit $ac_status); }; }; then
4958   cf_cv_ncurses_header=$cf_header; break
4959 else
4960   echo "$as_me: failed program was:" >&5
4961 cat conftest.$ac_ext >&5
4962 fi
4963 rm -f conftest.$ac_objext conftest.$ac_ext
4964 done
4965
4966 fi
4967 echo "$as_me:4967: result: $cf_cv_ncurses_header" >&5
4968 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4969
4970 if test "$cf_cv_ncurses_header" = none ; then
4971         { { echo "$as_me:4971: error: No curses header-files found" >&5
4972 echo "$as_me: error: No curses header-files found" >&2;}
4973    { (exit 1); exit 1; }; }
4974 fi
4975
4976 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4977
4978 for ac_header in $cf_cv_ncurses_header
4979 do
4980 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4981 echo "$as_me:4981: checking for $ac_header" >&5
4982 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4983 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4984   echo $ECHO_N "(cached) $ECHO_C" >&6
4985 else
4986   cat >conftest.$ac_ext <<_ACEOF
4987 #line 4987 "configure"
4988 #include "confdefs.h"
4989 #include <$ac_header>
4990 _ACEOF
4991 if { (eval echo "$as_me:4991: \"$ac_cpp conftest.$ac_ext\"") >&5
4992   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4993   ac_status=$?
4994   egrep -v '^ *\+' conftest.er1 >conftest.err
4995   rm -f conftest.er1
4996   cat conftest.err >&5
4997   echo "$as_me:4997: \$? = $ac_status" >&5
4998   (exit $ac_status); } >/dev/null; then
4999   if test -s conftest.err; then
5000     ac_cpp_err=$ac_c_preproc_warn_flag
5001   else
5002     ac_cpp_err=
5003   fi
5004 else
5005   ac_cpp_err=yes
5006 fi
5007 if test -z "$ac_cpp_err"; then
5008   eval "$as_ac_Header=yes"
5009 else
5010   echo "$as_me: failed program was:" >&5
5011   cat conftest.$ac_ext >&5
5012   eval "$as_ac_Header=no"
5013 fi
5014 rm -f conftest.err conftest.$ac_ext
5015 fi
5016 echo "$as_me:5016: result: `eval echo '${'$as_ac_Header'}'`" >&5
5017 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5018 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5019   cat >>confdefs.h <<EOF
5020 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5021 EOF
5022
5023 fi
5024 done
5025
5026 cat >>confdefs.h <<\EOF
5027 #define NCURSES 1
5028 EOF
5029
5030 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5031
5032                 cat >>confdefs.h <<EOF
5033 #define $cf_nculib_ROOT 1
5034 EOF
5035
5036                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5037
5038         else
5039
5040 cf_ncuhdr_root=ncurses
5041
5042 test -n "$cf_cv_curses_dir" && \
5043 test "$cf_cv_curses_dir" != "no" && { \
5044
5045 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5046   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5047   do
5048         while test $cf_add_incdir != /usr/include
5049         do
5050           if test -d $cf_add_incdir
5051           then
5052                 cf_have_incdir=no
5053                 if test -n "$CFLAGS$CPPFLAGS" ; then
5054                   # a loop is needed to ensure we can add subdirs of existing dirs
5055                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5056                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5057                           cf_have_incdir=yes; break
5058                         fi
5059                   done
5060                 fi
5061
5062                 if test "$cf_have_incdir" = no ; then
5063                   if test "$cf_add_incdir" = /usr/local/include ; then
5064                         if test "$GCC" = yes
5065                         then
5066                           cf_save_CPPFLAGS=$CPPFLAGS
5067
5068         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5069         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5070
5071                           cat >conftest.$ac_ext <<_ACEOF
5072 #line 5072 "configure"
5073 #include "confdefs.h"
5074 #include <stdio.h>
5075 int
5076 main (void)
5077 {
5078 printf("Hello")
5079   ;
5080   return 0;
5081 }
5082 _ACEOF
5083 rm -f conftest.$ac_objext
5084 if { (eval echo "$as_me:5084: \"$ac_compile\"") >&5
5085   (eval $ac_compile) 2>&5
5086   ac_status=$?
5087   echo "$as_me:5087: \$? = $ac_status" >&5
5088   (exit $ac_status); } &&
5089          { ac_try='test -s conftest.$ac_objext'
5090   { (eval echo "$as_me:5090: \"$ac_try\"") >&5
5091   (eval $ac_try) 2>&5
5092   ac_status=$?
5093   echo "$as_me:5093: \$? = $ac_status" >&5
5094   (exit $ac_status); }; }; then
5095   :
5096 else
5097   echo "$as_me: failed program was:" >&5
5098 cat conftest.$ac_ext >&5
5099 cf_have_incdir=yes
5100 fi
5101 rm -f conftest.$ac_objext conftest.$ac_ext
5102                           CPPFLAGS=$cf_save_CPPFLAGS
5103                         fi
5104                   fi
5105                 fi
5106
5107                 if test "$cf_have_incdir" = no ; then
5108                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5109
5110 echo "${as_me:-configure}:5110: testing adding $cf_add_incdir to include-path ..." 1>&5
5111
5112                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5113
5114                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5115                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5116                   cf_add_incdir="$cf_top_incdir"
5117                 else
5118                   break
5119                 fi
5120           else
5121                 break
5122           fi
5123         done
5124   done
5125 fi
5126
5127 }
5128
5129 echo "$as_me:5129: checking for $cf_ncuhdr_root header in include-path" >&5
5130 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5131 if test "${cf_cv_ncurses_h+set}" = set; then
5132   echo $ECHO_N "(cached) $ECHO_C" >&6
5133 else
5134
5135         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5136         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5137         for cf_header in $cf_header_list
5138         do
5139
5140         cat >conftest.$ac_ext <<_ACEOF
5141 #line 5141 "configure"
5142 #include "confdefs.h"
5143
5144 #include <$cf_header>
5145 int
5146 main (void)
5147 {
5148
5149 #ifdef NCURSES_VERSION
5150
5151 printf("%s\n", NCURSES_VERSION);
5152 #else
5153 #ifdef __NCURSES_H
5154 printf("old\n");
5155 #else
5156         make an error
5157 #endif
5158 #endif
5159
5160   ;
5161   return 0;
5162 }
5163 _ACEOF
5164 rm -f conftest.$ac_objext
5165 if { (eval echo "$as_me:5165: \"$ac_compile\"") >&5
5166   (eval $ac_compile) 2>&5
5167   ac_status=$?
5168   echo "$as_me:5168: \$? = $ac_status" >&5
5169   (exit $ac_status); } &&
5170          { ac_try='test -s conftest.$ac_objext'
5171   { (eval echo "$as_me:5171: \"$ac_try\"") >&5
5172   (eval $ac_try) 2>&5
5173   ac_status=$?
5174   echo "$as_me:5174: \$? = $ac_status" >&5
5175   (exit $ac_status); }; }; then
5176   cf_cv_ncurses_h=$cf_header
5177
5178 else
5179   echo "$as_me: failed program was:" >&5
5180 cat conftest.$ac_ext >&5
5181 cf_cv_ncurses_h=no
5182 fi
5183 rm -f conftest.$ac_objext conftest.$ac_ext
5184
5185                 test "$cf_cv_ncurses_h" != no && break
5186         done
5187
5188 fi
5189 echo "$as_me:5189: result: $cf_cv_ncurses_h" >&5
5190 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5191
5192 if test "$cf_cv_ncurses_h" != no ; then
5193         cf_cv_ncurses_header=$cf_cv_ncurses_h
5194 else
5195
5196 echo "$as_me:5196: checking for $cf_ncuhdr_root include-path" >&5
5197 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5198 if test "${cf_cv_ncurses_h2+set}" = set; then
5199   echo $ECHO_N "(cached) $ECHO_C" >&6
5200 else
5201
5202         test -n "$verbose" && echo
5203
5204 cf_search=
5205
5206 # collect the current set of include-directories from compiler flags
5207 cf_header_path_list=""
5208 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5209         for cf_header_path in $CPPFLAGS $CFLAGS
5210         do
5211                 case $cf_header_path in
5212                 (-I*)
5213                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5214
5215 test "x$cf_header_path" != "xNONE" && \
5216 test -d "$cf_header_path" && \
5217  {
5218         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5219         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5220         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5221         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5222         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5223         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"
5224 }
5225
5226                         cf_header_path_list="$cf_header_path_list $cf_search"
5227                         ;;
5228                 esac
5229         done
5230 fi
5231
5232 # add the variations for the package we are looking for
5233
5234 cf_search=
5235
5236 test "x$prefix" != "xNONE" && \
5237 test -d "$prefix" && \
5238  {
5239         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5240         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5241         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5242         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5243         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5244         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5245 }
5246
5247 for cf_subdir_prefix in \
5248         /usr \
5249         /usr/local \
5250         /usr/pkg \
5251         /opt \
5252         /opt/local \
5253         $HOME
5254 do
5255
5256 test "x$cf_subdir_prefix" != "x$prefix" && \
5257 test -d "$cf_subdir_prefix" && \
5258 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5259         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5260         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5261         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5262         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5263         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5264         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"
5265 }
5266
5267 done
5268
5269 test "$includedir" != NONE && \
5270 test "$includedir" != "/usr/include" && \
5271 test -d "$includedir" && {
5272         test -d $includedir &&    cf_search="$cf_search $includedir"
5273         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5274 }
5275
5276 test "$oldincludedir" != NONE && \
5277 test "$oldincludedir" != "/usr/include" && \
5278 test -d "$oldincludedir" && {
5279         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5280         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5281 }
5282
5283 cf_search="$cf_search $cf_header_path_list"
5284
5285         test -n "$verbose" && echo search path $cf_search
5286         cf_save2_CPPFLAGS="$CPPFLAGS"
5287         for cf_incdir in $cf_search
5288         do
5289
5290 if test -n "$cf_incdir" ; then
5291   for cf_add_incdir in $cf_incdir
5292   do
5293         while test $cf_add_incdir != /usr/include
5294         do
5295           if test -d $cf_add_incdir
5296           then
5297                 cf_have_incdir=no
5298                 if test -n "$CFLAGS$CPPFLAGS" ; then
5299                   # a loop is needed to ensure we can add subdirs of existing dirs
5300                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5301                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5302                           cf_have_incdir=yes; break
5303                         fi
5304                   done
5305                 fi
5306
5307                 if test "$cf_have_incdir" = no ; then
5308                   if test "$cf_add_incdir" = /usr/local/include ; then
5309                         if test "$GCC" = yes
5310                         then
5311                           cf_save_CPPFLAGS=$CPPFLAGS
5312
5313         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5314         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5315
5316                           cat >conftest.$ac_ext <<_ACEOF
5317 #line 5317 "configure"
5318 #include "confdefs.h"
5319 #include <stdio.h>
5320 int
5321 main (void)
5322 {
5323 printf("Hello")
5324   ;
5325   return 0;
5326 }
5327 _ACEOF
5328 rm -f conftest.$ac_objext
5329 if { (eval echo "$as_me:5329: \"$ac_compile\"") >&5
5330   (eval $ac_compile) 2>&5
5331   ac_status=$?
5332   echo "$as_me:5332: \$? = $ac_status" >&5
5333   (exit $ac_status); } &&
5334          { ac_try='test -s conftest.$ac_objext'
5335   { (eval echo "$as_me:5335: \"$ac_try\"") >&5
5336   (eval $ac_try) 2>&5
5337   ac_status=$?
5338   echo "$as_me:5338: \$? = $ac_status" >&5
5339   (exit $ac_status); }; }; then
5340   :
5341 else
5342   echo "$as_me: failed program was:" >&5
5343 cat conftest.$ac_ext >&5
5344 cf_have_incdir=yes
5345 fi
5346 rm -f conftest.$ac_objext conftest.$ac_ext
5347                           CPPFLAGS=$cf_save_CPPFLAGS
5348                         fi
5349                   fi
5350                 fi
5351
5352                 if test "$cf_have_incdir" = no ; then
5353                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5354
5355 echo "${as_me:-configure}:5355: testing adding $cf_add_incdir to include-path ..." 1>&5
5356
5357                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5358
5359                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5360                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5361                   cf_add_incdir="$cf_top_incdir"
5362                 else
5363                   break
5364                 fi
5365           else
5366                 break
5367           fi
5368         done
5369   done
5370 fi
5371
5372                 for cf_header in \
5373                         ncurses.h \
5374                         curses.h
5375                 do
5376
5377         cat >conftest.$ac_ext <<_ACEOF
5378 #line 5378 "configure"
5379 #include "confdefs.h"
5380
5381 #include <$cf_header>
5382 int
5383 main (void)
5384 {
5385
5386 #ifdef NCURSES_VERSION
5387
5388 printf("%s\n", NCURSES_VERSION);
5389 #else
5390 #ifdef __NCURSES_H
5391 printf("old\n");
5392 #else
5393         make an error
5394 #endif
5395 #endif
5396
5397   ;
5398   return 0;
5399 }
5400 _ACEOF
5401 rm -f conftest.$ac_objext
5402 if { (eval echo "$as_me:5402: \"$ac_compile\"") >&5
5403   (eval $ac_compile) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit $ac_status); } &&
5407          { ac_try='test -s conftest.$ac_objext'
5408   { (eval echo "$as_me:5408: \"$ac_try\"") >&5
5409   (eval $ac_try) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); }; }; then
5413   cf_cv_ncurses_h2=$cf_header
5414
5415 else
5416   echo "$as_me: failed program was:" >&5
5417 cat conftest.$ac_ext >&5
5418 cf_cv_ncurses_h2=no
5419 fi
5420 rm -f conftest.$ac_objext conftest.$ac_ext
5421
5422                         if test "$cf_cv_ncurses_h2" != no ; then
5423                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5424                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5425                                 break
5426                         fi
5427                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5428                 done
5429                 CPPFLAGS="$cf_save2_CPPFLAGS"
5430                 test "$cf_cv_ncurses_h2" != no && break
5431         done
5432         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5432: error: not found" >&5
5433 echo "$as_me: error: not found" >&2;}
5434    { (exit 1); exit 1; }; }
5435
5436 fi
5437 echo "$as_me:5437: result: $cf_cv_ncurses_h2" >&5
5438 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5439
5440         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5441         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5442         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5443                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5444         fi
5445
5446 if test -n "$cf_1st_incdir" ; then
5447   for cf_add_incdir in $cf_1st_incdir
5448   do
5449         while test $cf_add_incdir != /usr/include
5450         do
5451           if test -d $cf_add_incdir
5452           then
5453                 cf_have_incdir=no
5454                 if test -n "$CFLAGS$CPPFLAGS" ; then
5455                   # a loop is needed to ensure we can add subdirs of existing dirs
5456                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5457                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5458                           cf_have_incdir=yes; break
5459                         fi
5460                   done
5461                 fi
5462
5463                 if test "$cf_have_incdir" = no ; then
5464                   if test "$cf_add_incdir" = /usr/local/include ; then
5465                         if test "$GCC" = yes
5466                         then
5467                           cf_save_CPPFLAGS=$CPPFLAGS
5468
5469         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5470         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5471
5472                           cat >conftest.$ac_ext <<_ACEOF
5473 #line 5473 "configure"
5474 #include "confdefs.h"
5475 #include <stdio.h>
5476 int
5477 main (void)
5478 {
5479 printf("Hello")
5480   ;
5481   return 0;
5482 }
5483 _ACEOF
5484 rm -f conftest.$ac_objext
5485 if { (eval echo "$as_me:5485: \"$ac_compile\"") >&5
5486   (eval $ac_compile) 2>&5
5487   ac_status=$?
5488   echo "$as_me:5488: \$? = $ac_status" >&5
5489   (exit $ac_status); } &&
5490          { ac_try='test -s conftest.$ac_objext'
5491   { (eval echo "$as_me:5491: \"$ac_try\"") >&5
5492   (eval $ac_try) 2>&5
5493   ac_status=$?
5494   echo "$as_me:5494: \$? = $ac_status" >&5
5495   (exit $ac_status); }; }; then
5496   :
5497 else
5498   echo "$as_me: failed program was:" >&5
5499 cat conftest.$ac_ext >&5
5500 cf_have_incdir=yes
5501 fi
5502 rm -f conftest.$ac_objext conftest.$ac_ext
5503                           CPPFLAGS=$cf_save_CPPFLAGS
5504                         fi
5505                   fi
5506                 fi
5507
5508                 if test "$cf_have_incdir" = no ; then
5509                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5510
5511 echo "${as_me:-configure}:5511: testing adding $cf_add_incdir to include-path ..." 1>&5
5512
5513                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5514
5515                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5516                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5517                   cf_add_incdir="$cf_top_incdir"
5518                 else
5519                   break
5520                 fi
5521           else
5522                 break
5523           fi
5524         done
5525   done
5526 fi
5527
5528 fi
5529
5530 # Set definitions to allow ifdef'ing for ncurses.h
5531
5532 case $cf_cv_ncurses_header in
5533 (*ncurses.h)
5534
5535 cat >>confdefs.h <<\EOF
5536 #define HAVE_NCURSES_H 1
5537 EOF
5538
5539         ;;
5540 esac
5541
5542 case $cf_cv_ncurses_header in
5543 (ncurses/curses.h|ncurses/ncurses.h)
5544
5545 cat >>confdefs.h <<\EOF
5546 #define HAVE_NCURSES_NCURSES_H 1
5547 EOF
5548
5549         ;;
5550 (ncursesw/curses.h|ncursesw/ncurses.h)
5551
5552 cat >>confdefs.h <<\EOF
5553 #define HAVE_NCURSESW_NCURSES_H 1
5554 EOF
5555
5556         ;;
5557 esac
5558
5559 echo "$as_me:5559: checking for terminfo header" >&5
5560 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5561 if test "${cf_cv_term_header+set}" = set; then
5562   echo $ECHO_N "(cached) $ECHO_C" >&6
5563 else
5564
5565 case ${cf_cv_ncurses_header} in
5566 (*/ncurses.h|*/ncursesw.h)
5567         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5568         ;;
5569 (*)
5570         cf_term_header=term.h
5571         ;;
5572 esac
5573
5574 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5575 do
5576 cat >conftest.$ac_ext <<_ACEOF
5577 #line 5577 "configure"
5578 #include "confdefs.h"
5579 #include <stdio.h>
5580 #include <${cf_cv_ncurses_header:-curses.h}>
5581 #include <$cf_test>
5582
5583 int
5584 main (void)
5585 {
5586 int x = auto_left_margin; (void)x
5587   ;
5588   return 0;
5589 }
5590 _ACEOF
5591 rm -f conftest.$ac_objext
5592 if { (eval echo "$as_me:5592: \"$ac_compile\"") >&5
5593   (eval $ac_compile) 2>&5
5594   ac_status=$?
5595   echo "$as_me:5595: \$? = $ac_status" >&5
5596   (exit $ac_status); } &&
5597          { ac_try='test -s conftest.$ac_objext'
5598   { (eval echo "$as_me:5598: \"$ac_try\"") >&5
5599   (eval $ac_try) 2>&5
5600   ac_status=$?
5601   echo "$as_me:5601: \$? = $ac_status" >&5
5602   (exit $ac_status); }; }; then
5603
5604         cf_cv_term_header="$cf_test"
5605 else
5606   echo "$as_me: failed program was:" >&5
5607 cat conftest.$ac_ext >&5
5608
5609         cf_cv_term_header=unknown
5610
5611 fi
5612 rm -f conftest.$ac_objext conftest.$ac_ext
5613         test "$cf_cv_term_header" != unknown && break
5614 done
5615
5616 fi
5617 echo "$as_me:5617: result: $cf_cv_term_header" >&5
5618 echo "${ECHO_T}$cf_cv_term_header" >&6
5619
5620 # Set definitions to allow ifdef'ing to accommodate subdirectories
5621
5622 case $cf_cv_term_header in
5623 (*term.h)
5624
5625 cat >>confdefs.h <<\EOF
5626 #define HAVE_TERM_H 1
5627 EOF
5628
5629         ;;
5630 esac
5631
5632 case $cf_cv_term_header in
5633 (ncurses/term.h)
5634
5635 cat >>confdefs.h <<\EOF
5636 #define HAVE_NCURSES_TERM_H 1
5637 EOF
5638
5639         ;;
5640 (ncursesw/term.h)
5641
5642 cat >>confdefs.h <<\EOF
5643 #define HAVE_NCURSESW_TERM_H 1
5644 EOF
5645
5646         ;;
5647 esac
5648
5649 # some applications need this, but should check for NCURSES_VERSION
5650
5651 cat >>confdefs.h <<\EOF
5652 #define NCURSES 1
5653 EOF
5654
5655 echo "$as_me:5655: checking for ncurses version" >&5
5656 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5657 if test "${cf_cv_ncurses_version+set}" = set; then
5658   echo $ECHO_N "(cached) $ECHO_C" >&6
5659 else
5660
5661         cf_cv_ncurses_version=no
5662         cf_tempfile=out$$
5663         rm -f $cf_tempfile
5664         if test "$cross_compiling" = yes; then
5665
5666         # This will not work if the preprocessor splits the line after the
5667         # Autoconf token.  The 'unproto' program does that.
5668         cat > conftest.$ac_ext <<EOF
5669 #include <${cf_cv_ncurses_header:-curses.h}>
5670 #undef Autoconf
5671 #ifdef NCURSES_VERSION
5672 Autoconf NCURSES_VERSION
5673 #else
5674 #ifdef __NCURSES_H
5675 Autoconf "old"
5676 #endif
5677 ;
5678 #endif
5679 EOF
5680         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5681         { (eval echo "$as_me:5681: \"$cf_try\"") >&5
5682   (eval $cf_try) 2>&5
5683   ac_status=$?
5684   echo "$as_me:5684: \$? = $ac_status" >&5
5685   (exit $ac_status); }
5686         if test -f conftest.out ; then
5687                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5688                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5689                 rm -f conftest.out
5690         fi
5691
5692 else
5693   cat >conftest.$ac_ext <<_ACEOF
5694 #line 5694 "configure"
5695 #include "confdefs.h"
5696
5697 #include <${cf_cv_ncurses_header:-curses.h}>
5698 #include <stdio.h>
5699 int main(void)
5700 {
5701         FILE *fp = fopen("$cf_tempfile", "w");
5702 #ifdef NCURSES_VERSION
5703 # ifdef NCURSES_VERSION_PATCH
5704         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5705 # else
5706         fprintf(fp, "%s\n", NCURSES_VERSION);
5707 # endif
5708 #else
5709 # ifdef __NCURSES_H
5710         fprintf(fp, "old\n");
5711 # else
5712         make an error
5713 # endif
5714 #endif
5715         ${cf_cv_main_return:-return}(0);
5716 }
5717 _ACEOF
5718 rm -f conftest$ac_exeext
5719 if { (eval echo "$as_me:5719: \"$ac_link\"") >&5
5720   (eval $ac_link) 2>&5
5721   ac_status=$?
5722   echo "$as_me:5722: \$? = $ac_status" >&5
5723   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5724   { (eval echo "$as_me:5724: \"$ac_try\"") >&5
5725   (eval $ac_try) 2>&5
5726   ac_status=$?
5727   echo "$as_me:5727: \$? = $ac_status" >&5
5728   (exit $ac_status); }; }; then
5729
5730         cf_cv_ncurses_version=`cat $cf_tempfile`
5731 else
5732   echo "$as_me: program exited with status $ac_status" >&5
5733 echo "$as_me: failed program was:" >&5
5734 cat conftest.$ac_ext >&5
5735 fi
5736 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5737 fi
5738         rm -f $cf_tempfile
5739
5740 fi
5741 echo "$as_me:5741: result: $cf_cv_ncurses_version" >&5
5742 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5743 test "$cf_cv_ncurses_version" = no ||
5744 cat >>confdefs.h <<\EOF
5745 #define NCURSES 1
5746 EOF
5747
5748 cf_nculib_root=ncurses
5749         # This works, except for the special case where we find gpm, but
5750         # ncurses is in a nonstandard location via $LIBS, and we really want
5751         # to link gpm.
5752 cf_ncurses_LIBS=""
5753 cf_ncurses_SAVE="$LIBS"
5754 echo "$as_me:5754: checking for Gpm_Open in -lgpm" >&5
5755 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5756 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5757   echo $ECHO_N "(cached) $ECHO_C" >&6
5758 else
5759   ac_check_lib_save_LIBS=$LIBS
5760 LIBS="-lgpm  $LIBS"
5761 cat >conftest.$ac_ext <<_ACEOF
5762 #line 5762 "configure"
5763 #include "confdefs.h"
5764
5765 /* Override any gcc2 internal prototype to avoid an error.  */
5766 #ifdef __cplusplus
5767 extern "C"
5768 #endif
5769 /* We use char because int might match the return type of a gcc2
5770    builtin and then its argument prototype would still apply.  */
5771 char Gpm_Open ();
5772 int
5773 main (void)
5774 {
5775 Gpm_Open ();
5776   ;
5777   return 0;
5778 }
5779 _ACEOF
5780 rm -f conftest.$ac_objext conftest$ac_exeext
5781 if { (eval echo "$as_me:5781: \"$ac_link\"") >&5
5782   (eval $ac_link) 2>&5
5783   ac_status=$?
5784   echo "$as_me:5784: \$? = $ac_status" >&5
5785   (exit $ac_status); } &&
5786          { ac_try='test -s conftest$ac_exeext'
5787   { (eval echo "$as_me:5787: \"$ac_try\"") >&5
5788   (eval $ac_try) 2>&5
5789   ac_status=$?
5790   echo "$as_me:5790: \$? = $ac_status" >&5
5791   (exit $ac_status); }; }; then
5792   ac_cv_lib_gpm_Gpm_Open=yes
5793 else
5794   echo "$as_me: failed program was:" >&5
5795 cat conftest.$ac_ext >&5
5796 ac_cv_lib_gpm_Gpm_Open=no
5797 fi
5798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5799 LIBS=$ac_check_lib_save_LIBS
5800 fi
5801 echo "$as_me:5801: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5802 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5803 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5804   echo "$as_me:5804: checking for initscr in -lgpm" >&5
5805 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5806 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5807   echo $ECHO_N "(cached) $ECHO_C" >&6
5808 else
5809   ac_check_lib_save_LIBS=$LIBS
5810 LIBS="-lgpm  $LIBS"
5811 cat >conftest.$ac_ext <<_ACEOF
5812 #line 5812 "configure"
5813 #include "confdefs.h"
5814
5815 /* Override any gcc2 internal prototype to avoid an error.  */
5816 #ifdef __cplusplus
5817 extern "C"
5818 #endif
5819 /* We use char because int might match the return type of a gcc2
5820    builtin and then its argument prototype would still apply.  */
5821 char initscr ();
5822 int
5823 main (void)
5824 {
5825 initscr ();
5826   ;
5827   return 0;
5828 }
5829 _ACEOF
5830 rm -f conftest.$ac_objext conftest$ac_exeext
5831 if { (eval echo "$as_me:5831: \"$ac_link\"") >&5
5832   (eval $ac_link) 2>&5
5833   ac_status=$?
5834   echo "$as_me:5834: \$? = $ac_status" >&5
5835   (exit $ac_status); } &&
5836          { ac_try='test -s conftest$ac_exeext'
5837   { (eval echo "$as_me:5837: \"$ac_try\"") >&5
5838   (eval $ac_try) 2>&5
5839   ac_status=$?
5840   echo "$as_me:5840: \$? = $ac_status" >&5
5841   (exit $ac_status); }; }; then
5842   ac_cv_lib_gpm_initscr=yes
5843 else
5844   echo "$as_me: failed program was:" >&5
5845 cat conftest.$ac_ext >&5
5846 ac_cv_lib_gpm_initscr=no
5847 fi
5848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5849 LIBS=$ac_check_lib_save_LIBS
5850 fi
5851 echo "$as_me:5851: result: $ac_cv_lib_gpm_initscr" >&5
5852 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5853 if test $ac_cv_lib_gpm_initscr = yes; then
5854   LIBS="$cf_ncurses_SAVE"
5855 else
5856   cf_ncurses_LIBS="-lgpm"
5857 fi
5858
5859 fi
5860
5861 case $host_os in
5862 (freebsd*)
5863         # This is only necessary if you are linking against an obsolete
5864         # version of ncurses (but it should do no harm, since it's static).
5865         if test "$cf_nculib_root" = ncurses ; then
5866                 echo "$as_me:5866: checking for tgoto in -lmytinfo" >&5
5867 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5868 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5869   echo $ECHO_N "(cached) $ECHO_C" >&6
5870 else
5871   ac_check_lib_save_LIBS=$LIBS
5872 LIBS="-lmytinfo  $LIBS"
5873 cat >conftest.$ac_ext <<_ACEOF
5874 #line 5874 "configure"
5875 #include "confdefs.h"
5876
5877 /* Override any gcc2 internal prototype to avoid an error.  */
5878 #ifdef __cplusplus
5879 extern "C"
5880 #endif
5881 /* We use char because int might match the return type of a gcc2
5882    builtin and then its argument prototype would still apply.  */
5883 char tgoto ();
5884 int
5885 main (void)
5886 {
5887 tgoto ();
5888   ;
5889   return 0;
5890 }
5891 _ACEOF
5892 rm -f conftest.$ac_objext conftest$ac_exeext
5893 if { (eval echo "$as_me:5893: \"$ac_link\"") >&5
5894   (eval $ac_link) 2>&5
5895   ac_status=$?
5896   echo "$as_me:5896: \$? = $ac_status" >&5
5897   (exit $ac_status); } &&
5898          { ac_try='test -s conftest$ac_exeext'
5899   { (eval echo "$as_me:5899: \"$ac_try\"") >&5
5900   (eval $ac_try) 2>&5
5901   ac_status=$?
5902   echo "$as_me:5902: \$? = $ac_status" >&5
5903   (exit $ac_status); }; }; then
5904   ac_cv_lib_mytinfo_tgoto=yes
5905 else
5906   echo "$as_me: failed program was:" >&5
5907 cat conftest.$ac_ext >&5
5908 ac_cv_lib_mytinfo_tgoto=no
5909 fi
5910 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5911 LIBS=$ac_check_lib_save_LIBS
5912 fi
5913 echo "$as_me:5913: result: $ac_cv_lib_mytinfo_tgoto" >&5
5914 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5915 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5916   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5917 fi
5918
5919         fi
5920         ;;
5921 esac
5922
5923 cf_add_libs="$LIBS"
5924 # reverse order
5925 cf_add_0lib=
5926 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5927 # filter duplicates
5928 for cf_add_1lib in $cf_add_0lib; do
5929         for cf_add_2lib in $cf_add_libs; do
5930                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5931                         cf_add_1lib=
5932                         break
5933                 fi
5934         done
5935         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5936 done
5937 LIBS="$cf_add_libs"
5938
5939 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5940 then
5941
5942 cf_add_libs="$LIBS"
5943 # reverse order
5944 cf_add_0lib=
5945 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5946 # filter duplicates
5947 for cf_add_1lib in $cf_add_0lib; do
5948         for cf_add_2lib in $cf_add_libs; do
5949                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5950                         cf_add_1lib=
5951                         break
5952                 fi
5953         done
5954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5955 done
5956 LIBS="$cf_add_libs"
5957
5958 else
5959
5960         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5961         cf_libdir=""
5962         echo "$as_me:5962: checking for initscr" >&5
5963 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5964 if test "${ac_cv_func_initscr+set}" = set; then
5965   echo $ECHO_N "(cached) $ECHO_C" >&6
5966 else
5967   cat >conftest.$ac_ext <<_ACEOF
5968 #line 5968 "configure"
5969 #include "confdefs.h"
5970 #define initscr autoconf_temporary
5971 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5972 #undef initscr
5973
5974 #ifdef __cplusplus
5975 extern "C"
5976 #endif
5977
5978 /* We use char because int might match the return type of a gcc2
5979    builtin and then its argument prototype would still apply.  */
5980 char initscr (void);
5981
5982 int
5983 main (void)
5984 {
5985
5986 /* The GNU C library defines stubs for functions which it implements
5987     to always fail with ENOSYS.  Some functions are actually named
5988     something starting with __ and the normal name is an alias.  */
5989 #if defined (__stub_initscr) || defined (__stub___initscr)
5990 #error found stub for initscr
5991 #endif
5992
5993         return initscr ();
5994   ;
5995   return 0;
5996 }
5997 _ACEOF
5998 rm -f conftest.$ac_objext conftest$ac_exeext
5999 if { (eval echo "$as_me:5999: \"$ac_link\"") >&5
6000   (eval $ac_link) 2>&5
6001   ac_status=$?
6002   echo "$as_me:6002: \$? = $ac_status" >&5
6003   (exit $ac_status); } &&
6004          { ac_try='test -s conftest$ac_exeext'
6005   { (eval echo "$as_me:6005: \"$ac_try\"") >&5
6006   (eval $ac_try) 2>&5
6007   ac_status=$?
6008   echo "$as_me:6008: \$? = $ac_status" >&5
6009   (exit $ac_status); }; }; then
6010   ac_cv_func_initscr=yes
6011 else
6012   echo "$as_me: failed program was:" >&5
6013 cat conftest.$ac_ext >&5
6014 ac_cv_func_initscr=no
6015 fi
6016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6017 fi
6018 echo "$as_me:6018: result: $ac_cv_func_initscr" >&5
6019 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6020 if test $ac_cv_func_initscr = yes; then
6021   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6022 else
6023
6024                 cf_save_LIBS="$LIBS"
6025                 echo "$as_me:6025: checking for initscr in -l$cf_nculib_root" >&5
6026 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6027                 LIBS="-l$cf_nculib_root $LIBS"
6028                 cat >conftest.$ac_ext <<_ACEOF
6029 #line 6029 "configure"
6030 #include "confdefs.h"
6031 #include <${cf_cv_ncurses_header:-curses.h}>
6032 int
6033 main (void)
6034 {
6035 initscr()
6036   ;
6037   return 0;
6038 }
6039 _ACEOF
6040 rm -f conftest.$ac_objext conftest$ac_exeext
6041 if { (eval echo "$as_me:6041: \"$ac_link\"") >&5
6042   (eval $ac_link) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); } &&
6046          { ac_try='test -s conftest$ac_exeext'
6047   { (eval echo "$as_me:6047: \"$ac_try\"") >&5
6048   (eval $ac_try) 2>&5
6049   ac_status=$?
6050   echo "$as_me:6050: \$? = $ac_status" >&5
6051   (exit $ac_status); }; }; then
6052   echo "$as_me:6052: result: yes" >&5
6053 echo "${ECHO_T}yes" >&6
6054                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6055
6056 else
6057   echo "$as_me: failed program was:" >&5
6058 cat conftest.$ac_ext >&5
6059 echo "$as_me:6059: result: no" >&5
6060 echo "${ECHO_T}no" >&6
6061
6062 cf_search=
6063 cf_library_path_list=""
6064 if test -n "${LDFLAGS}${LIBS}" ; then
6065         for cf_library_path in $LDFLAGS $LIBS
6066         do
6067                 case $cf_library_path in
6068                 (-L*)
6069                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6070
6071 test "x$cf_library_path" != "xNONE" && \
6072 test -d "$cf_library_path" && \
6073  {
6074         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6075         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6076         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6077         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6078         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6079         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"
6080 }
6081
6082                         cf_library_path_list="$cf_library_path_list $cf_search"
6083                         ;;
6084                 esac
6085         done
6086 fi
6087
6088 cf_search=
6089
6090 test "x$prefix" != "xNONE" && \
6091 test -d "$prefix" && \
6092  {
6093         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6094         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6095         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6096         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6097         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6098         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6099 }
6100
6101 for cf_subdir_prefix in \
6102         /usr \
6103         /usr/local \
6104         /usr/pkg \
6105         /opt \
6106         /opt/local \
6107         $HOME
6108 do
6109
6110 test "x$cf_subdir_prefix" != "x$prefix" && \
6111 test -d "$cf_subdir_prefix" && \
6112 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6113         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6114         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6115         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6116         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6117         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6118         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"
6119 }
6120
6121 done
6122
6123 cf_search="$cf_library_path_list $cf_search"
6124
6125                         for cf_libdir in $cf_search
6126                         do
6127                                 echo "$as_me:6127: checking for -l$cf_nculib_root in $cf_libdir" >&5
6128 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6129                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6130                                 cat >conftest.$ac_ext <<_ACEOF
6131 #line 6131 "configure"
6132 #include "confdefs.h"
6133 #include <${cf_cv_ncurses_header:-curses.h}>
6134 int
6135 main (void)
6136 {
6137 initscr()
6138   ;
6139   return 0;
6140 }
6141 _ACEOF
6142 rm -f conftest.$ac_objext conftest$ac_exeext
6143 if { (eval echo "$as_me:6143: \"$ac_link\"") >&5
6144   (eval $ac_link) 2>&5
6145   ac_status=$?
6146   echo "$as_me:6146: \$? = $ac_status" >&5
6147   (exit $ac_status); } &&
6148          { ac_try='test -s conftest$ac_exeext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154   echo "$as_me:6154: result: yes" >&5
6155 echo "${ECHO_T}yes" >&6
6156                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6157                                          break
6158 else
6159   echo "$as_me: failed program was:" >&5
6160 cat conftest.$ac_ext >&5
6161 echo "$as_me:6161: result: no" >&5
6162 echo "${ECHO_T}no" >&6
6163                                          LIBS="$cf_save_LIBS"
6164 fi
6165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6166                         done
6167
6168 fi
6169 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6170
6171 fi
6172
6173 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6174
6175 if test $cf_found_library = no ; then
6176         { { echo "$as_me:6176: error: Cannot link $cf_nculib_root library" >&5
6177 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6178    { (exit 1); exit 1; }; }
6179 fi
6180
6181 fi
6182
6183 if test -n "$cf_ncurses_LIBS" ; then
6184         echo "$as_me:6184: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6185 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6186         cf_ncurses_SAVE="$LIBS"
6187         for p in $cf_ncurses_LIBS ; do
6188                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6189                 if test "$q" != "$LIBS" ; then
6190                         LIBS="$q"
6191                 fi
6192         done
6193         cat >conftest.$ac_ext <<_ACEOF
6194 #line 6194 "configure"
6195 #include "confdefs.h"
6196 #include <${cf_cv_ncurses_header:-curses.h}>
6197 int
6198 main (void)
6199 {
6200 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6201   ;
6202   return 0;
6203 }
6204 _ACEOF
6205 rm -f conftest.$ac_objext conftest$ac_exeext
6206 if { (eval echo "$as_me:6206: \"$ac_link\"") >&5
6207   (eval $ac_link) 2>&5
6208   ac_status=$?
6209   echo "$as_me:6209: \$? = $ac_status" >&5
6210   (exit $ac_status); } &&
6211          { ac_try='test -s conftest$ac_exeext'
6212   { (eval echo "$as_me:6212: \"$ac_try\"") >&5
6213   (eval $ac_try) 2>&5
6214   ac_status=$?
6215   echo "$as_me:6215: \$? = $ac_status" >&5
6216   (exit $ac_status); }; }; then
6217   echo "$as_me:6217: result: yes" >&5
6218 echo "${ECHO_T}yes" >&6
6219 else
6220   echo "$as_me: failed program was:" >&5
6221 cat conftest.$ac_ext >&5
6222 echo "$as_me:6222: result: no" >&5
6223 echo "${ECHO_T}no" >&6
6224                  LIBS="$cf_ncurses_SAVE"
6225 fi
6226 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6227 fi
6228
6229 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6230
6231 cat >>confdefs.h <<EOF
6232 #define $cf_nculib_ROOT 1
6233 EOF
6234
6235         fi
6236 else
6237         NCURSES_CONFIG=none
6238 fi
6239
6240 echo "$as_me:6240: checking if you want wide-character code" >&5
6241 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6242
6243 # Check whether --enable-widec or --disable-widec was given.
6244 if test "${enable_widec+set}" = set; then
6245   enableval="$enable_widec"
6246   with_widec=$enableval
6247 else
6248   with_widec=no
6249 fi;
6250 echo "$as_me:6250: result: $with_widec" >&5
6251 echo "${ECHO_T}$with_widec" >&6
6252 if test "$with_widec" = yes ; then
6253
6254 echo "$as_me:6254: checking for multibyte character support" >&5
6255 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6256 if test "${cf_cv_utf8_lib+set}" = set; then
6257   echo $ECHO_N "(cached) $ECHO_C" >&6
6258 else
6259
6260         cf_save_LIBS="$LIBS"
6261         cat >conftest.$ac_ext <<_ACEOF
6262 #line 6262 "configure"
6263 #include "confdefs.h"
6264
6265 #include <stdlib.h>
6266 int
6267 main (void)
6268 {
6269 putwc(0,0);
6270   ;
6271   return 0;
6272 }
6273 _ACEOF
6274 rm -f conftest.$ac_objext conftest$ac_exeext
6275 if { (eval echo "$as_me:6275: \"$ac_link\"") >&5
6276   (eval $ac_link) 2>&5
6277   ac_status=$?
6278   echo "$as_me:6278: \$? = $ac_status" >&5
6279   (exit $ac_status); } &&
6280          { ac_try='test -s conftest$ac_exeext'
6281   { (eval echo "$as_me:6281: \"$ac_try\"") >&5
6282   (eval $ac_try) 2>&5
6283   ac_status=$?
6284   echo "$as_me:6284: \$? = $ac_status" >&5
6285   (exit $ac_status); }; }; then
6286   cf_cv_utf8_lib=yes
6287 else
6288   echo "$as_me: failed program was:" >&5
6289 cat conftest.$ac_ext >&5
6290
6291 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6292 # will be set on completion of the AC_TRY_LINK below.
6293 cf_cv_header_path_utf8=
6294 cf_cv_library_path_utf8=
6295
6296 echo "${as_me:-configure}:6296: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6297
6298 cf_save_LIBS="$LIBS"
6299
6300 cat >conftest.$ac_ext <<_ACEOF
6301 #line 6301 "configure"
6302 #include "confdefs.h"
6303
6304 #include <libutf8.h>
6305 int
6306 main (void)
6307 {
6308 putwc(0,0);
6309   ;
6310   return 0;
6311 }
6312 _ACEOF
6313 rm -f conftest.$ac_objext conftest$ac_exeext
6314 if { (eval echo "$as_me:6314: \"$ac_link\"") >&5
6315   (eval $ac_link) 2>&5
6316   ac_status=$?
6317   echo "$as_me:6317: \$? = $ac_status" >&5
6318   (exit $ac_status); } &&
6319          { ac_try='test -s conftest$ac_exeext'
6320   { (eval echo "$as_me:6320: \"$ac_try\"") >&5
6321   (eval $ac_try) 2>&5
6322   ac_status=$?
6323   echo "$as_me:6323: \$? = $ac_status" >&5
6324   (exit $ac_status); }; }; then
6325
6326         cf_cv_find_linkage_utf8=yes
6327         cf_cv_header_path_utf8=/usr/include
6328         cf_cv_library_path_utf8=/usr/lib
6329
6330 else
6331   echo "$as_me: failed program was:" >&5
6332 cat conftest.$ac_ext >&5
6333
6334 LIBS="-lutf8  $cf_save_LIBS"
6335
6336 cat >conftest.$ac_ext <<_ACEOF
6337 #line 6337 "configure"
6338 #include "confdefs.h"
6339
6340 #include <libutf8.h>
6341 int
6342 main (void)
6343 {
6344 putwc(0,0);
6345   ;
6346   return 0;
6347 }
6348 _ACEOF
6349 rm -f conftest.$ac_objext conftest$ac_exeext
6350 if { (eval echo "$as_me:6350: \"$ac_link\"") >&5
6351   (eval $ac_link) 2>&5
6352   ac_status=$?
6353   echo "$as_me:6353: \$? = $ac_status" >&5
6354   (exit $ac_status); } &&
6355          { ac_try='test -s conftest$ac_exeext'
6356   { (eval echo "$as_me:6356: \"$ac_try\"") >&5
6357   (eval $ac_try) 2>&5
6358   ac_status=$?
6359   echo "$as_me:6359: \$? = $ac_status" >&5
6360   (exit $ac_status); }; }; then
6361
6362         cf_cv_find_linkage_utf8=yes
6363         cf_cv_header_path_utf8=/usr/include
6364         cf_cv_library_path_utf8=/usr/lib
6365         cf_cv_library_file_utf8="-lutf8"
6366
6367 else
6368   echo "$as_me: failed program was:" >&5
6369 cat conftest.$ac_ext >&5
6370
6371         cf_cv_find_linkage_utf8=no
6372         LIBS="$cf_save_LIBS"
6373
6374         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6375
6376 echo "${as_me:-configure}:6376: testing find linkage for utf8 library ..." 1>&5
6377
6378 echo "${as_me:-configure}:6378: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6379
6380         cf_save_CPPFLAGS="$CPPFLAGS"
6381         cf_test_CPPFLAGS="$CPPFLAGS"
6382
6383 cf_search=
6384
6385 # collect the current set of include-directories from compiler flags
6386 cf_header_path_list=""
6387 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6388         for cf_header_path in $CPPFLAGS $CFLAGS
6389         do
6390                 case $cf_header_path in
6391                 (-I*)
6392                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6393
6394 test "x$cf_header_path" != "xNONE" && \
6395 test -d "$cf_header_path" && \
6396  {
6397         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6398         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6399         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6400         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6401         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6402         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6403 }
6404
6405                         cf_header_path_list="$cf_header_path_list $cf_search"
6406                         ;;
6407                 esac
6408         done
6409 fi
6410
6411 # add the variations for the package we are looking for
6412
6413 cf_search=
6414
6415 test "x$prefix" != "xNONE" && \
6416 test -d "$prefix" && \
6417  {
6418         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6419         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6420         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6421         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6422         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6423         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6424 }
6425
6426 for cf_subdir_prefix in \
6427         /usr \
6428         /usr/local \
6429         /usr/pkg \
6430         /opt \
6431         /opt/local \
6432         $HOME
6433 do
6434
6435 test "x$cf_subdir_prefix" != "x$prefix" && \
6436 test -d "$cf_subdir_prefix" && \
6437 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6438         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6439         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6440         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6441         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6442         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6443         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6444 }
6445
6446 done
6447
6448 test "$includedir" != NONE && \
6449 test "$includedir" != "/usr/include" && \
6450 test -d "$includedir" && {
6451         test -d $includedir &&    cf_search="$cf_search $includedir"
6452         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6453 }
6454
6455 test "$oldincludedir" != NONE && \
6456 test "$oldincludedir" != "/usr/include" && \
6457 test -d "$oldincludedir" && {
6458         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6459         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6460 }
6461
6462 cf_search="$cf_search $cf_header_path_list"
6463
6464         for cf_cv_header_path_utf8 in $cf_search
6465         do
6466                 if test -d $cf_cv_header_path_utf8 ; then
6467                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6468
6469 echo "${as_me:-configure}:6469: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6470
6471                         CPPFLAGS="$cf_save_CPPFLAGS"
6472
6473         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6474         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6475
6476                         cat >conftest.$ac_ext <<_ACEOF
6477 #line 6477 "configure"
6478 #include "confdefs.h"
6479
6480 #include <libutf8.h>
6481 int
6482 main (void)
6483 {
6484 putwc(0,0);
6485   ;
6486   return 0;
6487 }
6488 _ACEOF
6489 rm -f conftest.$ac_objext
6490 if { (eval echo "$as_me:6490: \"$ac_compile\"") >&5
6491   (eval $ac_compile) 2>&5
6492   ac_status=$?
6493   echo "$as_me:6493: \$? = $ac_status" >&5
6494   (exit $ac_status); } &&
6495          { ac_try='test -s conftest.$ac_objext'
6496   { (eval echo "$as_me:6496: \"$ac_try\"") >&5
6497   (eval $ac_try) 2>&5
6498   ac_status=$?
6499   echo "$as_me:6499: \$? = $ac_status" >&5
6500   (exit $ac_status); }; }; then
6501
6502                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6503
6504 echo "${as_me:-configure}:6504: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6505
6506                                 cf_cv_find_linkage_utf8=maybe
6507                                 cf_test_CPPFLAGS="$CPPFLAGS"
6508                                 break
6509 else
6510   echo "$as_me: failed program was:" >&5
6511 cat conftest.$ac_ext >&5
6512
6513                                 CPPFLAGS="$cf_save_CPPFLAGS"
6514
6515 fi
6516 rm -f conftest.$ac_objext conftest.$ac_ext
6517                 fi
6518         done
6519
6520         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6521
6522 echo "${as_me:-configure}:6522: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6523
6524                 cf_save_LIBS="$LIBS"
6525                 cf_save_LDFLAGS="$LDFLAGS"
6526
6527                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6528
6529 cf_search=
6530 cf_library_path_list=""
6531 if test -n "${LDFLAGS}${LIBS}" ; then
6532         for cf_library_path in $LDFLAGS $LIBS
6533         do
6534                 case $cf_library_path in
6535                 (-L*)
6536                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6537
6538 test "x$cf_library_path" != "xNONE" && \
6539 test -d "$cf_library_path" && \
6540  {
6541         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6542         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6543         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6544         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6545         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6546         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6547 }
6548
6549                         cf_library_path_list="$cf_library_path_list $cf_search"
6550                         ;;
6551                 esac
6552         done
6553 fi
6554
6555 cf_search=
6556
6557 test "x$prefix" != "xNONE" && \
6558 test -d "$prefix" && \
6559  {
6560         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6561         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6562         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6563         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6564         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6565         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6566 }
6567
6568 for cf_subdir_prefix in \
6569         /usr \
6570         /usr/local \
6571         /usr/pkg \
6572         /opt \
6573         /opt/local \
6574         $HOME
6575 do
6576
6577 test "x$cf_subdir_prefix" != "x$prefix" && \
6578 test -d "$cf_subdir_prefix" && \
6579 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6580         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6581         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6582         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6583         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6584         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6585         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6586 }
6587
6588 done
6589
6590 cf_search="$cf_library_path_list $cf_search"
6591
6592                         for cf_cv_library_path_utf8 in $cf_search
6593                         do
6594                                 if test -d $cf_cv_library_path_utf8 ; then
6595                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6596
6597 echo "${as_me:-configure}:6597: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6598
6599                                         CPPFLAGS="$cf_test_CPPFLAGS"
6600                                         LIBS="-lutf8  $cf_save_LIBS"
6601                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6602                                         cat >conftest.$ac_ext <<_ACEOF
6603 #line 6603 "configure"
6604 #include "confdefs.h"
6605
6606 #include <libutf8.h>
6607 int
6608 main (void)
6609 {
6610 putwc(0,0);
6611   ;
6612   return 0;
6613 }
6614 _ACEOF
6615 rm -f conftest.$ac_objext conftest$ac_exeext
6616 if { (eval echo "$as_me:6616: \"$ac_link\"") >&5
6617   (eval $ac_link) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit $ac_status); } &&
6621          { ac_try='test -s conftest$ac_exeext'
6622   { (eval echo "$as_me:6622: \"$ac_try\"") >&5
6623   (eval $ac_try) 2>&5
6624   ac_status=$?
6625   echo "$as_me:6625: \$? = $ac_status" >&5
6626   (exit $ac_status); }; }; then
6627
6628                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6629
6630 echo "${as_me:-configure}:6630: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6631
6632                                         cf_cv_find_linkage_utf8=yes
6633                                         cf_cv_library_file_utf8="-lutf8"
6634                                         break
6635 else
6636   echo "$as_me: failed program was:" >&5
6637 cat conftest.$ac_ext >&5
6638
6639                                         CPPFLAGS="$cf_save_CPPFLAGS"
6640                                         LIBS="$cf_save_LIBS"
6641                                         LDFLAGS="$cf_save_LDFLAGS"
6642
6643 fi
6644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6645                                 fi
6646                         done
6647                         CPPFLAGS="$cf_save_CPPFLAGS"
6648                         LDFLAGS="$cf_save_LDFLAGS"
6649                 fi
6650
6651         else
6652                 cf_cv_find_linkage_utf8=no
6653         fi
6654
6655 fi
6656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6657
6658 fi
6659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6660
6661 LIBS="$cf_save_LIBS"
6662
6663 if test "$cf_cv_find_linkage_utf8" = yes ; then
6664 cf_cv_utf8_lib=add-on
6665 else
6666 cf_cv_utf8_lib=no
6667 fi
6668
6669 fi
6670 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6671 fi
6672 echo "$as_me:6672: result: $cf_cv_utf8_lib" >&5
6673 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6674
6675 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6676 # ncurses/ncursesw:
6677 if test "$cf_cv_utf8_lib" = "add-on" ; then
6678
6679 cat >>confdefs.h <<\EOF
6680 #define HAVE_LIBUTF8_H 1
6681 EOF
6682
6683 if test -n "$cf_cv_header_path_utf8" ; then
6684   for cf_add_incdir in $cf_cv_header_path_utf8
6685   do
6686         while test $cf_add_incdir != /usr/include
6687         do
6688           if test -d $cf_add_incdir
6689           then
6690                 cf_have_incdir=no
6691                 if test -n "$CFLAGS$CPPFLAGS" ; then
6692                   # a loop is needed to ensure we can add subdirs of existing dirs
6693                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6694                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6695                           cf_have_incdir=yes; break
6696                         fi
6697                   done
6698                 fi
6699
6700                 if test "$cf_have_incdir" = no ; then
6701                   if test "$cf_add_incdir" = /usr/local/include ; then
6702                         if test "$GCC" = yes
6703                         then
6704                           cf_save_CPPFLAGS=$CPPFLAGS
6705
6706         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6707         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6708
6709                           cat >conftest.$ac_ext <<_ACEOF
6710 #line 6710 "configure"
6711 #include "confdefs.h"
6712 #include <stdio.h>
6713 int
6714 main (void)
6715 {
6716 printf("Hello")
6717   ;
6718   return 0;
6719 }
6720 _ACEOF
6721 rm -f conftest.$ac_objext
6722 if { (eval echo "$as_me:6722: \"$ac_compile\"") >&5
6723   (eval $ac_compile) 2>&5
6724   ac_status=$?
6725   echo "$as_me:6725: \$? = $ac_status" >&5
6726   (exit $ac_status); } &&
6727          { ac_try='test -s conftest.$ac_objext'
6728   { (eval echo "$as_me:6728: \"$ac_try\"") >&5
6729   (eval $ac_try) 2>&5
6730   ac_status=$?
6731   echo "$as_me:6731: \$? = $ac_status" >&5
6732   (exit $ac_status); }; }; then
6733   :
6734 else
6735   echo "$as_me: failed program was:" >&5
6736 cat conftest.$ac_ext >&5
6737 cf_have_incdir=yes
6738 fi
6739 rm -f conftest.$ac_objext conftest.$ac_ext
6740                           CPPFLAGS=$cf_save_CPPFLAGS
6741                         fi
6742                   fi
6743                 fi
6744
6745                 if test "$cf_have_incdir" = no ; then
6746                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6747
6748 echo "${as_me:-configure}:6748: testing adding $cf_add_incdir to include-path ..." 1>&5
6749
6750                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6751
6752                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6753                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6754                   cf_add_incdir="$cf_top_incdir"
6755                 else
6756                   break
6757                 fi
6758           else
6759                 break
6760           fi
6761         done
6762   done
6763 fi
6764
6765 if test -n "$cf_cv_library_path_utf8" ; then
6766         for cf_add_libdir in $cf_cv_library_path_utf8
6767         do
6768                 if test $cf_add_libdir = /usr/lib ; then
6769                         :
6770                 elif test -d $cf_add_libdir
6771                 then
6772                         cf_have_libdir=no
6773                         if test -n "$LDFLAGS$LIBS" ; then
6774                                 # a loop is needed to ensure we can add subdirs of existing dirs
6775                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6776                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6777                                                 cf_have_libdir=yes; break
6778                                         fi
6779                                 done
6780                         fi
6781                         if test "$cf_have_libdir" = no ; then
6782                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6783
6784 echo "${as_me:-configure}:6784: testing adding $cf_add_libdir to library-path ..." 1>&5
6785
6786                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6787                         fi
6788                 fi
6789         done
6790 fi
6791
6792 cf_add_libs="$LIBS"
6793 # reverse order
6794 cf_add_0lib=
6795 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6796 # filter duplicates
6797 for cf_add_1lib in $cf_add_0lib; do
6798         for cf_add_2lib in $cf_add_libs; do
6799                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6800                         cf_add_1lib=
6801                         break
6802                 fi
6803         done
6804         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6805 done
6806 LIBS="$cf_add_libs"
6807
6808 fi
6809
6810 cf_ncuconfig_root=ncursesw
6811 cf_have_ncuconfig=no
6812
6813 if test "x${PKG_CONFIG:=none}" != xnone; then
6814         echo "$as_me:6814: checking pkg-config for $cf_ncuconfig_root" >&5
6815 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6816         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6817                 echo "$as_me:6817: result: yes" >&5
6818 echo "${ECHO_T}yes" >&6
6819
6820                 echo "$as_me:6820: checking if the $cf_ncuconfig_root package files work" >&5
6821 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6822                 cf_have_ncuconfig=unknown
6823
6824                 cf_save_CFLAGS="$CFLAGS"
6825                 cf_save_CPPFLAGS="$CPPFLAGS"
6826                 cf_save_LIBS="$LIBS"
6827
6828                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6829                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6830
6831                 # while -W for passing linker flags is prevalent, it is not "standard".
6832                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6833                 # incompatible _and_ non-standard -W option which gives an error.  Work
6834                 # around that pitfall.
6835                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6836                 (x*c[89]9@@*-W*)
6837
6838 cf_fix_cppflags=no
6839 cf_new_cflags=
6840 cf_new_cppflags=
6841 cf_new_extra_cppflags=
6842
6843 for cf_add_cflags in $cf_pkg_cflags
6844 do
6845 case $cf_fix_cppflags in
6846 (no)
6847         case $cf_add_cflags in
6848         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6849                 case $cf_add_cflags in
6850                 (-D*)
6851                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6852
6853                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6854                                 && test -z "${cf_tst_cflags}" \
6855                                 && cf_fix_cppflags=yes
6856
6857                         if test $cf_fix_cppflags = yes ; then
6858
6859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6861
6862                                 continue
6863                         elif test "${cf_tst_cflags}" = "\"'" ; then
6864
6865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6867
6868                                 continue
6869                         fi
6870                         ;;
6871                 esac
6872                 case "$CPPFLAGS" in
6873                 (*$cf_add_cflags)
6874                         ;;
6875                 (*)
6876                         case $cf_add_cflags in
6877                         (-D*)
6878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6879
6880 CPPFLAGS=`echo "$CPPFLAGS" | \
6881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6883
6884                                 ;;
6885                         esac
6886
6887         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6888         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6889
6890                         ;;
6891                 esac
6892                 ;;
6893         (*)
6894
6895         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6896         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6897
6898                 ;;
6899         esac
6900         ;;
6901 (yes)
6902
6903         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6904         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6905
6906         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6907
6908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6909                 && test -z "${cf_tst_cflags}" \
6910                 && cf_fix_cppflags=no
6911         ;;
6912 esac
6913 done
6914
6915 if test -n "$cf_new_cflags" ; then
6916
6917         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6918         CFLAGS="${CFLAGS}$cf_new_cflags"
6919
6920 fi
6921
6922 if test -n "$cf_new_cppflags" ; then
6923
6924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6925         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6926
6927 fi
6928
6929 if test -n "$cf_new_extra_cppflags" ; then
6930
6931         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6932         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6933
6934 fi
6935
6936 cf_add_libs="$LIBS"
6937 # reverse order
6938 cf_add_0lib=
6939 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6940 # filter duplicates
6941 for cf_add_1lib in $cf_add_0lib; do
6942         for cf_add_2lib in $cf_add_libs; do
6943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6944                         cf_add_1lib=
6945                         break
6946                 fi
6947         done
6948         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6949 done
6950 LIBS="$cf_add_libs"
6951
6952                         cat >conftest.$ac_ext <<_ACEOF
6953 #line 6953 "configure"
6954 #include "confdefs.h"
6955 #include <${cf_cv_ncurses_header:-curses.h}>
6956 int
6957 main (void)
6958 {
6959 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6960   ;
6961   return 0;
6962 }
6963 _ACEOF
6964 rm -f conftest.$ac_objext conftest$ac_exeext
6965 if { (eval echo "$as_me:6965: \"$ac_link\"") >&5
6966   (eval $ac_link) 2>&5
6967   ac_status=$?
6968   echo "$as_me:6968: \$? = $ac_status" >&5
6969   (exit $ac_status); } &&
6970          { ac_try='test -s conftest$ac_exeext'
6971   { (eval echo "$as_me:6971: \"$ac_try\"") >&5
6972   (eval $ac_try) 2>&5
6973   ac_status=$?
6974   echo "$as_me:6974: \$? = $ac_status" >&5
6975   (exit $ac_status); }; }; then
6976   if test "$cross_compiling" = yes; then
6977   cf_test_ncuconfig=maybe
6978 else
6979   cat >conftest.$ac_ext <<_ACEOF
6980 #line 6980 "configure"
6981 #include "confdefs.h"
6982 #include <${cf_cv_ncurses_header:-curses.h}>
6983                                         int main(void)
6984                                         { char *xx = curses_version(); return (xx == 0); }
6985 _ACEOF
6986 rm -f conftest$ac_exeext
6987 if { (eval echo "$as_me:6987: \"$ac_link\"") >&5
6988   (eval $ac_link) 2>&5
6989   ac_status=$?
6990   echo "$as_me:6990: \$? = $ac_status" >&5
6991   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6992   { (eval echo "$as_me:6992: \"$ac_try\"") >&5
6993   (eval $ac_try) 2>&5
6994   ac_status=$?
6995   echo "$as_me:6995: \$? = $ac_status" >&5
6996   (exit $ac_status); }; }; then
6997   cf_test_ncuconfig=yes
6998 else
6999   echo "$as_me: program exited with status $ac_status" >&5
7000 echo "$as_me: failed program was:" >&5
7001 cat conftest.$ac_ext >&5
7002 cf_test_ncuconfig=no
7003 fi
7004 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7005 fi
7006 else
7007   echo "$as_me: failed program was:" >&5
7008 cat conftest.$ac_ext >&5
7009 cf_test_ncuconfig=no
7010 fi
7011 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7012
7013                         CFLAGS="$cf_save_CFLAGS"
7014                         CPPFLAGS="$cf_save_CPPFLAGS"
7015                         LIBS="$cf_save_LIBS"
7016
7017                         if test "x$cf_test_ncuconfig" != xyes; then
7018                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7019                                 cf_pkg_cflags="$cf_temp"
7020                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7021                                 cf_pkg_libs="$cf_temp"
7022                         fi
7023                         ;;
7024                 esac
7025
7026 cf_fix_cppflags=no
7027 cf_new_cflags=
7028 cf_new_cppflags=
7029 cf_new_extra_cppflags=
7030
7031 for cf_add_cflags in $cf_pkg_cflags
7032 do
7033 case $cf_fix_cppflags in
7034 (no)
7035         case $cf_add_cflags in
7036         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7037                 case $cf_add_cflags in
7038                 (-D*)
7039                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7040
7041                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7042                                 && test -z "${cf_tst_cflags}" \
7043                                 && cf_fix_cppflags=yes
7044
7045                         if test $cf_fix_cppflags = yes ; then
7046
7047         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7048         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7049
7050                                 continue
7051                         elif test "${cf_tst_cflags}" = "\"'" ; then
7052
7053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7055
7056                                 continue
7057                         fi
7058                         ;;
7059                 esac
7060                 case "$CPPFLAGS" in
7061                 (*$cf_add_cflags)
7062                         ;;
7063                 (*)
7064                         case $cf_add_cflags in
7065                         (-D*)
7066                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7067
7068 CPPFLAGS=`echo "$CPPFLAGS" | \
7069         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7070                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7071
7072                                 ;;
7073                         esac
7074
7075         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7076         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7077
7078                         ;;
7079                 esac
7080                 ;;
7081         (*)
7082
7083         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7084         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7085
7086                 ;;
7087         esac
7088         ;;
7089 (yes)
7090
7091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7093
7094         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7095
7096         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7097                 && test -z "${cf_tst_cflags}" \
7098                 && cf_fix_cppflags=no
7099         ;;
7100 esac
7101 done
7102
7103 if test -n "$cf_new_cflags" ; then
7104
7105         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7106         CFLAGS="${CFLAGS}$cf_new_cflags"
7107
7108 fi
7109
7110 if test -n "$cf_new_cppflags" ; then
7111
7112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7113         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7114
7115 fi
7116
7117 if test -n "$cf_new_extra_cppflags" ; then
7118
7119         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7120         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7121
7122 fi
7123
7124 cf_add_libs="$LIBS"
7125 # reverse order
7126 cf_add_0lib=
7127 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7128 # filter duplicates
7129 for cf_add_1lib in $cf_add_0lib; do
7130         for cf_add_2lib in $cf_add_libs; do
7131                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7132                         cf_add_1lib=
7133                         break
7134                 fi
7135         done
7136         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7137 done
7138 LIBS="$cf_add_libs"
7139
7140                 cat >conftest.$ac_ext <<_ACEOF
7141 #line 7141 "configure"
7142 #include "confdefs.h"
7143 #include <${cf_cv_ncurses_header:-curses.h}>
7144 int
7145 main (void)
7146 {
7147 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7148   ;
7149   return 0;
7150 }
7151 _ACEOF
7152 rm -f conftest.$ac_objext conftest$ac_exeext
7153 if { (eval echo "$as_me:7153: \"$ac_link\"") >&5
7154   (eval $ac_link) 2>&5
7155   ac_status=$?
7156   echo "$as_me:7156: \$? = $ac_status" >&5
7157   (exit $ac_status); } &&
7158          { ac_try='test -s conftest$ac_exeext'
7159   { (eval echo "$as_me:7159: \"$ac_try\"") >&5
7160   (eval $ac_try) 2>&5
7161   ac_status=$?
7162   echo "$as_me:7162: \$? = $ac_status" >&5
7163   (exit $ac_status); }; }; then
7164   if test "$cross_compiling" = yes; then
7165   cf_have_ncuconfig=maybe
7166 else
7167   cat >conftest.$ac_ext <<_ACEOF
7168 #line 7168 "configure"
7169 #include "confdefs.h"
7170 #include <${cf_cv_ncurses_header:-curses.h}>
7171                                 int main(void)
7172                                 { char *xx = curses_version(); return (xx == 0); }
7173 _ACEOF
7174 rm -f conftest$ac_exeext
7175 if { (eval echo "$as_me:7175: \"$ac_link\"") >&5
7176   (eval $ac_link) 2>&5
7177   ac_status=$?
7178   echo "$as_me:7178: \$? = $ac_status" >&5
7179   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7180   { (eval echo "$as_me:7180: \"$ac_try\"") >&5
7181   (eval $ac_try) 2>&5
7182   ac_status=$?
7183   echo "$as_me:7183: \$? = $ac_status" >&5
7184   (exit $ac_status); }; }; then
7185   cf_have_ncuconfig=yes
7186 else
7187   echo "$as_me: program exited with status $ac_status" >&5
7188 echo "$as_me: failed program was:" >&5
7189 cat conftest.$ac_ext >&5
7190 cf_have_ncuconfig=no
7191 fi
7192 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7193 fi
7194 else
7195   echo "$as_me: failed program was:" >&5
7196 cat conftest.$ac_ext >&5
7197 cf_have_ncuconfig=no
7198 fi
7199 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7200                 echo "$as_me:7200: result: $cf_have_ncuconfig" >&5
7201 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7202                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7203                 if test "$cf_have_ncuconfig" != "yes"
7204                 then
7205                         CPPFLAGS="$cf_save_CPPFLAGS"
7206                         LIBS="$cf_save_LIBS"
7207                         NCURSES_CONFIG_PKG=none
7208                 else
7209
7210 cat >>confdefs.h <<\EOF
7211 #define NCURSES 1
7212 EOF
7213
7214                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7215
7216 echo "$as_me:7216: checking for terminfo header" >&5
7217 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7218 if test "${cf_cv_term_header+set}" = set; then
7219   echo $ECHO_N "(cached) $ECHO_C" >&6
7220 else
7221
7222 case ${cf_cv_ncurses_header} in
7223 (*/ncurses.h|*/ncursesw.h)
7224         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7225         ;;
7226 (*)
7227         cf_term_header=term.h
7228         ;;
7229 esac
7230
7231 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7232 do
7233 cat >conftest.$ac_ext <<_ACEOF
7234 #line 7234 "configure"
7235 #include "confdefs.h"
7236 #include <stdio.h>
7237 #include <${cf_cv_ncurses_header:-curses.h}>
7238 #include <$cf_test>
7239
7240 int
7241 main (void)
7242 {
7243 int x = auto_left_margin; (void)x
7244   ;
7245   return 0;
7246 }
7247 _ACEOF
7248 rm -f conftest.$ac_objext
7249 if { (eval echo "$as_me:7249: \"$ac_compile\"") >&5
7250   (eval $ac_compile) 2>&5
7251   ac_status=$?
7252   echo "$as_me:7252: \$? = $ac_status" >&5
7253   (exit $ac_status); } &&
7254          { ac_try='test -s conftest.$ac_objext'
7255   { (eval echo "$as_me:7255: \"$ac_try\"") >&5
7256   (eval $ac_try) 2>&5
7257   ac_status=$?
7258   echo "$as_me:7258: \$? = $ac_status" >&5
7259   (exit $ac_status); }; }; then
7260
7261         cf_cv_term_header="$cf_test"
7262 else
7263   echo "$as_me: failed program was:" >&5
7264 cat conftest.$ac_ext >&5
7265
7266         cf_cv_term_header=unknown
7267
7268 fi
7269 rm -f conftest.$ac_objext conftest.$ac_ext
7270         test "$cf_cv_term_header" != unknown && break
7271 done
7272
7273 fi
7274 echo "$as_me:7274: result: $cf_cv_term_header" >&5
7275 echo "${ECHO_T}$cf_cv_term_header" >&6
7276
7277 # Set definitions to allow ifdef'ing to accommodate subdirectories
7278
7279 case $cf_cv_term_header in
7280 (*term.h)
7281
7282 cat >>confdefs.h <<\EOF
7283 #define HAVE_TERM_H 1
7284 EOF
7285
7286         ;;
7287 esac
7288
7289 case $cf_cv_term_header in
7290 (ncurses/term.h)
7291
7292 cat >>confdefs.h <<\EOF
7293 #define HAVE_NCURSES_TERM_H 1
7294 EOF
7295
7296         ;;
7297 (ncursesw/term.h)
7298
7299 cat >>confdefs.h <<\EOF
7300 #define HAVE_NCURSESW_TERM_H 1
7301 EOF
7302
7303         ;;
7304 esac
7305
7306                 fi
7307
7308         else
7309                 echo "$as_me:7309: result: no" >&5
7310 echo "${ECHO_T}no" >&6
7311                 NCURSES_CONFIG_PKG=none
7312         fi
7313 else
7314         NCURSES_CONFIG_PKG=none
7315 fi
7316
7317 if test "x$cf_have_ncuconfig" = "xno"; then
7318         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7319
7320 if test -n "$ac_tool_prefix"; then
7321   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7322   do
7323     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7324 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7325 echo "$as_me:7325: checking for $ac_word" >&5
7326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7327 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7328   echo $ECHO_N "(cached) $ECHO_C" >&6
7329 else
7330   if test -n "$NCURSES_CONFIG"; then
7331   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7332 else
7333   ac_save_IFS=$IFS; IFS=$ac_path_separator
7334 ac_dummy="$PATH"
7335 for ac_dir in $ac_dummy; do
7336   IFS=$ac_save_IFS
7337   test -z "$ac_dir" && ac_dir=.
7338   $as_executable_p "$ac_dir/$ac_word" || continue
7339 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7340 echo "$as_me:7340: found $ac_dir/$ac_word" >&5
7341 break
7342 done
7343
7344 fi
7345 fi
7346 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7347 if test -n "$NCURSES_CONFIG"; then
7348   echo "$as_me:7348: result: $NCURSES_CONFIG" >&5
7349 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7350 else
7351   echo "$as_me:7351: result: no" >&5
7352 echo "${ECHO_T}no" >&6
7353 fi
7354
7355     test -n "$NCURSES_CONFIG" && break
7356   done
7357 fi
7358 if test -z "$NCURSES_CONFIG"; then
7359   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7360   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7361 do
7362   # Extract the first word of "$ac_prog", so it can be a program name with args.
7363 set dummy $ac_prog; ac_word=$2
7364 echo "$as_me:7364: checking for $ac_word" >&5
7365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7366 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7367   echo $ECHO_N "(cached) $ECHO_C" >&6
7368 else
7369   if test -n "$ac_ct_NCURSES_CONFIG"; then
7370   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7371 else
7372   ac_save_IFS=$IFS; IFS=$ac_path_separator
7373 ac_dummy="$PATH"
7374 for ac_dir in $ac_dummy; do
7375   IFS=$ac_save_IFS
7376   test -z "$ac_dir" && ac_dir=.
7377   $as_executable_p "$ac_dir/$ac_word" || continue
7378 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7379 echo "$as_me:7379: found $ac_dir/$ac_word" >&5
7380 break
7381 done
7382
7383 fi
7384 fi
7385 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7386 if test -n "$ac_ct_NCURSES_CONFIG"; then
7387   echo "$as_me:7387: result: $ac_ct_NCURSES_CONFIG" >&5
7388 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7389 else
7390   echo "$as_me:7390: result: no" >&5
7391 echo "${ECHO_T}no" >&6
7392 fi
7393
7394   test -n "$ac_ct_NCURSES_CONFIG" && break
7395 done
7396 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7397
7398   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7399 fi
7400
7401         if test "$NCURSES_CONFIG" != none ; then
7402
7403 cf_fix_cppflags=no
7404 cf_new_cflags=
7405 cf_new_cppflags=
7406 cf_new_extra_cppflags=
7407
7408 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7409 do
7410 case $cf_fix_cppflags in
7411 (no)
7412         case $cf_add_cflags in
7413         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7414                 case $cf_add_cflags in
7415                 (-D*)
7416                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7417
7418                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7419                                 && test -z "${cf_tst_cflags}" \
7420                                 && cf_fix_cppflags=yes
7421
7422                         if test $cf_fix_cppflags = yes ; then
7423
7424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7426
7427                                 continue
7428                         elif test "${cf_tst_cflags}" = "\"'" ; then
7429
7430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7432
7433                                 continue
7434                         fi
7435                         ;;
7436                 esac
7437                 case "$CPPFLAGS" in
7438                 (*$cf_add_cflags)
7439                         ;;
7440                 (*)
7441                         case $cf_add_cflags in
7442                         (-D*)
7443                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7444
7445 CPPFLAGS=`echo "$CPPFLAGS" | \
7446         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7447                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7448
7449                                 ;;
7450                         esac
7451
7452         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7453         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7454
7455                         ;;
7456                 esac
7457                 ;;
7458         (*)
7459
7460         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7461         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7462
7463                 ;;
7464         esac
7465         ;;
7466 (yes)
7467
7468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7470
7471         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7472
7473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7474                 && test -z "${cf_tst_cflags}" \
7475                 && cf_fix_cppflags=no
7476         ;;
7477 esac
7478 done
7479
7480 if test -n "$cf_new_cflags" ; then
7481
7482         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7483         CFLAGS="${CFLAGS}$cf_new_cflags"
7484
7485 fi
7486
7487 if test -n "$cf_new_cppflags" ; then
7488
7489         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7490         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7491
7492 fi
7493
7494 if test -n "$cf_new_extra_cppflags" ; then
7495
7496         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7497         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7498
7499 fi
7500
7501 cf_add_libs="$LIBS"
7502 # reverse order
7503 cf_add_0lib=
7504 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7505 # filter duplicates
7506 for cf_add_1lib in $cf_add_0lib; do
7507         for cf_add_2lib in $cf_add_libs; do
7508                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7509                         cf_add_1lib=
7510                         break
7511                 fi
7512         done
7513         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7514 done
7515 LIBS="$cf_add_libs"
7516
7517                 # even with config script, some packages use no-override for curses.h
7518
7519 echo "$as_me:7519: checking if we have identified curses headers" >&5
7520 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7521 if test "${cf_cv_ncurses_header+set}" = set; then
7522   echo $ECHO_N "(cached) $ECHO_C" >&6
7523 else
7524
7525 cf_cv_ncurses_header=none
7526 for cf_header in \
7527         ncurses.h ncursesw/ncurses.h \
7528         curses.h ncursesw/curses.h
7529 do
7530 cat >conftest.$ac_ext <<_ACEOF
7531 #line 7531 "configure"
7532 #include "confdefs.h"
7533 #include <${cf_header}>
7534 int
7535 main (void)
7536 {
7537 initscr(); tgoto("?", 0,0)
7538   ;
7539   return 0;
7540 }
7541 _ACEOF
7542 rm -f conftest.$ac_objext
7543 if { (eval echo "$as_me:7543: \"$ac_compile\"") >&5
7544   (eval $ac_compile) 2>&5
7545   ac_status=$?
7546   echo "$as_me:7546: \$? = $ac_status" >&5
7547   (exit $ac_status); } &&
7548          { ac_try='test -s conftest.$ac_objext'
7549   { (eval echo "$as_me:7549: \"$ac_try\"") >&5
7550   (eval $ac_try) 2>&5
7551   ac_status=$?
7552   echo "$as_me:7552: \$? = $ac_status" >&5
7553   (exit $ac_status); }; }; then
7554   cf_cv_ncurses_header=$cf_header; break
7555 else
7556   echo "$as_me: failed program was:" >&5
7557 cat conftest.$ac_ext >&5
7558 fi
7559 rm -f conftest.$ac_objext conftest.$ac_ext
7560 done
7561
7562 fi
7563 echo "$as_me:7563: result: $cf_cv_ncurses_header" >&5
7564 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7565
7566 if test "$cf_cv_ncurses_header" = none ; then
7567         { { echo "$as_me:7567: error: No curses header-files found" >&5
7568 echo "$as_me: error: No curses header-files found" >&2;}
7569    { (exit 1); exit 1; }; }
7570 fi
7571
7572 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7573
7574 for ac_header in $cf_cv_ncurses_header
7575 do
7576 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7577 echo "$as_me:7577: checking for $ac_header" >&5
7578 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7579 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7580   echo $ECHO_N "(cached) $ECHO_C" >&6
7581 else
7582   cat >conftest.$ac_ext <<_ACEOF
7583 #line 7583 "configure"
7584 #include "confdefs.h"
7585 #include <$ac_header>
7586 _ACEOF
7587 if { (eval echo "$as_me:7587: \"$ac_cpp conftest.$ac_ext\"") >&5
7588   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7589   ac_status=$?
7590   egrep -v '^ *\+' conftest.er1 >conftest.err
7591   rm -f conftest.er1
7592   cat conftest.err >&5
7593   echo "$as_me:7593: \$? = $ac_status" >&5
7594   (exit $ac_status); } >/dev/null; then
7595   if test -s conftest.err; then
7596     ac_cpp_err=$ac_c_preproc_warn_flag
7597   else
7598     ac_cpp_err=
7599   fi
7600 else
7601   ac_cpp_err=yes
7602 fi
7603 if test -z "$ac_cpp_err"; then
7604   eval "$as_ac_Header=yes"
7605 else
7606   echo "$as_me: failed program was:" >&5
7607   cat conftest.$ac_ext >&5
7608   eval "$as_ac_Header=no"
7609 fi
7610 rm -f conftest.err conftest.$ac_ext
7611 fi
7612 echo "$as_me:7612: result: `eval echo '${'$as_ac_Header'}'`" >&5
7613 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7614 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7615   cat >>confdefs.h <<EOF
7616 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7617 EOF
7618
7619 fi
7620 done
7621
7622 cat >>confdefs.h <<\EOF
7623 #define NCURSES 1
7624 EOF
7625
7626 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7627
7628                 cat >>confdefs.h <<EOF
7629 #define $cf_nculib_ROOT 1
7630 EOF
7631
7632                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7633
7634         else
7635
7636 cf_ncuhdr_root=ncursesw
7637
7638 test -n "$cf_cv_curses_dir" && \
7639 test "$cf_cv_curses_dir" != "no" && { \
7640
7641 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7642   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7643   do
7644         while test $cf_add_incdir != /usr/include
7645         do
7646           if test -d $cf_add_incdir
7647           then
7648                 cf_have_incdir=no
7649                 if test -n "$CFLAGS$CPPFLAGS" ; then
7650                   # a loop is needed to ensure we can add subdirs of existing dirs
7651                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7652                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7653                           cf_have_incdir=yes; break
7654                         fi
7655                   done
7656                 fi
7657
7658                 if test "$cf_have_incdir" = no ; then
7659                   if test "$cf_add_incdir" = /usr/local/include ; then
7660                         if test "$GCC" = yes
7661                         then
7662                           cf_save_CPPFLAGS=$CPPFLAGS
7663
7664         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7665         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7666
7667                           cat >conftest.$ac_ext <<_ACEOF
7668 #line 7668 "configure"
7669 #include "confdefs.h"
7670 #include <stdio.h>
7671 int
7672 main (void)
7673 {
7674 printf("Hello")
7675   ;
7676   return 0;
7677 }
7678 _ACEOF
7679 rm -f conftest.$ac_objext
7680 if { (eval echo "$as_me:7680: \"$ac_compile\"") >&5
7681   (eval $ac_compile) 2>&5
7682   ac_status=$?
7683   echo "$as_me:7683: \$? = $ac_status" >&5
7684   (exit $ac_status); } &&
7685          { ac_try='test -s conftest.$ac_objext'
7686   { (eval echo "$as_me:7686: \"$ac_try\"") >&5
7687   (eval $ac_try) 2>&5
7688   ac_status=$?
7689   echo "$as_me:7689: \$? = $ac_status" >&5
7690   (exit $ac_status); }; }; then
7691   :
7692 else
7693   echo "$as_me: failed program was:" >&5
7694 cat conftest.$ac_ext >&5
7695 cf_have_incdir=yes
7696 fi
7697 rm -f conftest.$ac_objext conftest.$ac_ext
7698                           CPPFLAGS=$cf_save_CPPFLAGS
7699                         fi
7700                   fi
7701                 fi
7702
7703                 if test "$cf_have_incdir" = no ; then
7704                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7705
7706 echo "${as_me:-configure}:7706: testing adding $cf_add_incdir to include-path ..." 1>&5
7707
7708                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7709
7710                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7711                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7712                   cf_add_incdir="$cf_top_incdir"
7713                 else
7714                   break
7715                 fi
7716           else
7717                 break
7718           fi
7719         done
7720   done
7721 fi
7722
7723 }
7724
7725 echo "$as_me:7725: checking for $cf_ncuhdr_root header in include-path" >&5
7726 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7727 if test "${cf_cv_ncurses_h+set}" = set; then
7728   echo $ECHO_N "(cached) $ECHO_C" >&6
7729 else
7730
7731         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7732         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7733         for cf_header in $cf_header_list
7734         do
7735
7736         cat >conftest.$ac_ext <<_ACEOF
7737 #line 7737 "configure"
7738 #include "confdefs.h"
7739
7740 #define _XOPEN_SOURCE_EXTENDED
7741 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7742 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7743
7744 #include <$cf_header>
7745 int
7746 main (void)
7747 {
7748
7749 #ifdef NCURSES_VERSION
7750
7751 #ifndef WACS_BSSB
7752         make an error
7753 #endif
7754
7755 printf("%s\n", NCURSES_VERSION);
7756 #else
7757 #ifdef __NCURSES_H
7758 printf("old\n");
7759 #else
7760         make an error
7761 #endif
7762 #endif
7763
7764   ;
7765   return 0;
7766 }
7767 _ACEOF
7768 rm -f conftest.$ac_objext
7769 if { (eval echo "$as_me:7769: \"$ac_compile\"") >&5
7770   (eval $ac_compile) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit $ac_status); } &&
7774          { ac_try='test -s conftest.$ac_objext'
7775   { (eval echo "$as_me:7775: \"$ac_try\"") >&5
7776   (eval $ac_try) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); }; }; then
7780   cf_cv_ncurses_h=$cf_header
7781
7782 else
7783   echo "$as_me: failed program was:" >&5
7784 cat conftest.$ac_ext >&5
7785 cf_cv_ncurses_h=no
7786 fi
7787 rm -f conftest.$ac_objext conftest.$ac_ext
7788
7789                 test "$cf_cv_ncurses_h" != no && break
7790         done
7791
7792 fi
7793 echo "$as_me:7793: result: $cf_cv_ncurses_h" >&5
7794 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7795
7796 if test "$cf_cv_ncurses_h" != no ; then
7797         cf_cv_ncurses_header=$cf_cv_ncurses_h
7798 else
7799
7800 echo "$as_me:7800: checking for $cf_ncuhdr_root include-path" >&5
7801 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7802 if test "${cf_cv_ncurses_h2+set}" = set; then
7803   echo $ECHO_N "(cached) $ECHO_C" >&6
7804 else
7805
7806         test -n "$verbose" && echo
7807
7808 cf_search=
7809
7810 # collect the current set of include-directories from compiler flags
7811 cf_header_path_list=""
7812 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7813         for cf_header_path in $CPPFLAGS $CFLAGS
7814         do
7815                 case $cf_header_path in
7816                 (-I*)
7817                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7818
7819 test "x$cf_header_path" != "xNONE" && \
7820 test -d "$cf_header_path" && \
7821  {
7822         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7823         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7824         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7825         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7826         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7827         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"
7828 }
7829
7830                         cf_header_path_list="$cf_header_path_list $cf_search"
7831                         ;;
7832                 esac
7833         done
7834 fi
7835
7836 # add the variations for the package we are looking for
7837
7838 cf_search=
7839
7840 test "x$prefix" != "xNONE" && \
7841 test -d "$prefix" && \
7842  {
7843         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7844         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7845         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7846         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7847         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7848         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7849 }
7850
7851 for cf_subdir_prefix in \
7852         /usr \
7853         /usr/local \
7854         /usr/pkg \
7855         /opt \
7856         /opt/local \
7857         $HOME
7858 do
7859
7860 test "x$cf_subdir_prefix" != "x$prefix" && \
7861 test -d "$cf_subdir_prefix" && \
7862 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7863         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7864         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7865         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7866         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7867         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7868         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"
7869 }
7870
7871 done
7872
7873 test "$includedir" != NONE && \
7874 test "$includedir" != "/usr/include" && \
7875 test -d "$includedir" && {
7876         test -d $includedir &&    cf_search="$cf_search $includedir"
7877         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7878 }
7879
7880 test "$oldincludedir" != NONE && \
7881 test "$oldincludedir" != "/usr/include" && \
7882 test -d "$oldincludedir" && {
7883         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7884         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7885 }
7886
7887 cf_search="$cf_search $cf_header_path_list"
7888
7889         test -n "$verbose" && echo search path $cf_search
7890         cf_save2_CPPFLAGS="$CPPFLAGS"
7891         for cf_incdir in $cf_search
7892         do
7893
7894 if test -n "$cf_incdir" ; then
7895   for cf_add_incdir in $cf_incdir
7896   do
7897         while test $cf_add_incdir != /usr/include
7898         do
7899           if test -d $cf_add_incdir
7900           then
7901                 cf_have_incdir=no
7902                 if test -n "$CFLAGS$CPPFLAGS" ; then
7903                   # a loop is needed to ensure we can add subdirs of existing dirs
7904                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7905                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7906                           cf_have_incdir=yes; break
7907                         fi
7908                   done
7909                 fi
7910
7911                 if test "$cf_have_incdir" = no ; then
7912                   if test "$cf_add_incdir" = /usr/local/include ; then
7913                         if test "$GCC" = yes
7914                         then
7915                           cf_save_CPPFLAGS=$CPPFLAGS
7916
7917         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7918         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7919
7920                           cat >conftest.$ac_ext <<_ACEOF
7921 #line 7921 "configure"
7922 #include "confdefs.h"
7923 #include <stdio.h>
7924 int
7925 main (void)
7926 {
7927 printf("Hello")
7928   ;
7929   return 0;
7930 }
7931 _ACEOF
7932 rm -f conftest.$ac_objext
7933 if { (eval echo "$as_me:7933: \"$ac_compile\"") >&5
7934   (eval $ac_compile) 2>&5
7935   ac_status=$?
7936   echo "$as_me:7936: \$? = $ac_status" >&5
7937   (exit $ac_status); } &&
7938          { ac_try='test -s conftest.$ac_objext'
7939   { (eval echo "$as_me:7939: \"$ac_try\"") >&5
7940   (eval $ac_try) 2>&5
7941   ac_status=$?
7942   echo "$as_me:7942: \$? = $ac_status" >&5
7943   (exit $ac_status); }; }; then
7944   :
7945 else
7946   echo "$as_me: failed program was:" >&5
7947 cat conftest.$ac_ext >&5
7948 cf_have_incdir=yes
7949 fi
7950 rm -f conftest.$ac_objext conftest.$ac_ext
7951                           CPPFLAGS=$cf_save_CPPFLAGS
7952                         fi
7953                   fi
7954                 fi
7955
7956                 if test "$cf_have_incdir" = no ; then
7957                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7958
7959 echo "${as_me:-configure}:7959: testing adding $cf_add_incdir to include-path ..." 1>&5
7960
7961                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7962
7963                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7964                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7965                   cf_add_incdir="$cf_top_incdir"
7966                 else
7967                   break
7968                 fi
7969           else
7970                 break
7971           fi
7972         done
7973   done
7974 fi
7975
7976                 for cf_header in \
7977                         ncurses.h \
7978                         curses.h
7979                 do
7980
7981         cat >conftest.$ac_ext <<_ACEOF
7982 #line 7982 "configure"
7983 #include "confdefs.h"
7984
7985 #include <$cf_header>
7986 int
7987 main (void)
7988 {
7989
7990 #ifdef NCURSES_VERSION
7991
7992 printf("%s\n", NCURSES_VERSION);
7993 #else
7994 #ifdef __NCURSES_H
7995 printf("old\n");
7996 #else
7997         make an error
7998 #endif
7999 #endif
8000
8001   ;
8002   return 0;
8003 }
8004 _ACEOF
8005 rm -f conftest.$ac_objext
8006 if { (eval echo "$as_me:8006: \"$ac_compile\"") >&5
8007   (eval $ac_compile) 2>&5
8008   ac_status=$?
8009   echo "$as_me:8009: \$? = $ac_status" >&5
8010   (exit $ac_status); } &&
8011          { ac_try='test -s conftest.$ac_objext'
8012   { (eval echo "$as_me:8012: \"$ac_try\"") >&5
8013   (eval $ac_try) 2>&5
8014   ac_status=$?
8015   echo "$as_me:8015: \$? = $ac_status" >&5
8016   (exit $ac_status); }; }; then
8017   cf_cv_ncurses_h2=$cf_header
8018
8019 else
8020   echo "$as_me: failed program was:" >&5
8021 cat conftest.$ac_ext >&5
8022 cf_cv_ncurses_h2=no
8023 fi
8024 rm -f conftest.$ac_objext conftest.$ac_ext
8025
8026                         if test "$cf_cv_ncurses_h2" != no ; then
8027                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8028                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8029                                 break
8030                         fi
8031                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8032                 done
8033                 CPPFLAGS="$cf_save2_CPPFLAGS"
8034                 test "$cf_cv_ncurses_h2" != no && break
8035         done
8036         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8036: error: not found" >&5
8037 echo "$as_me: error: not found" >&2;}
8038    { (exit 1); exit 1; }; }
8039
8040 fi
8041 echo "$as_me:8041: result: $cf_cv_ncurses_h2" >&5
8042 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8043
8044         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8045         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8046         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8047                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8048         fi
8049
8050 if test -n "$cf_1st_incdir" ; then
8051   for cf_add_incdir in $cf_1st_incdir
8052   do
8053         while test $cf_add_incdir != /usr/include
8054         do
8055           if test -d $cf_add_incdir
8056           then
8057                 cf_have_incdir=no
8058                 if test -n "$CFLAGS$CPPFLAGS" ; then
8059                   # a loop is needed to ensure we can add subdirs of existing dirs
8060                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8061                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8062                           cf_have_incdir=yes; break
8063                         fi
8064                   done
8065                 fi
8066
8067                 if test "$cf_have_incdir" = no ; then
8068                   if test "$cf_add_incdir" = /usr/local/include ; then
8069                         if test "$GCC" = yes
8070                         then
8071                           cf_save_CPPFLAGS=$CPPFLAGS
8072
8073         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8074         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8075
8076                           cat >conftest.$ac_ext <<_ACEOF
8077 #line 8077 "configure"
8078 #include "confdefs.h"
8079 #include <stdio.h>
8080 int
8081 main (void)
8082 {
8083 printf("Hello")
8084   ;
8085   return 0;
8086 }
8087 _ACEOF
8088 rm -f conftest.$ac_objext
8089 if { (eval echo "$as_me:8089: \"$ac_compile\"") >&5
8090   (eval $ac_compile) 2>&5
8091   ac_status=$?
8092   echo "$as_me:8092: \$? = $ac_status" >&5
8093   (exit $ac_status); } &&
8094          { ac_try='test -s conftest.$ac_objext'
8095   { (eval echo "$as_me:8095: \"$ac_try\"") >&5
8096   (eval $ac_try) 2>&5
8097   ac_status=$?
8098   echo "$as_me:8098: \$? = $ac_status" >&5
8099   (exit $ac_status); }; }; then
8100   :
8101 else
8102   echo "$as_me: failed program was:" >&5
8103 cat conftest.$ac_ext >&5
8104 cf_have_incdir=yes
8105 fi
8106 rm -f conftest.$ac_objext conftest.$ac_ext
8107                           CPPFLAGS=$cf_save_CPPFLAGS
8108                         fi
8109                   fi
8110                 fi
8111
8112                 if test "$cf_have_incdir" = no ; then
8113                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8114
8115 echo "${as_me:-configure}:8115: testing adding $cf_add_incdir to include-path ..." 1>&5
8116
8117                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8118
8119                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8120                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8121                   cf_add_incdir="$cf_top_incdir"
8122                 else
8123                   break
8124                 fi
8125           else
8126                 break
8127           fi
8128         done
8129   done
8130 fi
8131
8132 fi
8133
8134 # Set definitions to allow ifdef'ing for ncurses.h
8135
8136 case $cf_cv_ncurses_header in
8137 (*ncurses.h)
8138
8139 cat >>confdefs.h <<\EOF
8140 #define HAVE_NCURSES_H 1
8141 EOF
8142
8143         ;;
8144 esac
8145
8146 case $cf_cv_ncurses_header in
8147 (ncurses/curses.h|ncurses/ncurses.h)
8148
8149 cat >>confdefs.h <<\EOF
8150 #define HAVE_NCURSES_NCURSES_H 1
8151 EOF
8152
8153         ;;
8154 (ncursesw/curses.h|ncursesw/ncurses.h)
8155
8156 cat >>confdefs.h <<\EOF
8157 #define HAVE_NCURSESW_NCURSES_H 1
8158 EOF
8159
8160         ;;
8161 esac
8162
8163 echo "$as_me:8163: checking for terminfo header" >&5
8164 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8165 if test "${cf_cv_term_header+set}" = set; then
8166   echo $ECHO_N "(cached) $ECHO_C" >&6
8167 else
8168
8169 case ${cf_cv_ncurses_header} in
8170 (*/ncurses.h|*/ncursesw.h)
8171         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8172         ;;
8173 (*)
8174         cf_term_header=term.h
8175         ;;
8176 esac
8177
8178 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8179 do
8180 cat >conftest.$ac_ext <<_ACEOF
8181 #line 8181 "configure"
8182 #include "confdefs.h"
8183 #include <stdio.h>
8184 #include <${cf_cv_ncurses_header:-curses.h}>
8185 #include <$cf_test>
8186
8187 int
8188 main (void)
8189 {
8190 int x = auto_left_margin; (void)x
8191   ;
8192   return 0;
8193 }
8194 _ACEOF
8195 rm -f conftest.$ac_objext
8196 if { (eval echo "$as_me:8196: \"$ac_compile\"") >&5
8197   (eval $ac_compile) 2>&5
8198   ac_status=$?
8199   echo "$as_me:8199: \$? = $ac_status" >&5
8200   (exit $ac_status); } &&
8201          { ac_try='test -s conftest.$ac_objext'
8202   { (eval echo "$as_me:8202: \"$ac_try\"") >&5
8203   (eval $ac_try) 2>&5
8204   ac_status=$?
8205   echo "$as_me:8205: \$? = $ac_status" >&5
8206   (exit $ac_status); }; }; then
8207
8208         cf_cv_term_header="$cf_test"
8209 else
8210   echo "$as_me: failed program was:" >&5
8211 cat conftest.$ac_ext >&5
8212
8213         cf_cv_term_header=unknown
8214
8215 fi
8216 rm -f conftest.$ac_objext conftest.$ac_ext
8217         test "$cf_cv_term_header" != unknown && break
8218 done
8219
8220 fi
8221 echo "$as_me:8221: result: $cf_cv_term_header" >&5
8222 echo "${ECHO_T}$cf_cv_term_header" >&6
8223
8224 # Set definitions to allow ifdef'ing to accommodate subdirectories
8225
8226 case $cf_cv_term_header in
8227 (*term.h)
8228
8229 cat >>confdefs.h <<\EOF
8230 #define HAVE_TERM_H 1
8231 EOF
8232
8233         ;;
8234 esac
8235
8236 case $cf_cv_term_header in
8237 (ncurses/term.h)
8238
8239 cat >>confdefs.h <<\EOF
8240 #define HAVE_NCURSES_TERM_H 1
8241 EOF
8242
8243         ;;
8244 (ncursesw/term.h)
8245
8246 cat >>confdefs.h <<\EOF
8247 #define HAVE_NCURSESW_TERM_H 1
8248 EOF
8249
8250         ;;
8251 esac
8252
8253 # some applications need this, but should check for NCURSES_VERSION
8254
8255 cat >>confdefs.h <<\EOF
8256 #define NCURSES 1
8257 EOF
8258
8259 echo "$as_me:8259: checking for ncurses version" >&5
8260 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8261 if test "${cf_cv_ncurses_version+set}" = set; then
8262   echo $ECHO_N "(cached) $ECHO_C" >&6
8263 else
8264
8265         cf_cv_ncurses_version=no
8266         cf_tempfile=out$$
8267         rm -f $cf_tempfile
8268         if test "$cross_compiling" = yes; then
8269
8270         # This will not work if the preprocessor splits the line after the
8271         # Autoconf token.  The 'unproto' program does that.
8272         cat > conftest.$ac_ext <<EOF
8273 #include <${cf_cv_ncurses_header:-curses.h}>
8274 #undef Autoconf
8275 #ifdef NCURSES_VERSION
8276 Autoconf NCURSES_VERSION
8277 #else
8278 #ifdef __NCURSES_H
8279 Autoconf "old"
8280 #endif
8281 ;
8282 #endif
8283 EOF
8284         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8285         { (eval echo "$as_me:8285: \"$cf_try\"") >&5
8286   (eval $cf_try) 2>&5
8287   ac_status=$?
8288   echo "$as_me:8288: \$? = $ac_status" >&5
8289   (exit $ac_status); }
8290         if test -f conftest.out ; then
8291                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8292                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8293                 rm -f conftest.out
8294         fi
8295
8296 else
8297   cat >conftest.$ac_ext <<_ACEOF
8298 #line 8298 "configure"
8299 #include "confdefs.h"
8300
8301 #include <${cf_cv_ncurses_header:-curses.h}>
8302 #include <stdio.h>
8303 int main(void)
8304 {
8305         FILE *fp = fopen("$cf_tempfile", "w");
8306 #ifdef NCURSES_VERSION
8307 # ifdef NCURSES_VERSION_PATCH
8308         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8309 # else
8310         fprintf(fp, "%s\n", NCURSES_VERSION);
8311 # endif
8312 #else
8313 # ifdef __NCURSES_H
8314         fprintf(fp, "old\n");
8315 # else
8316         make an error
8317 # endif
8318 #endif
8319         ${cf_cv_main_return:-return}(0);
8320 }
8321 _ACEOF
8322 rm -f conftest$ac_exeext
8323 if { (eval echo "$as_me:8323: \"$ac_link\"") >&5
8324   (eval $ac_link) 2>&5
8325   ac_status=$?
8326   echo "$as_me:8326: \$? = $ac_status" >&5
8327   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8328   { (eval echo "$as_me:8328: \"$ac_try\"") >&5
8329   (eval $ac_try) 2>&5
8330   ac_status=$?
8331   echo "$as_me:8331: \$? = $ac_status" >&5
8332   (exit $ac_status); }; }; then
8333
8334         cf_cv_ncurses_version=`cat $cf_tempfile`
8335 else
8336   echo "$as_me: program exited with status $ac_status" >&5
8337 echo "$as_me: failed program was:" >&5
8338 cat conftest.$ac_ext >&5
8339 fi
8340 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8341 fi
8342         rm -f $cf_tempfile
8343
8344 fi
8345 echo "$as_me:8345: result: $cf_cv_ncurses_version" >&5
8346 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8347 test "$cf_cv_ncurses_version" = no ||
8348 cat >>confdefs.h <<\EOF
8349 #define NCURSES 1
8350 EOF
8351
8352 cf_nculib_root=ncursesw
8353         # This works, except for the special case where we find gpm, but
8354         # ncurses is in a nonstandard location via $LIBS, and we really want
8355         # to link gpm.
8356 cf_ncurses_LIBS=""
8357 cf_ncurses_SAVE="$LIBS"
8358 echo "$as_me:8358: checking for Gpm_Open in -lgpm" >&5
8359 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8360 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8361   echo $ECHO_N "(cached) $ECHO_C" >&6
8362 else
8363   ac_check_lib_save_LIBS=$LIBS
8364 LIBS="-lgpm  $LIBS"
8365 cat >conftest.$ac_ext <<_ACEOF
8366 #line 8366 "configure"
8367 #include "confdefs.h"
8368
8369 /* Override any gcc2 internal prototype to avoid an error.  */
8370 #ifdef __cplusplus
8371 extern "C"
8372 #endif
8373 /* We use char because int might match the return type of a gcc2
8374    builtin and then its argument prototype would still apply.  */
8375 char Gpm_Open ();
8376 int
8377 main (void)
8378 {
8379 Gpm_Open ();
8380   ;
8381   return 0;
8382 }
8383 _ACEOF
8384 rm -f conftest.$ac_objext conftest$ac_exeext
8385 if { (eval echo "$as_me:8385: \"$ac_link\"") >&5
8386   (eval $ac_link) 2>&5
8387   ac_status=$?
8388   echo "$as_me:8388: \$? = $ac_status" >&5
8389   (exit $ac_status); } &&
8390          { ac_try='test -s conftest$ac_exeext'
8391   { (eval echo "$as_me:8391: \"$ac_try\"") >&5
8392   (eval $ac_try) 2>&5
8393   ac_status=$?
8394   echo "$as_me:8394: \$? = $ac_status" >&5
8395   (exit $ac_status); }; }; then
8396   ac_cv_lib_gpm_Gpm_Open=yes
8397 else
8398   echo "$as_me: failed program was:" >&5
8399 cat conftest.$ac_ext >&5
8400 ac_cv_lib_gpm_Gpm_Open=no
8401 fi
8402 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8403 LIBS=$ac_check_lib_save_LIBS
8404 fi
8405 echo "$as_me:8405: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8406 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8407 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8408   echo "$as_me:8408: checking for initscr in -lgpm" >&5
8409 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8410 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8411   echo $ECHO_N "(cached) $ECHO_C" >&6
8412 else
8413   ac_check_lib_save_LIBS=$LIBS
8414 LIBS="-lgpm  $LIBS"
8415 cat >conftest.$ac_ext <<_ACEOF
8416 #line 8416 "configure"
8417 #include "confdefs.h"
8418
8419 /* Override any gcc2 internal prototype to avoid an error.  */
8420 #ifdef __cplusplus
8421 extern "C"
8422 #endif
8423 /* We use char because int might match the return type of a gcc2
8424    builtin and then its argument prototype would still apply.  */
8425 char initscr ();
8426 int
8427 main (void)
8428 {
8429 initscr ();
8430   ;
8431   return 0;
8432 }
8433 _ACEOF
8434 rm -f conftest.$ac_objext conftest$ac_exeext
8435 if { (eval echo "$as_me:8435: \"$ac_link\"") >&5
8436   (eval $ac_link) 2>&5
8437   ac_status=$?
8438   echo "$as_me:8438: \$? = $ac_status" >&5
8439   (exit $ac_status); } &&
8440          { ac_try='test -s conftest$ac_exeext'
8441   { (eval echo "$as_me:8441: \"$ac_try\"") >&5
8442   (eval $ac_try) 2>&5
8443   ac_status=$?
8444   echo "$as_me:8444: \$? = $ac_status" >&5
8445   (exit $ac_status); }; }; then
8446   ac_cv_lib_gpm_initscr=yes
8447 else
8448   echo "$as_me: failed program was:" >&5
8449 cat conftest.$ac_ext >&5
8450 ac_cv_lib_gpm_initscr=no
8451 fi
8452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8453 LIBS=$ac_check_lib_save_LIBS
8454 fi
8455 echo "$as_me:8455: result: $ac_cv_lib_gpm_initscr" >&5
8456 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8457 if test $ac_cv_lib_gpm_initscr = yes; then
8458   LIBS="$cf_ncurses_SAVE"
8459 else
8460   cf_ncurses_LIBS="-lgpm"
8461 fi
8462
8463 fi
8464
8465 case $host_os in
8466 (freebsd*)
8467         # This is only necessary if you are linking against an obsolete
8468         # version of ncurses (but it should do no harm, since it's static).
8469         if test "$cf_nculib_root" = ncurses ; then
8470                 echo "$as_me:8470: checking for tgoto in -lmytinfo" >&5
8471 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8472 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8473   echo $ECHO_N "(cached) $ECHO_C" >&6
8474 else
8475   ac_check_lib_save_LIBS=$LIBS
8476 LIBS="-lmytinfo  $LIBS"
8477 cat >conftest.$ac_ext <<_ACEOF
8478 #line 8478 "configure"
8479 #include "confdefs.h"
8480
8481 /* Override any gcc2 internal prototype to avoid an error.  */
8482 #ifdef __cplusplus
8483 extern "C"
8484 #endif
8485 /* We use char because int might match the return type of a gcc2
8486    builtin and then its argument prototype would still apply.  */
8487 char tgoto ();
8488 int
8489 main (void)
8490 {
8491 tgoto ();
8492   ;
8493   return 0;
8494 }
8495 _ACEOF
8496 rm -f conftest.$ac_objext conftest$ac_exeext
8497 if { (eval echo "$as_me:8497: \"$ac_link\"") >&5
8498   (eval $ac_link) 2>&5
8499   ac_status=$?
8500   echo "$as_me:8500: \$? = $ac_status" >&5
8501   (exit $ac_status); } &&
8502          { ac_try='test -s conftest$ac_exeext'
8503   { (eval echo "$as_me:8503: \"$ac_try\"") >&5
8504   (eval $ac_try) 2>&5
8505   ac_status=$?
8506   echo "$as_me:8506: \$? = $ac_status" >&5
8507   (exit $ac_status); }; }; then
8508   ac_cv_lib_mytinfo_tgoto=yes
8509 else
8510   echo "$as_me: failed program was:" >&5
8511 cat conftest.$ac_ext >&5
8512 ac_cv_lib_mytinfo_tgoto=no
8513 fi
8514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8515 LIBS=$ac_check_lib_save_LIBS
8516 fi
8517 echo "$as_me:8517: result: $ac_cv_lib_mytinfo_tgoto" >&5
8518 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8519 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8520   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8521 fi
8522
8523         fi
8524         ;;
8525 esac
8526
8527 cf_add_libs="$LIBS"
8528 # reverse order
8529 cf_add_0lib=
8530 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8531 # filter duplicates
8532 for cf_add_1lib in $cf_add_0lib; do
8533         for cf_add_2lib in $cf_add_libs; do
8534                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8535                         cf_add_1lib=
8536                         break
8537                 fi
8538         done
8539         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8540 done
8541 LIBS="$cf_add_libs"
8542
8543 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8544 then
8545
8546 cf_add_libs="$LIBS"
8547 # reverse order
8548 cf_add_0lib=
8549 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8550 # filter duplicates
8551 for cf_add_1lib in $cf_add_0lib; do
8552         for cf_add_2lib in $cf_add_libs; do
8553                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8554                         cf_add_1lib=
8555                         break
8556                 fi
8557         done
8558         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8559 done
8560 LIBS="$cf_add_libs"
8561
8562 else
8563
8564         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8565         cf_libdir=""
8566         echo "$as_me:8566: checking for initscr" >&5
8567 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8568 if test "${ac_cv_func_initscr+set}" = set; then
8569   echo $ECHO_N "(cached) $ECHO_C" >&6
8570 else
8571   cat >conftest.$ac_ext <<_ACEOF
8572 #line 8572 "configure"
8573 #include "confdefs.h"
8574 #define initscr autoconf_temporary
8575 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8576 #undef initscr
8577
8578 #ifdef __cplusplus
8579 extern "C"
8580 #endif
8581
8582 /* We use char because int might match the return type of a gcc2
8583    builtin and then its argument prototype would still apply.  */
8584 char initscr (void);
8585
8586 int
8587 main (void)
8588 {
8589
8590 /* The GNU C library defines stubs for functions which it implements
8591     to always fail with ENOSYS.  Some functions are actually named
8592     something starting with __ and the normal name is an alias.  */
8593 #if defined (__stub_initscr) || defined (__stub___initscr)
8594 #error found stub for initscr
8595 #endif
8596
8597         return initscr ();
8598   ;
8599   return 0;
8600 }
8601 _ACEOF
8602 rm -f conftest.$ac_objext conftest$ac_exeext
8603 if { (eval echo "$as_me:8603: \"$ac_link\"") >&5
8604   (eval $ac_link) 2>&5
8605   ac_status=$?
8606   echo "$as_me:8606: \$? = $ac_status" >&5
8607   (exit $ac_status); } &&
8608          { ac_try='test -s conftest$ac_exeext'
8609   { (eval echo "$as_me:8609: \"$ac_try\"") >&5
8610   (eval $ac_try) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit $ac_status); }; }; then
8614   ac_cv_func_initscr=yes
8615 else
8616   echo "$as_me: failed program was:" >&5
8617 cat conftest.$ac_ext >&5
8618 ac_cv_func_initscr=no
8619 fi
8620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8621 fi
8622 echo "$as_me:8622: result: $ac_cv_func_initscr" >&5
8623 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8624 if test $ac_cv_func_initscr = yes; then
8625   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8626 else
8627
8628                 cf_save_LIBS="$LIBS"
8629                 echo "$as_me:8629: checking for initscr in -l$cf_nculib_root" >&5
8630 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8631                 LIBS="-l$cf_nculib_root $LIBS"
8632                 cat >conftest.$ac_ext <<_ACEOF
8633 #line 8633 "configure"
8634 #include "confdefs.h"
8635 #include <${cf_cv_ncurses_header:-curses.h}>
8636 int
8637 main (void)
8638 {
8639 initscr()
8640   ;
8641   return 0;
8642 }
8643 _ACEOF
8644 rm -f conftest.$ac_objext conftest$ac_exeext
8645 if { (eval echo "$as_me:8645: \"$ac_link\"") >&5
8646   (eval $ac_link) 2>&5
8647   ac_status=$?
8648   echo "$as_me:8648: \$? = $ac_status" >&5
8649   (exit $ac_status); } &&
8650          { ac_try='test -s conftest$ac_exeext'
8651   { (eval echo "$as_me:8651: \"$ac_try\"") >&5
8652   (eval $ac_try) 2>&5
8653   ac_status=$?
8654   echo "$as_me:8654: \$? = $ac_status" >&5
8655   (exit $ac_status); }; }; then
8656   echo "$as_me:8656: result: yes" >&5
8657 echo "${ECHO_T}yes" >&6
8658                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8659
8660 else
8661   echo "$as_me: failed program was:" >&5
8662 cat conftest.$ac_ext >&5
8663 echo "$as_me:8663: result: no" >&5
8664 echo "${ECHO_T}no" >&6
8665
8666 cf_search=
8667 cf_library_path_list=""
8668 if test -n "${LDFLAGS}${LIBS}" ; then
8669         for cf_library_path in $LDFLAGS $LIBS
8670         do
8671                 case $cf_library_path in
8672                 (-L*)
8673                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8674
8675 test "x$cf_library_path" != "xNONE" && \
8676 test -d "$cf_library_path" && \
8677  {
8678         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8679         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8680         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8681         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8682         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8683         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"
8684 }
8685
8686                         cf_library_path_list="$cf_library_path_list $cf_search"
8687                         ;;
8688                 esac
8689         done
8690 fi
8691
8692 cf_search=
8693
8694 test "x$prefix" != "xNONE" && \
8695 test -d "$prefix" && \
8696  {
8697         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8698         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8699         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8700         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8701         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8702         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8703 }
8704
8705 for cf_subdir_prefix in \
8706         /usr \
8707         /usr/local \
8708         /usr/pkg \
8709         /opt \
8710         /opt/local \
8711         $HOME
8712 do
8713
8714 test "x$cf_subdir_prefix" != "x$prefix" && \
8715 test -d "$cf_subdir_prefix" && \
8716 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8717         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8718         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8719         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8720         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8721         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8722         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"
8723 }
8724
8725 done
8726
8727 cf_search="$cf_library_path_list $cf_search"
8728
8729                         for cf_libdir in $cf_search
8730                         do
8731                                 echo "$as_me:8731: checking for -l$cf_nculib_root in $cf_libdir" >&5
8732 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8733                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8734                                 cat >conftest.$ac_ext <<_ACEOF
8735 #line 8735 "configure"
8736 #include "confdefs.h"
8737 #include <${cf_cv_ncurses_header:-curses.h}>
8738 int
8739 main (void)
8740 {
8741 initscr()
8742   ;
8743   return 0;
8744 }
8745 _ACEOF
8746 rm -f conftest.$ac_objext conftest$ac_exeext
8747 if { (eval echo "$as_me:8747: \"$ac_link\"") >&5
8748   (eval $ac_link) 2>&5
8749   ac_status=$?
8750   echo "$as_me:8750: \$? = $ac_status" >&5
8751   (exit $ac_status); } &&
8752          { ac_try='test -s conftest$ac_exeext'
8753   { (eval echo "$as_me:8753: \"$ac_try\"") >&5
8754   (eval $ac_try) 2>&5
8755   ac_status=$?
8756   echo "$as_me:8756: \$? = $ac_status" >&5
8757   (exit $ac_status); }; }; then
8758   echo "$as_me:8758: result: yes" >&5
8759 echo "${ECHO_T}yes" >&6
8760                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8761                                          break
8762 else
8763   echo "$as_me: failed program was:" >&5
8764 cat conftest.$ac_ext >&5
8765 echo "$as_me:8765: result: no" >&5
8766 echo "${ECHO_T}no" >&6
8767                                          LIBS="$cf_save_LIBS"
8768 fi
8769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8770                         done
8771
8772 fi
8773 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8774
8775 fi
8776
8777 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8778
8779 if test $cf_found_library = no ; then
8780         { { echo "$as_me:8780: error: Cannot link $cf_nculib_root library" >&5
8781 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8782    { (exit 1); exit 1; }; }
8783 fi
8784
8785 fi
8786
8787 if test -n "$cf_ncurses_LIBS" ; then
8788         echo "$as_me:8788: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8789 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8790         cf_ncurses_SAVE="$LIBS"
8791         for p in $cf_ncurses_LIBS ; do
8792                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8793                 if test "$q" != "$LIBS" ; then
8794                         LIBS="$q"
8795                 fi
8796         done
8797         cat >conftest.$ac_ext <<_ACEOF
8798 #line 8798 "configure"
8799 #include "confdefs.h"
8800 #include <${cf_cv_ncurses_header:-curses.h}>
8801 int
8802 main (void)
8803 {
8804 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8805   ;
8806   return 0;
8807 }
8808 _ACEOF
8809 rm -f conftest.$ac_objext conftest$ac_exeext
8810 if { (eval echo "$as_me:8810: \"$ac_link\"") >&5
8811   (eval $ac_link) 2>&5
8812   ac_status=$?
8813   echo "$as_me:8813: \$? = $ac_status" >&5
8814   (exit $ac_status); } &&
8815          { ac_try='test -s conftest$ac_exeext'
8816   { (eval echo "$as_me:8816: \"$ac_try\"") >&5
8817   (eval $ac_try) 2>&5
8818   ac_status=$?
8819   echo "$as_me:8819: \$? = $ac_status" >&5
8820   (exit $ac_status); }; }; then
8821   echo "$as_me:8821: result: yes" >&5
8822 echo "${ECHO_T}yes" >&6
8823 else
8824   echo "$as_me: failed program was:" >&5
8825 cat conftest.$ac_ext >&5
8826 echo "$as_me:8826: result: no" >&5
8827 echo "${ECHO_T}no" >&6
8828                  LIBS="$cf_ncurses_SAVE"
8829 fi
8830 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8831 fi
8832
8833 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8834
8835 cat >>confdefs.h <<EOF
8836 #define $cf_nculib_ROOT 1
8837 EOF
8838
8839         fi
8840 else
8841         NCURSES_CONFIG=none
8842 fi
8843
8844 else
8845
8846 cf_ncuconfig_root=ncurses
8847 cf_have_ncuconfig=no
8848
8849 if test "x${PKG_CONFIG:=none}" != xnone; then
8850         echo "$as_me:8850: checking pkg-config for $cf_ncuconfig_root" >&5
8851 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8852         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8853                 echo "$as_me:8853: result: yes" >&5
8854 echo "${ECHO_T}yes" >&6
8855
8856                 echo "$as_me:8856: checking if the $cf_ncuconfig_root package files work" >&5
8857 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8858                 cf_have_ncuconfig=unknown
8859
8860                 cf_save_CFLAGS="$CFLAGS"
8861                 cf_save_CPPFLAGS="$CPPFLAGS"
8862                 cf_save_LIBS="$LIBS"
8863
8864                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8865                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8866
8867                 # while -W for passing linker flags is prevalent, it is not "standard".
8868                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8869                 # incompatible _and_ non-standard -W option which gives an error.  Work
8870                 # around that pitfall.
8871                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8872                 (x*c[89]9@@*-W*)
8873
8874 cf_fix_cppflags=no
8875 cf_new_cflags=
8876 cf_new_cppflags=
8877 cf_new_extra_cppflags=
8878
8879 for cf_add_cflags in $cf_pkg_cflags
8880 do
8881 case $cf_fix_cppflags in
8882 (no)
8883         case $cf_add_cflags in
8884         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8885                 case $cf_add_cflags in
8886                 (-D*)
8887                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8888
8889                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8890                                 && test -z "${cf_tst_cflags}" \
8891                                 && cf_fix_cppflags=yes
8892
8893                         if test $cf_fix_cppflags = yes ; then
8894
8895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8897
8898                                 continue
8899                         elif test "${cf_tst_cflags}" = "\"'" ; then
8900
8901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8903
8904                                 continue
8905                         fi
8906                         ;;
8907                 esac
8908                 case "$CPPFLAGS" in
8909                 (*$cf_add_cflags)
8910                         ;;
8911                 (*)
8912                         case $cf_add_cflags in
8913                         (-D*)
8914                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8915
8916 CPPFLAGS=`echo "$CPPFLAGS" | \
8917         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8918                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8919
8920                                 ;;
8921                         esac
8922
8923         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8924         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8925
8926                         ;;
8927                 esac
8928                 ;;
8929         (*)
8930
8931         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8932         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8933
8934                 ;;
8935         esac
8936         ;;
8937 (yes)
8938
8939         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8940         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8941
8942         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8943
8944         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8945                 && test -z "${cf_tst_cflags}" \
8946                 && cf_fix_cppflags=no
8947         ;;
8948 esac
8949 done
8950
8951 if test -n "$cf_new_cflags" ; then
8952
8953         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8954         CFLAGS="${CFLAGS}$cf_new_cflags"
8955
8956 fi
8957
8958 if test -n "$cf_new_cppflags" ; then
8959
8960         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8961         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8962
8963 fi
8964
8965 if test -n "$cf_new_extra_cppflags" ; then
8966
8967         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8968         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8969
8970 fi
8971
8972 cf_add_libs="$LIBS"
8973 # reverse order
8974 cf_add_0lib=
8975 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8976 # filter duplicates
8977 for cf_add_1lib in $cf_add_0lib; do
8978         for cf_add_2lib in $cf_add_libs; do
8979                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8980                         cf_add_1lib=
8981                         break
8982                 fi
8983         done
8984         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8985 done
8986 LIBS="$cf_add_libs"
8987
8988                         cat >conftest.$ac_ext <<_ACEOF
8989 #line 8989 "configure"
8990 #include "confdefs.h"
8991 #include <${cf_cv_ncurses_header:-curses.h}>
8992 int
8993 main (void)
8994 {
8995 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8996   ;
8997   return 0;
8998 }
8999 _ACEOF
9000 rm -f conftest.$ac_objext conftest$ac_exeext
9001 if { (eval echo "$as_me:9001: \"$ac_link\"") >&5
9002   (eval $ac_link) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit $ac_status); } &&
9006          { ac_try='test -s conftest$ac_exeext'
9007   { (eval echo "$as_me:9007: \"$ac_try\"") >&5
9008   (eval $ac_try) 2>&5
9009   ac_status=$?
9010   echo "$as_me:9010: \$? = $ac_status" >&5
9011   (exit $ac_status); }; }; then
9012   if test "$cross_compiling" = yes; then
9013   cf_test_ncuconfig=maybe
9014 else
9015   cat >conftest.$ac_ext <<_ACEOF
9016 #line 9016 "configure"
9017 #include "confdefs.h"
9018 #include <${cf_cv_ncurses_header:-curses.h}>
9019                                         int main(void)
9020                                         { char *xx = curses_version(); return (xx == 0); }
9021 _ACEOF
9022 rm -f conftest$ac_exeext
9023 if { (eval echo "$as_me:9023: \"$ac_link\"") >&5
9024   (eval $ac_link) 2>&5
9025   ac_status=$?
9026   echo "$as_me:9026: \$? = $ac_status" >&5
9027   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9028   { (eval echo "$as_me:9028: \"$ac_try\"") >&5
9029   (eval $ac_try) 2>&5
9030   ac_status=$?
9031   echo "$as_me:9031: \$? = $ac_status" >&5
9032   (exit $ac_status); }; }; then
9033   cf_test_ncuconfig=yes
9034 else
9035   echo "$as_me: program exited with status $ac_status" >&5
9036 echo "$as_me: failed program was:" >&5
9037 cat conftest.$ac_ext >&5
9038 cf_test_ncuconfig=no
9039 fi
9040 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9041 fi
9042 else
9043   echo "$as_me: failed program was:" >&5
9044 cat conftest.$ac_ext >&5
9045 cf_test_ncuconfig=no
9046 fi
9047 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9048
9049                         CFLAGS="$cf_save_CFLAGS"
9050                         CPPFLAGS="$cf_save_CPPFLAGS"
9051                         LIBS="$cf_save_LIBS"
9052
9053                         if test "x$cf_test_ncuconfig" != xyes; then
9054                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9055                                 cf_pkg_cflags="$cf_temp"
9056                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9057                                 cf_pkg_libs="$cf_temp"
9058                         fi
9059                         ;;
9060                 esac
9061
9062 cf_fix_cppflags=no
9063 cf_new_cflags=
9064 cf_new_cppflags=
9065 cf_new_extra_cppflags=
9066
9067 for cf_add_cflags in $cf_pkg_cflags
9068 do
9069 case $cf_fix_cppflags in
9070 (no)
9071         case $cf_add_cflags in
9072         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9073                 case $cf_add_cflags in
9074                 (-D*)
9075                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9076
9077                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9078                                 && test -z "${cf_tst_cflags}" \
9079                                 && cf_fix_cppflags=yes
9080
9081                         if test $cf_fix_cppflags = yes ; then
9082
9083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9085
9086                                 continue
9087                         elif test "${cf_tst_cflags}" = "\"'" ; then
9088
9089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9091
9092                                 continue
9093                         fi
9094                         ;;
9095                 esac
9096                 case "$CPPFLAGS" in
9097                 (*$cf_add_cflags)
9098                         ;;
9099                 (*)
9100                         case $cf_add_cflags in
9101                         (-D*)
9102                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9103
9104 CPPFLAGS=`echo "$CPPFLAGS" | \
9105         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9106                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9107
9108                                 ;;
9109                         esac
9110
9111         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9112         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9113
9114                         ;;
9115                 esac
9116                 ;;
9117         (*)
9118
9119         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9120         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9121
9122                 ;;
9123         esac
9124         ;;
9125 (yes)
9126
9127         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9128         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9129
9130         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9131
9132         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9133                 && test -z "${cf_tst_cflags}" \
9134                 && cf_fix_cppflags=no
9135         ;;
9136 esac
9137 done
9138
9139 if test -n "$cf_new_cflags" ; then
9140
9141         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9142         CFLAGS="${CFLAGS}$cf_new_cflags"
9143
9144 fi
9145
9146 if test -n "$cf_new_cppflags" ; then
9147
9148         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9149         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9150
9151 fi
9152
9153 if test -n "$cf_new_extra_cppflags" ; then
9154
9155         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9156         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9157
9158 fi
9159
9160 cf_add_libs="$LIBS"
9161 # reverse order
9162 cf_add_0lib=
9163 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9164 # filter duplicates
9165 for cf_add_1lib in $cf_add_0lib; do
9166         for cf_add_2lib in $cf_add_libs; do
9167                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9168                         cf_add_1lib=
9169                         break
9170                 fi
9171         done
9172         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9173 done
9174 LIBS="$cf_add_libs"
9175
9176                 cat >conftest.$ac_ext <<_ACEOF
9177 #line 9177 "configure"
9178 #include "confdefs.h"
9179 #include <${cf_cv_ncurses_header:-curses.h}>
9180 int
9181 main (void)
9182 {
9183 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9184   ;
9185   return 0;
9186 }
9187 _ACEOF
9188 rm -f conftest.$ac_objext conftest$ac_exeext
9189 if { (eval echo "$as_me:9189: \"$ac_link\"") >&5
9190   (eval $ac_link) 2>&5
9191   ac_status=$?
9192   echo "$as_me:9192: \$? = $ac_status" >&5
9193   (exit $ac_status); } &&
9194          { ac_try='test -s conftest$ac_exeext'
9195   { (eval echo "$as_me:9195: \"$ac_try\"") >&5
9196   (eval $ac_try) 2>&5
9197   ac_status=$?
9198   echo "$as_me:9198: \$? = $ac_status" >&5
9199   (exit $ac_status); }; }; then
9200   if test "$cross_compiling" = yes; then
9201   cf_have_ncuconfig=maybe
9202 else
9203   cat >conftest.$ac_ext <<_ACEOF
9204 #line 9204 "configure"
9205 #include "confdefs.h"
9206 #include <${cf_cv_ncurses_header:-curses.h}>
9207                                 int main(void)
9208                                 { char *xx = curses_version(); return (xx == 0); }
9209 _ACEOF
9210 rm -f conftest$ac_exeext
9211 if { (eval echo "$as_me:9211: \"$ac_link\"") >&5
9212   (eval $ac_link) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9216   { (eval echo "$as_me:9216: \"$ac_try\"") >&5
9217   (eval $ac_try) 2>&5
9218   ac_status=$?
9219   echo "$as_me:9219: \$? = $ac_status" >&5
9220   (exit $ac_status); }; }; then
9221   cf_have_ncuconfig=yes
9222 else
9223   echo "$as_me: program exited with status $ac_status" >&5
9224 echo "$as_me: failed program was:" >&5
9225 cat conftest.$ac_ext >&5
9226 cf_have_ncuconfig=no
9227 fi
9228 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9229 fi
9230 else
9231   echo "$as_me: failed program was:" >&5
9232 cat conftest.$ac_ext >&5
9233 cf_have_ncuconfig=no
9234 fi
9235 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9236                 echo "$as_me:9236: result: $cf_have_ncuconfig" >&5
9237 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9238                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9239                 if test "$cf_have_ncuconfig" != "yes"
9240                 then
9241                         CPPFLAGS="$cf_save_CPPFLAGS"
9242                         LIBS="$cf_save_LIBS"
9243                         NCURSES_CONFIG_PKG=none
9244                 else
9245
9246 cat >>confdefs.h <<\EOF
9247 #define NCURSES 1
9248 EOF
9249
9250                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9251
9252 echo "$as_me:9252: checking for terminfo header" >&5
9253 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9254 if test "${cf_cv_term_header+set}" = set; then
9255   echo $ECHO_N "(cached) $ECHO_C" >&6
9256 else
9257
9258 case ${cf_cv_ncurses_header} in
9259 (*/ncurses.h|*/ncursesw.h)
9260         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9261         ;;
9262 (*)
9263         cf_term_header=term.h
9264         ;;
9265 esac
9266
9267 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9268 do
9269 cat >conftest.$ac_ext <<_ACEOF
9270 #line 9270 "configure"
9271 #include "confdefs.h"
9272 #include <stdio.h>
9273 #include <${cf_cv_ncurses_header:-curses.h}>
9274 #include <$cf_test>
9275
9276 int
9277 main (void)
9278 {
9279 int x = auto_left_margin; (void)x
9280   ;
9281   return 0;
9282 }
9283 _ACEOF
9284 rm -f conftest.$ac_objext
9285 if { (eval echo "$as_me:9285: \"$ac_compile\"") >&5
9286   (eval $ac_compile) 2>&5
9287   ac_status=$?
9288   echo "$as_me:9288: \$? = $ac_status" >&5
9289   (exit $ac_status); } &&
9290          { ac_try='test -s conftest.$ac_objext'
9291   { (eval echo "$as_me:9291: \"$ac_try\"") >&5
9292   (eval $ac_try) 2>&5
9293   ac_status=$?
9294   echo "$as_me:9294: \$? = $ac_status" >&5
9295   (exit $ac_status); }; }; then
9296
9297         cf_cv_term_header="$cf_test"
9298 else
9299   echo "$as_me: failed program was:" >&5
9300 cat conftest.$ac_ext >&5
9301
9302         cf_cv_term_header=unknown
9303
9304 fi
9305 rm -f conftest.$ac_objext conftest.$ac_ext
9306         test "$cf_cv_term_header" != unknown && break
9307 done
9308
9309 fi
9310 echo "$as_me:9310: result: $cf_cv_term_header" >&5
9311 echo "${ECHO_T}$cf_cv_term_header" >&6
9312
9313 # Set definitions to allow ifdef'ing to accommodate subdirectories
9314
9315 case $cf_cv_term_header in
9316 (*term.h)
9317
9318 cat >>confdefs.h <<\EOF
9319 #define HAVE_TERM_H 1
9320 EOF
9321
9322         ;;
9323 esac
9324
9325 case $cf_cv_term_header in
9326 (ncurses/term.h)
9327
9328 cat >>confdefs.h <<\EOF
9329 #define HAVE_NCURSES_TERM_H 1
9330 EOF
9331
9332         ;;
9333 (ncursesw/term.h)
9334
9335 cat >>confdefs.h <<\EOF
9336 #define HAVE_NCURSESW_TERM_H 1
9337 EOF
9338
9339         ;;
9340 esac
9341
9342                 fi
9343
9344         else
9345                 echo "$as_me:9345: result: no" >&5
9346 echo "${ECHO_T}no" >&6
9347                 NCURSES_CONFIG_PKG=none
9348         fi
9349 else
9350         NCURSES_CONFIG_PKG=none
9351 fi
9352
9353 if test "x$cf_have_ncuconfig" = "xno"; then
9354         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9355
9356 if test -n "$ac_tool_prefix"; then
9357   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9358   do
9359     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9360 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9361 echo "$as_me:9361: checking for $ac_word" >&5
9362 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9363 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9364   echo $ECHO_N "(cached) $ECHO_C" >&6
9365 else
9366   if test -n "$NCURSES_CONFIG"; then
9367   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9368 else
9369   ac_save_IFS=$IFS; IFS=$ac_path_separator
9370 ac_dummy="$PATH"
9371 for ac_dir in $ac_dummy; do
9372   IFS=$ac_save_IFS
9373   test -z "$ac_dir" && ac_dir=.
9374   $as_executable_p "$ac_dir/$ac_word" || continue
9375 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9376 echo "$as_me:9376: found $ac_dir/$ac_word" >&5
9377 break
9378 done
9379
9380 fi
9381 fi
9382 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9383 if test -n "$NCURSES_CONFIG"; then
9384   echo "$as_me:9384: result: $NCURSES_CONFIG" >&5
9385 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9386 else
9387   echo "$as_me:9387: result: no" >&5
9388 echo "${ECHO_T}no" >&6
9389 fi
9390
9391     test -n "$NCURSES_CONFIG" && break
9392   done
9393 fi
9394 if test -z "$NCURSES_CONFIG"; then
9395   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9396   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9397 do
9398   # Extract the first word of "$ac_prog", so it can be a program name with args.
9399 set dummy $ac_prog; ac_word=$2
9400 echo "$as_me:9400: checking for $ac_word" >&5
9401 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9402 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9403   echo $ECHO_N "(cached) $ECHO_C" >&6
9404 else
9405   if test -n "$ac_ct_NCURSES_CONFIG"; then
9406   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9407 else
9408   ac_save_IFS=$IFS; IFS=$ac_path_separator
9409 ac_dummy="$PATH"
9410 for ac_dir in $ac_dummy; do
9411   IFS=$ac_save_IFS
9412   test -z "$ac_dir" && ac_dir=.
9413   $as_executable_p "$ac_dir/$ac_word" || continue
9414 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9415 echo "$as_me:9415: found $ac_dir/$ac_word" >&5
9416 break
9417 done
9418
9419 fi
9420 fi
9421 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9422 if test -n "$ac_ct_NCURSES_CONFIG"; then
9423   echo "$as_me:9423: result: $ac_ct_NCURSES_CONFIG" >&5
9424 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9425 else
9426   echo "$as_me:9426: result: no" >&5
9427 echo "${ECHO_T}no" >&6
9428 fi
9429
9430   test -n "$ac_ct_NCURSES_CONFIG" && break
9431 done
9432 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9433
9434   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9435 fi
9436
9437         if test "$NCURSES_CONFIG" != none ; then
9438
9439 cf_fix_cppflags=no
9440 cf_new_cflags=
9441 cf_new_cppflags=
9442 cf_new_extra_cppflags=
9443
9444 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9445 do
9446 case $cf_fix_cppflags in
9447 (no)
9448         case $cf_add_cflags in
9449         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9450                 case $cf_add_cflags in
9451                 (-D*)
9452                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9453
9454                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9455                                 && test -z "${cf_tst_cflags}" \
9456                                 && cf_fix_cppflags=yes
9457
9458                         if test $cf_fix_cppflags = yes ; then
9459
9460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9462
9463                                 continue
9464                         elif test "${cf_tst_cflags}" = "\"'" ; then
9465
9466         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9467         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9468
9469                                 continue
9470                         fi
9471                         ;;
9472                 esac
9473                 case "$CPPFLAGS" in
9474                 (*$cf_add_cflags)
9475                         ;;
9476                 (*)
9477                         case $cf_add_cflags in
9478                         (-D*)
9479                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9480
9481 CPPFLAGS=`echo "$CPPFLAGS" | \
9482         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9483                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9484
9485                                 ;;
9486                         esac
9487
9488         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9489         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9490
9491                         ;;
9492                 esac
9493                 ;;
9494         (*)
9495
9496         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9497         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9498
9499                 ;;
9500         esac
9501         ;;
9502 (yes)
9503
9504         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9505         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9506
9507         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9508
9509         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9510                 && test -z "${cf_tst_cflags}" \
9511                 && cf_fix_cppflags=no
9512         ;;
9513 esac
9514 done
9515
9516 if test -n "$cf_new_cflags" ; then
9517
9518         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9519         CFLAGS="${CFLAGS}$cf_new_cflags"
9520
9521 fi
9522
9523 if test -n "$cf_new_cppflags" ; then
9524
9525         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9526         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9527
9528 fi
9529
9530 if test -n "$cf_new_extra_cppflags" ; then
9531
9532         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9533         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9534
9535 fi
9536
9537 cf_add_libs="$LIBS"
9538 # reverse order
9539 cf_add_0lib=
9540 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9541 # filter duplicates
9542 for cf_add_1lib in $cf_add_0lib; do
9543         for cf_add_2lib in $cf_add_libs; do
9544                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9545                         cf_add_1lib=
9546                         break
9547                 fi
9548         done
9549         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9550 done
9551 LIBS="$cf_add_libs"
9552
9553                 # even with config script, some packages use no-override for curses.h
9554
9555 echo "$as_me:9555: checking if we have identified curses headers" >&5
9556 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9557 if test "${cf_cv_ncurses_header+set}" = set; then
9558   echo $ECHO_N "(cached) $ECHO_C" >&6
9559 else
9560
9561 cf_cv_ncurses_header=none
9562 for cf_header in \
9563         ncurses.h ncurses/ncurses.h \
9564         curses.h ncurses/curses.h
9565 do
9566 cat >conftest.$ac_ext <<_ACEOF
9567 #line 9567 "configure"
9568 #include "confdefs.h"
9569 #include <${cf_header}>
9570 int
9571 main (void)
9572 {
9573 initscr(); tgoto("?", 0,0)
9574   ;
9575   return 0;
9576 }
9577 _ACEOF
9578 rm -f conftest.$ac_objext
9579 if { (eval echo "$as_me:9579: \"$ac_compile\"") >&5
9580   (eval $ac_compile) 2>&5
9581   ac_status=$?
9582   echo "$as_me:9582: \$? = $ac_status" >&5
9583   (exit $ac_status); } &&
9584          { ac_try='test -s conftest.$ac_objext'
9585   { (eval echo "$as_me:9585: \"$ac_try\"") >&5
9586   (eval $ac_try) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); }; }; then
9590   cf_cv_ncurses_header=$cf_header; break
9591 else
9592   echo "$as_me: failed program was:" >&5
9593 cat conftest.$ac_ext >&5
9594 fi
9595 rm -f conftest.$ac_objext conftest.$ac_ext
9596 done
9597
9598 fi
9599 echo "$as_me:9599: result: $cf_cv_ncurses_header" >&5
9600 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9601
9602 if test "$cf_cv_ncurses_header" = none ; then
9603         { { echo "$as_me:9603: error: No curses header-files found" >&5
9604 echo "$as_me: error: No curses header-files found" >&2;}
9605    { (exit 1); exit 1; }; }
9606 fi
9607
9608 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9609
9610 for ac_header in $cf_cv_ncurses_header
9611 do
9612 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9613 echo "$as_me:9613: checking for $ac_header" >&5
9614 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9615 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9616   echo $ECHO_N "(cached) $ECHO_C" >&6
9617 else
9618   cat >conftest.$ac_ext <<_ACEOF
9619 #line 9619 "configure"
9620 #include "confdefs.h"
9621 #include <$ac_header>
9622 _ACEOF
9623 if { (eval echo "$as_me:9623: \"$ac_cpp conftest.$ac_ext\"") >&5
9624   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9625   ac_status=$?
9626   egrep -v '^ *\+' conftest.er1 >conftest.err
9627   rm -f conftest.er1
9628   cat conftest.err >&5
9629   echo "$as_me:9629: \$? = $ac_status" >&5
9630   (exit $ac_status); } >/dev/null; then
9631   if test -s conftest.err; then
9632     ac_cpp_err=$ac_c_preproc_warn_flag
9633   else
9634     ac_cpp_err=
9635   fi
9636 else
9637   ac_cpp_err=yes
9638 fi
9639 if test -z "$ac_cpp_err"; then
9640   eval "$as_ac_Header=yes"
9641 else
9642   echo "$as_me: failed program was:" >&5
9643   cat conftest.$ac_ext >&5
9644   eval "$as_ac_Header=no"
9645 fi
9646 rm -f conftest.err conftest.$ac_ext
9647 fi
9648 echo "$as_me:9648: result: `eval echo '${'$as_ac_Header'}'`" >&5
9649 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9650 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9651   cat >>confdefs.h <<EOF
9652 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9653 EOF
9654
9655 fi
9656 done
9657
9658 cat >>confdefs.h <<\EOF
9659 #define NCURSES 1
9660 EOF
9661
9662 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9663
9664                 cat >>confdefs.h <<EOF
9665 #define $cf_nculib_ROOT 1
9666 EOF
9667
9668                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9669
9670         else
9671
9672 cf_ncuhdr_root=ncurses
9673
9674 test -n "$cf_cv_curses_dir" && \
9675 test "$cf_cv_curses_dir" != "no" && { \
9676
9677 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9678   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9679   do
9680         while test $cf_add_incdir != /usr/include
9681         do
9682           if test -d $cf_add_incdir
9683           then
9684                 cf_have_incdir=no
9685                 if test -n "$CFLAGS$CPPFLAGS" ; then
9686                   # a loop is needed to ensure we can add subdirs of existing dirs
9687                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9688                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9689                           cf_have_incdir=yes; break
9690                         fi
9691                   done
9692                 fi
9693
9694                 if test "$cf_have_incdir" = no ; then
9695                   if test "$cf_add_incdir" = /usr/local/include ; then
9696                         if test "$GCC" = yes
9697                         then
9698                           cf_save_CPPFLAGS=$CPPFLAGS
9699
9700         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9701         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9702
9703                           cat >conftest.$ac_ext <<_ACEOF
9704 #line 9704 "configure"
9705 #include "confdefs.h"
9706 #include <stdio.h>
9707 int
9708 main (void)
9709 {
9710 printf("Hello")
9711   ;
9712   return 0;
9713 }
9714 _ACEOF
9715 rm -f conftest.$ac_objext
9716 if { (eval echo "$as_me:9716: \"$ac_compile\"") >&5
9717   (eval $ac_compile) 2>&5
9718   ac_status=$?
9719   echo "$as_me:9719: \$? = $ac_status" >&5
9720   (exit $ac_status); } &&
9721          { ac_try='test -s conftest.$ac_objext'
9722   { (eval echo "$as_me:9722: \"$ac_try\"") >&5
9723   (eval $ac_try) 2>&5
9724   ac_status=$?
9725   echo "$as_me:9725: \$? = $ac_status" >&5
9726   (exit $ac_status); }; }; then
9727   :
9728 else
9729   echo "$as_me: failed program was:" >&5
9730 cat conftest.$ac_ext >&5
9731 cf_have_incdir=yes
9732 fi
9733 rm -f conftest.$ac_objext conftest.$ac_ext
9734                           CPPFLAGS=$cf_save_CPPFLAGS
9735                         fi
9736                   fi
9737                 fi
9738
9739                 if test "$cf_have_incdir" = no ; then
9740                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9741
9742 echo "${as_me:-configure}:9742: testing adding $cf_add_incdir to include-path ..." 1>&5
9743
9744                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9745
9746                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9747                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9748                   cf_add_incdir="$cf_top_incdir"
9749                 else
9750                   break
9751                 fi
9752           else
9753                 break
9754           fi
9755         done
9756   done
9757 fi
9758
9759 }
9760
9761 echo "$as_me:9761: checking for $cf_ncuhdr_root header in include-path" >&5
9762 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9763 if test "${cf_cv_ncurses_h+set}" = set; then
9764   echo $ECHO_N "(cached) $ECHO_C" >&6
9765 else
9766
9767         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9768         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9769         for cf_header in $cf_header_list
9770         do
9771
9772         cat >conftest.$ac_ext <<_ACEOF
9773 #line 9773 "configure"
9774 #include "confdefs.h"
9775
9776 #include <$cf_header>
9777 int
9778 main (void)
9779 {
9780
9781 #ifdef NCURSES_VERSION
9782
9783 printf("%s\n", NCURSES_VERSION);
9784 #else
9785 #ifdef __NCURSES_H
9786 printf("old\n");
9787 #else
9788         make an error
9789 #endif
9790 #endif
9791
9792   ;
9793   return 0;
9794 }
9795 _ACEOF
9796 rm -f conftest.$ac_objext
9797 if { (eval echo "$as_me:9797: \"$ac_compile\"") >&5
9798   (eval $ac_compile) 2>&5
9799   ac_status=$?
9800   echo "$as_me:9800: \$? = $ac_status" >&5
9801   (exit $ac_status); } &&
9802          { ac_try='test -s conftest.$ac_objext'
9803   { (eval echo "$as_me:9803: \"$ac_try\"") >&5
9804   (eval $ac_try) 2>&5
9805   ac_status=$?
9806   echo "$as_me:9806: \$? = $ac_status" >&5
9807   (exit $ac_status); }; }; then
9808   cf_cv_ncurses_h=$cf_header
9809
9810 else
9811   echo "$as_me: failed program was:" >&5
9812 cat conftest.$ac_ext >&5
9813 cf_cv_ncurses_h=no
9814 fi
9815 rm -f conftest.$ac_objext conftest.$ac_ext
9816
9817                 test "$cf_cv_ncurses_h" != no && break
9818         done
9819
9820 fi
9821 echo "$as_me:9821: result: $cf_cv_ncurses_h" >&5
9822 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9823
9824 if test "$cf_cv_ncurses_h" != no ; then
9825         cf_cv_ncurses_header=$cf_cv_ncurses_h
9826 else
9827
9828 echo "$as_me:9828: checking for $cf_ncuhdr_root include-path" >&5
9829 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9830 if test "${cf_cv_ncurses_h2+set}" = set; then
9831   echo $ECHO_N "(cached) $ECHO_C" >&6
9832 else
9833
9834         test -n "$verbose" && echo
9835
9836 cf_search=
9837
9838 # collect the current set of include-directories from compiler flags
9839 cf_header_path_list=""
9840 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9841         for cf_header_path in $CPPFLAGS $CFLAGS
9842         do
9843                 case $cf_header_path in
9844                 (-I*)
9845                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9846
9847 test "x$cf_header_path" != "xNONE" && \
9848 test -d "$cf_header_path" && \
9849  {
9850         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9851         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9852         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9853         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9854         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9855         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"
9856 }
9857
9858                         cf_header_path_list="$cf_header_path_list $cf_search"
9859                         ;;
9860                 esac
9861         done
9862 fi
9863
9864 # add the variations for the package we are looking for
9865
9866 cf_search=
9867
9868 test "x$prefix" != "xNONE" && \
9869 test -d "$prefix" && \
9870  {
9871         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9872         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9873         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9874         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9875         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9876         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9877 }
9878
9879 for cf_subdir_prefix in \
9880         /usr \
9881         /usr/local \
9882         /usr/pkg \
9883         /opt \
9884         /opt/local \
9885         $HOME
9886 do
9887
9888 test "x$cf_subdir_prefix" != "x$prefix" && \
9889 test -d "$cf_subdir_prefix" && \
9890 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9891         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9892         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9893         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9894         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9895         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9896         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"
9897 }
9898
9899 done
9900
9901 test "$includedir" != NONE && \
9902 test "$includedir" != "/usr/include" && \
9903 test -d "$includedir" && {
9904         test -d $includedir &&    cf_search="$cf_search $includedir"
9905         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9906 }
9907
9908 test "$oldincludedir" != NONE && \
9909 test "$oldincludedir" != "/usr/include" && \
9910 test -d "$oldincludedir" && {
9911         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9912         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9913 }
9914
9915 cf_search="$cf_search $cf_header_path_list"
9916
9917         test -n "$verbose" && echo search path $cf_search
9918         cf_save2_CPPFLAGS="$CPPFLAGS"
9919         for cf_incdir in $cf_search
9920         do
9921
9922 if test -n "$cf_incdir" ; then
9923   for cf_add_incdir in $cf_incdir
9924   do
9925         while test $cf_add_incdir != /usr/include
9926         do
9927           if test -d $cf_add_incdir
9928           then
9929                 cf_have_incdir=no
9930                 if test -n "$CFLAGS$CPPFLAGS" ; then
9931                   # a loop is needed to ensure we can add subdirs of existing dirs
9932                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9933                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9934                           cf_have_incdir=yes; break
9935                         fi
9936                   done
9937                 fi
9938
9939                 if test "$cf_have_incdir" = no ; then
9940                   if test "$cf_add_incdir" = /usr/local/include ; then
9941                         if test "$GCC" = yes
9942                         then
9943                           cf_save_CPPFLAGS=$CPPFLAGS
9944
9945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9946         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9947
9948                           cat >conftest.$ac_ext <<_ACEOF
9949 #line 9949 "configure"
9950 #include "confdefs.h"
9951 #include <stdio.h>
9952 int
9953 main (void)
9954 {
9955 printf("Hello")
9956   ;
9957   return 0;
9958 }
9959 _ACEOF
9960 rm -f conftest.$ac_objext
9961 if { (eval echo "$as_me:9961: \"$ac_compile\"") >&5
9962   (eval $ac_compile) 2>&5
9963   ac_status=$?
9964   echo "$as_me:9964: \$? = $ac_status" >&5
9965   (exit $ac_status); } &&
9966          { ac_try='test -s conftest.$ac_objext'
9967   { (eval echo "$as_me:9967: \"$ac_try\"") >&5
9968   (eval $ac_try) 2>&5
9969   ac_status=$?
9970   echo "$as_me:9970: \$? = $ac_status" >&5
9971   (exit $ac_status); }; }; then
9972   :
9973 else
9974   echo "$as_me: failed program was:" >&5
9975 cat conftest.$ac_ext >&5
9976 cf_have_incdir=yes
9977 fi
9978 rm -f conftest.$ac_objext conftest.$ac_ext
9979                           CPPFLAGS=$cf_save_CPPFLAGS
9980                         fi
9981                   fi
9982                 fi
9983
9984                 if test "$cf_have_incdir" = no ; then
9985                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9986
9987 echo "${as_me:-configure}:9987: testing adding $cf_add_incdir to include-path ..." 1>&5
9988
9989                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9990
9991                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9992                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9993                   cf_add_incdir="$cf_top_incdir"
9994                 else
9995                   break
9996                 fi
9997           else
9998                 break
9999           fi
10000         done
10001   done
10002 fi
10003
10004                 for cf_header in \
10005                         ncurses.h \
10006                         curses.h
10007                 do
10008
10009         cat >conftest.$ac_ext <<_ACEOF
10010 #line 10010 "configure"
10011 #include "confdefs.h"
10012
10013 #include <$cf_header>
10014 int
10015 main (void)
10016 {
10017
10018 #ifdef NCURSES_VERSION
10019
10020 printf("%s\n", NCURSES_VERSION);
10021 #else
10022 #ifdef __NCURSES_H
10023 printf("old\n");
10024 #else
10025         make an error
10026 #endif
10027 #endif
10028
10029   ;
10030   return 0;
10031 }
10032 _ACEOF
10033 rm -f conftest.$ac_objext
10034 if { (eval echo "$as_me:10034: \"$ac_compile\"") >&5
10035   (eval $ac_compile) 2>&5
10036   ac_status=$?
10037   echo "$as_me:10037: \$? = $ac_status" >&5
10038   (exit $ac_status); } &&
10039          { ac_try='test -s conftest.$ac_objext'
10040   { (eval echo "$as_me:10040: \"$ac_try\"") >&5
10041   (eval $ac_try) 2>&5
10042   ac_status=$?
10043   echo "$as_me:10043: \$? = $ac_status" >&5
10044   (exit $ac_status); }; }; then
10045   cf_cv_ncurses_h2=$cf_header
10046
10047 else
10048   echo "$as_me: failed program was:" >&5
10049 cat conftest.$ac_ext >&5
10050 cf_cv_ncurses_h2=no
10051 fi
10052 rm -f conftest.$ac_objext conftest.$ac_ext
10053
10054                         if test "$cf_cv_ncurses_h2" != no ; then
10055                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10056                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10057                                 break
10058                         fi
10059                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10060                 done
10061                 CPPFLAGS="$cf_save2_CPPFLAGS"
10062                 test "$cf_cv_ncurses_h2" != no && break
10063         done
10064         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10064: error: not found" >&5
10065 echo "$as_me: error: not found" >&2;}
10066    { (exit 1); exit 1; }; }
10067
10068 fi
10069 echo "$as_me:10069: result: $cf_cv_ncurses_h2" >&5
10070 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10071
10072         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10073         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10074         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10075                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10076         fi
10077
10078 if test -n "$cf_1st_incdir" ; then
10079   for cf_add_incdir in $cf_1st_incdir
10080   do
10081         while test $cf_add_incdir != /usr/include
10082         do
10083           if test -d $cf_add_incdir
10084           then
10085                 cf_have_incdir=no
10086                 if test -n "$CFLAGS$CPPFLAGS" ; then
10087                   # a loop is needed to ensure we can add subdirs of existing dirs
10088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10090                           cf_have_incdir=yes; break
10091                         fi
10092                   done
10093                 fi
10094
10095                 if test "$cf_have_incdir" = no ; then
10096                   if test "$cf_add_incdir" = /usr/local/include ; then
10097                         if test "$GCC" = yes
10098                         then
10099                           cf_save_CPPFLAGS=$CPPFLAGS
10100
10101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10102         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10103
10104                           cat >conftest.$ac_ext <<_ACEOF
10105 #line 10105 "configure"
10106 #include "confdefs.h"
10107 #include <stdio.h>
10108 int
10109 main (void)
10110 {
10111 printf("Hello")
10112   ;
10113   return 0;
10114 }
10115 _ACEOF
10116 rm -f conftest.$ac_objext
10117 if { (eval echo "$as_me:10117: \"$ac_compile\"") >&5
10118   (eval $ac_compile) 2>&5
10119   ac_status=$?
10120   echo "$as_me:10120: \$? = $ac_status" >&5
10121   (exit $ac_status); } &&
10122          { ac_try='test -s conftest.$ac_objext'
10123   { (eval echo "$as_me:10123: \"$ac_try\"") >&5
10124   (eval $ac_try) 2>&5
10125   ac_status=$?
10126   echo "$as_me:10126: \$? = $ac_status" >&5
10127   (exit $ac_status); }; }; then
10128   :
10129 else
10130   echo "$as_me: failed program was:" >&5
10131 cat conftest.$ac_ext >&5
10132 cf_have_incdir=yes
10133 fi
10134 rm -f conftest.$ac_objext conftest.$ac_ext
10135                           CPPFLAGS=$cf_save_CPPFLAGS
10136                         fi
10137                   fi
10138                 fi
10139
10140                 if test "$cf_have_incdir" = no ; then
10141                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10142
10143 echo "${as_me:-configure}:10143: testing adding $cf_add_incdir to include-path ..." 1>&5
10144
10145                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10146
10147                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10148                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10149                   cf_add_incdir="$cf_top_incdir"
10150                 else
10151                   break
10152                 fi
10153           else
10154                 break
10155           fi
10156         done
10157   done
10158 fi
10159
10160 fi
10161
10162 # Set definitions to allow ifdef'ing for ncurses.h
10163
10164 case $cf_cv_ncurses_header in
10165 (*ncurses.h)
10166
10167 cat >>confdefs.h <<\EOF
10168 #define HAVE_NCURSES_H 1
10169 EOF
10170
10171         ;;
10172 esac
10173
10174 case $cf_cv_ncurses_header in
10175 (ncurses/curses.h|ncurses/ncurses.h)
10176
10177 cat >>confdefs.h <<\EOF
10178 #define HAVE_NCURSES_NCURSES_H 1
10179 EOF
10180
10181         ;;
10182 (ncursesw/curses.h|ncursesw/ncurses.h)
10183
10184 cat >>confdefs.h <<\EOF
10185 #define HAVE_NCURSESW_NCURSES_H 1
10186 EOF
10187
10188         ;;
10189 esac
10190
10191 echo "$as_me:10191: checking for terminfo header" >&5
10192 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10193 if test "${cf_cv_term_header+set}" = set; then
10194   echo $ECHO_N "(cached) $ECHO_C" >&6
10195 else
10196
10197 case ${cf_cv_ncurses_header} in
10198 (*/ncurses.h|*/ncursesw.h)
10199         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10200         ;;
10201 (*)
10202         cf_term_header=term.h
10203         ;;
10204 esac
10205
10206 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10207 do
10208 cat >conftest.$ac_ext <<_ACEOF
10209 #line 10209 "configure"
10210 #include "confdefs.h"
10211 #include <stdio.h>
10212 #include <${cf_cv_ncurses_header:-curses.h}>
10213 #include <$cf_test>
10214
10215 int
10216 main (void)
10217 {
10218 int x = auto_left_margin; (void)x
10219   ;
10220   return 0;
10221 }
10222 _ACEOF
10223 rm -f conftest.$ac_objext
10224 if { (eval echo "$as_me:10224: \"$ac_compile\"") >&5
10225   (eval $ac_compile) 2>&5
10226   ac_status=$?
10227   echo "$as_me:10227: \$? = $ac_status" >&5
10228   (exit $ac_status); } &&
10229          { ac_try='test -s conftest.$ac_objext'
10230   { (eval echo "$as_me:10230: \"$ac_try\"") >&5
10231   (eval $ac_try) 2>&5
10232   ac_status=$?
10233   echo "$as_me:10233: \$? = $ac_status" >&5
10234   (exit $ac_status); }; }; then
10235
10236         cf_cv_term_header="$cf_test"
10237 else
10238   echo "$as_me: failed program was:" >&5
10239 cat conftest.$ac_ext >&5
10240
10241         cf_cv_term_header=unknown
10242
10243 fi
10244 rm -f conftest.$ac_objext conftest.$ac_ext
10245         test "$cf_cv_term_header" != unknown && break
10246 done
10247
10248 fi
10249 echo "$as_me:10249: result: $cf_cv_term_header" >&5
10250 echo "${ECHO_T}$cf_cv_term_header" >&6
10251
10252 # Set definitions to allow ifdef'ing to accommodate subdirectories
10253
10254 case $cf_cv_term_header in
10255 (*term.h)
10256
10257 cat >>confdefs.h <<\EOF
10258 #define HAVE_TERM_H 1
10259 EOF
10260
10261         ;;
10262 esac
10263
10264 case $cf_cv_term_header in
10265 (ncurses/term.h)
10266
10267 cat >>confdefs.h <<\EOF
10268 #define HAVE_NCURSES_TERM_H 1
10269 EOF
10270
10271         ;;
10272 (ncursesw/term.h)
10273
10274 cat >>confdefs.h <<\EOF
10275 #define HAVE_NCURSESW_TERM_H 1
10276 EOF
10277
10278         ;;
10279 esac
10280
10281 # some applications need this, but should check for NCURSES_VERSION
10282
10283 cat >>confdefs.h <<\EOF
10284 #define NCURSES 1
10285 EOF
10286
10287 echo "$as_me:10287: checking for ncurses version" >&5
10288 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10289 if test "${cf_cv_ncurses_version+set}" = set; then
10290   echo $ECHO_N "(cached) $ECHO_C" >&6
10291 else
10292
10293         cf_cv_ncurses_version=no
10294         cf_tempfile=out$$
10295         rm -f $cf_tempfile
10296         if test "$cross_compiling" = yes; then
10297
10298         # This will not work if the preprocessor splits the line after the
10299         # Autoconf token.  The 'unproto' program does that.
10300         cat > conftest.$ac_ext <<EOF
10301 #include <${cf_cv_ncurses_header:-curses.h}>
10302 #undef Autoconf
10303 #ifdef NCURSES_VERSION
10304 Autoconf NCURSES_VERSION
10305 #else
10306 #ifdef __NCURSES_H
10307 Autoconf "old"
10308 #endif
10309 ;
10310 #endif
10311 EOF
10312         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10313         { (eval echo "$as_me:10313: \"$cf_try\"") >&5
10314   (eval $cf_try) 2>&5
10315   ac_status=$?
10316   echo "$as_me:10316: \$? = $ac_status" >&5
10317   (exit $ac_status); }
10318         if test -f conftest.out ; then
10319                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10320                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10321                 rm -f conftest.out
10322         fi
10323
10324 else
10325   cat >conftest.$ac_ext <<_ACEOF
10326 #line 10326 "configure"
10327 #include "confdefs.h"
10328
10329 #include <${cf_cv_ncurses_header:-curses.h}>
10330 #include <stdio.h>
10331 int main(void)
10332 {
10333         FILE *fp = fopen("$cf_tempfile", "w");
10334 #ifdef NCURSES_VERSION
10335 # ifdef NCURSES_VERSION_PATCH
10336         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10337 # else
10338         fprintf(fp, "%s\n", NCURSES_VERSION);
10339 # endif
10340 #else
10341 # ifdef __NCURSES_H
10342         fprintf(fp, "old\n");
10343 # else
10344         make an error
10345 # endif
10346 #endif
10347         ${cf_cv_main_return:-return}(0);
10348 }
10349 _ACEOF
10350 rm -f conftest$ac_exeext
10351 if { (eval echo "$as_me:10351: \"$ac_link\"") >&5
10352   (eval $ac_link) 2>&5
10353   ac_status=$?
10354   echo "$as_me:10354: \$? = $ac_status" >&5
10355   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10356   { (eval echo "$as_me:10356: \"$ac_try\"") >&5
10357   (eval $ac_try) 2>&5
10358   ac_status=$?
10359   echo "$as_me:10359: \$? = $ac_status" >&5
10360   (exit $ac_status); }; }; then
10361
10362         cf_cv_ncurses_version=`cat $cf_tempfile`
10363 else
10364   echo "$as_me: program exited with status $ac_status" >&5
10365 echo "$as_me: failed program was:" >&5
10366 cat conftest.$ac_ext >&5
10367 fi
10368 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10369 fi
10370         rm -f $cf_tempfile
10371
10372 fi
10373 echo "$as_me:10373: result: $cf_cv_ncurses_version" >&5
10374 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10375 test "$cf_cv_ncurses_version" = no ||
10376 cat >>confdefs.h <<\EOF
10377 #define NCURSES 1
10378 EOF
10379
10380 cf_nculib_root=ncurses
10381         # This works, except for the special case where we find gpm, but
10382         # ncurses is in a nonstandard location via $LIBS, and we really want
10383         # to link gpm.
10384 cf_ncurses_LIBS=""
10385 cf_ncurses_SAVE="$LIBS"
10386 echo "$as_me:10386: checking for Gpm_Open in -lgpm" >&5
10387 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10388 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10389   echo $ECHO_N "(cached) $ECHO_C" >&6
10390 else
10391   ac_check_lib_save_LIBS=$LIBS
10392 LIBS="-lgpm  $LIBS"
10393 cat >conftest.$ac_ext <<_ACEOF
10394 #line 10394 "configure"
10395 #include "confdefs.h"
10396
10397 /* Override any gcc2 internal prototype to avoid an error.  */
10398 #ifdef __cplusplus
10399 extern "C"
10400 #endif
10401 /* We use char because int might match the return type of a gcc2
10402    builtin and then its argument prototype would still apply.  */
10403 char Gpm_Open ();
10404 int
10405 main (void)
10406 {
10407 Gpm_Open ();
10408   ;
10409   return 0;
10410 }
10411 _ACEOF
10412 rm -f conftest.$ac_objext conftest$ac_exeext
10413 if { (eval echo "$as_me:10413: \"$ac_link\"") >&5
10414   (eval $ac_link) 2>&5
10415   ac_status=$?
10416   echo "$as_me:10416: \$? = $ac_status" >&5
10417   (exit $ac_status); } &&
10418          { ac_try='test -s conftest$ac_exeext'
10419   { (eval echo "$as_me:10419: \"$ac_try\"") >&5
10420   (eval $ac_try) 2>&5
10421   ac_status=$?
10422   echo "$as_me:10422: \$? = $ac_status" >&5
10423   (exit $ac_status); }; }; then
10424   ac_cv_lib_gpm_Gpm_Open=yes
10425 else
10426   echo "$as_me: failed program was:" >&5
10427 cat conftest.$ac_ext >&5
10428 ac_cv_lib_gpm_Gpm_Open=no
10429 fi
10430 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10431 LIBS=$ac_check_lib_save_LIBS
10432 fi
10433 echo "$as_me:10433: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10434 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10435 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10436   echo "$as_me:10436: checking for initscr in -lgpm" >&5
10437 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10438 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10439   echo $ECHO_N "(cached) $ECHO_C" >&6
10440 else
10441   ac_check_lib_save_LIBS=$LIBS
10442 LIBS="-lgpm  $LIBS"
10443 cat >conftest.$ac_ext <<_ACEOF
10444 #line 10444 "configure"
10445 #include "confdefs.h"
10446
10447 /* Override any gcc2 internal prototype to avoid an error.  */
10448 #ifdef __cplusplus
10449 extern "C"
10450 #endif
10451 /* We use char because int might match the return type of a gcc2
10452    builtin and then its argument prototype would still apply.  */
10453 char initscr ();
10454 int
10455 main (void)
10456 {
10457 initscr ();
10458   ;
10459   return 0;
10460 }
10461 _ACEOF
10462 rm -f conftest.$ac_objext conftest$ac_exeext
10463 if { (eval echo "$as_me:10463: \"$ac_link\"") >&5
10464   (eval $ac_link) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit $ac_status); } &&
10468          { ac_try='test -s conftest$ac_exeext'
10469   { (eval echo "$as_me:10469: \"$ac_try\"") >&5
10470   (eval $ac_try) 2>&5
10471   ac_status=$?
10472   echo "$as_me:10472: \$? = $ac_status" >&5
10473   (exit $ac_status); }; }; then
10474   ac_cv_lib_gpm_initscr=yes
10475 else
10476   echo "$as_me: failed program was:" >&5
10477 cat conftest.$ac_ext >&5
10478 ac_cv_lib_gpm_initscr=no
10479 fi
10480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10481 LIBS=$ac_check_lib_save_LIBS
10482 fi
10483 echo "$as_me:10483: result: $ac_cv_lib_gpm_initscr" >&5
10484 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10485 if test $ac_cv_lib_gpm_initscr = yes; then
10486   LIBS="$cf_ncurses_SAVE"
10487 else
10488   cf_ncurses_LIBS="-lgpm"
10489 fi
10490
10491 fi
10492
10493 case $host_os in
10494 (freebsd*)
10495         # This is only necessary if you are linking against an obsolete
10496         # version of ncurses (but it should do no harm, since it's static).
10497         if test "$cf_nculib_root" = ncurses ; then
10498                 echo "$as_me:10498: checking for tgoto in -lmytinfo" >&5
10499 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10500 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10501   echo $ECHO_N "(cached) $ECHO_C" >&6
10502 else
10503   ac_check_lib_save_LIBS=$LIBS
10504 LIBS="-lmytinfo  $LIBS"
10505 cat >conftest.$ac_ext <<_ACEOF
10506 #line 10506 "configure"
10507 #include "confdefs.h"
10508
10509 /* Override any gcc2 internal prototype to avoid an error.  */
10510 #ifdef __cplusplus
10511 extern "C"
10512 #endif
10513 /* We use char because int might match the return type of a gcc2
10514    builtin and then its argument prototype would still apply.  */
10515 char tgoto ();
10516 int
10517 main (void)
10518 {
10519 tgoto ();
10520   ;
10521   return 0;
10522 }
10523 _ACEOF
10524 rm -f conftest.$ac_objext conftest$ac_exeext
10525 if { (eval echo "$as_me:10525: \"$ac_link\"") >&5
10526   (eval $ac_link) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); } &&
10530          { ac_try='test -s conftest$ac_exeext'
10531   { (eval echo "$as_me:10531: \"$ac_try\"") >&5
10532   (eval $ac_try) 2>&5
10533   ac_status=$?
10534   echo "$as_me:10534: \$? = $ac_status" >&5
10535   (exit $ac_status); }; }; then
10536   ac_cv_lib_mytinfo_tgoto=yes
10537 else
10538   echo "$as_me: failed program was:" >&5
10539 cat conftest.$ac_ext >&5
10540 ac_cv_lib_mytinfo_tgoto=no
10541 fi
10542 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10543 LIBS=$ac_check_lib_save_LIBS
10544 fi
10545 echo "$as_me:10545: result: $ac_cv_lib_mytinfo_tgoto" >&5
10546 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10547 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10548   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10549 fi
10550
10551         fi
10552         ;;
10553 esac
10554
10555 cf_add_libs="$LIBS"
10556 # reverse order
10557 cf_add_0lib=
10558 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10559 # filter duplicates
10560 for cf_add_1lib in $cf_add_0lib; do
10561         for cf_add_2lib in $cf_add_libs; do
10562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10563                         cf_add_1lib=
10564                         break
10565                 fi
10566         done
10567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10568 done
10569 LIBS="$cf_add_libs"
10570
10571 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10572 then
10573
10574 cf_add_libs="$LIBS"
10575 # reverse order
10576 cf_add_0lib=
10577 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10578 # filter duplicates
10579 for cf_add_1lib in $cf_add_0lib; do
10580         for cf_add_2lib in $cf_add_libs; do
10581                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10582                         cf_add_1lib=
10583                         break
10584                 fi
10585         done
10586         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10587 done
10588 LIBS="$cf_add_libs"
10589
10590 else
10591
10592         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10593         cf_libdir=""
10594         echo "$as_me:10594: checking for initscr" >&5
10595 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10596 if test "${ac_cv_func_initscr+set}" = set; then
10597   echo $ECHO_N "(cached) $ECHO_C" >&6
10598 else
10599   cat >conftest.$ac_ext <<_ACEOF
10600 #line 10600 "configure"
10601 #include "confdefs.h"
10602 #define initscr autoconf_temporary
10603 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10604 #undef initscr
10605
10606 #ifdef __cplusplus
10607 extern "C"
10608 #endif
10609
10610 /* We use char because int might match the return type of a gcc2
10611    builtin and then its argument prototype would still apply.  */
10612 char initscr (void);
10613
10614 int
10615 main (void)
10616 {
10617
10618 /* The GNU C library defines stubs for functions which it implements
10619     to always fail with ENOSYS.  Some functions are actually named
10620     something starting with __ and the normal name is an alias.  */
10621 #if defined (__stub_initscr) || defined (__stub___initscr)
10622 #error found stub for initscr
10623 #endif
10624
10625         return initscr ();
10626   ;
10627   return 0;
10628 }
10629 _ACEOF
10630 rm -f conftest.$ac_objext conftest$ac_exeext
10631 if { (eval echo "$as_me:10631: \"$ac_link\"") >&5
10632   (eval $ac_link) 2>&5
10633   ac_status=$?
10634   echo "$as_me:10634: \$? = $ac_status" >&5
10635   (exit $ac_status); } &&
10636          { ac_try='test -s conftest$ac_exeext'
10637   { (eval echo "$as_me:10637: \"$ac_try\"") >&5
10638   (eval $ac_try) 2>&5
10639   ac_status=$?
10640   echo "$as_me:10640: \$? = $ac_status" >&5
10641   (exit $ac_status); }; }; then
10642   ac_cv_func_initscr=yes
10643 else
10644   echo "$as_me: failed program was:" >&5
10645 cat conftest.$ac_ext >&5
10646 ac_cv_func_initscr=no
10647 fi
10648 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10649 fi
10650 echo "$as_me:10650: result: $ac_cv_func_initscr" >&5
10651 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10652 if test $ac_cv_func_initscr = yes; then
10653   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10654 else
10655
10656                 cf_save_LIBS="$LIBS"
10657                 echo "$as_me:10657: checking for initscr in -l$cf_nculib_root" >&5
10658 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10659                 LIBS="-l$cf_nculib_root $LIBS"
10660                 cat >conftest.$ac_ext <<_ACEOF
10661 #line 10661 "configure"
10662 #include "confdefs.h"
10663 #include <${cf_cv_ncurses_header:-curses.h}>
10664 int
10665 main (void)
10666 {
10667 initscr()
10668   ;
10669   return 0;
10670 }
10671 _ACEOF
10672 rm -f conftest.$ac_objext conftest$ac_exeext
10673 if { (eval echo "$as_me:10673: \"$ac_link\"") >&5
10674   (eval $ac_link) 2>&5
10675   ac_status=$?
10676   echo "$as_me:10676: \$? = $ac_status" >&5
10677   (exit $ac_status); } &&
10678          { ac_try='test -s conftest$ac_exeext'
10679   { (eval echo "$as_me:10679: \"$ac_try\"") >&5
10680   (eval $ac_try) 2>&5
10681   ac_status=$?
10682   echo "$as_me:10682: \$? = $ac_status" >&5
10683   (exit $ac_status); }; }; then
10684   echo "$as_me:10684: result: yes" >&5
10685 echo "${ECHO_T}yes" >&6
10686                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10687
10688 else
10689   echo "$as_me: failed program was:" >&5
10690 cat conftest.$ac_ext >&5
10691 echo "$as_me:10691: result: no" >&5
10692 echo "${ECHO_T}no" >&6
10693
10694 cf_search=
10695 cf_library_path_list=""
10696 if test -n "${LDFLAGS}${LIBS}" ; then
10697         for cf_library_path in $LDFLAGS $LIBS
10698         do
10699                 case $cf_library_path in
10700                 (-L*)
10701                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10702
10703 test "x$cf_library_path" != "xNONE" && \
10704 test -d "$cf_library_path" && \
10705  {
10706         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10707         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10708         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10709         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10710         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10711         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"
10712 }
10713
10714                         cf_library_path_list="$cf_library_path_list $cf_search"
10715                         ;;
10716                 esac
10717         done
10718 fi
10719
10720 cf_search=
10721
10722 test "x$prefix" != "xNONE" && \
10723 test -d "$prefix" && \
10724  {
10725         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10726         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10727         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10728         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10729         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10730         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10731 }
10732
10733 for cf_subdir_prefix in \
10734         /usr \
10735         /usr/local \
10736         /usr/pkg \
10737         /opt \
10738         /opt/local \
10739         $HOME
10740 do
10741
10742 test "x$cf_subdir_prefix" != "x$prefix" && \
10743 test -d "$cf_subdir_prefix" && \
10744 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10745         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10746         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10747         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10748         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10749         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10750         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"
10751 }
10752
10753 done
10754
10755 cf_search="$cf_library_path_list $cf_search"
10756
10757                         for cf_libdir in $cf_search
10758                         do
10759                                 echo "$as_me:10759: checking for -l$cf_nculib_root in $cf_libdir" >&5
10760 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10761                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10762                                 cat >conftest.$ac_ext <<_ACEOF
10763 #line 10763 "configure"
10764 #include "confdefs.h"
10765 #include <${cf_cv_ncurses_header:-curses.h}>
10766 int
10767 main (void)
10768 {
10769 initscr()
10770   ;
10771   return 0;
10772 }
10773 _ACEOF
10774 rm -f conftest.$ac_objext conftest$ac_exeext
10775 if { (eval echo "$as_me:10775: \"$ac_link\"") >&5
10776   (eval $ac_link) 2>&5
10777   ac_status=$?
10778   echo "$as_me:10778: \$? = $ac_status" >&5
10779   (exit $ac_status); } &&
10780          { ac_try='test -s conftest$ac_exeext'
10781   { (eval echo "$as_me:10781: \"$ac_try\"") >&5
10782   (eval $ac_try) 2>&5
10783   ac_status=$?
10784   echo "$as_me:10784: \$? = $ac_status" >&5
10785   (exit $ac_status); }; }; then
10786   echo "$as_me:10786: result: yes" >&5
10787 echo "${ECHO_T}yes" >&6
10788                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10789                                          break
10790 else
10791   echo "$as_me: failed program was:" >&5
10792 cat conftest.$ac_ext >&5
10793 echo "$as_me:10793: result: no" >&5
10794 echo "${ECHO_T}no" >&6
10795                                          LIBS="$cf_save_LIBS"
10796 fi
10797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10798                         done
10799
10800 fi
10801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10802
10803 fi
10804
10805 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10806
10807 if test $cf_found_library = no ; then
10808         { { echo "$as_me:10808: error: Cannot link $cf_nculib_root library" >&5
10809 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10810    { (exit 1); exit 1; }; }
10811 fi
10812
10813 fi
10814
10815 if test -n "$cf_ncurses_LIBS" ; then
10816         echo "$as_me:10816: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10817 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10818         cf_ncurses_SAVE="$LIBS"
10819         for p in $cf_ncurses_LIBS ; do
10820                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10821                 if test "$q" != "$LIBS" ; then
10822                         LIBS="$q"
10823                 fi
10824         done
10825         cat >conftest.$ac_ext <<_ACEOF
10826 #line 10826 "configure"
10827 #include "confdefs.h"
10828 #include <${cf_cv_ncurses_header:-curses.h}>
10829 int
10830 main (void)
10831 {
10832 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10833   ;
10834   return 0;
10835 }
10836 _ACEOF
10837 rm -f conftest.$ac_objext conftest$ac_exeext
10838 if { (eval echo "$as_me:10838: \"$ac_link\"") >&5
10839   (eval $ac_link) 2>&5
10840   ac_status=$?
10841   echo "$as_me:10841: \$? = $ac_status" >&5
10842   (exit $ac_status); } &&
10843          { ac_try='test -s conftest$ac_exeext'
10844   { (eval echo "$as_me:10844: \"$ac_try\"") >&5
10845   (eval $ac_try) 2>&5
10846   ac_status=$?
10847   echo "$as_me:10847: \$? = $ac_status" >&5
10848   (exit $ac_status); }; }; then
10849   echo "$as_me:10849: result: yes" >&5
10850 echo "${ECHO_T}yes" >&6
10851 else
10852   echo "$as_me: failed program was:" >&5
10853 cat conftest.$ac_ext >&5
10854 echo "$as_me:10854: result: no" >&5
10855 echo "${ECHO_T}no" >&6
10856                  LIBS="$cf_ncurses_SAVE"
10857 fi
10858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10859 fi
10860
10861 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10862
10863 cat >>confdefs.h <<EOF
10864 #define $cf_nculib_ROOT 1
10865 EOF
10866
10867         fi
10868 else
10869         NCURSES_CONFIG=none
10870 fi
10871
10872 fi
10873
10874 if test "$NCURSES_CONFIG_PKG" != none ; then
10875         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10876
10877         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10878         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10879         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10880
10881         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10882         if test -z "$cf_cv_abi_version"
10883         then
10884                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10885         fi
10886
10887 elif test "$NCURSES_CONFIG" != none ; then
10888
10889         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10890
10891         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10892         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10893         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10894
10895         # ABI version is not available from headers
10896         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10897
10898 else
10899
10900         for cf_name in MAJOR MINOR PATCH
10901         do
10902         cat >conftest.$ac_ext <<CF_EOF
10903         #include <${cf_cv_ncurses_header:-curses.h}>
10904         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10905 CF_EOF
10906                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10907                 { (eval echo "$as_me:10907: \"$cf_try\"") >&5
10908   (eval $cf_try) 2>&5
10909   ac_status=$?
10910   echo "$as_me:10910: \$? = $ac_status" >&5
10911   (exit $ac_status); }
10912                 if test -f conftest.out ; then
10913                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10914                         eval NCURSES_$cf_name=\"$cf_result\"
10915                         # cat conftest.$ac_ext
10916                         # cat conftest.out
10917                 fi
10918         done
10919
10920         cf_cv_abi_version=${NCURSES_MAJOR}
10921
10922 fi
10923
10924 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10925
10926 cf_cv_timestamp=`date`
10927
10928 echo "$as_me:10928: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10929 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10930
10931 echo "$as_me:10931: checking if you want to have a library-prefix" >&5
10932 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10933
10934 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10935 if test "${with_lib_prefix+set}" = set; then
10936   withval="$with_lib_prefix"
10937   with_lib_prefix=$withval
10938 else
10939   with_lib_prefix=auto
10940 fi;
10941 echo "$as_me:10941: result: $with_lib_prefix" >&5
10942 echo "${ECHO_T}$with_lib_prefix" >&6
10943
10944 if test $with_lib_prefix = auto
10945 then
10946
10947         case $cf_cv_system_name in
10948         (OS/2*|os2*)
10949                 if test "$DFT_LWR_MODEL" = libtool; then
10950                         LIB_PREFIX='lib'
10951                 else
10952                         LIB_PREFIX=''
10953                 fi
10954                 ;;
10955         (*-msvc*)
10956                 LIB_PREFIX=''
10957                 ;;
10958         (*)     LIB_PREFIX='lib'
10959                 ;;
10960         esac
10961 cf_prefix=$LIB_PREFIX
10962
10963 elif test $with_lib_prefix = no
10964 then
10965         LIB_PREFIX=
10966 else
10967         LIB_PREFIX=$with_lib_prefix
10968 fi
10969
10970 LIB_SUFFIX=
10971
10972 ###############################################################################
10973
10974 if test X"$CC_G_OPT" = X"" ; then
10975         CC_G_OPT='-g'
10976         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10977 fi
10978
10979 echo "$as_me:10979: checking for default loader flags" >&5
10980 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10981 case $DFT_LWR_MODEL in
10982 (normal)  LD_MODEL=''   ;;
10983 (debug)   LD_MODEL=$CC_G_OPT ;;
10984 (profile) LD_MODEL='-pg';;
10985 (shared)  LD_MODEL=''   ;;
10986 esac
10987 echo "$as_me:10987: result: $LD_MODEL" >&5
10988 echo "${ECHO_T}$LD_MODEL" >&6
10989
10990 LD_RPATH_OPT=
10991 if test "x$cf_cv_enable_rpath" != xno
10992 then
10993         echo "$as_me:10993: checking for an rpath option" >&5
10994 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10995         case $cf_cv_system_name in
10996         (irix*)
10997                 if test "$GCC" = yes; then
10998                         LD_RPATH_OPT="-Wl,-rpath,"
10999                 else
11000                         LD_RPATH_OPT="-rpath "
11001                 fi
11002                 ;;
11003         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11004                 LD_RPATH_OPT="-Wl,-rpath,"
11005                 ;;
11006         (openbsd[2-9].*|mirbsd*)
11007                 LD_RPATH_OPT="-Wl,-rpath,"
11008                 ;;
11009         (dragonfly*)
11010                 LD_RPATH_OPT="-rpath "
11011                 ;;
11012         (netbsd*)
11013                 LD_RPATH_OPT="-Wl,-rpath,"
11014                 ;;
11015         (osf*|mls+*)
11016                 LD_RPATH_OPT="-rpath "
11017                 ;;
11018         (solaris2*)
11019                 LD_RPATH_OPT="-R"
11020                 ;;
11021         (*)
11022                 ;;
11023         esac
11024         echo "$as_me:11024: result: $LD_RPATH_OPT" >&5
11025 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11026
11027         case "x$LD_RPATH_OPT" in
11028         (x-R*)
11029                 echo "$as_me:11029: checking if we need a space after rpath option" >&5
11030 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11031                 cf_save_LIBS="$LIBS"
11032
11033 cf_add_libs="$LIBS"
11034 # reverse order
11035 cf_add_0lib=
11036 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11037 # filter duplicates
11038 for cf_add_1lib in $cf_add_0lib; do
11039         for cf_add_2lib in $cf_add_libs; do
11040                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11041                         cf_add_1lib=
11042                         break
11043                 fi
11044         done
11045         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11046 done
11047 LIBS="$cf_add_libs"
11048
11049                 cat >conftest.$ac_ext <<_ACEOF
11050 #line 11050 "configure"
11051 #include "confdefs.h"
11052
11053 int
11054 main (void)
11055 {
11056
11057   ;
11058   return 0;
11059 }
11060 _ACEOF
11061 rm -f conftest.$ac_objext conftest$ac_exeext
11062 if { (eval echo "$as_me:11062: \"$ac_link\"") >&5
11063   (eval $ac_link) 2>&5
11064   ac_status=$?
11065   echo "$as_me:11065: \$? = $ac_status" >&5
11066   (exit $ac_status); } &&
11067          { ac_try='test -s conftest$ac_exeext'
11068   { (eval echo "$as_me:11068: \"$ac_try\"") >&5
11069   (eval $ac_try) 2>&5
11070   ac_status=$?
11071   echo "$as_me:11071: \$? = $ac_status" >&5
11072   (exit $ac_status); }; }; then
11073   cf_rpath_space=no
11074 else
11075   echo "$as_me: failed program was:" >&5
11076 cat conftest.$ac_ext >&5
11077 cf_rpath_space=yes
11078 fi
11079 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11080                 LIBS="$cf_save_LIBS"
11081                 echo "$as_me:11081: result: $cf_rpath_space" >&5
11082 echo "${ECHO_T}$cf_rpath_space" >&6
11083                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11084                 ;;
11085         esac
11086 fi
11087
11088         RM_SHARED_OPTS=
11089         LOCAL_LDFLAGS=
11090         LOCAL_LDFLAGS2=
11091         LD_SHARED_OPTS=
11092         INSTALL_LIB="-m 644"
11093         : ${rel_builddir:=.}
11094
11095         shlibdir=$libdir
11096
11097         MAKE_DLLS="#"
11098
11099         cf_cv_do_symlinks=no
11100         cf_ld_rpath_opt=
11101         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11102
11103         echo "$as_me:11103: checking if release/abi version should be used for shared libs" >&5
11104 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11105
11106 # Check whether --with-shlib-version or --without-shlib-version was given.
11107 if test "${with_shlib_version+set}" = set; then
11108   withval="$with_shlib_version"
11109   test -z "$withval" && withval=auto
11110         case $withval in
11111         (yes)
11112                 cf_cv_shlib_version=auto
11113                 ;;
11114         (rel|abi|auto)
11115                 cf_cv_shlib_version=$withval
11116                 ;;
11117         (*)
11118                 echo "$as_me:11118: result: $withval" >&5
11119 echo "${ECHO_T}$withval" >&6
11120                 { { echo "$as_me:11120: error: option value must be one of: rel, abi, or auto" >&5
11121 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11122    { (exit 1); exit 1; }; }
11123                 ;;
11124         esac
11125
11126 else
11127   cf_cv_shlib_version=auto
11128 fi;
11129         echo "$as_me:11129: result: $cf_cv_shlib_version" >&5
11130 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11131
11132         cf_cv_rm_so_locs=no
11133         cf_try_cflags=
11134
11135         # Some less-capable ports of gcc support only -fpic
11136         CC_SHARED_OPTS=
11137
11138         cf_try_fPIC=no
11139         if test "$GCC" = yes
11140         then
11141                 cf_try_fPIC=yes
11142         else
11143                 case $cf_cv_system_name in
11144                 (*linux*)       # e.g., PGI compiler
11145                         cf_try_fPIC=yes
11146                         ;;
11147                 esac
11148         fi
11149
11150         if test "$cf_try_fPIC" = yes
11151         then
11152                 echo "$as_me:11152: checking which $CC option to use" >&5
11153 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11154                 cf_save_CFLAGS="$CFLAGS"
11155                 for CC_SHARED_OPTS in -fPIC -fpic ''
11156                 do
11157                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11158                         cat >conftest.$ac_ext <<_ACEOF
11159 #line 11159 "configure"
11160 #include "confdefs.h"
11161 #include <stdio.h>
11162 int
11163 main (void)
11164 {
11165 int x = 1
11166   ;
11167   return 0;
11168 }
11169 _ACEOF
11170 rm -f conftest.$ac_objext
11171 if { (eval echo "$as_me:11171: \"$ac_compile\"") >&5
11172   (eval $ac_compile) 2>&5
11173   ac_status=$?
11174   echo "$as_me:11174: \$? = $ac_status" >&5
11175   (exit $ac_status); } &&
11176          { ac_try='test -s conftest.$ac_objext'
11177   { (eval echo "$as_me:11177: \"$ac_try\"") >&5
11178   (eval $ac_try) 2>&5
11179   ac_status=$?
11180   echo "$as_me:11180: \$? = $ac_status" >&5
11181   (exit $ac_status); }; }; then
11182   break
11183 else
11184   echo "$as_me: failed program was:" >&5
11185 cat conftest.$ac_ext >&5
11186 fi
11187 rm -f conftest.$ac_objext conftest.$ac_ext
11188                 done
11189                 echo "$as_me:11189: result: $CC_SHARED_OPTS" >&5
11190 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11191                 CFLAGS="$cf_save_CFLAGS"
11192         fi
11193
11194         cf_cv_shlib_version_infix=no
11195
11196         case $cf_cv_system_name in
11197         (aix4.3-9*|aix[5-7]*)
11198                 if test "$GCC" = yes; then
11199                         CC_SHARED_OPTS='-Wl,-brtl'
11200                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11201                 else
11202                         CC_SHARED_OPTS='-brtl'
11203                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11204                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11205                 fi
11206                 ;;
11207         (beos*)
11208                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11209                 ;;
11210         (cygwin*)
11211                 CC_SHARED_OPTS=
11212                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11213                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11214                 cf_cv_shlib_version=cygdll
11215                 cf_cv_shlib_version_infix=cygdll
11216                 shlibdir=$bindir
11217                 MAKE_DLLS=
11218                 cat >mk_shared_lib.sh <<-CF_EOF
11219                 #!$SHELL
11220                 SHARED_LIB=\$1
11221                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11222                 shift
11223                 cat <<-EOF
11224                 Linking shared library
11225                 ** SHARED_LIB \$SHARED_LIB
11226                 ** IMPORT_LIB \$IMPORT_LIB
11227 EOF
11228                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11229 CF_EOF
11230                 chmod +x mk_shared_lib.sh
11231                 ;;
11232         (msys*)
11233                 CC_SHARED_OPTS=
11234                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11235                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11236                 cf_cv_shlib_version=msysdll
11237                 cf_cv_shlib_version_infix=msysdll
11238                 shlibdir=$bindir
11239                 MAKE_DLLS=
11240                 cat >mk_shared_lib.sh <<-CF_EOF
11241                 #!$SHELL
11242                 SHARED_LIB=\$1
11243                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11244                 shift
11245                 cat <<-EOF
11246                 Linking shared library
11247                 ** SHARED_LIB \$SHARED_LIB
11248                 ** IMPORT_LIB \$IMPORT_LIB
11249 EOF
11250                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11251 CF_EOF
11252                 chmod +x mk_shared_lib.sh
11253                 ;;
11254         (darwin*)
11255                 cf_try_cflags="no-cpp-precomp"
11256                 CC_SHARED_OPTS="-dynamic"
11257                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11258                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11259                 cf_cv_shlib_version_infix=yes
11260                 echo "$as_me:11260: checking if ld -search_paths_first works" >&5
11261 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11262 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11263   echo $ECHO_N "(cached) $ECHO_C" >&6
11264 else
11265
11266                         cf_save_LDFLAGS=$LDFLAGS
11267                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11268                         cat >conftest.$ac_ext <<_ACEOF
11269 #line 11269 "configure"
11270 #include "confdefs.h"
11271
11272 int
11273 main (void)
11274 {
11275 int i;
11276   ;
11277   return 0;
11278 }
11279 _ACEOF
11280 rm -f conftest.$ac_objext conftest$ac_exeext
11281 if { (eval echo "$as_me:11281: \"$ac_link\"") >&5
11282   (eval $ac_link) 2>&5
11283   ac_status=$?
11284   echo "$as_me:11284: \$? = $ac_status" >&5
11285   (exit $ac_status); } &&
11286          { ac_try='test -s conftest$ac_exeext'
11287   { (eval echo "$as_me:11287: \"$ac_try\"") >&5
11288   (eval $ac_try) 2>&5
11289   ac_status=$?
11290   echo "$as_me:11290: \$? = $ac_status" >&5
11291   (exit $ac_status); }; }; then
11292   cf_cv_ldflags_search_paths_first=yes
11293 else
11294   echo "$as_me: failed program was:" >&5
11295 cat conftest.$ac_ext >&5
11296 cf_cv_ldflags_search_paths_first=no
11297 fi
11298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11299                                 LDFLAGS=$cf_save_LDFLAGS
11300 fi
11301 echo "$as_me:11301: result: $cf_cv_ldflags_search_paths_first" >&5
11302 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11303                 if test $cf_cv_ldflags_search_paths_first = yes; then
11304                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11305                 fi
11306                 ;;
11307         (hpux[7-8]*)
11308                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11309                 if test "$GCC" != yes; then
11310                         CC_SHARED_OPTS='+Z'
11311                 fi
11312                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11313                 INSTALL_LIB="-m 555"
11314                 ;;
11315         (hpux*)
11316                 # (tested with gcc 2.7.2 -- I don't have c89)
11317                 if test "$GCC" = yes; then
11318                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11319                 else
11320                         CC_SHARED_OPTS='+Z'
11321                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11322                 fi
11323                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11324                 # HP-UX shared libraries must be executable, and should be
11325                 # readonly to exploit a quirk in the memory manager.
11326                 INSTALL_LIB="-m 555"
11327                 ;;
11328         (interix*)
11329                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11330                 if test "$cf_cv_shlib_version" = rel; then
11331                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11332                 else
11333                         cf_shared_soname='`basename $@`'
11334                 fi
11335                 CC_SHARED_OPTS=
11336                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11337                 ;;
11338         (irix*)
11339                 if test "$cf_cv_enable_rpath" = yes ; then
11340                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11341                 fi
11342                 # tested with IRIX 5.2 and 'cc'.
11343                 if test "$GCC" != yes; then
11344                         CC_SHARED_OPTS='-KPIC'
11345                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11346                 else
11347                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11348                 fi
11349                 cf_cv_rm_so_locs=yes
11350                 ;;
11351         (linux*|gnu*|k*bsd*-gnu)
11352                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11353                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11354                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11355                 fi
11356                 if test "$cf_cv_enable_rpath" = yes ; then
11357                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11358                 fi
11359
11360         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11361         if test "$cf_cv_shlib_version" = rel; then
11362                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11363         else
11364                 cf_cv_shared_soname='`basename $@`'
11365         fi
11366
11367                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11368                 ;;
11369         (mingw*msvc*)
11370                 cf_cv_shlib_version=msvcdll
11371                 cf_cv_shlib_version_infix=msvcdll
11372                 shlibdir=$bindir
11373                 MAKE_DLLS=
11374                 if test "$DFT_LWR_MODEL" = "shared" ; then
11375                         LOCAL_LDFLAGS="-link -dll"
11376                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11377                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11378                 fi
11379                 CC_SHARED_OPTS=
11380                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11381                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11382                 cat >mk_shared_lib.sh <<-CF_EOF
11383                 #!$SHELL
11384                 SHARED_LIB=\$1
11385                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11386                 shift
11387                 my_ld=\$1
11388                 shift
11389                 cat <<-EOF
11390                 Linking shared library
11391                 ** SHARED LIB \$SHARED_LIB
11392                 ** IMPORT_LIB \$IMPORT_LIB
11393 EOF
11394                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11395                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11396                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11397 CF_EOF
11398                 chmod +x mk_shared_lib.sh
11399                 cat >mk_prog.sh <<-CF_EOF
11400                 #!$SHELL
11401                 shift
11402                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11403                 LD="$LD"
11404                 clopts=()
11405                 ldopts=("/subsystem:console")
11406                 libs=()
11407                 isdll=0
11408                 while test \$# -gt 0; do
11409                         case "\$1" in
11410                                 -link)
11411                                         # ignore -link argument
11412                                         ;;
11413                                 -M[TD] | -M[TD]d)
11414                                         # ignore runtime-library option
11415                                         ;;
11416                                 -dll)
11417                                         isdll=1
11418                                         ;;
11419                                 -W* | -w*)
11420                                         # ignore warnings
11421                                         ;;
11422                                 -D*)
11423                                         clopts+=("\$1")
11424                                         ;;
11425                                 -I*)
11426                                         clopts+=("\$1")
11427                                         ;;
11428                                 -l*)
11429                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11430                                         ;;
11431                                 -L*)
11432                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11433                                         ;;
11434                                 *.obj | *.o)
11435                                         ldopts+=("\$1")
11436                                         ;;
11437                                 -Wl,*)
11438                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11439                                                 ldopts+=("\${linkarg}")
11440                                         done
11441                                         ;;
11442                                 *.lib)
11443                                         ldopts+=("\$1")
11444                                         ;;
11445                                 -o)
11446                                         shift
11447                                         ldopts+=("-out:\$1")
11448                                         ;;
11449                                 *)
11450                                         clopts+=("\$1")
11451                                         ldopts+=("\$1")
11452                                         ;;
11453                         esac
11454                         shift
11455                 done
11456                 if [ "\$isdll" -ne 0 ]; then
11457                         for lib in \${libs[*]}; do
11458                                 ldopts+=("\$lib.dll.lib")
11459                         done
11460                 else
11461                         for lib in \${libs[*]}; do
11462                                 ldopts+=("\$lib.lib")
11463                         done
11464                 fi
11465                 cat <<-EOF
11466                 Creating program
11467                 ** ld options:   "\${ldopts[@]}"
11468 EOF
11469                 exec \$LD \${ldopts[@]}
11470 CF_EOF
11471                 chmod +x mk_prog.sh
11472                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11473                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11474                 ;;
11475         (mingw*)
11476                 cf_cv_shlib_version=mingw
11477                 cf_cv_shlib_version_infix=mingw
11478                 shlibdir=$bindir
11479                 MAKE_DLLS=
11480                 if test "$DFT_LWR_MODEL" = "shared" ; then
11481                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11482                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11483                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11484                 fi
11485                 CC_SHARED_OPTS=
11486                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11487                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11488                 cat >mk_shared_lib.sh <<-CF_EOF
11489                 #!$SHELL
11490                 SHARED_LIB=\$1
11491                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11492                 shift
11493                 cat <<-EOF
11494                 Linking shared library
11495                 ** SHARED_LIB \$SHARED_LIB
11496                 ** IMPORT_LIB \$IMPORT_LIB
11497 EOF
11498                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11499 CF_EOF
11500                 chmod +x mk_shared_lib.sh
11501                 ;;
11502         (openbsd[2-9].*|mirbsd*)
11503                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11504                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11505                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11506                 fi
11507                 if test "$cf_cv_enable_rpath" = yes ; then
11508                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11509                 fi
11510                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11511
11512         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11513         if test "$cf_cv_shlib_version" = rel; then
11514                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11515         else
11516                 cf_cv_shared_soname='`basename $@`'
11517         fi
11518
11519                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11520                 ;;
11521         (nskJ*)
11522                 CC_SHARED_OPTS=
11523                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11524                 ;;
11525         (nskL*)
11526                 CC_SHARED_OPTS=
11527                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11528                 ;;
11529         (nto-qnx*|openbsd*|freebsd[12].*)
11530                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11531                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11532                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11533                 ;;
11534         (dragonfly*|freebsd*)
11535                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11536                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11537                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11538                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11539                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11540                 fi
11541
11542         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11543         if test "$cf_cv_shlib_version" = rel; then
11544                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11545         else
11546                 cf_cv_shared_soname='`basename $@`'
11547         fi
11548
11549                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11550                 ;;
11551         (netbsd*)
11552                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11553                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11554                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11555                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11556                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11557                         if test "$cf_cv_shlib_version" = auto; then
11558                         if test -f /usr/libexec/ld.elf_so; then
11559                                 cf_cv_shlib_version=abi
11560                         else
11561                                 cf_cv_shlib_version=rel
11562                         fi
11563                         fi
11564
11565         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11566         if test "$cf_cv_shlib_version" = rel; then
11567                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11568         else
11569                 cf_cv_shared_soname='`basename $@`'
11570         fi
11571
11572                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11573                 else
11574                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11575                 fi
11576                 ;;
11577         (osf*|mls+*)
11578                 # tested with OSF/1 V3.2 and 'cc'
11579                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11580                 # link with shared libs).
11581                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11582                 case $host_os in
11583                 (osf4*)
11584                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11585                         ;;
11586                 esac
11587                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11588                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11589                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11590                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11591                 fi
11592                 cf_cv_rm_so_locs=yes
11593                 ;;
11594         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11595                 # tested with osr5.0.5
11596                 if test "$GCC" != yes; then
11597                         CC_SHARED_OPTS='-belf -KPIC'
11598                 fi
11599                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11600                 if test "$cf_cv_enable_rpath" = yes ; then
11601                         # only way is to set LD_RUN_PATH but no switch for it
11602                         RUN_PATH=$libdir
11603                 fi
11604                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11605                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11606                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11607                 ;;
11608         (sunos4*)
11609                 # tested with SunOS 4.1.1 and gcc 2.7.0
11610                 if test "$GCC" != yes; then
11611                         CC_SHARED_OPTS='-KPIC'
11612                 fi
11613                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11614                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11615                 ;;
11616         (solaris2*)
11617                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11618                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11619                 if test "$DFT_LWR_MODEL" = "shared" ; then
11620                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11621                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11622                 fi
11623                 if test "$cf_cv_enable_rpath" = yes ; then
11624                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11625                 fi
11626
11627         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11628         if test "$cf_cv_shlib_version" = rel; then
11629                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11630         else
11631                 cf_cv_shared_soname='`basename $@`'
11632         fi
11633
11634                 if test "$GCC" != yes; then
11635                         cf_save_CFLAGS="$CFLAGS"
11636                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11637                         do
11638                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11639                                 cat >conftest.$ac_ext <<_ACEOF
11640 #line 11640 "configure"
11641 #include "confdefs.h"
11642 #include <stdio.h>
11643 int
11644 main (void)
11645 {
11646 printf("Hello\n");
11647   ;
11648   return 0;
11649 }
11650 _ACEOF
11651 rm -f conftest.$ac_objext
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); } &&
11657          { ac_try='test -s conftest.$ac_objext'
11658   { (eval echo "$as_me:11658: \"$ac_try\"") >&5
11659   (eval $ac_try) 2>&5
11660   ac_status=$?
11661   echo "$as_me:11661: \$? = $ac_status" >&5
11662   (exit $ac_status); }; }; then
11663   break
11664 else
11665   echo "$as_me: failed program was:" >&5
11666 cat conftest.$ac_ext >&5
11667 fi
11668 rm -f conftest.$ac_objext conftest.$ac_ext
11669                         done
11670                         CFLAGS="$cf_save_CFLAGS"
11671                         CC_SHARED_OPTS=$cf_shared_opts
11672                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11673                 else
11674                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11675                 fi
11676                 ;;
11677         (sysv5uw7*|unix_sv*)
11678                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11679                 if test "$GCC" != yes; then
11680                         CC_SHARED_OPTS='-KPIC'
11681                 fi
11682                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11683                 ;;
11684         (*)
11685                 CC_SHARED_OPTS='unknown'
11686                 MK_SHARED_LIB='echo unknown'
11687                 ;;
11688         esac
11689
11690         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11691         case "$cf_cv_shlib_version" in
11692         (rel|abi)
11693                 case "$MK_SHARED_LIB" in
11694                 (*'-o $@')
11695                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11696                         ;;
11697                 (*)
11698                         { echo "$as_me:11698: WARNING: ignored --with-shlib-version" >&5
11699 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11700                         ;;
11701                 esac
11702                 ;;
11703         esac
11704
11705         if test -n "$cf_try_cflags"
11706         then
11707 cat > conftest.$ac_ext <<EOF
11708 #line 11708 "${as_me:-configure}"
11709 #include <stdio.h>
11710 int main(int argc, char *argv[])
11711 {
11712         printf("hello\n");
11713         return (argv[argc-1] == 0) ;
11714 }
11715 EOF
11716                 cf_save_CFLAGS="$CFLAGS"
11717                 for cf_opt in $cf_try_cflags
11718                 do
11719                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11720                         echo "$as_me:11720: checking if CFLAGS option -$cf_opt works" >&5
11721 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11722                         if { (eval echo "$as_me:11722: \"$ac_compile\"") >&5
11723   (eval $ac_compile) 2>&5
11724   ac_status=$?
11725   echo "$as_me:11725: \$? = $ac_status" >&5
11726   (exit $ac_status); }; then
11727                                 echo "$as_me:11727: result: yes" >&5
11728 echo "${ECHO_T}yes" >&6
11729                                 cf_save_CFLAGS="$CFLAGS"
11730                         else
11731                                 echo "$as_me:11731: result: no" >&5
11732 echo "${ECHO_T}no" >&6
11733                         fi
11734                 done
11735                 CFLAGS="$cf_save_CFLAGS"
11736         fi
11737
11738         # RPATH_LIST is a colon-separated list of directories
11739         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11740         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11741
11742         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11743
11744         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11745
11746 echo "${as_me:-configure}:11746: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11747
11748         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11749
11750 echo "${as_me:-configure}:11750: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11751
11752 # The test/sample programs in the original tree link using rpath option.
11753 # Make it optional for packagers.
11754 if test -n "$LOCAL_LDFLAGS"
11755 then
11756         echo "$as_me:11756: checking if you want to link sample programs with rpath option" >&5
11757 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11758
11759 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11760 if test "${enable_rpath_link+set}" = set; then
11761   enableval="$enable_rpath_link"
11762   with_rpath_link=$enableval
11763 else
11764   with_rpath_link=yes
11765 fi;
11766         echo "$as_me:11766: result: $with_rpath_link" >&5
11767 echo "${ECHO_T}$with_rpath_link" >&6
11768         if test "$with_rpath_link" = no
11769         then
11770                 LOCAL_LDFLAGS=
11771                 LOCAL_LDFLAGS2=
11772         fi
11773 fi
11774
11775 ###############################################################################
11776
11777 ###   use option --enable-broken-linker to force on use of broken-linker support
11778
11779 echo "$as_me:11779: checking if you want broken-linker support code" >&5
11780 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11781
11782 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11783 if test "${enable_broken_linker+set}" = set; then
11784   enableval="$enable_broken_linker"
11785   with_broken_linker=$enableval
11786 else
11787   with_broken_linker=no
11788 fi;
11789 echo "$as_me:11789: result: $with_broken_linker" >&5
11790 echo "${ECHO_T}$with_broken_linker" >&6
11791
11792 : ${BROKEN_LINKER:=0}
11793 if test "x$with_broken_linker" = xyes ; then
11794
11795 cat >>confdefs.h <<\EOF
11796 #define BROKEN_LINKER 1
11797 EOF
11798
11799         BROKEN_LINKER=1
11800 fi
11801
11802 # Check to define _XOPEN_SOURCE "automatically"
11803
11804 echo "$as_me:11804: checking if the POSIX test-macros are already defined" >&5
11805 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11806 if test "${cf_cv_posix_visible+set}" = set; then
11807   echo $ECHO_N "(cached) $ECHO_C" >&6
11808 else
11809
11810 cat >conftest.$ac_ext <<_ACEOF
11811 #line 11811 "configure"
11812 #include "confdefs.h"
11813 #include <stdio.h>
11814 int
11815 main (void)
11816 {
11817
11818 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11819         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11820         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11821         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11822 #error conflicting symbols found
11823 #endif
11824
11825   ;
11826   return 0;
11827 }
11828 _ACEOF
11829 rm -f conftest.$ac_objext
11830 if { (eval echo "$as_me:11830: \"$ac_compile\"") >&5
11831   (eval $ac_compile) 2>&5
11832   ac_status=$?
11833   echo "$as_me:11833: \$? = $ac_status" >&5
11834   (exit $ac_status); } &&
11835          { ac_try='test -s conftest.$ac_objext'
11836   { (eval echo "$as_me:11836: \"$ac_try\"") >&5
11837   (eval $ac_try) 2>&5
11838   ac_status=$?
11839   echo "$as_me:11839: \$? = $ac_status" >&5
11840   (exit $ac_status); }; }; then
11841   cf_cv_posix_visible=no
11842 else
11843   echo "$as_me: failed program was:" >&5
11844 cat conftest.$ac_ext >&5
11845 cf_cv_posix_visible=yes
11846 fi
11847 rm -f conftest.$ac_objext conftest.$ac_ext
11848
11849 fi
11850 echo "$as_me:11850: result: $cf_cv_posix_visible" >&5
11851 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11852
11853 if test "$cf_cv_posix_visible" = no; then
11854
11855 cf_XOPEN_SOURCE=600
11856 cf_POSIX_C_SOURCE=199506L
11857 cf_xopen_source=
11858
11859 case $host_os in
11860 (aix[4-7]*)
11861         cf_xopen_source="-D_ALL_SOURCE"
11862         ;;
11863 (msys)
11864         cf_XOPEN_SOURCE=600
11865         ;;
11866 (darwin[0-8].*)
11867         cf_xopen_source="-D_APPLE_C_SOURCE"
11868         ;;
11869 (darwin*)
11870         cf_xopen_source="-D_DARWIN_C_SOURCE"
11871         cf_XOPEN_SOURCE=
11872         ;;
11873 (freebsd*|dragonfly*|midnightbsd*)
11874         # 5.x headers associate
11875         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11876         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11877         cf_POSIX_C_SOURCE=200112L
11878         cf_XOPEN_SOURCE=600
11879         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11880         ;;
11881 (hpux11*)
11882         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11883         ;;
11884 (hpux*)
11885         cf_xopen_source="-D_HPUX_SOURCE"
11886         ;;
11887 (irix[56].*)
11888         cf_xopen_source="-D_SGI_SOURCE"
11889         cf_XOPEN_SOURCE=
11890         ;;
11891 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11892
11893 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11894
11895 echo "$as_me:11895: checking if this is the GNU C library" >&5
11896 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11897 if test "${cf_cv_gnu_library+set}" = set; then
11898   echo $ECHO_N "(cached) $ECHO_C" >&6
11899 else
11900
11901 cat >conftest.$ac_ext <<_ACEOF
11902 #line 11902 "configure"
11903 #include "confdefs.h"
11904 #include <sys/types.h>
11905 int
11906 main (void)
11907 {
11908
11909         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11910                 return 0;
11911         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11912                 return 0;
11913         #else
11914         #       error not GNU C library
11915         #endif
11916   ;
11917   return 0;
11918 }
11919 _ACEOF
11920 rm -f conftest.$ac_objext
11921 if { (eval echo "$as_me:11921: \"$ac_compile\"") >&5
11922   (eval $ac_compile) 2>&5
11923   ac_status=$?
11924   echo "$as_me:11924: \$? = $ac_status" >&5
11925   (exit $ac_status); } &&
11926          { ac_try='test -s conftest.$ac_objext'
11927   { (eval echo "$as_me:11927: \"$ac_try\"") >&5
11928   (eval $ac_try) 2>&5
11929   ac_status=$?
11930   echo "$as_me:11930: \$? = $ac_status" >&5
11931   (exit $ac_status); }; }; then
11932   cf_cv_gnu_library=yes
11933 else
11934   echo "$as_me: failed program was:" >&5
11935 cat conftest.$ac_ext >&5
11936 cf_cv_gnu_library=no
11937 fi
11938 rm -f conftest.$ac_objext conftest.$ac_ext
11939
11940 fi
11941 echo "$as_me:11941: result: $cf_cv_gnu_library" >&5
11942 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11943
11944 if test x$cf_cv_gnu_library = xyes; then
11945
11946         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11947         # was changed to help a little.  newlib incorporated the change about 4
11948         # years later.
11949         echo "$as_me:11949: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11950 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11951 if test "${cf_cv_gnu_library_219+set}" = set; then
11952   echo $ECHO_N "(cached) $ECHO_C" >&6
11953 else
11954
11955                 cf_save="$CPPFLAGS"
11956
11957         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11958         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11959
11960                 cat >conftest.$ac_ext <<_ACEOF
11961 #line 11961 "configure"
11962 #include "confdefs.h"
11963 #include <sys/types.h>
11964 int
11965 main (void)
11966 {
11967
11968                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11969                                 return 0;
11970                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11971                                 return 0;
11972                         #else
11973                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11974                         #endif
11975   ;
11976   return 0;
11977 }
11978 _ACEOF
11979 rm -f conftest.$ac_objext
11980 if { (eval echo "$as_me:11980: \"$ac_compile\"") >&5
11981   (eval $ac_compile) 2>&5
11982   ac_status=$?
11983   echo "$as_me:11983: \$? = $ac_status" >&5
11984   (exit $ac_status); } &&
11985          { ac_try='test -s conftest.$ac_objext'
11986   { (eval echo "$as_me:11986: \"$ac_try\"") >&5
11987   (eval $ac_try) 2>&5
11988   ac_status=$?
11989   echo "$as_me:11989: \$? = $ac_status" >&5
11990   (exit $ac_status); }; }; then
11991   cf_cv_gnu_library_219=yes
11992 else
11993   echo "$as_me: failed program was:" >&5
11994 cat conftest.$ac_ext >&5
11995 cf_cv_gnu_library_219=no
11996 fi
11997 rm -f conftest.$ac_objext conftest.$ac_ext
11998                 CPPFLAGS="$cf_save"
11999
12000 fi
12001 echo "$as_me:12001: result: $cf_cv_gnu_library_219" >&5
12002 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12003
12004         if test "x$cf_cv_gnu_library_219" = xyes; then
12005                 cf_save="$CPPFLAGS"
12006                 echo "$as_me:12006: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12007 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12008 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12009   echo $ECHO_N "(cached) $ECHO_C" >&6
12010 else
12011
12012 cf_fix_cppflags=no
12013 cf_new_cflags=
12014 cf_new_cppflags=
12015 cf_new_extra_cppflags=
12016
12017 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12018 do
12019 case $cf_fix_cppflags in
12020 (no)
12021         case $cf_add_cflags in
12022         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12023                 case $cf_add_cflags in
12024                 (-D*)
12025                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12026
12027                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12028                                 && test -z "${cf_tst_cflags}" \
12029                                 && cf_fix_cppflags=yes
12030
12031                         if test $cf_fix_cppflags = yes ; then
12032
12033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12035
12036                                 continue
12037                         elif test "${cf_tst_cflags}" = "\"'" ; then
12038
12039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12041
12042                                 continue
12043                         fi
12044                         ;;
12045                 esac
12046                 case "$CPPFLAGS" in
12047                 (*$cf_add_cflags)
12048                         ;;
12049                 (*)
12050                         case $cf_add_cflags in
12051                         (-D*)
12052                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12053
12054 CPPFLAGS=`echo "$CPPFLAGS" | \
12055         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12056                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12057
12058                                 ;;
12059                         esac
12060
12061         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12062         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12063
12064                         ;;
12065                 esac
12066                 ;;
12067         (*)
12068
12069         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12070         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12071
12072                 ;;
12073         esac
12074         ;;
12075 (yes)
12076
12077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12079
12080         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12081
12082         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12083                 && test -z "${cf_tst_cflags}" \
12084                 && cf_fix_cppflags=no
12085         ;;
12086 esac
12087 done
12088
12089 if test -n "$cf_new_cflags" ; then
12090
12091         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12092         CFLAGS="${CFLAGS}$cf_new_cflags"
12093
12094 fi
12095
12096 if test -n "$cf_new_cppflags" ; then
12097
12098         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12099         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12100
12101 fi
12102
12103 if test -n "$cf_new_extra_cppflags" ; then
12104
12105         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12106         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12107
12108 fi
12109
12110                         cat >conftest.$ac_ext <<_ACEOF
12111 #line 12111 "configure"
12112 #include "confdefs.h"
12113
12114                                 #include <limits.h>
12115                                 #include <sys/types.h>
12116
12117 int
12118 main (void)
12119 {
12120
12121                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12122                                         return 0;
12123                                 #else
12124                                 #       error GNU C library is too old
12125                                 #endif
12126   ;
12127   return 0;
12128 }
12129 _ACEOF
12130 rm -f conftest.$ac_objext
12131 if { (eval echo "$as_me:12131: \"$ac_compile\"") >&5
12132   (eval $ac_compile) 2>&5
12133   ac_status=$?
12134   echo "$as_me:12134: \$? = $ac_status" >&5
12135   (exit $ac_status); } &&
12136          { ac_try='test -s conftest.$ac_objext'
12137   { (eval echo "$as_me:12137: \"$ac_try\"") >&5
12138   (eval $ac_try) 2>&5
12139   ac_status=$?
12140   echo "$as_me:12140: \$? = $ac_status" >&5
12141   (exit $ac_status); }; }; then
12142   cf_cv_gnu_dftsrc_219=yes
12143 else
12144   echo "$as_me: failed program was:" >&5
12145 cat conftest.$ac_ext >&5
12146 cf_cv_gnu_dftsrc_219=no
12147 fi
12148 rm -f conftest.$ac_objext conftest.$ac_ext
12149
12150 fi
12151 echo "$as_me:12151: result: $cf_cv_gnu_dftsrc_219" >&5
12152 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12153                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12154         else
12155                 cf_cv_gnu_dftsrc_219=maybe
12156         fi
12157
12158         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12159
12160                 echo "$as_me:12160: checking if we must define _GNU_SOURCE" >&5
12161 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12162 if test "${cf_cv_gnu_source+set}" = set; then
12163   echo $ECHO_N "(cached) $ECHO_C" >&6
12164 else
12165
12166                 cat >conftest.$ac_ext <<_ACEOF
12167 #line 12167 "configure"
12168 #include "confdefs.h"
12169 #include <sys/types.h>
12170 int
12171 main (void)
12172 {
12173
12174                         #ifndef _XOPEN_SOURCE
12175                         #error  expected _XOPEN_SOURCE to be defined
12176                         #endif
12177   ;
12178   return 0;
12179 }
12180 _ACEOF
12181 rm -f conftest.$ac_objext
12182 if { (eval echo "$as_me:12182: \"$ac_compile\"") >&5
12183   (eval $ac_compile) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit $ac_status); } &&
12187          { ac_try='test -s conftest.$ac_objext'
12188   { (eval echo "$as_me:12188: \"$ac_try\"") >&5
12189   (eval $ac_try) 2>&5
12190   ac_status=$?
12191   echo "$as_me:12191: \$? = $ac_status" >&5
12192   (exit $ac_status); }; }; then
12193   cf_cv_gnu_source=no
12194 else
12195   echo "$as_me: failed program was:" >&5
12196 cat conftest.$ac_ext >&5
12197 cf_save="$CPPFLAGS"
12198
12199 cf_fix_cppflags=no
12200 cf_new_cflags=
12201 cf_new_cppflags=
12202 cf_new_extra_cppflags=
12203
12204 for cf_add_cflags in -D_GNU_SOURCE
12205 do
12206 case $cf_fix_cppflags in
12207 (no)
12208         case $cf_add_cflags in
12209         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12210                 case $cf_add_cflags in
12211                 (-D*)
12212                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12213
12214                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12215                                 && test -z "${cf_tst_cflags}" \
12216                                 && cf_fix_cppflags=yes
12217
12218                         if test $cf_fix_cppflags = yes ; then
12219
12220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12222
12223                                 continue
12224                         elif test "${cf_tst_cflags}" = "\"'" ; then
12225
12226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12228
12229                                 continue
12230                         fi
12231                         ;;
12232                 esac
12233                 case "$CPPFLAGS" in
12234                 (*$cf_add_cflags)
12235                         ;;
12236                 (*)
12237                         case $cf_add_cflags in
12238                         (-D*)
12239                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12240
12241 CPPFLAGS=`echo "$CPPFLAGS" | \
12242         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12243                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12244
12245                                 ;;
12246                         esac
12247
12248         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12249         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12250
12251                         ;;
12252                 esac
12253                 ;;
12254         (*)
12255
12256         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12257         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12258
12259                 ;;
12260         esac
12261         ;;
12262 (yes)
12263
12264         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12265         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12266
12267         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12268
12269         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12270                 && test -z "${cf_tst_cflags}" \
12271                 && cf_fix_cppflags=no
12272         ;;
12273 esac
12274 done
12275
12276 if test -n "$cf_new_cflags" ; then
12277
12278         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12279         CFLAGS="${CFLAGS}$cf_new_cflags"
12280
12281 fi
12282
12283 if test -n "$cf_new_cppflags" ; then
12284
12285         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12286         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12287
12288 fi
12289
12290 if test -n "$cf_new_extra_cppflags" ; then
12291
12292         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12293         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12294
12295 fi
12296
12297                          cat >conftest.$ac_ext <<_ACEOF
12298 #line 12298 "configure"
12299 #include "confdefs.h"
12300 #include <sys/types.h>
12301 int
12302 main (void)
12303 {
12304
12305                                 #ifdef _XOPEN_SOURCE
12306                                 #error  expected _XOPEN_SOURCE to be undefined
12307                                 #endif
12308   ;
12309   return 0;
12310 }
12311 _ACEOF
12312 rm -f conftest.$ac_objext
12313 if { (eval echo "$as_me:12313: \"$ac_compile\"") >&5
12314   (eval $ac_compile) 2>&5
12315   ac_status=$?
12316   echo "$as_me:12316: \$? = $ac_status" >&5
12317   (exit $ac_status); } &&
12318          { ac_try='test -s conftest.$ac_objext'
12319   { (eval echo "$as_me:12319: \"$ac_try\"") >&5
12320   (eval $ac_try) 2>&5
12321   ac_status=$?
12322   echo "$as_me:12322: \$? = $ac_status" >&5
12323   (exit $ac_status); }; }; then
12324   cf_cv_gnu_source=no
12325 else
12326   echo "$as_me: failed program was:" >&5
12327 cat conftest.$ac_ext >&5
12328 cf_cv_gnu_source=yes
12329 fi
12330 rm -f conftest.$ac_objext conftest.$ac_ext
12331                         CPPFLAGS="$cf_save"
12332
12333 fi
12334 rm -f conftest.$ac_objext conftest.$ac_ext
12335
12336 fi
12337 echo "$as_me:12337: result: $cf_cv_gnu_source" >&5
12338 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12339
12340                 if test "$cf_cv_gnu_source" = yes
12341                 then
12342                 echo "$as_me:12342: checking if we should also define _DEFAULT_SOURCE" >&5
12343 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12344 if test "${cf_cv_default_source+set}" = set; then
12345   echo $ECHO_N "(cached) $ECHO_C" >&6
12346 else
12347
12348         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12349         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12350
12351                         cat >conftest.$ac_ext <<_ACEOF
12352 #line 12352 "configure"
12353 #include "confdefs.h"
12354 #include <sys/types.h>
12355 int
12356 main (void)
12357 {
12358
12359                                 #ifdef _DEFAULT_SOURCE
12360                                 #error  expected _DEFAULT_SOURCE to be undefined
12361                                 #endif
12362   ;
12363   return 0;
12364 }
12365 _ACEOF
12366 rm -f conftest.$ac_objext
12367 if { (eval echo "$as_me:12367: \"$ac_compile\"") >&5
12368   (eval $ac_compile) 2>&5
12369   ac_status=$?
12370   echo "$as_me:12370: \$? = $ac_status" >&5
12371   (exit $ac_status); } &&
12372          { ac_try='test -s conftest.$ac_objext'
12373   { (eval echo "$as_me:12373: \"$ac_try\"") >&5
12374   (eval $ac_try) 2>&5
12375   ac_status=$?
12376   echo "$as_me:12376: \$? = $ac_status" >&5
12377   (exit $ac_status); }; }; then
12378   cf_cv_default_source=no
12379 else
12380   echo "$as_me: failed program was:" >&5
12381 cat conftest.$ac_ext >&5
12382 cf_cv_default_source=yes
12383 fi
12384 rm -f conftest.$ac_objext conftest.$ac_ext
12385
12386 fi
12387 echo "$as_me:12387: result: $cf_cv_default_source" >&5
12388 echo "${ECHO_T}$cf_cv_default_source" >&6
12389                         if test "$cf_cv_default_source" = yes
12390                         then
12391
12392         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12393         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12394
12395                         fi
12396                 fi
12397         fi
12398
12399 fi
12400
12401         ;;
12402 (minix*)
12403         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12404         ;;
12405 (mirbsd*)
12406         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12407         cf_XOPEN_SOURCE=
12408
12409 if test "$cf_cv_posix_visible" = no; then
12410
12411 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12412
12413 cf_save_CFLAGS="$CFLAGS"
12414 cf_save_CPPFLAGS="$CPPFLAGS"
12415
12416 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12417         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12418                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12419
12420 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12421         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12422                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12423
12424 echo "$as_me:12424: checking if we should define _POSIX_C_SOURCE" >&5
12425 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12426 if test "${cf_cv_posix_c_source+set}" = set; then
12427   echo $ECHO_N "(cached) $ECHO_C" >&6
12428 else
12429
12430 echo "${as_me:-configure}:12430: testing if the symbol is already defined go no further ..." 1>&5
12431
12432         cat >conftest.$ac_ext <<_ACEOF
12433 #line 12433 "configure"
12434 #include "confdefs.h"
12435 #include <sys/types.h>
12436 int
12437 main (void)
12438 {
12439
12440 #ifndef _POSIX_C_SOURCE
12441 make an error
12442 #endif
12443   ;
12444   return 0;
12445 }
12446 _ACEOF
12447 rm -f conftest.$ac_objext
12448 if { (eval echo "$as_me:12448: \"$ac_compile\"") >&5
12449   (eval $ac_compile) 2>&5
12450   ac_status=$?
12451   echo "$as_me:12451: \$? = $ac_status" >&5
12452   (exit $ac_status); } &&
12453          { ac_try='test -s conftest.$ac_objext'
12454   { (eval echo "$as_me:12454: \"$ac_try\"") >&5
12455   (eval $ac_try) 2>&5
12456   ac_status=$?
12457   echo "$as_me:12457: \$? = $ac_status" >&5
12458   (exit $ac_status); }; }; then
12459   cf_cv_posix_c_source=no
12460 else
12461   echo "$as_me: failed program was:" >&5
12462 cat conftest.$ac_ext >&5
12463 cf_want_posix_source=no
12464          case .$cf_POSIX_C_SOURCE in
12465          (.[12]??*)
12466                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12467                 ;;
12468          (.2)
12469                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12470                 cf_want_posix_source=yes
12471                 ;;
12472          (.*)
12473                 cf_want_posix_source=yes
12474                 ;;
12475          esac
12476          if test "$cf_want_posix_source" = yes ; then
12477                 cat >conftest.$ac_ext <<_ACEOF
12478 #line 12478 "configure"
12479 #include "confdefs.h"
12480 #include <sys/types.h>
12481 int
12482 main (void)
12483 {
12484
12485 #ifdef _POSIX_SOURCE
12486 make an error
12487 #endif
12488   ;
12489   return 0;
12490 }
12491 _ACEOF
12492 rm -f conftest.$ac_objext
12493 if { (eval echo "$as_me:12493: \"$ac_compile\"") >&5
12494   (eval $ac_compile) 2>&5
12495   ac_status=$?
12496   echo "$as_me:12496: \$? = $ac_status" >&5
12497   (exit $ac_status); } &&
12498          { ac_try='test -s conftest.$ac_objext'
12499   { (eval echo "$as_me:12499: \"$ac_try\"") >&5
12500   (eval $ac_try) 2>&5
12501   ac_status=$?
12502   echo "$as_me:12502: \$? = $ac_status" >&5
12503   (exit $ac_status); }; }; then
12504   :
12505 else
12506   echo "$as_me: failed program was:" >&5
12507 cat conftest.$ac_ext >&5
12508 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12509 fi
12510 rm -f conftest.$ac_objext conftest.$ac_ext
12511          fi
12512
12513 echo "${as_me:-configure}:12513: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12514
12515          CFLAGS="$cf_trim_CFLAGS"
12516          CPPFLAGS="$cf_trim_CPPFLAGS"
12517
12518         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12519         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12520
12521 echo "${as_me:-configure}:12521: testing if the second compile does not leave our definition intact error ..." 1>&5
12522
12523          cat >conftest.$ac_ext <<_ACEOF
12524 #line 12524 "configure"
12525 #include "confdefs.h"
12526 #include <sys/types.h>
12527 int
12528 main (void)
12529 {
12530
12531 #ifndef _POSIX_C_SOURCE
12532 make an error
12533 #endif
12534   ;
12535   return 0;
12536 }
12537 _ACEOF
12538 rm -f conftest.$ac_objext
12539 if { (eval echo "$as_me:12539: \"$ac_compile\"") >&5
12540   (eval $ac_compile) 2>&5
12541   ac_status=$?
12542   echo "$as_me:12542: \$? = $ac_status" >&5
12543   (exit $ac_status); } &&
12544          { ac_try='test -s conftest.$ac_objext'
12545   { (eval echo "$as_me:12545: \"$ac_try\"") >&5
12546   (eval $ac_try) 2>&5
12547   ac_status=$?
12548   echo "$as_me:12548: \$? = $ac_status" >&5
12549   (exit $ac_status); }; }; then
12550   :
12551 else
12552   echo "$as_me: failed program was:" >&5
12553 cat conftest.$ac_ext >&5
12554 cf_cv_posix_c_source=no
12555 fi
12556 rm -f conftest.$ac_objext conftest.$ac_ext
12557          CFLAGS="$cf_save_CFLAGS"
12558          CPPFLAGS="$cf_save_CPPFLAGS"
12559
12560 fi
12561 rm -f conftest.$ac_objext conftest.$ac_ext
12562
12563 fi
12564 echo "$as_me:12564: result: $cf_cv_posix_c_source" >&5
12565 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12566
12567 if test "$cf_cv_posix_c_source" != no ; then
12568         CFLAGS="$cf_trim_CFLAGS"
12569         CPPFLAGS="$cf_trim_CPPFLAGS"
12570
12571 cf_fix_cppflags=no
12572 cf_new_cflags=
12573 cf_new_cppflags=
12574 cf_new_extra_cppflags=
12575
12576 for cf_add_cflags in $cf_cv_posix_c_source
12577 do
12578 case $cf_fix_cppflags in
12579 (no)
12580         case $cf_add_cflags in
12581         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12582                 case $cf_add_cflags in
12583                 (-D*)
12584                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12585
12586                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12587                                 && test -z "${cf_tst_cflags}" \
12588                                 && cf_fix_cppflags=yes
12589
12590                         if test $cf_fix_cppflags = yes ; then
12591
12592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12594
12595                                 continue
12596                         elif test "${cf_tst_cflags}" = "\"'" ; then
12597
12598         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12599         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12600
12601                                 continue
12602                         fi
12603                         ;;
12604                 esac
12605                 case "$CPPFLAGS" in
12606                 (*$cf_add_cflags)
12607                         ;;
12608                 (*)
12609                         case $cf_add_cflags in
12610                         (-D*)
12611                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12612
12613 CPPFLAGS=`echo "$CPPFLAGS" | \
12614         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12615                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12616
12617                                 ;;
12618                         esac
12619
12620         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12621         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12622
12623                         ;;
12624                 esac
12625                 ;;
12626         (*)
12627
12628         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12629         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12630
12631                 ;;
12632         esac
12633         ;;
12634 (yes)
12635
12636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12638
12639         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12640
12641         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12642                 && test -z "${cf_tst_cflags}" \
12643                 && cf_fix_cppflags=no
12644         ;;
12645 esac
12646 done
12647
12648 if test -n "$cf_new_cflags" ; then
12649
12650         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12651         CFLAGS="${CFLAGS}$cf_new_cflags"
12652
12653 fi
12654
12655 if test -n "$cf_new_cppflags" ; then
12656
12657         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12658         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12659
12660 fi
12661
12662 if test -n "$cf_new_extra_cppflags" ; then
12663
12664         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12665         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12666
12667 fi
12668
12669 fi
12670
12671 fi # cf_cv_posix_visible
12672
12673         ;;
12674 (netbsd*)
12675         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12676         ;;
12677 (openbsd[4-9]*)
12678         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12679         cf_xopen_source="-D_BSD_SOURCE"
12680         cf_XOPEN_SOURCE=600
12681         ;;
12682 (openbsd*)
12683         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12684         ;;
12685 (osf[45]*)
12686         cf_xopen_source="-D_OSF_SOURCE"
12687         ;;
12688 (nto-qnx*)
12689         cf_xopen_source="-D_QNX_SOURCE"
12690         ;;
12691 (sco*)
12692         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12693         ;;
12694 (solaris2.*)
12695         cf_xopen_source="-D__EXTENSIONS__"
12696         cf_cv_xopen_source=broken
12697         ;;
12698 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12699         cf_XOPEN_SOURCE=
12700         cf_POSIX_C_SOURCE=
12701         ;;
12702 (*)
12703
12704 echo "$as_me:12704: checking if we should define _XOPEN_SOURCE" >&5
12705 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12706 if test "${cf_cv_xopen_source+set}" = set; then
12707   echo $ECHO_N "(cached) $ECHO_C" >&6
12708 else
12709
12710         cat >conftest.$ac_ext <<_ACEOF
12711 #line 12711 "configure"
12712 #include "confdefs.h"
12713
12714 #include <stdlib.h>
12715 #include <string.h>
12716 #include <sys/types.h>
12717
12718 int
12719 main (void)
12720 {
12721
12722 #ifndef _XOPEN_SOURCE
12723 make an error
12724 #endif
12725   ;
12726   return 0;
12727 }
12728 _ACEOF
12729 rm -f conftest.$ac_objext
12730 if { (eval echo "$as_me:12730: \"$ac_compile\"") >&5
12731   (eval $ac_compile) 2>&5
12732   ac_status=$?
12733   echo "$as_me:12733: \$? = $ac_status" >&5
12734   (exit $ac_status); } &&
12735          { ac_try='test -s conftest.$ac_objext'
12736   { (eval echo "$as_me:12736: \"$ac_try\"") >&5
12737   (eval $ac_try) 2>&5
12738   ac_status=$?
12739   echo "$as_me:12739: \$? = $ac_status" >&5
12740   (exit $ac_status); }; }; then
12741   cf_cv_xopen_source=no
12742 else
12743   echo "$as_me: failed program was:" >&5
12744 cat conftest.$ac_ext >&5
12745 cf_save="$CPPFLAGS"
12746
12747         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12748         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12749
12750          cat >conftest.$ac_ext <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753
12754 #include <stdlib.h>
12755 #include <string.h>
12756 #include <sys/types.h>
12757
12758 int
12759 main (void)
12760 {
12761
12762 #ifdef _XOPEN_SOURCE
12763 make an error
12764 #endif
12765   ;
12766   return 0;
12767 }
12768 _ACEOF
12769 rm -f conftest.$ac_objext
12770 if { (eval echo "$as_me:12770: \"$ac_compile\"") >&5
12771   (eval $ac_compile) 2>&5
12772   ac_status=$?
12773   echo "$as_me:12773: \$? = $ac_status" >&5
12774   (exit $ac_status); } &&
12775          { ac_try='test -s conftest.$ac_objext'
12776   { (eval echo "$as_me:12776: \"$ac_try\"") >&5
12777   (eval $ac_try) 2>&5
12778   ac_status=$?
12779   echo "$as_me:12779: \$? = $ac_status" >&5
12780   (exit $ac_status); }; }; then
12781   cf_cv_xopen_source=no
12782 else
12783   echo "$as_me: failed program was:" >&5
12784 cat conftest.$ac_ext >&5
12785 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12786 fi
12787 rm -f conftest.$ac_objext conftest.$ac_ext
12788         CPPFLAGS="$cf_save"
12789
12790 fi
12791 rm -f conftest.$ac_objext conftest.$ac_ext
12792
12793 fi
12794 echo "$as_me:12794: result: $cf_cv_xopen_source" >&5
12795 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12796
12797 if test "$cf_cv_xopen_source" != no ; then
12798
12799 CFLAGS=`echo "$CFLAGS" | \
12800         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12801                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12802
12803 CPPFLAGS=`echo "$CPPFLAGS" | \
12804         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12805                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12806
12807         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12808
12809 cf_fix_cppflags=no
12810 cf_new_cflags=
12811 cf_new_cppflags=
12812 cf_new_extra_cppflags=
12813
12814 for cf_add_cflags in $cf_temp_xopen_source
12815 do
12816 case $cf_fix_cppflags in
12817 (no)
12818         case $cf_add_cflags in
12819         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12820                 case $cf_add_cflags in
12821                 (-D*)
12822                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12823
12824                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12825                                 && test -z "${cf_tst_cflags}" \
12826                                 && cf_fix_cppflags=yes
12827
12828                         if test $cf_fix_cppflags = yes ; then
12829
12830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12832
12833                                 continue
12834                         elif test "${cf_tst_cflags}" = "\"'" ; then
12835
12836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12838
12839                                 continue
12840                         fi
12841                         ;;
12842                 esac
12843                 case "$CPPFLAGS" in
12844                 (*$cf_add_cflags)
12845                         ;;
12846                 (*)
12847                         case $cf_add_cflags in
12848                         (-D*)
12849                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12850
12851 CPPFLAGS=`echo "$CPPFLAGS" | \
12852         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12853                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12854
12855                                 ;;
12856                         esac
12857
12858         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12859         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12860
12861                         ;;
12862                 esac
12863                 ;;
12864         (*)
12865
12866         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12867         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12868
12869                 ;;
12870         esac
12871         ;;
12872 (yes)
12873
12874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12876
12877         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12878
12879         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12880                 && test -z "${cf_tst_cflags}" \
12881                 && cf_fix_cppflags=no
12882         ;;
12883 esac
12884 done
12885
12886 if test -n "$cf_new_cflags" ; then
12887
12888         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12889         CFLAGS="${CFLAGS}$cf_new_cflags"
12890
12891 fi
12892
12893 if test -n "$cf_new_cppflags" ; then
12894
12895         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12896         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12897
12898 fi
12899
12900 if test -n "$cf_new_extra_cppflags" ; then
12901
12902         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12903         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12904
12905 fi
12906
12907 fi
12908
12909 if test "$cf_cv_posix_visible" = no; then
12910
12911 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12912
12913 cf_save_CFLAGS="$CFLAGS"
12914 cf_save_CPPFLAGS="$CPPFLAGS"
12915
12916 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12917         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12918                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12919
12920 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12921         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12922                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12923
12924 echo "$as_me:12924: checking if we should define _POSIX_C_SOURCE" >&5
12925 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12926 if test "${cf_cv_posix_c_source+set}" = set; then
12927   echo $ECHO_N "(cached) $ECHO_C" >&6
12928 else
12929
12930 echo "${as_me:-configure}:12930: testing if the symbol is already defined go no further ..." 1>&5
12931
12932         cat >conftest.$ac_ext <<_ACEOF
12933 #line 12933 "configure"
12934 #include "confdefs.h"
12935 #include <sys/types.h>
12936 int
12937 main (void)
12938 {
12939
12940 #ifndef _POSIX_C_SOURCE
12941 make an error
12942 #endif
12943   ;
12944   return 0;
12945 }
12946 _ACEOF
12947 rm -f conftest.$ac_objext
12948 if { (eval echo "$as_me:12948: \"$ac_compile\"") >&5
12949   (eval $ac_compile) 2>&5
12950   ac_status=$?
12951   echo "$as_me:12951: \$? = $ac_status" >&5
12952   (exit $ac_status); } &&
12953          { ac_try='test -s conftest.$ac_objext'
12954   { (eval echo "$as_me:12954: \"$ac_try\"") >&5
12955   (eval $ac_try) 2>&5
12956   ac_status=$?
12957   echo "$as_me:12957: \$? = $ac_status" >&5
12958   (exit $ac_status); }; }; then
12959   cf_cv_posix_c_source=no
12960 else
12961   echo "$as_me: failed program was:" >&5
12962 cat conftest.$ac_ext >&5
12963 cf_want_posix_source=no
12964          case .$cf_POSIX_C_SOURCE in
12965          (.[12]??*)
12966                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12967                 ;;
12968          (.2)
12969                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12970                 cf_want_posix_source=yes
12971                 ;;
12972          (.*)
12973                 cf_want_posix_source=yes
12974                 ;;
12975          esac
12976          if test "$cf_want_posix_source" = yes ; then
12977                 cat >conftest.$ac_ext <<_ACEOF
12978 #line 12978 "configure"
12979 #include "confdefs.h"
12980 #include <sys/types.h>
12981 int
12982 main (void)
12983 {
12984
12985 #ifdef _POSIX_SOURCE
12986 make an error
12987 #endif
12988   ;
12989   return 0;
12990 }
12991 _ACEOF
12992 rm -f conftest.$ac_objext
12993 if { (eval echo "$as_me:12993: \"$ac_compile\"") >&5
12994   (eval $ac_compile) 2>&5
12995   ac_status=$?
12996   echo "$as_me:12996: \$? = $ac_status" >&5
12997   (exit $ac_status); } &&
12998          { ac_try='test -s conftest.$ac_objext'
12999   { (eval echo "$as_me:12999: \"$ac_try\"") >&5
13000   (eval $ac_try) 2>&5
13001   ac_status=$?
13002   echo "$as_me:13002: \$? = $ac_status" >&5
13003   (exit $ac_status); }; }; then
13004   :
13005 else
13006   echo "$as_me: failed program was:" >&5
13007 cat conftest.$ac_ext >&5
13008 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13009 fi
13010 rm -f conftest.$ac_objext conftest.$ac_ext
13011          fi
13012
13013 echo "${as_me:-configure}:13013: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13014
13015          CFLAGS="$cf_trim_CFLAGS"
13016          CPPFLAGS="$cf_trim_CPPFLAGS"
13017
13018         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13019         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13020
13021 echo "${as_me:-configure}:13021: testing if the second compile does not leave our definition intact error ..." 1>&5
13022
13023          cat >conftest.$ac_ext <<_ACEOF
13024 #line 13024 "configure"
13025 #include "confdefs.h"
13026 #include <sys/types.h>
13027 int
13028 main (void)
13029 {
13030
13031 #ifndef _POSIX_C_SOURCE
13032 make an error
13033 #endif
13034   ;
13035   return 0;
13036 }
13037 _ACEOF
13038 rm -f conftest.$ac_objext
13039 if { (eval echo "$as_me:13039: \"$ac_compile\"") >&5
13040   (eval $ac_compile) 2>&5
13041   ac_status=$?
13042   echo "$as_me:13042: \$? = $ac_status" >&5
13043   (exit $ac_status); } &&
13044          { ac_try='test -s conftest.$ac_objext'
13045   { (eval echo "$as_me:13045: \"$ac_try\"") >&5
13046   (eval $ac_try) 2>&5
13047   ac_status=$?
13048   echo "$as_me:13048: \$? = $ac_status" >&5
13049   (exit $ac_status); }; }; then
13050   :
13051 else
13052   echo "$as_me: failed program was:" >&5
13053 cat conftest.$ac_ext >&5
13054 cf_cv_posix_c_source=no
13055 fi
13056 rm -f conftest.$ac_objext conftest.$ac_ext
13057          CFLAGS="$cf_save_CFLAGS"
13058          CPPFLAGS="$cf_save_CPPFLAGS"
13059
13060 fi
13061 rm -f conftest.$ac_objext conftest.$ac_ext
13062
13063 fi
13064 echo "$as_me:13064: result: $cf_cv_posix_c_source" >&5
13065 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13066
13067 if test "$cf_cv_posix_c_source" != no ; then
13068         CFLAGS="$cf_trim_CFLAGS"
13069         CPPFLAGS="$cf_trim_CPPFLAGS"
13070
13071 cf_fix_cppflags=no
13072 cf_new_cflags=
13073 cf_new_cppflags=
13074 cf_new_extra_cppflags=
13075
13076 for cf_add_cflags in $cf_cv_posix_c_source
13077 do
13078 case $cf_fix_cppflags in
13079 (no)
13080         case $cf_add_cflags in
13081         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13082                 case $cf_add_cflags in
13083                 (-D*)
13084                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13085
13086                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13087                                 && test -z "${cf_tst_cflags}" \
13088                                 && cf_fix_cppflags=yes
13089
13090                         if test $cf_fix_cppflags = yes ; then
13091
13092         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13093         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13094
13095                                 continue
13096                         elif test "${cf_tst_cflags}" = "\"'" ; then
13097
13098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13100
13101                                 continue
13102                         fi
13103                         ;;
13104                 esac
13105                 case "$CPPFLAGS" in
13106                 (*$cf_add_cflags)
13107                         ;;
13108                 (*)
13109                         case $cf_add_cflags in
13110                         (-D*)
13111                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13112
13113 CPPFLAGS=`echo "$CPPFLAGS" | \
13114         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13115                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13116
13117                                 ;;
13118                         esac
13119
13120         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13121         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13122
13123                         ;;
13124                 esac
13125                 ;;
13126         (*)
13127
13128         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13129         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13130
13131                 ;;
13132         esac
13133         ;;
13134 (yes)
13135
13136         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13137         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13138
13139         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13140
13141         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13142                 && test -z "${cf_tst_cflags}" \
13143                 && cf_fix_cppflags=no
13144         ;;
13145 esac
13146 done
13147
13148 if test -n "$cf_new_cflags" ; then
13149
13150         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13151         CFLAGS="${CFLAGS}$cf_new_cflags"
13152
13153 fi
13154
13155 if test -n "$cf_new_cppflags" ; then
13156
13157         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13158         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13159
13160 fi
13161
13162 if test -n "$cf_new_extra_cppflags" ; then
13163
13164         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13165         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13166
13167 fi
13168
13169 fi
13170
13171 fi # cf_cv_posix_visible
13172
13173         ;;
13174 esac
13175
13176 if test -n "$cf_xopen_source" ; then
13177
13178 cf_fix_cppflags=no
13179 cf_new_cflags=
13180 cf_new_cppflags=
13181 cf_new_extra_cppflags=
13182
13183 for cf_add_cflags in $cf_xopen_source
13184 do
13185 case $cf_fix_cppflags in
13186 (no)
13187         case $cf_add_cflags in
13188         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13189                 case $cf_add_cflags in
13190                 (-D*)
13191                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13192
13193                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13194                                 && test -z "${cf_tst_cflags}" \
13195                                 && cf_fix_cppflags=yes
13196
13197                         if test $cf_fix_cppflags = yes ; then
13198
13199         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13200         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13201
13202                                 continue
13203                         elif test "${cf_tst_cflags}" = "\"'" ; then
13204
13205         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13206         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13207
13208                                 continue
13209                         fi
13210                         ;;
13211                 esac
13212                 case "$CPPFLAGS" in
13213                 (*$cf_add_cflags)
13214                         ;;
13215                 (*)
13216                         case $cf_add_cflags in
13217                         (-D*)
13218                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13219
13220 CPPFLAGS=`echo "$CPPFLAGS" | \
13221         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13222                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13223
13224                                 ;;
13225                         esac
13226
13227         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13228         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13229
13230                         ;;
13231                 esac
13232                 ;;
13233         (*)
13234
13235         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13236         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13237
13238                 ;;
13239         esac
13240         ;;
13241 (yes)
13242
13243         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13244         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13245
13246         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13247
13248         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13249                 && test -z "${cf_tst_cflags}" \
13250                 && cf_fix_cppflags=no
13251         ;;
13252 esac
13253 done
13254
13255 if test -n "$cf_new_cflags" ; then
13256         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13257
13258 echo "${as_me:-configure}:13258: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13259
13260         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13261         CFLAGS="${CFLAGS}$cf_new_cflags"
13262
13263 fi
13264
13265 if test -n "$cf_new_cppflags" ; then
13266         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13267
13268 echo "${as_me:-configure}:13268: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13269
13270         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13271         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13272
13273 fi
13274
13275 if test -n "$cf_new_extra_cppflags" ; then
13276         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13277
13278 echo "${as_me:-configure}:13278: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13279
13280         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13281         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13282
13283 fi
13284
13285 fi
13286
13287 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13288         echo "$as_me:13288: checking if _XOPEN_SOURCE really is set" >&5
13289 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13290         cat >conftest.$ac_ext <<_ACEOF
13291 #line 13291 "configure"
13292 #include "confdefs.h"
13293 #include <stdlib.h>
13294 int
13295 main (void)
13296 {
13297
13298 #ifndef _XOPEN_SOURCE
13299 make an error
13300 #endif
13301   ;
13302   return 0;
13303 }
13304 _ACEOF
13305 rm -f conftest.$ac_objext
13306 if { (eval echo "$as_me:13306: \"$ac_compile\"") >&5
13307   (eval $ac_compile) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit $ac_status); } &&
13311          { ac_try='test -s conftest.$ac_objext'
13312   { (eval echo "$as_me:13312: \"$ac_try\"") >&5
13313   (eval $ac_try) 2>&5
13314   ac_status=$?
13315   echo "$as_me:13315: \$? = $ac_status" >&5
13316   (exit $ac_status); }; }; then
13317   cf_XOPEN_SOURCE_set=yes
13318 else
13319   echo "$as_me: failed program was:" >&5
13320 cat conftest.$ac_ext >&5
13321 cf_XOPEN_SOURCE_set=no
13322 fi
13323 rm -f conftest.$ac_objext conftest.$ac_ext
13324         echo "$as_me:13324: result: $cf_XOPEN_SOURCE_set" >&5
13325 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13326         if test $cf_XOPEN_SOURCE_set = yes
13327         then
13328                 cat >conftest.$ac_ext <<_ACEOF
13329 #line 13329 "configure"
13330 #include "confdefs.h"
13331 #include <stdlib.h>
13332 int
13333 main (void)
13334 {
13335
13336 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13337 make an error
13338 #endif
13339   ;
13340   return 0;
13341 }
13342 _ACEOF
13343 rm -f conftest.$ac_objext
13344 if { (eval echo "$as_me:13344: \"$ac_compile\"") >&5
13345   (eval $ac_compile) 2>&5
13346   ac_status=$?
13347   echo "$as_me:13347: \$? = $ac_status" >&5
13348   (exit $ac_status); } &&
13349          { ac_try='test -s conftest.$ac_objext'
13350   { (eval echo "$as_me:13350: \"$ac_try\"") >&5
13351   (eval $ac_try) 2>&5
13352   ac_status=$?
13353   echo "$as_me:13353: \$? = $ac_status" >&5
13354   (exit $ac_status); }; }; then
13355   cf_XOPEN_SOURCE_set_ok=yes
13356 else
13357   echo "$as_me: failed program was:" >&5
13358 cat conftest.$ac_ext >&5
13359 cf_XOPEN_SOURCE_set_ok=no
13360 fi
13361 rm -f conftest.$ac_objext conftest.$ac_ext
13362                 if test $cf_XOPEN_SOURCE_set_ok = no
13363                 then
13364                         { echo "$as_me:13364: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13365 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13366                 fi
13367         else
13368
13369 echo "$as_me:13369: checking if we should define _XOPEN_SOURCE" >&5
13370 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13371 if test "${cf_cv_xopen_source+set}" = set; then
13372   echo $ECHO_N "(cached) $ECHO_C" >&6
13373 else
13374
13375         cat >conftest.$ac_ext <<_ACEOF
13376 #line 13376 "configure"
13377 #include "confdefs.h"
13378
13379 #include <stdlib.h>
13380 #include <string.h>
13381 #include <sys/types.h>
13382
13383 int
13384 main (void)
13385 {
13386
13387 #ifndef _XOPEN_SOURCE
13388 make an error
13389 #endif
13390   ;
13391   return 0;
13392 }
13393 _ACEOF
13394 rm -f conftest.$ac_objext
13395 if { (eval echo "$as_me:13395: \"$ac_compile\"") >&5
13396   (eval $ac_compile) 2>&5
13397   ac_status=$?
13398   echo "$as_me:13398: \$? = $ac_status" >&5
13399   (exit $ac_status); } &&
13400          { ac_try='test -s conftest.$ac_objext'
13401   { (eval echo "$as_me:13401: \"$ac_try\"") >&5
13402   (eval $ac_try) 2>&5
13403   ac_status=$?
13404   echo "$as_me:13404: \$? = $ac_status" >&5
13405   (exit $ac_status); }; }; then
13406   cf_cv_xopen_source=no
13407 else
13408   echo "$as_me: failed program was:" >&5
13409 cat conftest.$ac_ext >&5
13410 cf_save="$CPPFLAGS"
13411
13412         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13413         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13414
13415          cat >conftest.$ac_ext <<_ACEOF
13416 #line 13416 "configure"
13417 #include "confdefs.h"
13418
13419 #include <stdlib.h>
13420 #include <string.h>
13421 #include <sys/types.h>
13422
13423 int
13424 main (void)
13425 {
13426
13427 #ifdef _XOPEN_SOURCE
13428 make an error
13429 #endif
13430   ;
13431   return 0;
13432 }
13433 _ACEOF
13434 rm -f conftest.$ac_objext
13435 if { (eval echo "$as_me:13435: \"$ac_compile\"") >&5
13436   (eval $ac_compile) 2>&5
13437   ac_status=$?
13438   echo "$as_me:13438: \$? = $ac_status" >&5
13439   (exit $ac_status); } &&
13440          { ac_try='test -s conftest.$ac_objext'
13441   { (eval echo "$as_me:13441: \"$ac_try\"") >&5
13442   (eval $ac_try) 2>&5
13443   ac_status=$?
13444   echo "$as_me:13444: \$? = $ac_status" >&5
13445   (exit $ac_status); }; }; then
13446   cf_cv_xopen_source=no
13447 else
13448   echo "$as_me: failed program was:" >&5
13449 cat conftest.$ac_ext >&5
13450 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13451 fi
13452 rm -f conftest.$ac_objext conftest.$ac_ext
13453         CPPFLAGS="$cf_save"
13454
13455 fi
13456 rm -f conftest.$ac_objext conftest.$ac_ext
13457
13458 fi
13459 echo "$as_me:13459: result: $cf_cv_xopen_source" >&5
13460 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13461
13462 if test "$cf_cv_xopen_source" != no ; then
13463
13464 CFLAGS=`echo "$CFLAGS" | \
13465         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13466                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13467
13468 CPPFLAGS=`echo "$CPPFLAGS" | \
13469         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13470                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13471
13472         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13473
13474 cf_fix_cppflags=no
13475 cf_new_cflags=
13476 cf_new_cppflags=
13477 cf_new_extra_cppflags=
13478
13479 for cf_add_cflags in $cf_temp_xopen_source
13480 do
13481 case $cf_fix_cppflags in
13482 (no)
13483         case $cf_add_cflags in
13484         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13485                 case $cf_add_cflags in
13486                 (-D*)
13487                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13488
13489                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13490                                 && test -z "${cf_tst_cflags}" \
13491                                 && cf_fix_cppflags=yes
13492
13493                         if test $cf_fix_cppflags = yes ; then
13494
13495         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13496         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13497
13498                                 continue
13499                         elif test "${cf_tst_cflags}" = "\"'" ; then
13500
13501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13503
13504                                 continue
13505                         fi
13506                         ;;
13507                 esac
13508                 case "$CPPFLAGS" in
13509                 (*$cf_add_cflags)
13510                         ;;
13511                 (*)
13512                         case $cf_add_cflags in
13513                         (-D*)
13514                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13515
13516 CPPFLAGS=`echo "$CPPFLAGS" | \
13517         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13518                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13519
13520                                 ;;
13521                         esac
13522
13523         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13524         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13525
13526                         ;;
13527                 esac
13528                 ;;
13529         (*)
13530
13531         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13532         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13533
13534                 ;;
13535         esac
13536         ;;
13537 (yes)
13538
13539         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13540         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13541
13542         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13543
13544         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13545                 && test -z "${cf_tst_cflags}" \
13546                 && cf_fix_cppflags=no
13547         ;;
13548 esac
13549 done
13550
13551 if test -n "$cf_new_cflags" ; then
13552
13553         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13554         CFLAGS="${CFLAGS}$cf_new_cflags"
13555
13556 fi
13557
13558 if test -n "$cf_new_cppflags" ; then
13559
13560         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13561         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13562
13563 fi
13564
13565 if test -n "$cf_new_extra_cppflags" ; then
13566
13567         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13568         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13569
13570 fi
13571
13572 fi
13573
13574         fi
13575 fi
13576 fi # cf_cv_posix_visible
13577
13578 # Check whether --enable-largefile or --disable-largefile was given.
13579 if test "${enable_largefile+set}" = set; then
13580   enableval="$enable_largefile"
13581
13582 fi;
13583 if test "$enable_largefile" != no; then
13584
13585   echo "$as_me:13585: checking for special C compiler options needed for large files" >&5
13586 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13587 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13588   echo $ECHO_N "(cached) $ECHO_C" >&6
13589 else
13590   ac_cv_sys_largefile_CC=no
13591      if test "$GCC" != yes; then
13592        ac_save_CC=$CC
13593        while :; do
13594          # IRIX 6.2 and later do not support large files by default,
13595          # so use the C compiler's -n32 option if that helps.
13596          cat >conftest.$ac_ext <<_ACEOF
13597 #line 13597 "configure"
13598 #include "confdefs.h"
13599 #include <sys/types.h>
13600  /* Check that off_t can represent 2**63 - 1 correctly.
13601     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13602     since some C++ compilers masquerading as C compilers
13603     incorrectly reject 9223372036854775807.  */
13604 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13605   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13606                        && LARGE_OFF_T % 2147483647 == 1)
13607                       ? 1 : -1];
13608 int
13609 main (void)
13610 {
13611
13612   ;
13613   return 0;
13614 }
13615 _ACEOF
13616          rm -f conftest.$ac_objext
13617 if { (eval echo "$as_me:13617: \"$ac_compile\"") >&5
13618   (eval $ac_compile) 2>&5
13619   ac_status=$?
13620   echo "$as_me:13620: \$? = $ac_status" >&5
13621   (exit $ac_status); } &&
13622          { ac_try='test -s conftest.$ac_objext'
13623   { (eval echo "$as_me:13623: \"$ac_try\"") >&5
13624   (eval $ac_try) 2>&5
13625   ac_status=$?
13626   echo "$as_me:13626: \$? = $ac_status" >&5
13627   (exit $ac_status); }; }; then
13628   break
13629 else
13630   echo "$as_me: failed program was:" >&5
13631 cat conftest.$ac_ext >&5
13632 fi
13633 rm -f conftest.$ac_objext
13634          CC="$CC -n32"
13635          rm -f conftest.$ac_objext
13636 if { (eval echo "$as_me:13636: \"$ac_compile\"") >&5
13637   (eval $ac_compile) 2>&5
13638   ac_status=$?
13639   echo "$as_me:13639: \$? = $ac_status" >&5
13640   (exit $ac_status); } &&
13641          { ac_try='test -s conftest.$ac_objext'
13642   { (eval echo "$as_me:13642: \"$ac_try\"") >&5
13643   (eval $ac_try) 2>&5
13644   ac_status=$?
13645   echo "$as_me:13645: \$? = $ac_status" >&5
13646   (exit $ac_status); }; }; then
13647   ac_cv_sys_largefile_CC=' -n32'; break
13648 else
13649   echo "$as_me: failed program was:" >&5
13650 cat conftest.$ac_ext >&5
13651 fi
13652 rm -f conftest.$ac_objext
13653          break
13654        done
13655        CC=$ac_save_CC
13656        rm -f conftest.$ac_ext
13657     fi
13658 fi
13659 echo "$as_me:13659: result: $ac_cv_sys_largefile_CC" >&5
13660 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13661   if test "$ac_cv_sys_largefile_CC" != no; then
13662     CC=$CC$ac_cv_sys_largefile_CC
13663   fi
13664
13665   echo "$as_me:13665: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13666 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13667 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13668   echo $ECHO_N "(cached) $ECHO_C" >&6
13669 else
13670   while :; do
13671   ac_cv_sys_file_offset_bits=no
13672   cat >conftest.$ac_ext <<_ACEOF
13673 #line 13673 "configure"
13674 #include "confdefs.h"
13675 #include <sys/types.h>
13676  /* Check that off_t can represent 2**63 - 1 correctly.
13677     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13678     since some C++ compilers masquerading as C compilers
13679     incorrectly reject 9223372036854775807.  */
13680 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13681   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13682                        && LARGE_OFF_T % 2147483647 == 1)
13683                       ? 1 : -1];
13684 int
13685 main (void)
13686 {
13687
13688   ;
13689   return 0;
13690 }
13691 _ACEOF
13692 rm -f conftest.$ac_objext
13693 if { (eval echo "$as_me:13693: \"$ac_compile\"") >&5
13694   (eval $ac_compile) 2>&5
13695   ac_status=$?
13696   echo "$as_me:13696: \$? = $ac_status" >&5
13697   (exit $ac_status); } &&
13698          { ac_try='test -s conftest.$ac_objext'
13699   { (eval echo "$as_me:13699: \"$ac_try\"") >&5
13700   (eval $ac_try) 2>&5
13701   ac_status=$?
13702   echo "$as_me:13702: \$? = $ac_status" >&5
13703   (exit $ac_status); }; }; then
13704   break
13705 else
13706   echo "$as_me: failed program was:" >&5
13707 cat conftest.$ac_ext >&5
13708 fi
13709 rm -f conftest.$ac_objext conftest.$ac_ext
13710   cat >conftest.$ac_ext <<_ACEOF
13711 #line 13711 "configure"
13712 #include "confdefs.h"
13713 #define _FILE_OFFSET_BITS 64
13714 #include <sys/types.h>
13715  /* Check that off_t can represent 2**63 - 1 correctly.
13716     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13717     since some C++ compilers masquerading as C compilers
13718     incorrectly reject 9223372036854775807.  */
13719 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13720   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13721                        && LARGE_OFF_T % 2147483647 == 1)
13722                       ? 1 : -1];
13723 int
13724 main (void)
13725 {
13726
13727   ;
13728   return 0;
13729 }
13730 _ACEOF
13731 rm -f conftest.$ac_objext
13732 if { (eval echo "$as_me:13732: \"$ac_compile\"") >&5
13733   (eval $ac_compile) 2>&5
13734   ac_status=$?
13735   echo "$as_me:13735: \$? = $ac_status" >&5
13736   (exit $ac_status); } &&
13737          { ac_try='test -s conftest.$ac_objext'
13738   { (eval echo "$as_me:13738: \"$ac_try\"") >&5
13739   (eval $ac_try) 2>&5
13740   ac_status=$?
13741   echo "$as_me:13741: \$? = $ac_status" >&5
13742   (exit $ac_status); }; }; then
13743   ac_cv_sys_file_offset_bits=64; break
13744 else
13745   echo "$as_me: failed program was:" >&5
13746 cat conftest.$ac_ext >&5
13747 fi
13748 rm -f conftest.$ac_objext conftest.$ac_ext
13749   break
13750 done
13751 fi
13752 echo "$as_me:13752: result: $ac_cv_sys_file_offset_bits" >&5
13753 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13754 if test "$ac_cv_sys_file_offset_bits" != no; then
13755
13756 cat >>confdefs.h <<EOF
13757 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13758 EOF
13759
13760 fi
13761 rm -rf conftest*
13762   echo "$as_me:13762: checking for _LARGE_FILES value needed for large files" >&5
13763 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13764 if test "${ac_cv_sys_large_files+set}" = set; then
13765   echo $ECHO_N "(cached) $ECHO_C" >&6
13766 else
13767   while :; do
13768   ac_cv_sys_large_files=no
13769   cat >conftest.$ac_ext <<_ACEOF
13770 #line 13770 "configure"
13771 #include "confdefs.h"
13772 #include <sys/types.h>
13773  /* Check that off_t can represent 2**63 - 1 correctly.
13774     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13775     since some C++ compilers masquerading as C compilers
13776     incorrectly reject 9223372036854775807.  */
13777 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13778   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13779                        && LARGE_OFF_T % 2147483647 == 1)
13780                       ? 1 : -1];
13781 int
13782 main (void)
13783 {
13784
13785   ;
13786   return 0;
13787 }
13788 _ACEOF
13789 rm -f conftest.$ac_objext
13790 if { (eval echo "$as_me:13790: \"$ac_compile\"") >&5
13791   (eval $ac_compile) 2>&5
13792   ac_status=$?
13793   echo "$as_me:13793: \$? = $ac_status" >&5
13794   (exit $ac_status); } &&
13795          { ac_try='test -s conftest.$ac_objext'
13796   { (eval echo "$as_me:13796: \"$ac_try\"") >&5
13797   (eval $ac_try) 2>&5
13798   ac_status=$?
13799   echo "$as_me:13799: \$? = $ac_status" >&5
13800   (exit $ac_status); }; }; then
13801   break
13802 else
13803   echo "$as_me: failed program was:" >&5
13804 cat conftest.$ac_ext >&5
13805 fi
13806 rm -f conftest.$ac_objext conftest.$ac_ext
13807   cat >conftest.$ac_ext <<_ACEOF
13808 #line 13808 "configure"
13809 #include "confdefs.h"
13810 #define _LARGE_FILES 1
13811 #include <sys/types.h>
13812  /* Check that off_t can represent 2**63 - 1 correctly.
13813     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13814     since some C++ compilers masquerading as C compilers
13815     incorrectly reject 9223372036854775807.  */
13816 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13817   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13818                        && LARGE_OFF_T % 2147483647 == 1)
13819                       ? 1 : -1];
13820 int
13821 main (void)
13822 {
13823
13824   ;
13825   return 0;
13826 }
13827 _ACEOF
13828 rm -f conftest.$ac_objext
13829 if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5
13830   (eval $ac_compile) 2>&5
13831   ac_status=$?
13832   echo "$as_me:13832: \$? = $ac_status" >&5
13833   (exit $ac_status); } &&
13834          { ac_try='test -s conftest.$ac_objext'
13835   { (eval echo "$as_me:13835: \"$ac_try\"") >&5
13836   (eval $ac_try) 2>&5
13837   ac_status=$?
13838   echo "$as_me:13838: \$? = $ac_status" >&5
13839   (exit $ac_status); }; }; then
13840   ac_cv_sys_large_files=1; break
13841 else
13842   echo "$as_me: failed program was:" >&5
13843 cat conftest.$ac_ext >&5
13844 fi
13845 rm -f conftest.$ac_objext conftest.$ac_ext
13846   break
13847 done
13848 fi
13849 echo "$as_me:13849: result: $ac_cv_sys_large_files" >&5
13850 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13851 if test "$ac_cv_sys_large_files" != no; then
13852
13853 cat >>confdefs.h <<EOF
13854 #define _LARGE_FILES $ac_cv_sys_large_files
13855 EOF
13856
13857 fi
13858 rm -rf conftest*
13859 fi
13860
13861         if test "$enable_largefile" != no ; then
13862         echo "$as_me:13862: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13863 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13864 if test "${ac_cv_sys_largefile_source+set}" = set; then
13865   echo $ECHO_N "(cached) $ECHO_C" >&6
13866 else
13867   while :; do
13868   ac_cv_sys_largefile_source=no
13869   cat >conftest.$ac_ext <<_ACEOF
13870 #line 13870 "configure"
13871 #include "confdefs.h"
13872 #include <stdio.h>
13873 int
13874 main (void)
13875 {
13876 return !fseeko;
13877   ;
13878   return 0;
13879 }
13880 _ACEOF
13881 rm -f conftest.$ac_objext
13882 if { (eval echo "$as_me:13882: \"$ac_compile\"") >&5
13883   (eval $ac_compile) 2>&5
13884   ac_status=$?
13885   echo "$as_me:13885: \$? = $ac_status" >&5
13886   (exit $ac_status); } &&
13887          { ac_try='test -s conftest.$ac_objext'
13888   { (eval echo "$as_me:13888: \"$ac_try\"") >&5
13889   (eval $ac_try) 2>&5
13890   ac_status=$?
13891   echo "$as_me:13891: \$? = $ac_status" >&5
13892   (exit $ac_status); }; }; then
13893   break
13894 else
13895   echo "$as_me: failed program was:" >&5
13896 cat conftest.$ac_ext >&5
13897 fi
13898 rm -f conftest.$ac_objext conftest.$ac_ext
13899   cat >conftest.$ac_ext <<_ACEOF
13900 #line 13900 "configure"
13901 #include "confdefs.h"
13902 #define _LARGEFILE_SOURCE 1
13903 #include <stdio.h>
13904 int
13905 main (void)
13906 {
13907 return !fseeko;
13908   ;
13909   return 0;
13910 }
13911 _ACEOF
13912 rm -f conftest.$ac_objext
13913 if { (eval echo "$as_me:13913: \"$ac_compile\"") >&5
13914   (eval $ac_compile) 2>&5
13915   ac_status=$?
13916   echo "$as_me:13916: \$? = $ac_status" >&5
13917   (exit $ac_status); } &&
13918          { ac_try='test -s conftest.$ac_objext'
13919   { (eval echo "$as_me:13919: \"$ac_try\"") >&5
13920   (eval $ac_try) 2>&5
13921   ac_status=$?
13922   echo "$as_me:13922: \$? = $ac_status" >&5
13923   (exit $ac_status); }; }; then
13924   ac_cv_sys_largefile_source=1; break
13925 else
13926   echo "$as_me: failed program was:" >&5
13927 cat conftest.$ac_ext >&5
13928 fi
13929 rm -f conftest.$ac_objext conftest.$ac_ext
13930   break
13931 done
13932 fi
13933 echo "$as_me:13933: result: $ac_cv_sys_largefile_source" >&5
13934 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13935 if test "$ac_cv_sys_largefile_source" != no; then
13936
13937 cat >>confdefs.h <<EOF
13938 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13939 EOF
13940
13941 fi
13942 rm -rf conftest*
13943
13944 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13945 # in glibc 2.1.3, but that breaks too many other things.
13946 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13947 echo "$as_me:13947: checking for fseeko" >&5
13948 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13949 if test "${ac_cv_func_fseeko+set}" = set; then
13950   echo $ECHO_N "(cached) $ECHO_C" >&6
13951 else
13952   cat >conftest.$ac_ext <<_ACEOF
13953 #line 13953 "configure"
13954 #include "confdefs.h"
13955 #include <stdio.h>
13956 int
13957 main (void)
13958 {
13959 return fseeko && fseeko (stdin, 0, 0);
13960   ;
13961   return 0;
13962 }
13963 _ACEOF
13964 rm -f conftest.$ac_objext conftest$ac_exeext
13965 if { (eval echo "$as_me:13965: \"$ac_link\"") >&5
13966   (eval $ac_link) 2>&5
13967   ac_status=$?
13968   echo "$as_me:13968: \$? = $ac_status" >&5
13969   (exit $ac_status); } &&
13970          { ac_try='test -s conftest$ac_exeext'
13971   { (eval echo "$as_me:13971: \"$ac_try\"") >&5
13972   (eval $ac_try) 2>&5
13973   ac_status=$?
13974   echo "$as_me:13974: \$? = $ac_status" >&5
13975   (exit $ac_status); }; }; then
13976   ac_cv_func_fseeko=yes
13977 else
13978   echo "$as_me: failed program was:" >&5
13979 cat conftest.$ac_ext >&5
13980 ac_cv_func_fseeko=no
13981 fi
13982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13983 fi
13984 echo "$as_me:13984: result: $ac_cv_func_fseeko" >&5
13985 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13986 if test $ac_cv_func_fseeko = yes; then
13987
13988 cat >>confdefs.h <<\EOF
13989 #define HAVE_FSEEKO 1
13990 EOF
13991
13992 fi
13993
13994         # Normally we would collect these definitions in the config.h,
13995         # but (like _XOPEN_SOURCE), some environments rely on having these
13996         # defined before any of the system headers are included.  Another
13997         # case comes up with C++, e.g., on AIX the compiler compiles the
13998         # header files by themselves before looking at the body files it is
13999         # told to compile.  For ncurses, those header files do not include
14000         # the config.h
14001         if test "$ac_cv_sys_large_files" != no
14002         then
14003
14004         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14005         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14006
14007         fi
14008         if test "$ac_cv_sys_largefile_source" != no
14009         then
14010
14011         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14012         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14013
14014         fi
14015         if test "$ac_cv_sys_file_offset_bits" != no
14016         then
14017
14018         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14019         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14020
14021         fi
14022
14023         echo "$as_me:14023: checking whether to use struct dirent64" >&5
14024 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14025 if test "${cf_cv_struct_dirent64+set}" = set; then
14026   echo $ECHO_N "(cached) $ECHO_C" >&6
14027 else
14028
14029                 cat >conftest.$ac_ext <<_ACEOF
14030 #line 14030 "configure"
14031 #include "confdefs.h"
14032
14033 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14034 #include <sys/types.h>
14035 #include <dirent.h>
14036
14037 int
14038 main (void)
14039 {
14040
14041                 /* if transitional largefile support is setup, this is true */
14042                 extern struct dirent64 * readdir(DIR *);
14043                 struct dirent64 *x = readdir((DIR *)0);
14044                 struct dirent *y = readdir((DIR *)0);
14045                 int z = x - y;
14046                 (void)z;
14047
14048   ;
14049   return 0;
14050 }
14051 _ACEOF
14052 rm -f conftest.$ac_objext
14053 if { (eval echo "$as_me:14053: \"$ac_compile\"") >&5
14054   (eval $ac_compile) 2>&5
14055   ac_status=$?
14056   echo "$as_me:14056: \$? = $ac_status" >&5
14057   (exit $ac_status); } &&
14058          { ac_try='test -s conftest.$ac_objext'
14059   { (eval echo "$as_me:14059: \"$ac_try\"") >&5
14060   (eval $ac_try) 2>&5
14061   ac_status=$?
14062   echo "$as_me:14062: \$? = $ac_status" >&5
14063   (exit $ac_status); }; }; then
14064   cf_cv_struct_dirent64=yes
14065 else
14066   echo "$as_me: failed program was:" >&5
14067 cat conftest.$ac_ext >&5
14068 cf_cv_struct_dirent64=no
14069 fi
14070 rm -f conftest.$ac_objext conftest.$ac_ext
14071
14072 fi
14073 echo "$as_me:14073: result: $cf_cv_struct_dirent64" >&5
14074 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14075         test "$cf_cv_struct_dirent64" = yes &&
14076 cat >>confdefs.h <<\EOF
14077 #define HAVE_STRUCT_DIRENT64 1
14078 EOF
14079
14080         fi
14081
14082 ### Enable compiling-in rcs id's
14083 echo "$as_me:14083: checking if RCS identifiers should be compiled-in" >&5
14084 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14085
14086 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14087 if test "${with_rcs_ids+set}" = set; then
14088   withval="$with_rcs_ids"
14089   with_rcs_ids=$withval
14090 else
14091   with_rcs_ids=no
14092 fi;
14093 echo "$as_me:14093: result: $with_rcs_ids" >&5
14094 echo "${ECHO_T}$with_rcs_ids" >&6
14095 test "$with_rcs_ids" = yes &&
14096 cat >>confdefs.h <<\EOF
14097 #define USE_RCS_IDS 1
14098 EOF
14099
14100 ###############################################################################
14101
14102 ### Note that some functions (such as const) are normally disabled anyway.
14103 echo "$as_me:14103: checking if you want to build with function extensions" >&5
14104 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14105
14106 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14107 if test "${enable_ext_funcs+set}" = set; then
14108   enableval="$enable_ext_funcs"
14109   with_ext_funcs=$enableval
14110 else
14111   with_ext_funcs=yes
14112 fi;
14113 echo "$as_me:14113: result: $with_ext_funcs" >&5
14114 echo "${ECHO_T}$with_ext_funcs" >&6
14115 if test "$with_ext_funcs" = yes ; then
14116         NCURSES_EXT_FUNCS=1
14117
14118 cat >>confdefs.h <<\EOF
14119 #define HAVE_USE_DEFAULT_COLORS 1
14120 EOF
14121
14122 cat >>confdefs.h <<\EOF
14123 #define NCURSES_EXT_FUNCS 1
14124 EOF
14125
14126 else
14127         NCURSES_EXT_FUNCS=0
14128 fi
14129
14130 ###   use option --enable-const to turn on use of const beyond that in XSI.
14131 echo "$as_me:14131: checking for extended use of const keyword" >&5
14132 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14133
14134 # Check whether --enable-const or --disable-const was given.
14135 if test "${enable_const+set}" = set; then
14136   enableval="$enable_const"
14137   with_ext_const=$enableval
14138 else
14139   with_ext_const=no
14140 fi;
14141 echo "$as_me:14141: result: $with_ext_const" >&5
14142 echo "${ECHO_T}$with_ext_const" >&6
14143 NCURSES_CONST='/*nothing*/'
14144 if test "$with_ext_const" = yes ; then
14145         NCURSES_CONST=const
14146 fi
14147
14148 ###############################################################################
14149 # These options are relatively safe to experiment with.
14150
14151 echo "$as_me:14151: checking if you want all development code" >&5
14152 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14153
14154 # Check whether --with-develop or --without-develop was given.
14155 if test "${with_develop+set}" = set; then
14156   withval="$with_develop"
14157   with_develop=$withval
14158 else
14159   with_develop=no
14160 fi;
14161 echo "$as_me:14161: result: $with_develop" >&5
14162 echo "${ECHO_T}$with_develop" >&6
14163
14164 ###############################################################################
14165 # These are just experimental, probably should not be in a package:
14166
14167 # This is still experimental (20080329), but should ultimately be moved to
14168 # the script-block --with-normal, etc.
14169
14170 echo "$as_me:14170: checking if you want to link with the pthread library" >&5
14171 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14172
14173 # Check whether --with-pthread or --without-pthread was given.
14174 if test "${with_pthread+set}" = set; then
14175   withval="$with_pthread"
14176   with_pthread=$withval
14177 else
14178   with_pthread=no
14179 fi;
14180 echo "$as_me:14180: result: $with_pthread" >&5
14181 echo "${ECHO_T}$with_pthread" >&6
14182
14183 if test "$with_pthread" != no ; then
14184         echo "$as_me:14184: checking for pthread.h" >&5
14185 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14186 if test "${ac_cv_header_pthread_h+set}" = set; then
14187   echo $ECHO_N "(cached) $ECHO_C" >&6
14188 else
14189   cat >conftest.$ac_ext <<_ACEOF
14190 #line 14190 "configure"
14191 #include "confdefs.h"
14192 #include <pthread.h>
14193 _ACEOF
14194 if { (eval echo "$as_me:14194: \"$ac_cpp conftest.$ac_ext\"") >&5
14195   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14196   ac_status=$?
14197   egrep -v '^ *\+' conftest.er1 >conftest.err
14198   rm -f conftest.er1
14199   cat conftest.err >&5
14200   echo "$as_me:14200: \$? = $ac_status" >&5
14201   (exit $ac_status); } >/dev/null; then
14202   if test -s conftest.err; then
14203     ac_cpp_err=$ac_c_preproc_warn_flag
14204   else
14205     ac_cpp_err=
14206   fi
14207 else
14208   ac_cpp_err=yes
14209 fi
14210 if test -z "$ac_cpp_err"; then
14211   ac_cv_header_pthread_h=yes
14212 else
14213   echo "$as_me: failed program was:" >&5
14214   cat conftest.$ac_ext >&5
14215   ac_cv_header_pthread_h=no
14216 fi
14217 rm -f conftest.err conftest.$ac_ext
14218 fi
14219 echo "$as_me:14219: result: $ac_cv_header_pthread_h" >&5
14220 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14221 if test $ac_cv_header_pthread_h = yes; then
14222
14223 cat >>confdefs.h <<\EOF
14224 #define HAVE_PTHREADS_H 1
14225 EOF
14226
14227         for cf_lib_pthread in pthread c_r
14228         do
14229             echo "$as_me:14229: checking if we can link with the $cf_lib_pthread library" >&5
14230 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14231             cf_save_LIBS="$LIBS"
14232
14233 cf_add_libs="$LIBS"
14234 # reverse order
14235 cf_add_0lib=
14236 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14237 # filter duplicates
14238 for cf_add_1lib in $cf_add_0lib; do
14239         for cf_add_2lib in $cf_add_libs; do
14240                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14241                         cf_add_1lib=
14242                         break
14243                 fi
14244         done
14245         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14246 done
14247 LIBS="$cf_add_libs"
14248
14249             cat >conftest.$ac_ext <<_ACEOF
14250 #line 14250 "configure"
14251 #include "confdefs.h"
14252
14253 #include <pthread.h>
14254
14255 int
14256 main (void)
14257 {
14258
14259                 int rc = pthread_create(0,0,0,0);
14260                 int r2 = pthread_mutexattr_settype(0, 0);
14261
14262   ;
14263   return 0;
14264 }
14265 _ACEOF
14266 rm -f conftest.$ac_objext conftest$ac_exeext
14267 if { (eval echo "$as_me:14267: \"$ac_link\"") >&5
14268   (eval $ac_link) 2>&5
14269   ac_status=$?
14270   echo "$as_me:14270: \$? = $ac_status" >&5
14271   (exit $ac_status); } &&
14272          { ac_try='test -s conftest$ac_exeext'
14273   { (eval echo "$as_me:14273: \"$ac_try\"") >&5
14274   (eval $ac_try) 2>&5
14275   ac_status=$?
14276   echo "$as_me:14276: \$? = $ac_status" >&5
14277   (exit $ac_status); }; }; then
14278   with_pthread=yes
14279 else
14280   echo "$as_me: failed program was:" >&5
14281 cat conftest.$ac_ext >&5
14282 with_pthread=no
14283 fi
14284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14285             LIBS="$cf_save_LIBS"
14286             echo "$as_me:14286: result: $with_pthread" >&5
14287 echo "${ECHO_T}$with_pthread" >&6
14288             test "$with_pthread" = yes && break
14289         done
14290
14291         if test "$with_pthread" = yes ; then
14292
14293 cf_add_libs="$LIBS"
14294 # reverse order
14295 cf_add_0lib=
14296 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14297 # filter duplicates
14298 for cf_add_1lib in $cf_add_0lib; do
14299         for cf_add_2lib in $cf_add_libs; do
14300                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14301                         cf_add_1lib=
14302                         break
14303                 fi
14304         done
14305         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14306 done
14307 LIBS="$cf_add_libs"
14308
14309 cat >>confdefs.h <<\EOF
14310 #define HAVE_LIBPTHREADS 1
14311 EOF
14312
14313         else
14314             { { echo "$as_me:14314: error: Cannot link with pthread library" >&5
14315 echo "$as_me: error: Cannot link with pthread library" >&2;}
14316    { (exit 1); exit 1; }; }
14317         fi
14318
14319 fi
14320
14321 fi
14322
14323 echo "$as_me:14323: checking if you want to use weak-symbols for pthreads" >&5
14324 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14325
14326 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14327 if test "${enable_weak_symbols+set}" = set; then
14328   enableval="$enable_weak_symbols"
14329   use_weak_symbols=$withval
14330 else
14331   use_weak_symbols=no
14332 fi;
14333 echo "$as_me:14333: result: $use_weak_symbols" >&5
14334 echo "${ECHO_T}$use_weak_symbols" >&6
14335 if test "$use_weak_symbols" = yes ; then
14336
14337 echo "$as_me:14337: checking if $CC supports weak symbols" >&5
14338 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14339 if test "${cf_cv_weak_symbols+set}" = set; then
14340   echo $ECHO_N "(cached) $ECHO_C" >&6
14341 else
14342
14343 cat >conftest.$ac_ext <<_ACEOF
14344 #line 14344 "configure"
14345 #include "confdefs.h"
14346
14347 #include <stdio.h>
14348 int
14349 main (void)
14350 {
14351
14352 #if defined(__GNUC__)
14353 #  if defined __USE_ISOC99
14354 #    define _cat_pragma(exp)    _Pragma(#exp)
14355 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14356 #  else
14357 #    define _weak_pragma(exp)
14358 #  endif
14359 #  define _declare(name)        __extension__ extern __typeof__(name) name
14360 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14361 #endif
14362
14363 weak_symbol(fopen);
14364
14365   ;
14366   return 0;
14367 }
14368 _ACEOF
14369 rm -f conftest.$ac_objext
14370 if { (eval echo "$as_me:14370: \"$ac_compile\"") >&5
14371   (eval $ac_compile) 2>&5
14372   ac_status=$?
14373   echo "$as_me:14373: \$? = $ac_status" >&5
14374   (exit $ac_status); } &&
14375          { ac_try='test -s conftest.$ac_objext'
14376   { (eval echo "$as_me:14376: \"$ac_try\"") >&5
14377   (eval $ac_try) 2>&5
14378   ac_status=$?
14379   echo "$as_me:14379: \$? = $ac_status" >&5
14380   (exit $ac_status); }; }; then
14381   cf_cv_weak_symbols=yes
14382 else
14383   echo "$as_me: failed program was:" >&5
14384 cat conftest.$ac_ext >&5
14385 cf_cv_weak_symbols=no
14386 fi
14387 rm -f conftest.$ac_objext conftest.$ac_ext
14388
14389 fi
14390 echo "$as_me:14390: result: $cf_cv_weak_symbols" >&5
14391 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14392
14393 else
14394         cf_cv_weak_symbols=no
14395 fi
14396
14397 if test $cf_cv_weak_symbols = yes ; then
14398
14399 cat >>confdefs.h <<\EOF
14400 #define USE_WEAK_SYMBOLS 1
14401 EOF
14402
14403 fi
14404
14405 PTHREAD=
14406 if test "$with_pthread" = "yes" ; then
14407
14408 cat >>confdefs.h <<\EOF
14409 #define USE_PTHREADS 1
14410 EOF
14411
14412         enable_reentrant=yes
14413         if test $cf_cv_weak_symbols = yes ; then
14414                 PTHREAD=-lpthread
14415         fi
14416 fi
14417
14418 # OpenSUSE is installing ncurses6, using reentrant option.
14419 echo "$as_me:14419: checking for _nc_TABSIZE" >&5
14420 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14421 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14422   echo $ECHO_N "(cached) $ECHO_C" >&6
14423 else
14424   cat >conftest.$ac_ext <<_ACEOF
14425 #line 14425 "configure"
14426 #include "confdefs.h"
14427 #define _nc_TABSIZE autoconf_temporary
14428 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14429 #undef _nc_TABSIZE
14430
14431 #ifdef __cplusplus
14432 extern "C"
14433 #endif
14434
14435 /* We use char because int might match the return type of a gcc2
14436    builtin and then its argument prototype would still apply.  */
14437 char _nc_TABSIZE (void);
14438
14439 int
14440 main (void)
14441 {
14442
14443 /* The GNU C library defines stubs for functions which it implements
14444     to always fail with ENOSYS.  Some functions are actually named
14445     something starting with __ and the normal name is an alias.  */
14446 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14447 #error found stub for _nc_TABSIZE
14448 #endif
14449
14450         return _nc_TABSIZE ();
14451   ;
14452   return 0;
14453 }
14454 _ACEOF
14455 rm -f conftest.$ac_objext conftest$ac_exeext
14456 if { (eval echo "$as_me:14456: \"$ac_link\"") >&5
14457   (eval $ac_link) 2>&5
14458   ac_status=$?
14459   echo "$as_me:14459: \$? = $ac_status" >&5
14460   (exit $ac_status); } &&
14461          { ac_try='test -s conftest$ac_exeext'
14462   { (eval echo "$as_me:14462: \"$ac_try\"") >&5
14463   (eval $ac_try) 2>&5
14464   ac_status=$?
14465   echo "$as_me:14465: \$? = $ac_status" >&5
14466   (exit $ac_status); }; }; then
14467   ac_cv_func__nc_TABSIZE=yes
14468 else
14469   echo "$as_me: failed program was:" >&5
14470 cat conftest.$ac_ext >&5
14471 ac_cv_func__nc_TABSIZE=no
14472 fi
14473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14474 fi
14475 echo "$as_me:14475: result: $ac_cv_func__nc_TABSIZE" >&5
14476 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14477 if test $ac_cv_func__nc_TABSIZE = yes; then
14478   assume_reentrant=yes
14479 else
14480   assume_reentrant=no
14481 fi
14482
14483 # Reentrant code has to be opaque; there's little advantage to making ncurses
14484 # opaque outside of that, so there is no --enable-opaque option.  We can use
14485 # this option without --with-pthreads, but this will be always set for
14486 # pthreads.
14487 echo "$as_me:14487: checking if you want experimental reentrant code" >&5
14488 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14489
14490 # Check whether --enable-reentrant or --disable-reentrant was given.
14491 if test "${enable_reentrant+set}" = set; then
14492   enableval="$enable_reentrant"
14493   with_reentrant=$enableval
14494 else
14495   with_reentrant=$assume_reentrant
14496 fi;
14497 echo "$as_me:14497: result: $with_reentrant" >&5
14498 echo "${ECHO_T}$with_reentrant" >&6
14499 if test "$with_reentrant" = yes ; then
14500         cf_cv_enable_reentrant=1
14501         if test $cf_cv_weak_symbols = yes ; then
14502
14503 # remove pthread library from $LIBS
14504 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14505
14506         elif test "$assume_reentrant" = no ; then
14507                 LIB_SUFFIX="t${LIB_SUFFIX}"
14508         fi
14509
14510 cat >>confdefs.h <<\EOF
14511 #define USE_REENTRANT 1
14512 EOF
14513
14514 else
14515         cf_cv_enable_reentrant=0
14516 fi
14517
14518 ### Allow using a different wrap-prefix
14519 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14520         echo "$as_me:14520: checking for prefix used to wrap public variables" >&5
14521 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14522
14523 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14524 if test "${with_wrap_prefix+set}" = set; then
14525   withval="$with_wrap_prefix"
14526   NCURSES_WRAP_PREFIX=$withval
14527 else
14528   NCURSES_WRAP_PREFIX=_nc_
14529 fi;
14530         echo "$as_me:14530: result: $NCURSES_WRAP_PREFIX" >&5
14531 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14532 else
14533         NCURSES_WRAP_PREFIX=_nc_
14534 fi
14535
14536 cat >>confdefs.h <<EOF
14537 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14538 EOF
14539
14540 ###############################################################################
14541
14542 ###     use option --disable-echo to suppress full display compiling commands
14543
14544 echo "$as_me:14544: checking if you want to see long compiling messages" >&5
14545 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14546
14547 # Check whether --enable-echo or --disable-echo was given.
14548 if test "${enable_echo+set}" = set; then
14549   enableval="$enable_echo"
14550   test "$enableval" != no && enableval=yes
14551         if test "$enableval" != "yes" ; then
14552
14553         ECHO_LT='--silent'
14554         ECHO_LD='@echo linking $@;'
14555         RULE_CC='@echo compiling $<'
14556         SHOW_CC='@echo compiling $@'
14557         ECHO_CC='@'
14558
14559         else
14560
14561         ECHO_LT=''
14562         ECHO_LD=''
14563         RULE_CC=''
14564         SHOW_CC=''
14565         ECHO_CC=''
14566
14567         fi
14568 else
14569   enableval=yes
14570
14571         ECHO_LT=''
14572         ECHO_LD=''
14573         RULE_CC=''
14574         SHOW_CC=''
14575         ECHO_CC=''
14576
14577 fi;
14578 echo "$as_me:14578: result: $enableval" >&5
14579 echo "${ECHO_T}$enableval" >&6
14580
14581 ###     use option --enable-warnings to turn on all gcc warnings
14582 echo "$as_me:14582: checking if you want to see compiler warnings" >&5
14583 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14584
14585 # Check whether --enable-warnings or --disable-warnings was given.
14586 if test "${enable_warnings+set}" = set; then
14587   enableval="$enable_warnings"
14588   with_warnings=$enableval
14589 fi;
14590 echo "$as_me:14590: result: $with_warnings" >&5
14591 echo "${ECHO_T}$with_warnings" >&6
14592
14593 if ( test "$GCC" = yes || test "$GXX" = yes )
14594 then
14595
14596 if ( test "$GCC" = yes || test "$GXX" = yes )
14597 then
14598         case $CFLAGS in
14599         (*-Werror=*)
14600                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14601
14602 echo "${as_me:-configure}:14602: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14603
14604                 cf_temp_flags=
14605                 for cf_temp_scan in $CFLAGS
14606                 do
14607                         case "x$cf_temp_scan" in
14608                         (x-Werror=*)
14609
14610         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14611         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14612
14613                                 ;;
14614                         (*)
14615
14616         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14617         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14618
14619                                 ;;
14620                         esac
14621                 done
14622                 CFLAGS="$cf_temp_flags"
14623                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14624
14625 echo "${as_me:-configure}:14625: testing ... fixed $CFLAGS ..." 1>&5
14626
14627                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14628
14629 echo "${as_me:-configure}:14629: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14630
14631                 ;;
14632         esac
14633 fi
14634
14635 if ( test "$GCC" = yes || test "$GXX" = yes )
14636 then
14637         case $CPPFLAGS in
14638         (*-Werror=*)
14639                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14640
14641 echo "${as_me:-configure}:14641: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14642
14643                 cf_temp_flags=
14644                 for cf_temp_scan in $CPPFLAGS
14645                 do
14646                         case "x$cf_temp_scan" in
14647                         (x-Werror=*)
14648
14649         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14650         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14651
14652                                 ;;
14653                         (*)
14654
14655         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14656         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14657
14658                                 ;;
14659                         esac
14660                 done
14661                 CPPFLAGS="$cf_temp_flags"
14662                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14663
14664 echo "${as_me:-configure}:14664: testing ... fixed $CPPFLAGS ..." 1>&5
14665
14666                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14667
14668 echo "${as_me:-configure}:14668: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14669
14670                 ;;
14671         esac
14672 fi
14673
14674 if ( test "$GCC" = yes || test "$GXX" = yes )
14675 then
14676         case $LDFLAGS in
14677         (*-Werror=*)
14678                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14679
14680 echo "${as_me:-configure}:14680: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14681
14682                 cf_temp_flags=
14683                 for cf_temp_scan in $LDFLAGS
14684                 do
14685                         case "x$cf_temp_scan" in
14686                         (x-Werror=*)
14687
14688         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14689         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14690
14691                                 ;;
14692                         (*)
14693
14694         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14695         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14696
14697                                 ;;
14698                         esac
14699                 done
14700                 LDFLAGS="$cf_temp_flags"
14701                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14702
14703 echo "${as_me:-configure}:14703: testing ... fixed $LDFLAGS ..." 1>&5
14704
14705                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14706
14707 echo "${as_me:-configure}:14707: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14708
14709                 ;;
14710         esac
14711 fi
14712
14713 echo "$as_me:14713: checking if you want to turn on gcc warnings" >&5
14714 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14715
14716 # Check whether --enable-warnings or --disable-warnings was given.
14717 if test "${enable_warnings+set}" = set; then
14718   enableval="$enable_warnings"
14719   test "$enableval" != yes && enableval=no
14720         if test "$enableval" != "no" ; then
14721     with_warnings=yes
14722         else
14723                 with_warnings=no
14724         fi
14725 else
14726   enableval=no
14727         with_warnings=no
14728
14729 fi;
14730 echo "$as_me:14730: result: $with_warnings" >&5
14731 echo "${ECHO_T}$with_warnings" >&6
14732 if test "$with_warnings" = "yes"
14733 then
14734
14735 if test "x$have_x" = xyes; then
14736
14737 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14738 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14739 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14740 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14741 for cf_X_CFLAGS in $X_CFLAGS
14742 do
14743         case "x$cf_X_CFLAGS" in
14744         x-[IUD]*)
14745                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14746                 ;;
14747         *)
14748                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14749                 ;;
14750         esac
14751 done
14752
14753 cat >conftest.$ac_ext <<_ACEOF
14754 #line 14754 "configure"
14755 #include "confdefs.h"
14756
14757 #include <stdlib.h>
14758 #include <X11/Intrinsic.h>
14759
14760 int
14761 main (void)
14762 {
14763 String foo = malloc(1); (void)foo
14764   ;
14765   return 0;
14766 }
14767 _ACEOF
14768 rm -f conftest.$ac_objext
14769 if { (eval echo "$as_me:14769: \"$ac_compile\"") >&5
14770   (eval $ac_compile) 2>&5
14771   ac_status=$?
14772   echo "$as_me:14772: \$? = $ac_status" >&5
14773   (exit $ac_status); } &&
14774          { ac_try='test -s conftest.$ac_objext'
14775   { (eval echo "$as_me:14775: \"$ac_try\"") >&5
14776   (eval $ac_try) 2>&5
14777   ac_status=$?
14778   echo "$as_me:14778: \$? = $ac_status" >&5
14779   (exit $ac_status); }; }; then
14780
14781 echo "$as_me:14781: checking for X11/Xt const-feature" >&5
14782 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14783 if test "${cf_cv_const_x_string+set}" = set; then
14784   echo $ECHO_N "(cached) $ECHO_C" >&6
14785 else
14786
14787         cat >conftest.$ac_ext <<_ACEOF
14788 #line 14788 "configure"
14789 #include "confdefs.h"
14790
14791 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14792 #undef  XTSTRINGDEFINES /* X11R5 and later */
14793 #include <stdlib.h>
14794 #include <X11/Intrinsic.h>
14795
14796 int
14797 main (void)
14798 {
14799 String foo = malloc(1); *foo = 0
14800   ;
14801   return 0;
14802 }
14803 _ACEOF
14804 rm -f conftest.$ac_objext
14805 if { (eval echo "$as_me:14805: \"$ac_compile\"") >&5
14806   (eval $ac_compile) 2>&5
14807   ac_status=$?
14808   echo "$as_me:14808: \$? = $ac_status" >&5
14809   (exit $ac_status); } &&
14810          { ac_try='test -s conftest.$ac_objext'
14811   { (eval echo "$as_me:14811: \"$ac_try\"") >&5
14812   (eval $ac_try) 2>&5
14813   ac_status=$?
14814   echo "$as_me:14814: \$? = $ac_status" >&5
14815   (exit $ac_status); }; }; then
14816
14817                         cf_cv_const_x_string=no
14818
14819 else
14820   echo "$as_me: failed program was:" >&5
14821 cat conftest.$ac_ext >&5
14822
14823                         cf_cv_const_x_string=yes
14824
14825 fi
14826 rm -f conftest.$ac_objext conftest.$ac_ext
14827
14828 fi
14829 echo "$as_me:14829: result: $cf_cv_const_x_string" >&5
14830 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14831
14832 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14833 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14834 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14835
14836 case $cf_cv_const_x_string in
14837 (no)
14838
14839         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14840         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14841
14842         ;;
14843 (*)
14844
14845         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14846         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14847
14848         ;;
14849 esac
14850
14851 else
14852   echo "$as_me: failed program was:" >&5
14853 cat conftest.$ac_ext >&5
14854 fi
14855 rm -f conftest.$ac_objext conftest.$ac_ext
14856  fi
14857 cat > conftest.$ac_ext <<EOF
14858 #line 14858 "${as_me:-configure}"
14859 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14860 EOF
14861 if test "$INTEL_COMPILER" = yes
14862 then
14863 # The "-wdXXX" options suppress warnings:
14864 # remark #1419: external declaration in primary source file
14865 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14866 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14867 # remark #193: zero used for undefined preprocessing identifier
14868 # remark #593: variable "curs_sb_left_arrow" was set but never used
14869 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14870 # remark #869: parameter "tw" was never referenced
14871 # remark #981: operands are evaluated in unspecified order
14872 # warning #279: controlling expression is constant
14873
14874         { echo "$as_me:14874: checking for $CC warning options..." >&5
14875 echo "$as_me: checking for $CC warning options..." >&6;}
14876         cf_save_CFLAGS="$CFLAGS"
14877         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
14878         for cf_opt in \
14879                 wd1419 \
14880                 wd1683 \
14881                 wd1684 \
14882                 wd193 \
14883                 wd593 \
14884                 wd279 \
14885                 wd810 \
14886                 wd869 \
14887                 wd981
14888         do
14889                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14890                 if { (eval echo "$as_me:14890: \"$ac_compile\"") >&5
14891   (eval $ac_compile) 2>&5
14892   ac_status=$?
14893   echo "$as_me:14893: \$? = $ac_status" >&5
14894   (exit $ac_status); }; then
14895                         test -n "$verbose" && echo "$as_me:14895: result: ... -$cf_opt" >&5
14896 echo "${ECHO_T}... -$cf_opt" >&6
14897                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14898                 fi
14899         done
14900         CFLAGS="$cf_save_CFLAGS"
14901 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14902 then
14903         { echo "$as_me:14903: checking for $CC warning options..." >&5
14904 echo "$as_me: checking for $CC warning options..." >&6;}
14905         cf_save_CFLAGS="$CFLAGS"
14906         cf_warn_CONST=""
14907         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14908         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14909         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14910         for cf_opt in W Wall \
14911                 Wbad-function-cast \
14912                 Wcast-align \
14913                 Wcast-qual \
14914                 Wdeclaration-after-statement \
14915                 Wextra \
14916                 Winline \
14917                 Wmissing-declarations \
14918                 Wmissing-prototypes \
14919                 Wnested-externs \
14920                 Wpointer-arith \
14921                 Wshadow \
14922                 Wstrict-prototypes \
14923                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14924         do
14925                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14926                 if { (eval echo "$as_me:14926: \"$ac_compile\"") >&5
14927   (eval $ac_compile) 2>&5
14928   ac_status=$?
14929   echo "$as_me:14929: \$? = $ac_status" >&5
14930   (exit $ac_status); }; then
14931                         test -n "$verbose" && echo "$as_me:14931: result: ... -$cf_opt" >&5
14932 echo "${ECHO_T}... -$cf_opt" >&6
14933                         case $cf_opt in
14934                         (Winline)
14935                                 case $GCC_VERSION in
14936                                 ([34].*)
14937                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14938
14939 echo "${as_me:-configure}:14939: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14940
14941                                         continue;;
14942                                 esac
14943                                 ;;
14944                         (Wpointer-arith)
14945                                 case $GCC_VERSION in
14946                                 ([12].*)
14947                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14948
14949 echo "${as_me:-configure}:14949: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14950
14951                                         continue;;
14952                                 esac
14953                                 ;;
14954                         esac
14955                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14956                 fi
14957         done
14958         CFLAGS="$cf_save_CFLAGS"
14959 fi
14960 rm -rf conftest*
14961
14962 fi
14963
14964 if ( test "$GCC" = yes || test "$GXX" = yes )
14965 then
14966 cat > conftest.i <<EOF
14967 #ifndef GCC_PRINTF
14968 #define GCC_PRINTF 0
14969 #endif
14970 #ifndef GCC_SCANF
14971 #define GCC_SCANF 0
14972 #endif
14973 #ifndef GCC_NORETURN
14974 #define GCC_NORETURN /* nothing */
14975 #endif
14976 #ifndef GCC_UNUSED
14977 #define GCC_UNUSED /* nothing */
14978 #endif
14979 EOF
14980 if test "$GCC" = yes
14981 then
14982         { echo "$as_me:14982: checking for $CC __attribute__ directives..." >&5
14983 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14984 cat > conftest.$ac_ext <<EOF
14985 #line 14985 "${as_me:-configure}"
14986 #include "confdefs.h"
14987 #include "conftest.h"
14988 #include "conftest.i"
14989 #if     GCC_PRINTF
14990 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14991 #else
14992 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14993 #endif
14994 #if     GCC_SCANF
14995 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14996 #else
14997 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14998 #endif
14999 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15000 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15001 extern void foo(void) GCC_NORETURN;
15002 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15003 EOF
15004         cf_printf_attribute=no
15005         cf_scanf_attribute=no
15006         for cf_attribute in scanf printf unused noreturn
15007         do
15008
15009 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15010
15011                 cf_directive="__attribute__(($cf_attribute))"
15012                 echo "checking for $CC $cf_directive" 1>&5
15013
15014                 case $cf_attribute in
15015                 (printf)
15016                         cf_printf_attribute=yes
15017                         cat >conftest.h <<EOF
15018 #define GCC_$cf_ATTRIBUTE 1
15019 EOF
15020                         ;;
15021                 (scanf)
15022                         cf_scanf_attribute=yes
15023                         cat >conftest.h <<EOF
15024 #define GCC_$cf_ATTRIBUTE 1
15025 EOF
15026                         ;;
15027                 (*)
15028                         cat >conftest.h <<EOF
15029 #define GCC_$cf_ATTRIBUTE $cf_directive
15030 EOF
15031                         ;;
15032                 esac
15033
15034                 if { (eval echo "$as_me:15034: \"$ac_compile\"") >&5
15035   (eval $ac_compile) 2>&5
15036   ac_status=$?
15037   echo "$as_me:15037: \$? = $ac_status" >&5
15038   (exit $ac_status); }; then
15039                         test -n "$verbose" && echo "$as_me:15039: result: ... $cf_attribute" >&5
15040 echo "${ECHO_T}... $cf_attribute" >&6
15041                         cat conftest.h >>confdefs.h
15042                         case $cf_attribute in
15043                         (noreturn)
15044
15045 cat >>confdefs.h <<EOF
15046 #define GCC_NORETURN $cf_directive
15047 EOF
15048
15049                                 ;;
15050                         (printf)
15051                                 cf_value='/* nothing */'
15052                                 if test "$cf_printf_attribute" != no ; then
15053                                         cf_value='__attribute__((format(printf,fmt,var)))'
15054
15055 cat >>confdefs.h <<\EOF
15056 #define GCC_PRINTF 1
15057 EOF
15058
15059                                 fi
15060
15061 cat >>confdefs.h <<EOF
15062 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15063 EOF
15064
15065                                 ;;
15066                         (scanf)
15067                                 cf_value='/* nothing */'
15068                                 if test "$cf_scanf_attribute" != no ; then
15069                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15070
15071 cat >>confdefs.h <<\EOF
15072 #define GCC_SCANF 1
15073 EOF
15074
15075                                 fi
15076
15077 cat >>confdefs.h <<EOF
15078 #define GCC_SCANFLIKE(fmt,var) $cf_value
15079 EOF
15080
15081                                 ;;
15082                         (unused)
15083
15084 cat >>confdefs.h <<EOF
15085 #define GCC_UNUSED $cf_directive
15086 EOF
15087
15088                                 ;;
15089                         esac
15090                 fi
15091         done
15092 else
15093         fgrep define conftest.i >>confdefs.h
15094 fi
15095 rm -rf conftest*
15096 fi
15097
15098 fi
15099
15100 if test "x$with_warnings" = "xyes"; then
15101
15102         ADAFLAGS="$ADAFLAGS -gnatg"
15103
15104 fi
15105
15106 ###     use option --enable-assertions to turn on generation of assertion code
15107 echo "$as_me:15107: checking if you want to enable runtime assertions" >&5
15108 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15109
15110 # Check whether --enable-assertions or --disable-assertions was given.
15111 if test "${enable_assertions+set}" = set; then
15112   enableval="$enable_assertions"
15113   with_assertions=$enableval
15114 else
15115   with_assertions=no
15116 fi;
15117 echo "$as_me:15117: result: $with_assertions" >&5
15118 echo "${ECHO_T}$with_assertions" >&6
15119 if test -n "$GCC"
15120 then
15121         if test "$with_assertions" = no
15122         then
15123                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15124         else
15125
15126         ADAFLAGS="$ADAFLAGS -gnata"
15127
15128         fi
15129 fi
15130
15131 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15132
15133 cat >>confdefs.h <<\EOF
15134 #define HAVE_NC_ALLOC_H 1
15135 EOF
15136
15137 ###     use option --enable-expanded to generate certain macros as functions
15138
15139 # Check whether --enable-expanded or --disable-expanded was given.
15140 if test "${enable_expanded+set}" = set; then
15141   enableval="$enable_expanded"
15142   test "$enableval" = yes &&
15143 cat >>confdefs.h <<\EOF
15144 #define NCURSES_EXPANDED 1
15145 EOF
15146
15147 fi;
15148
15149 ###     use option --disable-macros to suppress macros in favor of functions
15150
15151 # Check whether --enable-macros or --disable-macros was given.
15152 if test "${enable_macros+set}" = set; then
15153   enableval="$enable_macros"
15154   test "$enableval" = no &&
15155 cat >>confdefs.h <<\EOF
15156 #define NCURSES_NOMACROS 1
15157 EOF
15158
15159 fi;
15160
15161 # Normally we only add trace() to the debug-library.  Allow this to be
15162 # extended to all models of the ncurses library:
15163 cf_all_traces=no
15164 case "$CFLAGS $CPPFLAGS" in
15165 (*-DTRACE*)
15166         cf_all_traces=yes
15167         ;;
15168 esac
15169
15170 echo "$as_me:15170: checking whether to add trace feature to all models" >&5
15171 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15172
15173 # Check whether --with-trace or --without-trace was given.
15174 if test "${with_trace+set}" = set; then
15175   withval="$with_trace"
15176   cf_with_trace=$withval
15177 else
15178   cf_with_trace=$cf_all_traces
15179 fi;
15180 echo "$as_me:15180: result: $cf_with_trace" >&5
15181 echo "${ECHO_T}$cf_with_trace" >&6
15182
15183 if test "$cf_with_trace" = yes ; then
15184         ADA_TRACE=TRUE
15185
15186 cf_fix_cppflags=no
15187 cf_new_cflags=
15188 cf_new_cppflags=
15189 cf_new_extra_cppflags=
15190
15191 for cf_add_cflags in -DTRACE
15192 do
15193 case $cf_fix_cppflags in
15194 (no)
15195         case $cf_add_cflags in
15196         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15197                 case $cf_add_cflags in
15198                 (-D*)
15199                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15200
15201                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15202                                 && test -z "${cf_tst_cflags}" \
15203                                 && cf_fix_cppflags=yes
15204
15205                         if test $cf_fix_cppflags = yes ; then
15206
15207         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15208         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15209
15210                                 continue
15211                         elif test "${cf_tst_cflags}" = "\"'" ; then
15212
15213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15215
15216                                 continue
15217                         fi
15218                         ;;
15219                 esac
15220                 case "$CPPFLAGS" in
15221                 (*$cf_add_cflags)
15222                         ;;
15223                 (*)
15224                         case $cf_add_cflags in
15225                         (-D*)
15226                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15227
15228 CPPFLAGS=`echo "$CPPFLAGS" | \
15229         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15230                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15231
15232                                 ;;
15233                         esac
15234
15235         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15236         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15237
15238                         ;;
15239                 esac
15240                 ;;
15241         (*)
15242
15243         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15244         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15245
15246                 ;;
15247         esac
15248         ;;
15249 (yes)
15250
15251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15253
15254         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15255
15256         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15257                 && test -z "${cf_tst_cflags}" \
15258                 && cf_fix_cppflags=no
15259         ;;
15260 esac
15261 done
15262
15263 if test -n "$cf_new_cflags" ; then
15264
15265         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15266         CFLAGS="${CFLAGS}$cf_new_cflags"
15267
15268 fi
15269
15270 if test -n "$cf_new_cppflags" ; then
15271
15272         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15273         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15274
15275 fi
15276
15277 if test -n "$cf_new_extra_cppflags" ; then
15278
15279         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15280         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15281
15282 fi
15283
15284 else
15285         ADA_TRACE=FALSE
15286 fi
15287
15288 echo "$as_me:15288: checking if we want to use GNAT projects" >&5
15289 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15290
15291 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15292 if test "${enable_gnat_projects+set}" = set; then
15293   enableval="$enable_gnat_projects"
15294   test "$enableval" != no && enableval=yes
15295         if test "$enableval" != "yes" ; then
15296     enable_gnat_projects=no
15297         else
15298                 enable_gnat_projects=yes
15299         fi
15300 else
15301   enableval=yes
15302         enable_gnat_projects=yes
15303
15304 fi;
15305 echo "$as_me:15305: result: $enable_gnat_projects" >&5
15306 echo "${ECHO_T}$enable_gnat_projects" >&6
15307
15308 ###     Checks for libraries.
15309 case $cf_cv_system_name in
15310 (*mingw32*)
15311         ;;
15312 (*)
15313 echo "$as_me:15313: checking for gettimeofday" >&5
15314 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15315 if test "${ac_cv_func_gettimeofday+set}" = set; then
15316   echo $ECHO_N "(cached) $ECHO_C" >&6
15317 else
15318   cat >conftest.$ac_ext <<_ACEOF
15319 #line 15319 "configure"
15320 #include "confdefs.h"
15321 #define gettimeofday autoconf_temporary
15322 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15323 #undef gettimeofday
15324
15325 #ifdef __cplusplus
15326 extern "C"
15327 #endif
15328
15329 /* We use char because int might match the return type of a gcc2
15330    builtin and then its argument prototype would still apply.  */
15331 char gettimeofday (void);
15332
15333 int
15334 main (void)
15335 {
15336
15337 /* The GNU C library defines stubs for functions which it implements
15338     to always fail with ENOSYS.  Some functions are actually named
15339     something starting with __ and the normal name is an alias.  */
15340 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15341 #error found stub for gettimeofday
15342 #endif
15343
15344         return gettimeofday ();
15345   ;
15346   return 0;
15347 }
15348 _ACEOF
15349 rm -f conftest.$ac_objext conftest$ac_exeext
15350 if { (eval echo "$as_me:15350: \"$ac_link\"") >&5
15351   (eval $ac_link) 2>&5
15352   ac_status=$?
15353   echo "$as_me:15353: \$? = $ac_status" >&5
15354   (exit $ac_status); } &&
15355          { ac_try='test -s conftest$ac_exeext'
15356   { (eval echo "$as_me:15356: \"$ac_try\"") >&5
15357   (eval $ac_try) 2>&5
15358   ac_status=$?
15359   echo "$as_me:15359: \$? = $ac_status" >&5
15360   (exit $ac_status); }; }; then
15361   ac_cv_func_gettimeofday=yes
15362 else
15363   echo "$as_me: failed program was:" >&5
15364 cat conftest.$ac_ext >&5
15365 ac_cv_func_gettimeofday=no
15366 fi
15367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15368 fi
15369 echo "$as_me:15369: result: $ac_cv_func_gettimeofday" >&5
15370 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15371 if test $ac_cv_func_gettimeofday = yes; then
15372   cat >>confdefs.h <<\EOF
15373 #define HAVE_GETTIMEOFDAY 1
15374 EOF
15375
15376 else
15377
15378 echo "$as_me:15378: checking for gettimeofday in -lbsd" >&5
15379 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15380 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15381   echo $ECHO_N "(cached) $ECHO_C" >&6
15382 else
15383   ac_check_lib_save_LIBS=$LIBS
15384 LIBS="-lbsd  $LIBS"
15385 cat >conftest.$ac_ext <<_ACEOF
15386 #line 15386 "configure"
15387 #include "confdefs.h"
15388
15389 /* Override any gcc2 internal prototype to avoid an error.  */
15390 #ifdef __cplusplus
15391 extern "C"
15392 #endif
15393 /* We use char because int might match the return type of a gcc2
15394    builtin and then its argument prototype would still apply.  */
15395 char gettimeofday ();
15396 int
15397 main (void)
15398 {
15399 gettimeofday ();
15400   ;
15401   return 0;
15402 }
15403 _ACEOF
15404 rm -f conftest.$ac_objext conftest$ac_exeext
15405 if { (eval echo "$as_me:15405: \"$ac_link\"") >&5
15406   (eval $ac_link) 2>&5
15407   ac_status=$?
15408   echo "$as_me:15408: \$? = $ac_status" >&5
15409   (exit $ac_status); } &&
15410          { ac_try='test -s conftest$ac_exeext'
15411   { (eval echo "$as_me:15411: \"$ac_try\"") >&5
15412   (eval $ac_try) 2>&5
15413   ac_status=$?
15414   echo "$as_me:15414: \$? = $ac_status" >&5
15415   (exit $ac_status); }; }; then
15416   ac_cv_lib_bsd_gettimeofday=yes
15417 else
15418   echo "$as_me: failed program was:" >&5
15419 cat conftest.$ac_ext >&5
15420 ac_cv_lib_bsd_gettimeofday=no
15421 fi
15422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15423 LIBS=$ac_check_lib_save_LIBS
15424 fi
15425 echo "$as_me:15425: result: $ac_cv_lib_bsd_gettimeofday" >&5
15426 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15427 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15428
15429 cat >>confdefs.h <<\EOF
15430 #define HAVE_GETTIMEOFDAY 1
15431 EOF
15432
15433         LIBS="$LIBS -lbsd"
15434 fi
15435
15436 fi
15437         ;;
15438 esac
15439
15440 ###     Checks for header files.
15441 echo "$as_me:15441: checking for ANSI C header files" >&5
15442 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15443 if test "${ac_cv_header_stdc+set}" = set; then
15444   echo $ECHO_N "(cached) $ECHO_C" >&6
15445 else
15446   cat >conftest.$ac_ext <<_ACEOF
15447 #line 15447 "configure"
15448 #include "confdefs.h"
15449 #include <stdlib.h>
15450 #include <stdarg.h>
15451 #include <string.h>
15452 #include <float.h>
15453
15454 _ACEOF
15455 if { (eval echo "$as_me:15455: \"$ac_cpp conftest.$ac_ext\"") >&5
15456   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15457   ac_status=$?
15458   egrep -v '^ *\+' conftest.er1 >conftest.err
15459   rm -f conftest.er1
15460   cat conftest.err >&5
15461   echo "$as_me:15461: \$? = $ac_status" >&5
15462   (exit $ac_status); } >/dev/null; then
15463   if test -s conftest.err; then
15464     ac_cpp_err=$ac_c_preproc_warn_flag
15465   else
15466     ac_cpp_err=
15467   fi
15468 else
15469   ac_cpp_err=yes
15470 fi
15471 if test -z "$ac_cpp_err"; then
15472   ac_cv_header_stdc=yes
15473 else
15474   echo "$as_me: failed program was:" >&5
15475   cat conftest.$ac_ext >&5
15476   ac_cv_header_stdc=no
15477 fi
15478 rm -f conftest.err conftest.$ac_ext
15479
15480 if test $ac_cv_header_stdc = yes; then
15481   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15482   cat >conftest.$ac_ext <<_ACEOF
15483 #line 15483 "configure"
15484 #include "confdefs.h"
15485 #include <string.h>
15486
15487 _ACEOF
15488 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15489   egrep "memchr" >/dev/null 2>&1; then
15490   :
15491 else
15492   ac_cv_header_stdc=no
15493 fi
15494 rm -rf conftest*
15495
15496 fi
15497
15498 if test $ac_cv_header_stdc = yes; then
15499   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15500   cat >conftest.$ac_ext <<_ACEOF
15501 #line 15501 "configure"
15502 #include "confdefs.h"
15503 #include <stdlib.h>
15504
15505 _ACEOF
15506 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15507   egrep "free" >/dev/null 2>&1; then
15508   :
15509 else
15510   ac_cv_header_stdc=no
15511 fi
15512 rm -rf conftest*
15513
15514 fi
15515
15516 if test $ac_cv_header_stdc = yes; then
15517   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15518   if test "$cross_compiling" = yes; then
15519   :
15520 else
15521   cat >conftest.$ac_ext <<_ACEOF
15522 #line 15522 "configure"
15523 #include "confdefs.h"
15524 #include <ctype.h>
15525 #if ((' ' & 0x0FF) == 0x020)
15526 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15527 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15528 #else
15529 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15530                      || ('j' <= (c) && (c) <= 'r') \
15531                      || ('s' <= (c) && (c) <= 'z'))
15532 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15533 #endif
15534
15535 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15536 int
15537 main (void)
15538 {
15539   int i;
15540   for (i = 0; i < 256; i++)
15541     if (XOR (islower (i), ISLOWER (i))
15542         || toupper (i) != TOUPPER (i))
15543       $ac_main_return(2);
15544   $ac_main_return (0);
15545 }
15546 _ACEOF
15547 rm -f conftest$ac_exeext
15548 if { (eval echo "$as_me:15548: \"$ac_link\"") >&5
15549   (eval $ac_link) 2>&5
15550   ac_status=$?
15551   echo "$as_me:15551: \$? = $ac_status" >&5
15552   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15553   { (eval echo "$as_me:15553: \"$ac_try\"") >&5
15554   (eval $ac_try) 2>&5
15555   ac_status=$?
15556   echo "$as_me:15556: \$? = $ac_status" >&5
15557   (exit $ac_status); }; }; then
15558   :
15559 else
15560   echo "$as_me: program exited with status $ac_status" >&5
15561 echo "$as_me: failed program was:" >&5
15562 cat conftest.$ac_ext >&5
15563 ac_cv_header_stdc=no
15564 fi
15565 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15566 fi
15567 fi
15568 fi
15569 echo "$as_me:15569: result: $ac_cv_header_stdc" >&5
15570 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15571 if test $ac_cv_header_stdc = yes; then
15572
15573 cat >>confdefs.h <<\EOF
15574 #define STDC_HEADERS 1
15575 EOF
15576
15577 fi
15578
15579 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15580
15581 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15582                   inttypes.h stdint.h unistd.h
15583 do
15584 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15585 echo "$as_me:15585: checking for $ac_header" >&5
15586 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15587 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15588   echo $ECHO_N "(cached) $ECHO_C" >&6
15589 else
15590   cat >conftest.$ac_ext <<_ACEOF
15591 #line 15591 "configure"
15592 #include "confdefs.h"
15593 $ac_includes_default
15594 #include <$ac_header>
15595 _ACEOF
15596 rm -f conftest.$ac_objext
15597 if { (eval echo "$as_me:15597: \"$ac_compile\"") >&5
15598   (eval $ac_compile) 2>&5
15599   ac_status=$?
15600   echo "$as_me:15600: \$? = $ac_status" >&5
15601   (exit $ac_status); } &&
15602          { ac_try='test -s conftest.$ac_objext'
15603   { (eval echo "$as_me:15603: \"$ac_try\"") >&5
15604   (eval $ac_try) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); }; }; then
15608   eval "$as_ac_Header=yes"
15609 else
15610   echo "$as_me: failed program was:" >&5
15611 cat conftest.$ac_ext >&5
15612 eval "$as_ac_Header=no"
15613 fi
15614 rm -f conftest.$ac_objext conftest.$ac_ext
15615 fi
15616 echo "$as_me:15616: result: `eval echo '${'$as_ac_Header'}'`" >&5
15617 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15618 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15619   cat >>confdefs.h <<EOF
15620 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15621 EOF
15622
15623 fi
15624 done
15625
15626 echo "$as_me:15626: checking for signed char" >&5
15627 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15628 if test "${ac_cv_type_signed_char+set}" = set; then
15629   echo $ECHO_N "(cached) $ECHO_C" >&6
15630 else
15631   cat >conftest.$ac_ext <<_ACEOF
15632 #line 15632 "configure"
15633 #include "confdefs.h"
15634 $ac_includes_default
15635 int
15636 main (void)
15637 {
15638 if ((signed char *) 0)
15639   return 0;
15640 if (sizeof (signed char))
15641   return 0;
15642   ;
15643   return 0;
15644 }
15645 _ACEOF
15646 rm -f conftest.$ac_objext
15647 if { (eval echo "$as_me:15647: \"$ac_compile\"") >&5
15648   (eval $ac_compile) 2>&5
15649   ac_status=$?
15650   echo "$as_me:15650: \$? = $ac_status" >&5
15651   (exit $ac_status); } &&
15652          { ac_try='test -s conftest.$ac_objext'
15653   { (eval echo "$as_me:15653: \"$ac_try\"") >&5
15654   (eval $ac_try) 2>&5
15655   ac_status=$?
15656   echo "$as_me:15656: \$? = $ac_status" >&5
15657   (exit $ac_status); }; }; then
15658   ac_cv_type_signed_char=yes
15659 else
15660   echo "$as_me: failed program was:" >&5
15661 cat conftest.$ac_ext >&5
15662 ac_cv_type_signed_char=no
15663 fi
15664 rm -f conftest.$ac_objext conftest.$ac_ext
15665 fi
15666 echo "$as_me:15666: result: $ac_cv_type_signed_char" >&5
15667 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15668
15669 echo "$as_me:15669: checking size of signed char" >&5
15670 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15671 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15672   echo $ECHO_N "(cached) $ECHO_C" >&6
15673 else
15674   if test "$ac_cv_type_signed_char" = yes; then
15675   if test "$cross_compiling" = yes; then
15676   # Depending upon the size, compute the lo and hi bounds.
15677 cat >conftest.$ac_ext <<_ACEOF
15678 #line 15678 "configure"
15679 #include "confdefs.h"
15680 $ac_includes_default
15681 int
15682 main (void)
15683 {
15684 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15685   ;
15686   return 0;
15687 }
15688 _ACEOF
15689 rm -f conftest.$ac_objext
15690 if { (eval echo "$as_me:15690: \"$ac_compile\"") >&5
15691   (eval $ac_compile) 2>&5
15692   ac_status=$?
15693   echo "$as_me:15693: \$? = $ac_status" >&5
15694   (exit $ac_status); } &&
15695          { ac_try='test -s conftest.$ac_objext'
15696   { (eval echo "$as_me:15696: \"$ac_try\"") >&5
15697   (eval $ac_try) 2>&5
15698   ac_status=$?
15699   echo "$as_me:15699: \$? = $ac_status" >&5
15700   (exit $ac_status); }; }; then
15701   ac_lo=0 ac_mid=0
15702   while :; do
15703     cat >conftest.$ac_ext <<_ACEOF
15704 #line 15704 "configure"
15705 #include "confdefs.h"
15706 $ac_includes_default
15707 int
15708 main (void)
15709 {
15710 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15711   ;
15712   return 0;
15713 }
15714 _ACEOF
15715 rm -f conftest.$ac_objext
15716 if { (eval echo "$as_me:15716: \"$ac_compile\"") >&5
15717   (eval $ac_compile) 2>&5
15718   ac_status=$?
15719   echo "$as_me:15719: \$? = $ac_status" >&5
15720   (exit $ac_status); } &&
15721          { ac_try='test -s conftest.$ac_objext'
15722   { (eval echo "$as_me:15722: \"$ac_try\"") >&5
15723   (eval $ac_try) 2>&5
15724   ac_status=$?
15725   echo "$as_me:15725: \$? = $ac_status" >&5
15726   (exit $ac_status); }; }; then
15727   ac_hi=$ac_mid; break
15728 else
15729   echo "$as_me: failed program was:" >&5
15730 cat conftest.$ac_ext >&5
15731 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15732 fi
15733 rm -f conftest.$ac_objext conftest.$ac_ext
15734   done
15735 else
15736   echo "$as_me: failed program was:" >&5
15737 cat conftest.$ac_ext >&5
15738 ac_hi=-1 ac_mid=-1
15739   while :; do
15740     cat >conftest.$ac_ext <<_ACEOF
15741 #line 15741 "configure"
15742 #include "confdefs.h"
15743 $ac_includes_default
15744 int
15745 main (void)
15746 {
15747 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15748   ;
15749   return 0;
15750 }
15751 _ACEOF
15752 rm -f conftest.$ac_objext
15753 if { (eval echo "$as_me:15753: \"$ac_compile\"") >&5
15754   (eval $ac_compile) 2>&5
15755   ac_status=$?
15756   echo "$as_me:15756: \$? = $ac_status" >&5
15757   (exit $ac_status); } &&
15758          { ac_try='test -s conftest.$ac_objext'
15759   { (eval echo "$as_me:15759: \"$ac_try\"") >&5
15760   (eval $ac_try) 2>&5
15761   ac_status=$?
15762   echo "$as_me:15762: \$? = $ac_status" >&5
15763   (exit $ac_status); }; }; then
15764   ac_lo=$ac_mid; break
15765 else
15766   echo "$as_me: failed program was:" >&5
15767 cat conftest.$ac_ext >&5
15768 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15769 fi
15770 rm -f conftest.$ac_objext conftest.$ac_ext
15771   done
15772 fi
15773 rm -f conftest.$ac_objext conftest.$ac_ext
15774 # Binary search between lo and hi bounds.
15775 while test "x$ac_lo" != "x$ac_hi"; do
15776   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15777   cat >conftest.$ac_ext <<_ACEOF
15778 #line 15778 "configure"
15779 #include "confdefs.h"
15780 $ac_includes_default
15781 int
15782 main (void)
15783 {
15784 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15785   ;
15786   return 0;
15787 }
15788 _ACEOF
15789 rm -f conftest.$ac_objext
15790 if { (eval echo "$as_me:15790: \"$ac_compile\"") >&5
15791   (eval $ac_compile) 2>&5
15792   ac_status=$?
15793   echo "$as_me:15793: \$? = $ac_status" >&5
15794   (exit $ac_status); } &&
15795          { ac_try='test -s conftest.$ac_objext'
15796   { (eval echo "$as_me:15796: \"$ac_try\"") >&5
15797   (eval $ac_try) 2>&5
15798   ac_status=$?
15799   echo "$as_me:15799: \$? = $ac_status" >&5
15800   (exit $ac_status); }; }; then
15801   ac_hi=$ac_mid
15802 else
15803   echo "$as_me: failed program was:" >&5
15804 cat conftest.$ac_ext >&5
15805 ac_lo=`expr $ac_mid + 1`
15806 fi
15807 rm -f conftest.$ac_objext conftest.$ac_ext
15808 done
15809 ac_cv_sizeof_signed_char=$ac_lo
15810 else
15811   if test "$cross_compiling" = yes; then
15812   { { echo "$as_me:15812: error: cannot run test program while cross compiling" >&5
15813 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15814    { (exit 1); exit 1; }; }
15815 else
15816   cat >conftest.$ac_ext <<_ACEOF
15817 #line 15817 "configure"
15818 #include "confdefs.h"
15819 $ac_includes_default
15820 int
15821 main (void)
15822 {
15823 FILE *f = fopen ("conftest.val", "w");
15824 if (!f)
15825   $ac_main_return (1);
15826 fprintf (f, "%d", (sizeof (signed char)));
15827 fclose (f);
15828   ;
15829   return 0;
15830 }
15831 _ACEOF
15832 rm -f conftest$ac_exeext
15833 if { (eval echo "$as_me:15833: \"$ac_link\"") >&5
15834   (eval $ac_link) 2>&5
15835   ac_status=$?
15836   echo "$as_me:15836: \$? = $ac_status" >&5
15837   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15838   { (eval echo "$as_me:15838: \"$ac_try\"") >&5
15839   (eval $ac_try) 2>&5
15840   ac_status=$?
15841   echo "$as_me:15841: \$? = $ac_status" >&5
15842   (exit $ac_status); }; }; then
15843   ac_cv_sizeof_signed_char=`cat conftest.val`
15844 else
15845   echo "$as_me: program exited with status $ac_status" >&5
15846 echo "$as_me: failed program was:" >&5
15847 cat conftest.$ac_ext >&5
15848 fi
15849 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15850 fi
15851 fi
15852 rm -f conftest.val
15853 else
15854   ac_cv_sizeof_signed_char=0
15855 fi
15856 fi
15857 echo "$as_me:15857: result: $ac_cv_sizeof_signed_char" >&5
15858 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15859 cat >>confdefs.h <<EOF
15860 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15861 EOF
15862
15863 echo "$as_me:15863: checking for ANSI C header files" >&5
15864 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15865 if test "${ac_cv_header_stdc+set}" = set; then
15866   echo $ECHO_N "(cached) $ECHO_C" >&6
15867 else
15868   cat >conftest.$ac_ext <<_ACEOF
15869 #line 15869 "configure"
15870 #include "confdefs.h"
15871 #include <stdlib.h>
15872 #include <stdarg.h>
15873 #include <string.h>
15874 #include <float.h>
15875
15876 _ACEOF
15877 if { (eval echo "$as_me:15877: \"$ac_cpp conftest.$ac_ext\"") >&5
15878   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15879   ac_status=$?
15880   egrep -v '^ *\+' conftest.er1 >conftest.err
15881   rm -f conftest.er1
15882   cat conftest.err >&5
15883   echo "$as_me:15883: \$? = $ac_status" >&5
15884   (exit $ac_status); } >/dev/null; then
15885   if test -s conftest.err; then
15886     ac_cpp_err=$ac_c_preproc_warn_flag
15887   else
15888     ac_cpp_err=
15889   fi
15890 else
15891   ac_cpp_err=yes
15892 fi
15893 if test -z "$ac_cpp_err"; then
15894   ac_cv_header_stdc=yes
15895 else
15896   echo "$as_me: failed program was:" >&5
15897   cat conftest.$ac_ext >&5
15898   ac_cv_header_stdc=no
15899 fi
15900 rm -f conftest.err conftest.$ac_ext
15901
15902 if test $ac_cv_header_stdc = yes; then
15903   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15904   cat >conftest.$ac_ext <<_ACEOF
15905 #line 15905 "configure"
15906 #include "confdefs.h"
15907 #include <string.h>
15908
15909 _ACEOF
15910 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15911   egrep "memchr" >/dev/null 2>&1; then
15912   :
15913 else
15914   ac_cv_header_stdc=no
15915 fi
15916 rm -rf conftest*
15917
15918 fi
15919
15920 if test $ac_cv_header_stdc = yes; then
15921   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15922   cat >conftest.$ac_ext <<_ACEOF
15923 #line 15923 "configure"
15924 #include "confdefs.h"
15925 #include <stdlib.h>
15926
15927 _ACEOF
15928 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15929   egrep "free" >/dev/null 2>&1; then
15930   :
15931 else
15932   ac_cv_header_stdc=no
15933 fi
15934 rm -rf conftest*
15935
15936 fi
15937
15938 if test $ac_cv_header_stdc = yes; then
15939   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15940   if test "$cross_compiling" = yes; then
15941   :
15942 else
15943   cat >conftest.$ac_ext <<_ACEOF
15944 #line 15944 "configure"
15945 #include "confdefs.h"
15946 #include <ctype.h>
15947 #if ((' ' & 0x0FF) == 0x020)
15948 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15949 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15950 #else
15951 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15952                      || ('j' <= (c) && (c) <= 'r') \
15953                      || ('s' <= (c) && (c) <= 'z'))
15954 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15955 #endif
15956
15957 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15958 int
15959 main (void)
15960 {
15961   int i;
15962   for (i = 0; i < 256; i++)
15963     if (XOR (islower (i), ISLOWER (i))
15964         || toupper (i) != TOUPPER (i))
15965       $ac_main_return(2);
15966   $ac_main_return (0);
15967 }
15968 _ACEOF
15969 rm -f conftest$ac_exeext
15970 if { (eval echo "$as_me:15970: \"$ac_link\"") >&5
15971   (eval $ac_link) 2>&5
15972   ac_status=$?
15973   echo "$as_me:15973: \$? = $ac_status" >&5
15974   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15975   { (eval echo "$as_me:15975: \"$ac_try\"") >&5
15976   (eval $ac_try) 2>&5
15977   ac_status=$?
15978   echo "$as_me:15978: \$? = $ac_status" >&5
15979   (exit $ac_status); }; }; then
15980   :
15981 else
15982   echo "$as_me: program exited with status $ac_status" >&5
15983 echo "$as_me: failed program was:" >&5
15984 cat conftest.$ac_ext >&5
15985 ac_cv_header_stdc=no
15986 fi
15987 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15988 fi
15989 fi
15990 fi
15991 echo "$as_me:15991: result: $ac_cv_header_stdc" >&5
15992 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15993 if test $ac_cv_header_stdc = yes; then
15994
15995 cat >>confdefs.h <<\EOF
15996 #define STDC_HEADERS 1
15997 EOF
15998
15999 fi
16000
16001 ac_header_dirent=no
16002 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16003   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16004 echo "$as_me:16004: checking for $ac_hdr that defines DIR" >&5
16005 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16006 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16007   echo $ECHO_N "(cached) $ECHO_C" >&6
16008 else
16009   cat >conftest.$ac_ext <<_ACEOF
16010 #line 16010 "configure"
16011 #include "confdefs.h"
16012 #include <sys/types.h>
16013 #include <$ac_hdr>
16014
16015 int
16016 main (void)
16017 {
16018 if ((DIR *) 0)
16019 return 0;
16020   ;
16021   return 0;
16022 }
16023 _ACEOF
16024 rm -f conftest.$ac_objext
16025 if { (eval echo "$as_me:16025: \"$ac_compile\"") >&5
16026   (eval $ac_compile) 2>&5
16027   ac_status=$?
16028   echo "$as_me:16028: \$? = $ac_status" >&5
16029   (exit $ac_status); } &&
16030          { ac_try='test -s conftest.$ac_objext'
16031   { (eval echo "$as_me:16031: \"$ac_try\"") >&5
16032   (eval $ac_try) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit $ac_status); }; }; then
16036   eval "$as_ac_Header=yes"
16037 else
16038   echo "$as_me: failed program was:" >&5
16039 cat conftest.$ac_ext >&5
16040 eval "$as_ac_Header=no"
16041 fi
16042 rm -f conftest.$ac_objext conftest.$ac_ext
16043 fi
16044 echo "$as_me:16044: result: `eval echo '${'$as_ac_Header'}'`" >&5
16045 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16046 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16047   cat >>confdefs.h <<EOF
16048 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16049 EOF
16050
16051 ac_header_dirent=$ac_hdr; break
16052 fi
16053
16054 done
16055 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16056 if test $ac_header_dirent = dirent.h; then
16057   echo "$as_me:16057: checking for opendir in -ldir" >&5
16058 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16059 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16060   echo $ECHO_N "(cached) $ECHO_C" >&6
16061 else
16062   ac_check_lib_save_LIBS=$LIBS
16063 LIBS="-ldir  $LIBS"
16064 cat >conftest.$ac_ext <<_ACEOF
16065 #line 16065 "configure"
16066 #include "confdefs.h"
16067
16068 /* Override any gcc2 internal prototype to avoid an error.  */
16069 #ifdef __cplusplus
16070 extern "C"
16071 #endif
16072 /* We use char because int might match the return type of a gcc2
16073    builtin and then its argument prototype would still apply.  */
16074 char opendir ();
16075 int
16076 main (void)
16077 {
16078 opendir ();
16079   ;
16080   return 0;
16081 }
16082 _ACEOF
16083 rm -f conftest.$ac_objext conftest$ac_exeext
16084 if { (eval echo "$as_me:16084: \"$ac_link\"") >&5
16085   (eval $ac_link) 2>&5
16086   ac_status=$?
16087   echo "$as_me:16087: \$? = $ac_status" >&5
16088   (exit $ac_status); } &&
16089          { ac_try='test -s conftest$ac_exeext'
16090   { (eval echo "$as_me:16090: \"$ac_try\"") >&5
16091   (eval $ac_try) 2>&5
16092   ac_status=$?
16093   echo "$as_me:16093: \$? = $ac_status" >&5
16094   (exit $ac_status); }; }; then
16095   ac_cv_lib_dir_opendir=yes
16096 else
16097   echo "$as_me: failed program was:" >&5
16098 cat conftest.$ac_ext >&5
16099 ac_cv_lib_dir_opendir=no
16100 fi
16101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16102 LIBS=$ac_check_lib_save_LIBS
16103 fi
16104 echo "$as_me:16104: result: $ac_cv_lib_dir_opendir" >&5
16105 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16106 if test $ac_cv_lib_dir_opendir = yes; then
16107   LIBS="$LIBS -ldir"
16108 fi
16109
16110 else
16111   echo "$as_me:16111: checking for opendir in -lx" >&5
16112 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16113 if test "${ac_cv_lib_x_opendir+set}" = set; then
16114   echo $ECHO_N "(cached) $ECHO_C" >&6
16115 else
16116   ac_check_lib_save_LIBS=$LIBS
16117 LIBS="-lx  $LIBS"
16118 cat >conftest.$ac_ext <<_ACEOF
16119 #line 16119 "configure"
16120 #include "confdefs.h"
16121
16122 /* Override any gcc2 internal prototype to avoid an error.  */
16123 #ifdef __cplusplus
16124 extern "C"
16125 #endif
16126 /* We use char because int might match the return type of a gcc2
16127    builtin and then its argument prototype would still apply.  */
16128 char opendir ();
16129 int
16130 main (void)
16131 {
16132 opendir ();
16133   ;
16134   return 0;
16135 }
16136 _ACEOF
16137 rm -f conftest.$ac_objext conftest$ac_exeext
16138 if { (eval echo "$as_me:16138: \"$ac_link\"") >&5
16139   (eval $ac_link) 2>&5
16140   ac_status=$?
16141   echo "$as_me:16141: \$? = $ac_status" >&5
16142   (exit $ac_status); } &&
16143          { ac_try='test -s conftest$ac_exeext'
16144   { (eval echo "$as_me:16144: \"$ac_try\"") >&5
16145   (eval $ac_try) 2>&5
16146   ac_status=$?
16147   echo "$as_me:16147: \$? = $ac_status" >&5
16148   (exit $ac_status); }; }; then
16149   ac_cv_lib_x_opendir=yes
16150 else
16151   echo "$as_me: failed program was:" >&5
16152 cat conftest.$ac_ext >&5
16153 ac_cv_lib_x_opendir=no
16154 fi
16155 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16156 LIBS=$ac_check_lib_save_LIBS
16157 fi
16158 echo "$as_me:16158: result: $ac_cv_lib_x_opendir" >&5
16159 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16160 if test $ac_cv_lib_x_opendir = yes; then
16161   LIBS="$LIBS -lx"
16162 fi
16163
16164 fi
16165
16166 echo "$as_me:16166: checking whether time.h and sys/time.h may both be included" >&5
16167 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16168 if test "${ac_cv_header_time+set}" = set; then
16169   echo $ECHO_N "(cached) $ECHO_C" >&6
16170 else
16171   cat >conftest.$ac_ext <<_ACEOF
16172 #line 16172 "configure"
16173 #include "confdefs.h"
16174 #include <sys/types.h>
16175 #include <sys/time.h>
16176 #include <time.h>
16177
16178 int
16179 main (void)
16180 {
16181 if ((struct tm *) 0)
16182 return 0;
16183   ;
16184   return 0;
16185 }
16186 _ACEOF
16187 rm -f conftest.$ac_objext
16188 if { (eval echo "$as_me:16188: \"$ac_compile\"") >&5
16189   (eval $ac_compile) 2>&5
16190   ac_status=$?
16191   echo "$as_me:16191: \$? = $ac_status" >&5
16192   (exit $ac_status); } &&
16193          { ac_try='test -s conftest.$ac_objext'
16194   { (eval echo "$as_me:16194: \"$ac_try\"") >&5
16195   (eval $ac_try) 2>&5
16196   ac_status=$?
16197   echo "$as_me:16197: \$? = $ac_status" >&5
16198   (exit $ac_status); }; }; then
16199   ac_cv_header_time=yes
16200 else
16201   echo "$as_me: failed program was:" >&5
16202 cat conftest.$ac_ext >&5
16203 ac_cv_header_time=no
16204 fi
16205 rm -f conftest.$ac_objext conftest.$ac_ext
16206 fi
16207 echo "$as_me:16207: result: $ac_cv_header_time" >&5
16208 echo "${ECHO_T}$ac_cv_header_time" >&6
16209 if test $ac_cv_header_time = yes; then
16210
16211 cat >>confdefs.h <<\EOF
16212 #define TIME_WITH_SYS_TIME 1
16213 EOF
16214
16215 fi
16216
16217 ###     checks for compiler characteristics
16218 ac_ext=c
16219 ac_cpp='$CPP $CPPFLAGS'
16220 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16221 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16222 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16223 ac_main_return=return
16224
16225 echo "$as_me:16225: checking for an ANSI C-conforming const" >&5
16226 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16227 if test "${ac_cv_c_const+set}" = set; then
16228   echo $ECHO_N "(cached) $ECHO_C" >&6
16229 else
16230   cat >conftest.$ac_ext <<_ACEOF
16231 #line 16231 "configure"
16232 #include "confdefs.h"
16233
16234 int
16235 main (void)
16236 {
16237 /* FIXME: Include the comments suggested by Paul. */
16238 #ifndef __cplusplus
16239   /* Ultrix mips cc rejects this.  */
16240   typedef int charset[2];
16241   const charset x;
16242   /* SunOS 4.1.1 cc rejects this.  */
16243   char const *const *ccp;
16244   char **p;
16245   /* NEC SVR4.0.2 mips cc rejects this.  */
16246   struct point {int x, y;};
16247   static struct point const zero = {0,0};
16248   /* AIX XL C 1.02.0.0 rejects this.
16249      It does not let you subtract one const X* pointer from another in
16250      an arm of an if-expression whose if-part is not a constant
16251      expression */
16252   const char *g = "string";
16253   ccp = &g + (g ? g-g : 0);
16254   /* HPUX 7.0 cc rejects these. */
16255   ++ccp;
16256   p = (char**) ccp;
16257   ccp = (char const *const *) p;
16258   { /* SCO 3.2v4 cc rejects this.  */
16259     char *t;
16260     char const *s = 0 ? (char *) 0 : (char const *) 0;
16261
16262     *t++ = 0;
16263   }
16264   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16265     int x[] = {25, 17};
16266     const int *foo = &x[0];
16267     ++foo;
16268   }
16269   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16270     typedef const int *iptr;
16271     iptr p = 0;
16272     ++p;
16273   }
16274   { /* AIX XL C 1.02.0.0 rejects this saying
16275        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16276     struct s { int j; const int *ap[3]; };
16277     struct s *b; b->j = 5;
16278   }
16279   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16280     const int foo = 10;
16281   }
16282 #endif
16283
16284   ;
16285   return 0;
16286 }
16287 _ACEOF
16288 rm -f conftest.$ac_objext
16289 if { (eval echo "$as_me:16289: \"$ac_compile\"") >&5
16290   (eval $ac_compile) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit $ac_status); } &&
16294          { ac_try='test -s conftest.$ac_objext'
16295   { (eval echo "$as_me:16295: \"$ac_try\"") >&5
16296   (eval $ac_try) 2>&5
16297   ac_status=$?
16298   echo "$as_me:16298: \$? = $ac_status" >&5
16299   (exit $ac_status); }; }; then
16300   ac_cv_c_const=yes
16301 else
16302   echo "$as_me: failed program was:" >&5
16303 cat conftest.$ac_ext >&5
16304 ac_cv_c_const=no
16305 fi
16306 rm -f conftest.$ac_objext conftest.$ac_ext
16307 fi
16308 echo "$as_me:16308: result: $ac_cv_c_const" >&5
16309 echo "${ECHO_T}$ac_cv_c_const" >&6
16310 if test $ac_cv_c_const = no; then
16311
16312 cat >>confdefs.h <<\EOF
16313 #define const
16314 EOF
16315
16316 fi
16317
16318 ###     Checks for external-data
16319
16320 echo "$as_me:16320: checking if data-only library module links" >&5
16321 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16322 if test "${cf_cv_link_dataonly+set}" = set; then
16323   echo $ECHO_N "(cached) $ECHO_C" >&6
16324 else
16325
16326         rm -f conftest.a
16327         cat >conftest.$ac_ext <<EOF
16328 #line 16328 "configure"
16329 int     testdata[3] = { 123, 456, 789 };
16330 EOF
16331         if { (eval echo "$as_me:16331: \"$ac_compile\"") >&5
16332   (eval $ac_compile) 2>&5
16333   ac_status=$?
16334   echo "$as_me:16334: \$? = $ac_status" >&5
16335   (exit $ac_status); } ; then
16336                 mv conftest.o data.o && \
16337                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16338         fi
16339         rm -f conftest.$ac_ext data.o
16340         cat >conftest.$ac_ext <<EOF
16341 #line 16341 "configure"
16342 int     testfunc(void)
16343 {
16344 #if defined(NeXT)
16345         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16346 #else
16347         extern int testdata[3];
16348         return testdata[0] == 123
16349            &&  testdata[1] == 456
16350            &&  testdata[2] == 789;
16351 #endif
16352 }
16353 EOF
16354         if { (eval echo "$as_me:16354: \"$ac_compile\"") >&5
16355   (eval $ac_compile) 2>&5
16356   ac_status=$?
16357   echo "$as_me:16357: \$? = $ac_status" >&5
16358   (exit $ac_status); }; then
16359                 mv conftest.o func.o && \
16360                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16361         fi
16362         rm -f conftest.$ac_ext func.o
16363         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16364         cf_saveLIBS="$LIBS"
16365         LIBS="conftest.a $LIBS"
16366         if test "$cross_compiling" = yes; then
16367   cf_cv_link_dataonly=unknown
16368 else
16369   cat >conftest.$ac_ext <<_ACEOF
16370 #line 16370 "configure"
16371 #include "confdefs.h"
16372
16373         int main(void)
16374         {
16375                 extern int testfunc();
16376                 ${cf_cv_main_return:-return} (!testfunc());
16377         }
16378
16379 _ACEOF
16380 rm -f conftest$ac_exeext
16381 if { (eval echo "$as_me:16381: \"$ac_link\"") >&5
16382   (eval $ac_link) 2>&5
16383   ac_status=$?
16384   echo "$as_me:16384: \$? = $ac_status" >&5
16385   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16386   { (eval echo "$as_me:16386: \"$ac_try\"") >&5
16387   (eval $ac_try) 2>&5
16388   ac_status=$?
16389   echo "$as_me:16389: \$? = $ac_status" >&5
16390   (exit $ac_status); }; }; then
16391   cf_cv_link_dataonly=yes
16392 else
16393   echo "$as_me: program exited with status $ac_status" >&5
16394 echo "$as_me: failed program was:" >&5
16395 cat conftest.$ac_ext >&5
16396 cf_cv_link_dataonly=no
16397 fi
16398 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16399 fi
16400         LIBS="$cf_saveLIBS"
16401
16402 fi
16403
16404 echo "$as_me:16404: result: $cf_cv_link_dataonly" >&5
16405 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16406
16407 if test "$cf_cv_link_dataonly" = no ; then
16408
16409 cat >>confdefs.h <<\EOF
16410 #define BROKEN_LINKER 1
16411 EOF
16412
16413         BROKEN_LINKER=1
16414 fi
16415
16416 ###     Checks for library functions.
16417
16418 for ac_header in \
16419 unistd.h \
16420
16421 do
16422 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16423 echo "$as_me:16423: checking for $ac_header" >&5
16424 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16425 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16426   echo $ECHO_N "(cached) $ECHO_C" >&6
16427 else
16428   cat >conftest.$ac_ext <<_ACEOF
16429 #line 16429 "configure"
16430 #include "confdefs.h"
16431 #include <$ac_header>
16432 _ACEOF
16433 if { (eval echo "$as_me:16433: \"$ac_cpp conftest.$ac_ext\"") >&5
16434   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16435   ac_status=$?
16436   egrep -v '^ *\+' conftest.er1 >conftest.err
16437   rm -f conftest.er1
16438   cat conftest.err >&5
16439   echo "$as_me:16439: \$? = $ac_status" >&5
16440   (exit $ac_status); } >/dev/null; then
16441   if test -s conftest.err; then
16442     ac_cpp_err=$ac_c_preproc_warn_flag
16443   else
16444     ac_cpp_err=
16445   fi
16446 else
16447   ac_cpp_err=yes
16448 fi
16449 if test -z "$ac_cpp_err"; then
16450   eval "$as_ac_Header=yes"
16451 else
16452   echo "$as_me: failed program was:" >&5
16453   cat conftest.$ac_ext >&5
16454   eval "$as_ac_Header=no"
16455 fi
16456 rm -f conftest.err conftest.$ac_ext
16457 fi
16458 echo "$as_me:16458: result: `eval echo '${'$as_ac_Header'}'`" >&5
16459 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16460 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16461   cat >>confdefs.h <<EOF
16462 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16463 EOF
16464
16465 fi
16466 done
16467
16468 echo "$as_me:16468: checking for working mkstemp" >&5
16469 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16470 if test "${cf_cv_func_mkstemp+set}" = set; then
16471   echo $ECHO_N "(cached) $ECHO_C" >&6
16472 else
16473
16474 rm -rf conftest*
16475 if test "$cross_compiling" = yes; then
16476   cf_cv_func_mkstemp=maybe
16477 else
16478   cat >conftest.$ac_ext <<_ACEOF
16479 #line 16479 "configure"
16480 #include "confdefs.h"
16481
16482 #include <sys/types.h>
16483 #ifdef HAVE_UNISTD_H
16484 #include <unistd.h>
16485 #endif
16486 #include <stdlib.h>
16487 #include <stdio.h>
16488 #include <string.h>
16489 #include <sys/stat.h>
16490 int main(void)
16491 {
16492         char *tmpl = "conftestXXXXXX";
16493         char name[2][80];
16494         int n;
16495         int result = 0;
16496         int fd;
16497         struct stat sb;
16498
16499         umask(077);
16500         for (n = 0; n < 2; ++n) {
16501                 strcpy(name[n], tmpl);
16502                 if ((fd = mkstemp(name[n])) >= 0) {
16503                         if (!strcmp(name[n], tmpl)
16504                          || stat(name[n], &sb) != 0
16505                          || (sb.st_mode & S_IFMT) != S_IFREG
16506                          || (sb.st_mode & 077) != 0) {
16507                                 result = 1;
16508                         }
16509                         close(fd);
16510                 }
16511         }
16512         if (result == 0
16513          && !strcmp(name[0], name[1]))
16514                 result = 1;
16515         ${cf_cv_main_return:-return}(result);
16516 }
16517
16518 _ACEOF
16519 rm -f conftest$ac_exeext
16520 if { (eval echo "$as_me:16520: \"$ac_link\"") >&5
16521   (eval $ac_link) 2>&5
16522   ac_status=$?
16523   echo "$as_me:16523: \$? = $ac_status" >&5
16524   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16525   { (eval echo "$as_me:16525: \"$ac_try\"") >&5
16526   (eval $ac_try) 2>&5
16527   ac_status=$?
16528   echo "$as_me:16528: \$? = $ac_status" >&5
16529   (exit $ac_status); }; }; then
16530   cf_cv_func_mkstemp=yes
16531
16532 else
16533   echo "$as_me: program exited with status $ac_status" >&5
16534 echo "$as_me: failed program was:" >&5
16535 cat conftest.$ac_ext >&5
16536 cf_cv_func_mkstemp=no
16537
16538 fi
16539 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16540 fi
16541
16542 fi
16543 echo "$as_me:16543: result: $cf_cv_func_mkstemp" >&5
16544 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16545 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16546         echo "$as_me:16546: checking for mkstemp" >&5
16547 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16548 if test "${ac_cv_func_mkstemp+set}" = set; then
16549   echo $ECHO_N "(cached) $ECHO_C" >&6
16550 else
16551   cat >conftest.$ac_ext <<_ACEOF
16552 #line 16552 "configure"
16553 #include "confdefs.h"
16554 #define mkstemp autoconf_temporary
16555 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16556 #undef mkstemp
16557
16558 #ifdef __cplusplus
16559 extern "C"
16560 #endif
16561
16562 /* We use char because int might match the return type of a gcc2
16563    builtin and then its argument prototype would still apply.  */
16564 char mkstemp (void);
16565
16566 int
16567 main (void)
16568 {
16569
16570 /* The GNU C library defines stubs for functions which it implements
16571     to always fail with ENOSYS.  Some functions are actually named
16572     something starting with __ and the normal name is an alias.  */
16573 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16574 #error found stub for mkstemp
16575 #endif
16576
16577         return mkstemp ();
16578   ;
16579   return 0;
16580 }
16581 _ACEOF
16582 rm -f conftest.$ac_objext conftest$ac_exeext
16583 if { (eval echo "$as_me:16583: \"$ac_link\"") >&5
16584   (eval $ac_link) 2>&5
16585   ac_status=$?
16586   echo "$as_me:16586: \$? = $ac_status" >&5
16587   (exit $ac_status); } &&
16588          { ac_try='test -s conftest$ac_exeext'
16589   { (eval echo "$as_me:16589: \"$ac_try\"") >&5
16590   (eval $ac_try) 2>&5
16591   ac_status=$?
16592   echo "$as_me:16592: \$? = $ac_status" >&5
16593   (exit $ac_status); }; }; then
16594   ac_cv_func_mkstemp=yes
16595 else
16596   echo "$as_me: failed program was:" >&5
16597 cat conftest.$ac_ext >&5
16598 ac_cv_func_mkstemp=no
16599 fi
16600 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16601 fi
16602 echo "$as_me:16602: result: $ac_cv_func_mkstemp" >&5
16603 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16604
16605 fi
16606 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16607
16608 cat >>confdefs.h <<\EOF
16609 #define HAVE_MKSTEMP 1
16610 EOF
16611
16612 fi
16613
16614 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16615         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16616         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16617 fi
16618
16619 cf_with_ada=yes
16620 if test "$cf_with_ada" != "no" ; then
16621
16622 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16623 do
16624
16625 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16626
16627         unset ac_cv_path_cf_TEMP_gnat
16628         unset cf_TEMP_gnat
16629         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16630 set dummy $cf_prog_gnat; ac_word=$2
16631 echo "$as_me:16631: checking for $ac_word" >&5
16632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16633 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16634   echo $ECHO_N "(cached) $ECHO_C" >&6
16635 else
16636   case $cf_TEMP_gnat in
16637   [\\/]* | ?:[\\/]*)
16638   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16639   ;;
16640   *)
16641   ac_save_IFS=$IFS; IFS=$ac_path_separator
16642 ac_dummy="$PATH"
16643 for ac_dir in $ac_dummy; do
16644   IFS=$ac_save_IFS
16645   test -z "$ac_dir" && ac_dir=.
16646   if $as_executable_p "$ac_dir/$ac_word"; then
16647    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16648    echo "$as_me:16648: found $ac_dir/$ac_word" >&5
16649    break
16650 fi
16651 done
16652
16653   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16654   ;;
16655 esac
16656 fi
16657 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16658
16659 if test -n "$cf_TEMP_gnat"; then
16660   echo "$as_me:16660: result: $cf_TEMP_gnat" >&5
16661 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16662 else
16663   echo "$as_me:16663: result: no" >&5
16664 echo "${ECHO_T}no" >&6
16665 fi
16666
16667         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16668
16669         if test "x$cf_TEMP_gnat" != xno; then
16670                 unset cf_cv_gnat_version
16671                 unset cf_TEMP_gnat
16672
16673 echo "$as_me:16673: checking for $cf_prog_gnat version" >&5
16674 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16675 if test "${cf_cv_gnat_version+set}" = set; then
16676   echo $ECHO_N "(cached) $ECHO_C" >&6
16677 else
16678
16679 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16680         grep '[0-9].[0-9][0-9]*' |\
16681         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16682
16683 fi
16684 echo "$as_me:16684: result: $cf_cv_gnat_version" >&5
16685 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16686 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16687 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16688
16689         fi
16690         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16691
16692         unset cf_TEMP_gnat
16693         unset cf_cv_gnat_version
16694         unset ac_cv_path_cf_TEMP_gnat
16695 done
16696
16697 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16698         cf_ada_make=
16699         cf_cv_prog_gnat_correct=no
16700 else
16701         cf_ada_make=gnatmake
16702         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16703                 # gprconfig is newer than gnatmake; we can continue...
16704                 cf_ada_config="##"
16705         else
16706                 rm -rf conftest* *~conftest*
16707                 if mkdir conftest.src
16708                 then
16709                         cf_ada_config=""
16710                         cd conftest.src
16711                         for cf_gprconfig in Ada C
16712                         do
16713                                 echo "$as_me:16713: checking for gprconfig name for $cf_gprconfig" >&5
16714 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16715                                 if test $cf_gprconfig = C
16716                                 then
16717                                         for cf_gprconfig_param in \
16718                                                 $cf_gprconfig,,,,GNATGCC \
16719                                                 $cf_gprconfig,,,,GCC \
16720                                                 $cf_gprconfig
16721                                         do
16722                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16723                                                 test -n "$cf_gprconfig_value" && break
16724                                         done
16725                                 else
16726                                         cf_gprconfig_param=$cf_gprconfig
16727                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16728                                 fi
16729                                 if test -n "$cf_gprconfig_value"
16730                                 then
16731                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16732                                         echo "$as_me:16732: result: $cf_gprconfig_value" >&5
16733 echo "${ECHO_T}$cf_gprconfig_value" >&6
16734                                 else
16735                                         echo "$as_me:16735: result: missing" >&5
16736 echo "${ECHO_T}missing" >&6
16737                                         cf_ada_config="#"
16738                                         break
16739                                 fi
16740                         done
16741                         cd ..
16742                         rm -rf conftest* *~conftest*
16743                 fi
16744         fi
16745         if test "x$cf_ada_config" != "x#"
16746         then
16747
16748 echo "$as_me:16748: checking for gnat version" >&5
16749 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16750 if test "${cf_cv_gnat_version+set}" = set; then
16751   echo $ECHO_N "(cached) $ECHO_C" >&6
16752 else
16753
16754 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16755         grep '[0-9].[0-9][0-9]*' |\
16756         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16757
16758 fi
16759 echo "$as_me:16759: result: $cf_cv_gnat_version" >&5
16760 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16761 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16762
16763 case $cf_cv_gnat_version in
16764 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16765         cf_cv_prog_gnat_correct=yes
16766         ;;
16767 (*)
16768         { echo "$as_me:16768: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16769 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16770         cf_cv_prog_gnat_correct=no
16771         ;;
16772 esac
16773
16774                 # Extract the first word of "m4", so it can be a program name with args.
16775 set dummy m4; ac_word=$2
16776 echo "$as_me:16776: checking for $ac_word" >&5
16777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16778 if test "${ac_cv_prog_M4_exists+set}" = set; then
16779   echo $ECHO_N "(cached) $ECHO_C" >&6
16780 else
16781   if test -n "$M4_exists"; then
16782   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16783 else
16784   ac_save_IFS=$IFS; IFS=$ac_path_separator
16785 ac_dummy="$PATH"
16786 for ac_dir in $ac_dummy; do
16787   IFS=$ac_save_IFS
16788   test -z "$ac_dir" && ac_dir=.
16789   $as_executable_p "$ac_dir/$ac_word" || continue
16790 ac_cv_prog_M4_exists="yes"
16791 echo "$as_me:16791: found $ac_dir/$ac_word" >&5
16792 break
16793 done
16794
16795   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16796 fi
16797 fi
16798 M4_exists=$ac_cv_prog_M4_exists
16799 if test -n "$M4_exists"; then
16800   echo "$as_me:16800: result: $M4_exists" >&5
16801 echo "${ECHO_T}$M4_exists" >&6
16802 else
16803   echo "$as_me:16803: result: no" >&5
16804 echo "${ECHO_T}no" >&6
16805 fi
16806
16807                 if test "$ac_cv_prog_M4_exists" = no; then
16808                         cf_cv_prog_gnat_correct=no
16809                         { echo "$as_me:16809: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16810 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16811                 fi
16812                 if test "$cf_cv_prog_gnat_correct" = yes; then
16813                         echo "$as_me:16813: checking if GNAT works" >&5
16814 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16815
16816 rm -rf conftest* *~conftest*
16817 cat >>conftest.ads <<CF_EOF
16818 procedure conftest;
16819 CF_EOF
16820 cat >>conftest.adb <<CF_EOF
16821 with Text_IO;
16822 with GNAT.OS_Lib;
16823 procedure conftest is
16824 begin
16825    Text_IO.Put ("Hello World");
16826    Text_IO.New_Line;
16827    GNAT.OS_Lib.OS_Exit (0);
16828 end conftest;
16829 CF_EOF
16830 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16831    if ( ./conftest 1>&5 2>&1 ) ; then
16832       cf_cv_prog_gnat_correct=yes
16833    else
16834       cf_cv_prog_gnat_correct=no
16835    fi
16836 else
16837    cf_cv_prog_gnat_correct=no
16838 fi
16839 rm -rf conftest* *~conftest*
16840
16841                         echo "$as_me:16841: result: $cf_cv_prog_gnat_correct" >&5
16842 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16843                 fi
16844         else
16845                 cf_cv_prog_gnat_correct=no
16846         fi
16847 fi
16848
16849         if test "$cf_cv_prog_gnat_correct" = yes; then
16850
16851         echo "$as_me:16851: checking optimization options for ADAFLAGS" >&5
16852 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16853         case "$CFLAGS" in
16854         (*-g*)
16855
16856         ADAFLAGS="$ADAFLAGS -g"
16857
16858                 ;;
16859         esac
16860         case "$CFLAGS" in
16861         (*-O*)
16862                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16863
16864         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16865
16866                 ;;
16867         esac
16868         echo "$as_me:16868: result: $ADAFLAGS" >&5
16869 echo "${ECHO_T}$ADAFLAGS" >&6
16870
16871 echo "$as_me:16871: checking if GNATPREP supports -T option" >&5
16872 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16873 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16874   echo $ECHO_N "(cached) $ECHO_C" >&6
16875 else
16876
16877 cf_cv_gnatprep_opt_t=no
16878 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16879
16880 fi
16881 echo "$as_me:16881: result: $cf_cv_gnatprep_opt_t" >&5
16882 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16883 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16884
16885 echo "$as_me:16885: checking if GNAT supports generics" >&5
16886 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16887 case $cf_cv_gnat_version in
16888 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16889         cf_gnat_generics=yes
16890         ;;
16891 (*)
16892         cf_gnat_generics=no
16893         ;;
16894 esac
16895 echo "$as_me:16895: result: $cf_gnat_generics" >&5
16896 echo "${ECHO_T}$cf_gnat_generics" >&6
16897
16898 if test "$cf_gnat_generics" = yes
16899 then
16900         cf_compile_generics=generics
16901         cf_generic_objects="\${GENOBJS}"
16902 else
16903         cf_compile_generics=
16904         cf_generic_objects=
16905 fi
16906
16907 echo "$as_me:16907: checking if GNAT supports SIGINT" >&5
16908 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16909 if test "${cf_cv_gnat_sigint+set}" = set; then
16910   echo $ECHO_N "(cached) $ECHO_C" >&6
16911 else
16912
16913 rm -rf conftest* *~conftest*
16914 cat >>conftest.ads <<CF_EOF
16915 with Ada.Interrupts.Names;
16916
16917 package ConfTest is
16918
16919    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16920    pragma Unreserve_All_Interrupts;
16921    pragma Warnings (On);
16922
16923    protected Process is
16924       procedure Stop;
16925       function Continue return Boolean;
16926       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16927    private
16928       Done : Boolean := False;
16929    end Process;
16930
16931 end ConfTest;
16932 CF_EOF
16933 cat >>conftest.adb <<CF_EOF
16934 package body ConfTest is
16935    protected body Process is
16936       procedure Stop is
16937       begin
16938          Done := True;
16939       end Stop;
16940       function Continue return Boolean is
16941       begin
16942          return not Done;
16943       end Continue;
16944    end Process;
16945 end ConfTest;
16946 CF_EOF
16947 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16948       cf_cv_gnat_sigint=yes
16949 else
16950    cf_cv_gnat_sigint=no
16951 fi
16952 rm -rf conftest* *~conftest*
16953
16954 fi
16955 echo "$as_me:16955: result: $cf_cv_gnat_sigint" >&5
16956 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16957
16958 if test $cf_cv_gnat_sigint = yes ; then
16959         USE_GNAT_SIGINT=""
16960 else
16961         USE_GNAT_SIGINT="#"
16962 fi
16963
16964 cf_gnat_libraries=no
16965 cf_gnat_projects=no
16966
16967 if test "$enable_gnat_projects" != no ; then
16968 echo "$as_me:16968: checking if GNAT supports project files" >&5
16969 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16970 case $cf_cv_gnat_version in
16971 (3.[0-9]*)
16972         ;;
16973 (*)
16974         case $cf_cv_system_name in
16975         (cygwin*|msys*)
16976                 ;;
16977         (*)
16978                 rm -rf conftest* *~conftest*
16979                 if mkdir conftest.src conftest.bin conftest.lib
16980                 then
16981                         cd conftest.src
16982                         rm -rf conftest* *~conftest*
16983                         cat >>library.gpr <<CF_EOF
16984 project Library is
16985   Kind := External ("LIB_KIND");
16986   for Library_Name use "ConfTest";
16987   for Object_Dir use ".";
16988   for Library_ALI_Dir use External("LIBRARY_DIR");
16989   for Library_Version use External ("SONAME");
16990   for Library_Kind use Kind;
16991   for Library_Dir use External("BUILD_DIR");
16992   Source_Dir := External ("SOURCE_DIR");
16993   for Source_Dirs use (Source_Dir);
16994 end Library;
16995 CF_EOF
16996                         cat >>confpackage.ads <<CF_EOF
16997 package ConfPackage is
16998    procedure conftest;
16999 end ConfPackage;
17000 CF_EOF
17001                         cat >>confpackage.adb <<CF_EOF
17002 with Text_IO;
17003 package body ConfPackage is
17004    procedure conftest is
17005    begin
17006       Text_IO.Put ("Hello World");
17007       Text_IO.New_Line;
17008    end conftest;
17009 end ConfPackage;
17010 CF_EOF
17011                         if ( $cf_ada_make $ADAFLAGS \
17012                                         -Plibrary.gpr \
17013                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
17014                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
17015                                         -XSOURCE_DIR=`pwd` \
17016                                         -XSONAME=libConfTest.so.1 \
17017                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17018                                 cf_gnat_projects=yes
17019                         fi
17020                         cd ..
17021                 fi
17022                 if test -f conftest.lib/confpackage.ali
17023                 then
17024                         cf_gnat_libraries=yes
17025                 fi
17026                 rm -rf conftest* *~conftest*
17027                 ;;
17028         esac
17029         ;;
17030 esac
17031 echo "$as_me:17031: result: $cf_gnat_projects" >&5
17032 echo "${ECHO_T}$cf_gnat_projects" >&6
17033 fi # enable_gnat_projects
17034
17035 if test $cf_gnat_projects = yes
17036 then
17037         echo "$as_me:17037: checking if GNAT supports libraries" >&5
17038 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17039         echo "$as_me:17039: result: $cf_gnat_libraries" >&5
17040 echo "${ECHO_T}$cf_gnat_libraries" >&6
17041 fi
17042
17043 if test "$cf_gnat_projects" = yes
17044 then
17045         USE_OLD_MAKERULES="#"
17046         USE_GNAT_PROJECTS=""
17047 else
17048         USE_OLD_MAKERULES=""
17049         USE_GNAT_PROJECTS="#"
17050 fi
17051
17052 if test "$cf_gnat_libraries" = yes
17053 then
17054         USE_GNAT_LIBRARIES=""
17055 else
17056         USE_GNAT_LIBRARIES="#"
17057 fi
17058
17059 echo "$as_me:17059: checking for ada-compiler" >&5
17060 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17061
17062 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17063 if test "${with_ada_compiler+set}" = set; then
17064   withval="$with_ada_compiler"
17065   cf_ada_compiler=$withval
17066 else
17067   cf_ada_compiler=gnatmake
17068 fi;
17069
17070 echo "$as_me:17070: result: $cf_ada_compiler" >&5
17071 echo "${ECHO_T}$cf_ada_compiler" >&6
17072
17073                 cf_ada_package=terminal_interface
17074
17075 echo "$as_me:17075: checking for ada-include" >&5
17076 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17077
17078 # Check whether --with-ada-include or --without-ada-include was given.
17079 if test "${with_ada_include+set}" = set; then
17080   withval="$with_ada_include"
17081
17082 else
17083   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17084 fi; if test -n "$prefix/share/ada/adainclude" ; then
17085
17086 if test "x$prefix" != xNONE; then
17087         cf_path_syntax="$prefix"
17088 else
17089         cf_path_syntax="$ac_default_prefix"
17090 fi
17091
17092 case ".$withval" in
17093 (.\$\(*\)*|.\'*\'*)
17094         ;;
17095 (..|./*|.\\*)
17096         ;;
17097 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17098         ;;
17099 (.\${*prefix}*|.\${*dir}*)
17100         eval withval="$withval"
17101         case ".$withval" in
17102         (.NONE/*)
17103                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17104                 ;;
17105         esac
17106         ;;
17107 (.no|.NONE/*)
17108         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17109         ;;
17110 (*)
17111         { { echo "$as_me:17111: error: expected a pathname, not \"$withval\"" >&5
17112 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17113    { (exit 1); exit 1; }; }
17114         ;;
17115 esac
17116
17117 fi
17118 eval ADA_INCLUDE="$withval"
17119
17120 echo "$as_me:17120: result: $ADA_INCLUDE" >&5
17121 echo "${ECHO_T}$ADA_INCLUDE" >&6
17122
17123 echo "$as_me:17123: checking for ada-objects" >&5
17124 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17125
17126 # Check whether --with-ada-objects or --without-ada-objects was given.
17127 if test "${with_ada_objects+set}" = set; then
17128   withval="$with_ada_objects"
17129
17130 else
17131   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17132 fi; if test -n "$prefix/lib/ada/adalib" ; then
17133
17134 if test "x$prefix" != xNONE; then
17135         cf_path_syntax="$prefix"
17136 else
17137         cf_path_syntax="$ac_default_prefix"
17138 fi
17139
17140 case ".$withval" in
17141 (.\$\(*\)*|.\'*\'*)
17142         ;;
17143 (..|./*|.\\*)
17144         ;;
17145 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17146         ;;
17147 (.\${*prefix}*|.\${*dir}*)
17148         eval withval="$withval"
17149         case ".$withval" in
17150         (.NONE/*)
17151                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17152                 ;;
17153         esac
17154         ;;
17155 (.no|.NONE/*)
17156         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17157         ;;
17158 (*)
17159         { { echo "$as_me:17159: error: expected a pathname, not \"$withval\"" >&5
17160 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17161    { (exit 1); exit 1; }; }
17162         ;;
17163 esac
17164
17165 fi
17166 eval ADA_OBJECTS="$withval"
17167
17168 echo "$as_me:17168: result: $ADA_OBJECTS" >&5
17169 echo "${ECHO_T}$ADA_OBJECTS" >&6
17170
17171 echo "$as_me:17171: checking if an Ada95 shared-library should be built" >&5
17172 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17173
17174 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17175 if test "${with_ada_sharedlib+set}" = set; then
17176   withval="$with_ada_sharedlib"
17177   with_ada_sharedlib=$withval
17178 else
17179   with_ada_sharedlib=no
17180 fi;
17181 echo "$as_me:17181: result: $with_ada_sharedlib" >&5
17182 echo "${ECHO_T}$with_ada_sharedlib" >&6
17183
17184 if test "x$with_ada_sharedlib" != xno
17185 then
17186         if test "x$cf_gnat_projects" != xyes
17187         then
17188                 { echo "$as_me:17188: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17189 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17190                 with_ada_sharedlib=no
17191         fi
17192 fi
17193
17194 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17195 MAKE_ADA_SHAREDLIB="#"
17196
17197 if test "x$with_ada_sharedlib" != xno
17198 then
17199         MAKE_ADA_SHAREDLIB=
17200         if test "x$with_ada_sharedlib" != xyes
17201         then
17202                 ADA_SHAREDLIB="$with_ada_sharedlib"
17203         fi
17204 fi
17205
17206                 # allow the Ada binding to be renamed
17207
17208 echo "$as_me:17208: checking for ada-libname" >&5
17209 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17210
17211 # Check whether --with-ada-libname or --without-ada-libname was given.
17212 if test "${with_ada_libname+set}" = set; then
17213   withval="$with_ada_libname"
17214   ADA_LIBNAME=$withval
17215 else
17216   ADA_LIBNAME=AdaCurses
17217 fi;
17218 case "x$ADA_LIBNAME" in
17219 (x|xyes|xno)
17220         ADA_LIBNAME=AdaCurses
17221         ;;
17222 esac
17223
17224 echo "$as_me:17224: result: $ADA_LIBNAME" >&5
17225 echo "${ECHO_T}$ADA_LIBNAME" >&6
17226
17227         else
17228                 { { echo "$as_me:17228: error: No usable Ada compiler found" >&5
17229 echo "$as_me: error: No usable Ada compiler found" >&2;}
17230    { (exit 1); exit 1; }; }
17231         fi
17232 else
17233         { { echo "$as_me:17233: error: The Ada compiler is needed for this package" >&5
17234 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17235    { (exit 1); exit 1; }; }
17236 fi
17237
17238 ################################################################################
17239
17240 # not needed
17241 TINFO_LDFLAGS2=
17242
17243 TINFO_LIBS=
17244
17245 ### Construct the list of include-directories to be generated
17246
17247 if test "$srcdir" != "."; then
17248         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17249 fi
17250 CPPFLAGS="-I../include $CPPFLAGS"
17251 if test "$srcdir" != "."; then
17252         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17253 fi
17254 CPPFLAGS="-I. $CPPFLAGS"
17255
17256 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17257 if test "$srcdir" != "."; then
17258         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17259 fi
17260 if test "$GCC" != yes; then
17261         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17262 elif test "$includedir" != "/usr/include"; then
17263         if test "$includedir" = '${prefix}/include' ; then
17264                 if test x$prefix != x/usr ; then
17265                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17266                 fi
17267         else
17268                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17269         fi
17270 fi
17271
17272 ### Build up pieces for makefile rules
17273 echo "$as_me:17273: checking default library suffix" >&5
17274 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17275
17276         case $DFT_LWR_MODEL in
17277         (libtool) DFT_ARG_SUFFIX=''   ;;
17278         (normal)  DFT_ARG_SUFFIX=''   ;;
17279         (debug)   DFT_ARG_SUFFIX='_g' ;;
17280         (profile) DFT_ARG_SUFFIX='_p' ;;
17281         (shared)  DFT_ARG_SUFFIX=''   ;;
17282         esac
17283         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17284 echo "$as_me:17284: result: $DFT_ARG_SUFFIX" >&5
17285 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17286
17287 echo "$as_me:17287: checking default library-dependency suffix" >&5
17288 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17289
17290         case X$DFT_LWR_MODEL in
17291         (Xlibtool)
17292                 DFT_LIB_SUFFIX='.la'
17293                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17294                 ;;
17295         (Xdebug)
17296                 case $cf_cv_system_name in
17297                 (*-msvc*)
17298                         DFT_LIB_SUFFIX='_g.lib'
17299                         ;;
17300                 (*)
17301                         DFT_LIB_SUFFIX='_g.a'
17302                         ;;
17303                 esac
17304                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17305                 ;;
17306         (Xprofile)
17307                 case $cf_cv_system_name in
17308                 (*-msvc*)
17309                         DFT_LIB_SUFFIX='_p.lib'
17310                         ;;
17311                 (*)
17312                         DFT_LIB_SUFFIX='_p.a'
17313                         ;;
17314                 esac
17315                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17316                 ;;
17317         (Xshared)
17318                 case $cf_cv_system_name in
17319                 (aix[5-7]*)
17320                         DFT_LIB_SUFFIX='.so'
17321                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17322                         ;;
17323                 (*-msvc*)
17324                         DFT_LIB_SUFFIX='.dll'
17325                         DFT_DEP_SUFFIX='.dll.lib'
17326                         ;;
17327                 (cygwin*|msys*|mingw*)
17328                         DFT_LIB_SUFFIX='.dll'
17329                         DFT_DEP_SUFFIX='.dll.a'
17330                         ;;
17331                 (darwin*)
17332                         DFT_LIB_SUFFIX='.dylib'
17333                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17334                         ;;
17335                 (hpux*)
17336                         case $target in
17337                         (ia64*)
17338                                 DFT_LIB_SUFFIX='.so'
17339                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17340                                 ;;
17341                         (*)
17342                                 DFT_LIB_SUFFIX='.sl'
17343                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17344                                 ;;
17345                         esac
17346                         ;;
17347                 (*)
17348                         DFT_LIB_SUFFIX='.so'
17349                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17350                         ;;
17351                 esac
17352                 ;;
17353         (*)
17354                 case $target in
17355                 (*-msvc*)
17356                         DFT_LIB_SUFFIX='.lib'
17357                         ;;
17358                 (*)
17359                         DFT_LIB_SUFFIX='.a'
17360                         ;;
17361                 esac
17362                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17363                 ;;
17364         esac
17365         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17366         then
17367                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17368                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17369         fi
17370 echo "$as_me:17370: result: $DFT_DEP_SUFFIX" >&5
17371 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17372
17373 echo "$as_me:17373: checking default object directory" >&5
17374 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17375
17376         case $DFT_LWR_MODEL in
17377         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17378         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17379         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17380         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17381         (shared)
17382                 case $cf_cv_system_name in
17383                 (cygwin|msys)
17384                         DFT_OBJ_SUBDIR='objects' ;;
17385                 (*)
17386                         DFT_OBJ_SUBDIR='obj_s' ;;
17387                 esac
17388         esac
17389 echo "$as_me:17389: result: $DFT_OBJ_SUBDIR" >&5
17390 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17391
17392 ### Set up low-level terminfo dependencies for makefiles.
17393
17394 if test "$DFT_LWR_MODEL" = shared ; then
17395         case $cf_cv_system_name in
17396         (cygwin*)
17397                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17398                 ;;
17399         (msys*)
17400                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17401                 ;;
17402         esac
17403 fi
17404
17405 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17406
17407 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17408
17409 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17410
17411 ### Construct the list of subdirectories for which we'll customize makefiles
17412 ### with the appropriate compile-rules.
17413
17414 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17415
17416 cat >>confdefs.h <<EOF
17417 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17418 EOF
17419
17420 ################################################################################
17421
17422 TEST_ARG2=
17423
17424 TEST_LIBS2=
17425
17426 NCURSES_SHLIB2="sh -c"
17427
17428 ADA_SUBDIRS="include gen src doc"
17429 if test "x$cf_with_tests" != "xno" ; then
17430         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17431 fi
17432 for cf_dir in $ADA_SUBDIRS
17433 do
17434         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17435 done
17436
17437 NCURSES_TREE="#"
17438
17439 EXTERNAL_TREE=
17440
17441 # match layout used by make-tar.sh
17442 ADAHTML_DIR=../doc/ada
17443
17444 if test "x$cross_compiling" = xyes ; then
17445         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17446 else
17447         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17448 fi
17449
17450 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"
17451 ac_config_commands="$ac_config_commands default"
17452 cat >confcache <<\_ACEOF
17453 # This file is a shell script that caches the results of configure
17454 # tests run on this system so they can be shared between configure
17455 # scripts and configure runs, see configure's option --config-cache.
17456 # It is not useful on other systems.  If it contains results you don't
17457 # want to keep, you may remove or edit it.
17458 #
17459 # config.status only pays attention to the cache file if you give it
17460 # the --recheck option to rerun configure.
17461 #
17462 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17463 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17464 # following values.
17465
17466 _ACEOF
17467
17468 # The following way of writing the cache mishandles newlines in values,
17469 # but we know of no workaround that is simple, portable, and efficient.
17470 # So, don't put newlines in cache variables' values.
17471 # Ultrix sh set writes to stderr and can't be redirected directly,
17472 # and sets the high bit in the cache file unless we assign to the vars.
17473 {
17474   (set) 2>&1 |
17475     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17476     *ac_space=\ *)
17477       # `set' does not quote correctly, so add quotes (double-quote
17478       # substitution turns \\\\ into \\, and sed turns \\ into \).
17479       sed -n \
17480         "s/'/'\\\\''/g;
17481           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17482       ;;
17483     *)
17484       # `set' quotes correctly as required by POSIX, so do not add quotes.
17485       sed -n \
17486         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17487       ;;
17488     esac;
17489 } |
17490   sed '
17491      t clear
17492      : clear
17493      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17494      t end
17495      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17496      : end' >>confcache
17497 if cmp -s $cache_file confcache; then :; else
17498   if test -w $cache_file; then
17499     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17500     cat confcache >$cache_file
17501   else
17502     echo "not updating unwritable cache $cache_file"
17503   fi
17504 fi
17505 rm -f confcache
17506
17507 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17508 # Let make expand exec_prefix.
17509 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17510
17511 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17512 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17513 # trailing colons and then remove the whole line if VPATH becomes empty
17514 # (actually we leave an empty line to preserve line numbers).
17515 if test "x$srcdir" = x.; then
17516   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17517 s/:*\$(srcdir):*/:/;
17518 s/:*\${srcdir}:*/:/;
17519 s/:*@srcdir@:*/:/;
17520 s/^\([^=]*=[    ]*\):*/\1/;
17521 s/:*$//;
17522 s/^[^=]*=[      ]*$//;
17523 }'
17524 fi
17525
17526 DEFS=-DHAVE_CONFIG_H
17527
17528 : ${CONFIG_STATUS=./config.status}
17529 ac_clean_files_save=$ac_clean_files
17530 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17531 { echo "$as_me:17531: creating $CONFIG_STATUS" >&5
17532 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17533 cat >$CONFIG_STATUS <<_ACEOF
17534 #! $SHELL
17535 # Generated automatically by configure.
17536 # Run this file to recreate the current configuration.
17537 # Compiler output produced by configure, useful for debugging
17538 # configure, is in config.log if it exists.
17539
17540 debug=false
17541 SHELL=\${CONFIG_SHELL-$SHELL}
17542 ac_cs_invocation="\$0 \$@"
17543
17544 CLICOLOR_FORCE= GREP_OPTIONS=
17545 unset CLICOLOR_FORCE GREP_OPTIONS
17546 _ACEOF
17547
17548 cat >>$CONFIG_STATUS <<\_ACEOF
17549 # Be Bourne compatible
17550 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17551   emulate sh
17552   NULLCMD=:
17553 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17554   set -o posix
17555 fi
17556
17557 # Name of the executable.
17558 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17559
17560 if expr a : '\(a\)' >/dev/null 2>&1; then
17561   as_expr=expr
17562 else
17563   as_expr=false
17564 fi
17565
17566 rm -f conf$$ conf$$.exe conf$$.file
17567 echo >conf$$.file
17568 if ln -s conf$$.file conf$$ 2>/dev/null; then
17569   # We could just check for DJGPP; but this test a) works b) is more generic
17570   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17571   if test -f conf$$.exe; then
17572     # Don't use ln at all; we don't have any links
17573     as_ln_s='cp -p'
17574   else
17575     as_ln_s='ln -s'
17576   fi
17577 elif ln conf$$.file conf$$ 2>/dev/null; then
17578   as_ln_s=ln
17579 else
17580   as_ln_s='cp -p'
17581 fi
17582 rm -f conf$$ conf$$.exe conf$$.file
17583
17584 as_executable_p="test -f"
17585
17586 # Support unset when possible.
17587 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17588   as_unset=unset
17589 else
17590   as_unset=false
17591 fi
17592
17593 # NLS nuisances.
17594 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17595 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17596 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17597 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17598 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17599 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17600 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17601 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17602
17603 # IFS
17604 # We need space, tab and new line, in precisely that order.
17605 as_nl='
17606 '
17607 IFS="   $as_nl"
17608
17609 # CDPATH.
17610 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17611
17612 exec 6>&1
17613
17614 _ACEOF
17615
17616 # Files that config.status was made for.
17617 if test -n "$ac_config_files"; then
17618   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17619 fi
17620
17621 if test -n "$ac_config_headers"; then
17622   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17623 fi
17624
17625 if test -n "$ac_config_links"; then
17626   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17627 fi
17628
17629 if test -n "$ac_config_commands"; then
17630   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17631 fi
17632
17633 cat >>$CONFIG_STATUS <<\EOF
17634
17635 ac_cs_usage="\
17636 \`$as_me' instantiates files from templates according to the
17637 current configuration.
17638
17639 Usage: $0 [OPTIONS] [FILE]...
17640
17641   -h, --help       print this help, then exit
17642   -V, --version    print version number, then exit
17643   -d, --debug      don't remove temporary files
17644       --recheck    update $as_me by reconfiguring in the same conditions
17645   --file=FILE[:TEMPLATE]
17646                    instantiate the configuration file FILE
17647   --header=FILE[:TEMPLATE]
17648                    instantiate the configuration header FILE
17649
17650 Configuration files:
17651 $config_files
17652
17653 Configuration headers:
17654 $config_headers
17655
17656 Configuration commands:
17657 $config_commands
17658
17659 Report bugs to <dickey@invisible-island.net>."
17660 EOF
17661
17662 cat >>$CONFIG_STATUS <<EOF
17663 ac_cs_version="\\
17664 config.status
17665 configured by $0, generated by GNU Autoconf 2.52.20200802,
17666   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17667
17668 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17669 Free Software Foundation, Inc.
17670 This config.status script is free software; the Free Software Foundation
17671 gives unlimited permission to copy, distribute and modify it."
17672 srcdir=$srcdir
17673 INSTALL="$INSTALL"
17674 EOF
17675
17676 cat >>$CONFIG_STATUS <<\EOF
17677 # If no file are specified by the user, then we need to provide default
17678 # value.  By we need to know if files were specified by the user.
17679 ac_need_defaults=:
17680 while test $# != 0
17681 do
17682   case $1 in
17683   --*=*)
17684     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17685     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17686     shift
17687     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17688     shift
17689     ;;
17690   -*);;
17691   *) # This is not an option, so the user has probably given explicit
17692      # arguments.
17693      ac_need_defaults=false;;
17694   esac
17695
17696   case $1 in
17697   # Handling of the options.
17698 EOF
17699 cat >>$CONFIG_STATUS <<EOF
17700   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17701     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17702     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17703 EOF
17704 cat >>$CONFIG_STATUS <<\EOF
17705   --version | --vers* | -V )
17706     echo "$ac_cs_version"; exit 0 ;;
17707   --he | --h)
17708     # Conflict between --help and --header
17709     { { echo "$as_me:17709: error: ambiguous option: $1
17710 Try \`$0 --help' for more information." >&5
17711 echo "$as_me: error: ambiguous option: $1
17712 Try \`$0 --help' for more information." >&2;}
17713    { (exit 1); exit 1; }; };;
17714   --help | --hel | -h )
17715     echo "$ac_cs_usage"; exit 0 ;;
17716   --debug | --d* | -d )
17717     debug=: ;;
17718   --file | --fil | --fi | --f )
17719     shift
17720     CONFIG_FILES="$CONFIG_FILES $1"
17721     ac_need_defaults=false;;
17722   --header | --heade | --head | --hea )
17723     shift
17724     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17725     ac_need_defaults=false;;
17726
17727   # This is an error.
17728   -*) { { echo "$as_me:17728: error: unrecognized option: $1
17729 Try \`$0 --help' for more information." >&5
17730 echo "$as_me: error: unrecognized option: $1
17731 Try \`$0 --help' for more information." >&2;}
17732    { (exit 1); exit 1; }; } ;;
17733
17734   *) ac_config_targets="$ac_config_targets $1" ;;
17735
17736   esac
17737   shift
17738 done
17739
17740 exec 5>>config.log
17741 cat >&5 << _ACEOF
17742
17743 ## ----------------------- ##
17744 ## Running config.status.  ##
17745 ## ----------------------- ##
17746
17747 This file was extended by $as_me 2.52.20200802, executed with
17748   CONFIG_FILES    = $CONFIG_FILES
17749   CONFIG_HEADERS  = $CONFIG_HEADERS
17750   CONFIG_LINKS    = $CONFIG_LINKS
17751   CONFIG_COMMANDS = $CONFIG_COMMANDS
17752   > $ac_cs_invocation
17753 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17754
17755 _ACEOF
17756 EOF
17757
17758 cat >>$CONFIG_STATUS <<EOF
17759 #
17760 # INIT-COMMANDS section.
17761 #
17762
17763 ### Special initialization commands, used to pass information from the
17764 ### configuration-run into config.status
17765
17766 AWK="$AWK"
17767 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17768 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17769 LIB_NAME="$LIB_NAME"
17770 LIB_PREFIX="$LIB_PREFIX"
17771 LIB_SUFFIX="$LIB_SUFFIX"
17772 LN_S="$LN_S"
17773 NCURSES_MAJOR="$NCURSES_MAJOR"
17774 NCURSES_MINOR="$NCURSES_MINOR"
17775 NCURSES_PATCH="$NCURSES_PATCH"
17776 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17777 cf_cv_abi_version="$cf_cv_abi_version"
17778 cf_cv_rel_version="$cf_cv_rel_version"
17779 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17780 cf_cv_shared_soname='$cf_cv_shared_soname'
17781 cf_cv_shlib_version="$cf_cv_shlib_version"
17782 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17783 cf_cv_system_name="$cf_cv_system_name"
17784 host="$host"
17785 target="$target"
17786
17787 EOF
17788
17789 cat >>$CONFIG_STATUS <<\EOF
17790 for ac_config_target in $ac_config_targets
17791 do
17792   case "$ac_config_target" in
17793   # Handling of arguments.
17794   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17795   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17796   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17797   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17798   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17799   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17800   *) { { echo "$as_me:17800: error: invalid argument: $ac_config_target" >&5
17801 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17802    { (exit 1); exit 1; }; };;
17803   esac
17804 done
17805
17806 # If the user did not use the arguments to specify the items to instantiate,
17807 # then the envvar interface is used.  Set only those that are not.
17808 # We use the long form for the default assignment because of an extremely
17809 # bizarre bug on SunOS 4.1.3.
17810 if $ac_need_defaults; then
17811   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17812   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17813   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17814 fi
17815
17816 # Create a temporary directory, and hook for its removal unless debugging.
17817 $debug ||
17818 {
17819   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17820   trap '{ (exit 1); exit 1; }' 1 2 13 15
17821 }
17822
17823 # Create a (secure) tmp directory for tmp files.
17824 : ${TMPDIR=/tmp}
17825 {
17826   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17827   test -n "$tmp" && test -d "$tmp"
17828 }  ||
17829 {
17830   tmp=$TMPDIR/cs$$-$RANDOM
17831   (umask 077 && mkdir $tmp)
17832 } ||
17833 {
17834    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17835    { (exit 1); exit 1; }
17836 }
17837
17838 EOF
17839
17840 cat >>$CONFIG_STATUS <<EOF
17841
17842 #
17843 # CONFIG_FILES section.
17844 #
17845
17846 # No need to generate the scripts if there are no CONFIG_FILES.
17847 # This happens for instance when ./config.status config.h
17848 if test -n "\$CONFIG_FILES"; then
17849   # Protect against being on the right side of a sed subst in config.status.
17850   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17851    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17852 s,@SHELL@,$SHELL,;t t
17853 s,@exec_prefix@,$exec_prefix,;t t
17854 s,@prefix@,$prefix,;t t
17855 s,@program_transform_name@,$program_transform_name,;t t
17856 s,@bindir@,$bindir,;t t
17857 s,@sbindir@,$sbindir,;t t
17858 s,@libexecdir@,$libexecdir,;t t
17859 s,@datarootdir@,$datarootdir,;t t
17860 s,@datadir@,$datadir,;t t
17861 s,@sysconfdir@,$sysconfdir,;t t
17862 s,@sharedstatedir@,$sharedstatedir,;t t
17863 s,@localstatedir@,$localstatedir,;t t
17864 s,@runstatedir@,$runstatedir,;t t
17865 s,@libdir@,$libdir,;t t
17866 s,@includedir@,$includedir,;t t
17867 s,@oldincludedir@,$oldincludedir,;t t
17868 s,@infodir@,$infodir,;t t
17869 s,@mandir@,$mandir,;t t
17870 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17871 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17872 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17873 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17874 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17875 s,@build_alias@,$build_alias,;t t
17876 s,@host_alias@,$host_alias,;t t
17877 s,@target_alias@,$target_alias,;t t
17878 s,@ECHO_C@,$ECHO_C,;t t
17879 s,@ECHO_N@,$ECHO_N,;t t
17880 s,@ECHO_T@,$ECHO_T,;t t
17881 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17882 s,@DEFS@,$DEFS,;t t
17883 s,@LIBS@,$LIBS,;t t
17884 s,@top_builddir@,$top_builddir,;t t
17885 s,@build@,$build,;t t
17886 s,@build_cpu@,$build_cpu,;t t
17887 s,@build_vendor@,$build_vendor,;t t
17888 s,@build_os@,$build_os,;t t
17889 s,@host@,$host,;t t
17890 s,@host_cpu@,$host_cpu,;t t
17891 s,@host_vendor@,$host_vendor,;t t
17892 s,@host_os@,$host_os,;t t
17893 s,@target@,$target,;t t
17894 s,@target_cpu@,$target_cpu,;t t
17895 s,@target_vendor@,$target_vendor,;t t
17896 s,@target_os@,$target_os,;t t
17897 s,@CC@,$CC,;t t
17898 s,@CFLAGS@,$CFLAGS,;t t
17899 s,@LDFLAGS@,$LDFLAGS,;t t
17900 s,@CPPFLAGS@,$CPPFLAGS,;t t
17901 s,@ac_ct_CC@,$ac_ct_CC,;t t
17902 s,@EXEEXT@,$EXEEXT,;t t
17903 s,@OBJEXT@,$OBJEXT,;t t
17904 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17905 s,@CPP@,$CPP,;t t
17906 s,@AWK@,$AWK,;t t
17907 s,@EGREP@,$EGREP,;t t
17908 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17909 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17910 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17911 s,@LN_S@,$LN_S,;t t
17912 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17913 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17914 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17915 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17916 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17917 s,@SET_MAKE@,$SET_MAKE,;t t
17918 s,@CTAGS@,$CTAGS,;t t
17919 s,@ETAGS@,$ETAGS,;t t
17920 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17921 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17922 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17923 s,@RANLIB@,$RANLIB,;t t
17924 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17925 s,@LD@,$LD,;t t
17926 s,@ac_ct_LD@,$ac_ct_LD,;t t
17927 s,@AR@,$AR,;t t
17928 s,@ac_ct_AR@,$ac_ct_AR,;t t
17929 s,@ARFLAGS@,$ARFLAGS,;t t
17930 s,@DESTDIR@,$DESTDIR,;t t
17931 s,@BUILD_CC@,$BUILD_CC,;t t
17932 s,@BUILD_CPP@,$BUILD_CPP,;t t
17933 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17934 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17935 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17936 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17937 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17938 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17939 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17940 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17941 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17942 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17943 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17944 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17945 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17946 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17947 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17948 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17949 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17950 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17951 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17952 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17953 s,@CC_G_OPT@,$CC_G_OPT,;t t
17954 s,@LD_MODEL@,$LD_MODEL,;t t
17955 s,@shlibdir@,$shlibdir,;t t
17956 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17957 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17958 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17959 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17960 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17961 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17962 s,@LINK_PROGS@,$LINK_PROGS,;t t
17963 s,@LINK_TESTS@,$LINK_TESTS,;t t
17964 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17965 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17966 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17967 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17968 s,@RPATH_LIST@,$RPATH_LIST,;t t
17969 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17970 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17971 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17972 s,@PTHREAD@,$PTHREAD,;t t
17973 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17974 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17975 s,@ECHO_LT@,$ECHO_LT,;t t
17976 s,@ECHO_LD@,$ECHO_LD,;t t
17977 s,@RULE_CC@,$RULE_CC,;t t
17978 s,@SHOW_CC@,$SHOW_CC,;t t
17979 s,@ECHO_CC@,$ECHO_CC,;t t
17980 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17981 s,@ADAFLAGS@,$ADAFLAGS,;t t
17982 s,@ADA_TRACE@,$ADA_TRACE,;t t
17983 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17984 s,@M4_exists@,$M4_exists,;t t
17985 s,@cf_ada_make@,$cf_ada_make,;t t
17986 s,@cf_ada_config@,$cf_ada_config,;t t
17987 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17988 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17989 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17990 s,@cf_compile_generics@,$cf_compile_generics,;t t
17991 s,@cf_generic_objects@,$cf_generic_objects,;t t
17992 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17993 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17994 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17995 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17996 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17997 s,@cf_ada_package@,$cf_ada_package,;t t
17998 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17999 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18000 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18001 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18002 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18003 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18004 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18005 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18006 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18007 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18008 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18009 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18010 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18011 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18012 s,@TEST_ARG2@,$TEST_ARG2,;t t
18013 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18014 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18015 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18016 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18017 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18018 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18019 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18020 CEOF
18021
18022 EOF
18023
18024   cat >>$CONFIG_STATUS <<\EOF
18025   # Split the substitutions into bite-sized pieces for seds with
18026   # small command number limits, like on Digital OSF/1 and HP-UX.
18027   ac_max_sed_lines=48
18028   ac_sed_frag=1 # Number of current file.
18029   ac_beg=1 # First line for current file.
18030   ac_end=$ac_max_sed_lines # Line after last line for current file.
18031   ac_more_lines=:
18032   ac_sed_cmds=
18033   while $ac_more_lines; do
18034     if test $ac_beg -gt 1; then
18035       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18036     else
18037       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18038     fi
18039     if test ! -s $tmp/subs.frag; then
18040       ac_more_lines=false
18041     else
18042       # The purpose of the label and of the branching condition is to
18043       # speed up the sed processing (if there are no `@' at all, there
18044       # is no need to browse any of the substitutions).
18045       # These are the two extra sed commands mentioned above.
18046       (echo ':t
18047   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18048       # It is possible to make a multiline substitution using escaped newlines.
18049       # Ensure that we do not split the substitution between script fragments.
18050       ac_BEG=$ac_end
18051       ac_END=`expr $ac_end + $ac_max_sed_lines`
18052       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18053       if test -s $tmp/subs.next; then
18054         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18055         if test ! -s $tmp/subs.edit; then
18056           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18057           if test ! -s $tmp/subs.edit; then
18058             if test $ac_beg -gt 1; then
18059               ac_end=`expr $ac_end - 1`
18060               continue
18061             fi
18062           fi
18063         fi
18064       fi
18065
18066       if test -z "$ac_sed_cmds"; then
18067         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18068       else
18069         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18070       fi
18071       ac_sed_frag=`expr $ac_sed_frag + 1`
18072       ac_beg=$ac_end
18073       ac_end=`expr $ac_end + $ac_max_sed_lines`
18074     fi
18075   done
18076   if test -z "$ac_sed_cmds"; then
18077     ac_sed_cmds=cat
18078   fi
18079 fi # test -n "$CONFIG_FILES"
18080
18081 EOF
18082 cat >>$CONFIG_STATUS <<\EOF
18083 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18084   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18085   case $ac_file in
18086   - | *:- | *:-:* ) # input from stdin
18087         cat >$tmp/stdin
18088         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18089         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18090   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18091         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18092   * )   ac_file_in=$ac_file.in ;;
18093   esac
18094
18095   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18096   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18097          X"$ac_file" : 'X\(//\)[^/]' \| \
18098          X"$ac_file" : 'X\(//\)$' \| \
18099          X"$ac_file" : 'X\(/\)' \| \
18100          .     : '\(.\)' 2>/dev/null ||
18101 echo X"$ac_file" |
18102     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18103           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18104           /^X\(\/\/\)$/{ s//\1/; q; }
18105           /^X\(\/\).*/{ s//\1/; q; }
18106           s/.*/./; q'`
18107   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18108     { case "$ac_dir" in
18109   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18110   *)                      as_incr_dir=.;;
18111 esac
18112 as_dummy="$ac_dir"
18113 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18114   case $as_mkdir_dir in
18115     # Skip DOS drivespec
18116     ?:) as_incr_dir=$as_mkdir_dir ;;
18117     *)
18118       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18119       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18120     ;;
18121   esac
18122 done; }
18123
18124     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18125     # A "../" for each directory in $ac_dir_suffix.
18126     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18127   else
18128     ac_dir_suffix= ac_dots=
18129   fi
18130
18131   case $srcdir in
18132   .)  ac_srcdir=.
18133       if test -z "$ac_dots"; then
18134          ac_top_srcdir=.
18135       else
18136          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18137       fi ;;
18138   [\\/]* | ?:[\\/]* )
18139       ac_srcdir=$srcdir$ac_dir_suffix;
18140       ac_top_srcdir=$srcdir ;;
18141   *) # Relative path.
18142     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18143     ac_top_srcdir=$ac_dots$srcdir ;;
18144   esac
18145
18146   case $INSTALL in
18147   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18148   *) ac_INSTALL=$ac_dots$INSTALL ;;
18149   esac
18150
18151   if test x"$ac_file" != x-; then
18152     { echo "$as_me:18152: creating $ac_file" >&5
18153 echo "$as_me: creating $ac_file" >&6;}
18154     rm -f "$ac_file"
18155   fi
18156   # Let's still pretend it is `configure' which instantiates (i.e., don't
18157   # use $as_me), people would be surprised to read:
18158   #    /* config.h.  Generated automatically by config.status.  */
18159   configure_input="Generated automatically from `echo $ac_file_in |
18160                                                  sed 's,.*/,,'` by configure."
18161
18162   # First look for the input files in the build tree, otherwise in the
18163   # src tree.
18164   ac_file_inputs=`IFS=:
18165     for f in $ac_file_in; do
18166       case $f in
18167       -) echo $tmp/stdin ;;
18168       [\\/$]*)
18169          # Absolute (can't be DOS-style, as IFS=:)
18170          test -f "$f" || { { echo "$as_me:18170: error: cannot find input file: $f" >&5
18171 echo "$as_me: error: cannot find input file: $f" >&2;}
18172    { (exit 1); exit 1; }; }
18173          echo $f;;
18174       *) # Relative
18175          if test -f "$f"; then
18176            # Build tree
18177            echo $f
18178          elif test -f "$srcdir/$f"; then
18179            # Source tree
18180            echo $srcdir/$f
18181          else
18182            # /dev/null tree
18183            { { echo "$as_me:18183: error: cannot find input file: $f" >&5
18184 echo "$as_me: error: cannot find input file: $f" >&2;}
18185    { (exit 1); exit 1; }; }
18186          fi;;
18187       esac
18188     done` || { (exit 1); exit 1; }
18189 EOF
18190 cat >>$CONFIG_STATUS <<\EOF
18191   ac_warn_datarootdir=no
18192   if test x"$ac_file" != x-; then
18193     for ac_item in $ac_file_inputs
18194     do
18195       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18196       if test -n "$ac_seen"; then
18197         ac_used=`grep '@datarootdir@' $ac_item`
18198         if test -z "$ac_used"; then
18199           { echo "$as_me:18199: WARNING: datarootdir was used implicitly but not set:
18200 $ac_seen" >&5
18201 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18202 $ac_seen" >&2;}
18203           ac_warn_datarootdir=yes
18204         fi
18205       fi
18206       ac_seen=`grep '${datarootdir}' $ac_item`
18207       if test -n "$ac_seen"; then
18208         { echo "$as_me:18208: WARNING: datarootdir was used explicitly but not set:
18209 $ac_seen" >&5
18210 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18211 $ac_seen" >&2;}
18212         ac_warn_datarootdir=yes
18213       fi
18214     done
18215   fi
18216
18217 if test "x$ac_warn_datarootdir" = xyes; then
18218   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18219 fi
18220
18221 EOF
18222 cat >>$CONFIG_STATUS <<EOF
18223   sed "$ac_vpsub
18224 $extrasub
18225 EOF
18226 cat >>$CONFIG_STATUS <<\EOF
18227 :t
18228 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18229 s,@configure_input@,$configure_input,;t t
18230 s,@srcdir@,$ac_srcdir,;t t
18231 s,@top_srcdir@,$ac_top_srcdir,;t t
18232 s,@INSTALL@,$ac_INSTALL,;t t
18233 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18234   rm -f $tmp/stdin
18235   if test x"$ac_file" != x-; then
18236     cp $tmp/out $ac_file
18237
18238     for ac_name in prefix exec_prefix datarootdir
18239     do
18240         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18241         if test -n "$ac_seen"; then
18242             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18243             if test -z "$ac_init"; then
18244               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18245               { echo "$as_me:18245: WARNING: Variable $ac_name is used but was not set:
18246 $ac_seen" >&5
18247 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18248 $ac_seen" >&2;}
18249             fi
18250         fi
18251     done
18252     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18253     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18254     if test -s $tmp/out; then
18255       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18256       { echo "$as_me:18256: WARNING: Some variables may not be substituted:
18257 $ac_seen" >&5
18258 echo "$as_me: WARNING: Some variables may not be substituted:
18259 $ac_seen" >&2;}
18260     fi
18261   else
18262     cat $tmp/out
18263   fi
18264   rm -f $tmp/out
18265
18266 done
18267 EOF
18268 cat >>$CONFIG_STATUS <<\EOF
18269
18270 #
18271 # CONFIG_HEADER section.
18272 #
18273
18274 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18275 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18276 #
18277 # ac_d sets the value in "#define NAME VALUE" lines.
18278 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18279 ac_dB='[        ].*$,\1#\2'
18280 ac_dC=' '
18281 ac_dD=',;t'
18282 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18283 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18284 ac_iB='\([      ]\),\1#\2define\3'
18285 ac_iC=' '
18286 ac_iD='\4,;t'
18287 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18288 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18289 ac_uB='$,\1#\2define\3'
18290 ac_uC=' '
18291 ac_uD=',;t'
18292
18293 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18294   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18295   case $ac_file in
18296   - | *:- | *:-:* ) # input from stdin
18297         cat >$tmp/stdin
18298         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18299         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18300   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18301         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18302   * )   ac_file_in=$ac_file.in ;;
18303   esac
18304
18305   test x"$ac_file" != x- && { echo "$as_me:18305: creating $ac_file" >&5
18306 echo "$as_me: creating $ac_file" >&6;}
18307
18308   # First look for the input files in the build tree, otherwise in the
18309   # src tree.
18310   ac_file_inputs=`IFS=:
18311     for f in $ac_file_in; do
18312       case $f in
18313       -) echo $tmp/stdin ;;
18314       [\\/$]*)
18315          # Absolute (can't be DOS-style, as IFS=:)
18316          test -f "$f" || { { echo "$as_me:18316: error: cannot find input file: $f" >&5
18317 echo "$as_me: error: cannot find input file: $f" >&2;}
18318    { (exit 1); exit 1; }; }
18319          echo $f;;
18320       *) # Relative
18321          if test -f "$f"; then
18322            # Build tree
18323            echo $f
18324          elif test -f "$srcdir/$f"; then
18325            # Source tree
18326            echo $srcdir/$f
18327          else
18328            # /dev/null tree
18329            { { echo "$as_me:18329: error: cannot find input file: $f" >&5
18330 echo "$as_me: error: cannot find input file: $f" >&2;}
18331    { (exit 1); exit 1; }; }
18332          fi;;
18333       esac
18334     done` || { (exit 1); exit 1; }
18335   # Remove the trailing spaces.
18336   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18337
18338 EOF
18339
18340 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18341 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18342 # be either 'cat' or 'sort'.
18343 cat confdefs.h | uniq >conftest.vals
18344
18345 # Break up conftest.vals because some shells have a limit on
18346 # the size of here documents, and old seds have small limits too.
18347
18348 rm -f conftest.tail
18349 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18350 while grep . conftest.vals >/dev/null
18351 do
18352   # Write chunks of a limited-size here document to conftest.frag.
18353   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18354   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18355   echo 'CEOF' >> $CONFIG_STATUS
18356   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18357   rm -f conftest.vals
18358   mv conftest.tail conftest.vals
18359 done
18360 rm -f conftest.vals
18361
18362 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18363 # marker @DEFS@.
18364 echo '  cat >> conftest.edit <<CEOF
18365 /@DEFS@/r conftest.frag
18366 /@DEFS@/d
18367 CEOF
18368 sed -f conftest.edit $tmp/in > $tmp/out
18369 rm -f $tmp/in
18370 mv $tmp/out $tmp/in
18371 rm -f conftest.edit conftest.frag
18372 ' >> $CONFIG_STATUS
18373
18374 cat >>$CONFIG_STATUS <<\EOF
18375   # Let's still pretend it is `configure' which instantiates (i.e., don't
18376   # use $as_me), people would be surprised to read:
18377   #    /* config.h.  Generated automatically by config.status.  */
18378   if test x"$ac_file" = x-; then
18379     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18380   else
18381     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18382   fi
18383   cat $tmp/in >>$tmp/config.h
18384   rm -f $tmp/in
18385   if test x"$ac_file" != x-; then
18386     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18387       { echo "$as_me:18387: $ac_file is unchanged" >&5
18388 echo "$as_me: $ac_file is unchanged" >&6;}
18389     else
18390       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18391          X"$ac_file" : 'X\(//\)[^/]' \| \
18392          X"$ac_file" : 'X\(//\)$' \| \
18393          X"$ac_file" : 'X\(/\)' \| \
18394          .     : '\(.\)' 2>/dev/null ||
18395 echo X"$ac_file" |
18396     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18397           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18398           /^X\(\/\/\)$/{ s//\1/; q; }
18399           /^X\(\/\).*/{ s//\1/; q; }
18400           s/.*/./; q'`
18401       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18402         { case "$ac_dir" in
18403   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18404   *)                      as_incr_dir=.;;
18405 esac
18406 as_dummy="$ac_dir"
18407 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18408   case $as_mkdir_dir in
18409     # Skip DOS drivespec
18410     ?:) as_incr_dir=$as_mkdir_dir ;;
18411     *)
18412       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18413       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18414     ;;
18415   esac
18416 done; }
18417
18418       fi
18419       rm -f $ac_file
18420       mv $tmp/config.h $ac_file
18421     fi
18422   else
18423     cat $tmp/config.h
18424     rm -f $tmp/config.h
18425   fi
18426 done
18427 EOF
18428 cat >>$CONFIG_STATUS <<\EOF
18429 #
18430 # CONFIG_COMMANDS section.
18431 #
18432 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18433   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18434   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18435
18436   case $ac_dest in
18437     default )
18438 if test -z "$USE_OLD_MAKERULES" ; then
18439         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18440 fi
18441  ;;
18442   esac
18443 done
18444 EOF
18445
18446 cat >>$CONFIG_STATUS <<\EOF
18447
18448 { (exit 0); exit 0; }
18449 EOF
18450 chmod +x $CONFIG_STATUS
18451 ac_clean_files=$ac_clean_files_save
18452
18453 # configure is writing to config.log, and then calls config.status.
18454 # config.status does its own redirection, appending to config.log.
18455 # Unfortunately, on DOS this fails, as config.log is still kept open
18456 # by configure, so config.status won't be able to write to it; its
18457 # output is simply discarded.  So we exec the FD to /dev/null,
18458 # effectively closing config.log, so it can be properly (re)opened and
18459 # appended to by config.status.  When coming back to configure, we
18460 # need to make the FD available again.
18461 if test "$no_create" != yes; then
18462   ac_cs_success=:
18463   exec 5>/dev/null
18464   $SHELL $CONFIG_STATUS || ac_cs_success=false
18465   exec 5>>config.log
18466   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18467   # would make configure fail if this is the last instruction.
18468   $ac_cs_success || { (exit 1); exit 1; }
18469 fi
18470 ${MAKE:-make} preinstall